MCPInstall
matlab avatar

generate-requirement-drafts

Generates draft requirements from Simulink models. Use when drafting or updating requirement artifacts from a model. Prefers Requirements Toolbox (.slreqx) when available; falls back to structured YAML.

Installs
80
Last 24h
—
Trending rank
—
Security
Not audited

Install

Works with every agent the skills CLI supports.

npx skills add https://github.com/matlab/simulink-agentic-toolkit --skill generate-requirement-drafts
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads generate-requirement-drafts automatically when relevant.

  3. 03

    Review the result

    The agent follows the SKILL.md steps, scripts and references bundled with the skill.

SKILL.md

The instructions your agent reads when the skill is triggered.

Generate Requirement Drafts

Generate draft requirements from Simulink models using the richest artifact the environment supports. All outputs are drafts requiring human review and approval before baselining.

When to Use

  • Drafting or updating requirements from a Simulink model
  • Creating .slreqx or .yaml requirements artifacts
  • Establishing model-to-requirement traceability

When NOT to Use

  • Importing requirements from an existing source of truth (ReqIF, DOORS, Word, Excel) — use Requirements Toolbox import APIs directly
  • Writing or running tests — use the testing-simulink-models skill
  • Free-form prose notes with no saved artifact
  • User explicitly wants a different text format (markdown, Word)

Output Conventions

  • Default file names: <Model>_Requirements.slreqx or <model>_requirements.yaml
  • Stable IDs: REQ_<SYSTEM>_001, REQ_<SYSTEM>_002, … — use one consistent project-wide prefix with sequential integers across all requirements, even when they derive from different subsystems. Do not switch to per-subsystem prefixes or hierarchical decimal numbering (e.g. CB-1.1, TP-1.1).
  • Follow repo conventions if .slreqx or .yaml files already exist
  • When updating an existing artifact, preserve existing IDs — append new IDs, never renumber
  • Every generated requirement must be marked as draft — use "draft" in Keywords (slreq) or status: Draft + keywords: [draft] (YAML)

Writing Good Requirements

Requirements must express behavioral intent (WHAT the system shall do), not restate model topology (HOW it is implemented). Put the WHY in Rationale. Use EARS (Easy Approach to Requirements Syntax) patterns:

EARS Patterns

Choose the pattern that best fits the model behavior:

PatternTemplateWhen to Use
UbiquitousThe <system> shall <response>.Always-on behavior, invariants
Event-drivenWhen <trigger>, the <system> shall <response>.A momentary trigger causes a one-time response: input events, entering a Stateflow state (the transition itself)
State-drivenWhile <state>, the <system> shall <response>.Behavior that holds continuously while in a Stateflow state or mode — the ongoing response, not the entry transition
Unwanted behaviorIf <condition>, then the <system> shall <response>.Error handling, safety limits, saturation
Optional featureWhere <feature>, the <system> shall <response>.Variant subsystems, configurable features
CombinedWhile <state>, when <trigger>, the <system> shall <response>.State + event combinations

Examples — Model Concepts to EARS Requirements

❌ Bad — restates implementation✅ Good — EARS pattern
"Saturation block limits output to [0,1]""If throttle command exceeds ThrottleMax (1.0) or falls below ThrottleMin (0.0), then the controller shall clamp the output to the valid range."
"BrakeLogic subsystem disengages controller""When brake pedal input exceeds BrakeThreshold (0.0), the controller shall disengage cruise control."
"Gain block multiplies by 2.5""While cruise control is active, the controller shall amplify speed error by Kp (2.5) to compute proportional correction."
"Stateflow chart transitions to Idle""When the driver presses the off button, the system shall transition to the Idle state."
"Defrost state runs the heater at full power""While in the Defrost state, the system shall drive the heater at full power."
"Variant subsystem selects Algorithm A""Where the adaptive mode is enabled, the controller shall use the predictive algorithm."

Rules

  • Write requirements using EARS patterns — pick the pattern that matches the model behavior
  • Use block/subsystem names (e.g. Saturation, BrakeLogic) only in Rationale, Description, or provenance notes — never in the requirement Summary. (A workspace parameter rendered as VarName (value) is required in the Summary and is not a block name.)
  • When referencing a numeric value, include the workspace variable name and resolved value: VarName (value). If the model uses a literal with no variable, record the numeric literal directly
  • Put the WHY in Rationale, not in the requirement statement
  • One subsystem may support zero, one, or several behavioral requirements — don't force a 1:1 mapping
  • For a Stateflow state or mode, separate entering it from being in it: the entry transition is event-driven (When <trigger>, … shall transition to <state>), but the behavior that holds throughout the mode is state-driven (While <state>, … shall <response>). When asked for a mode's behavior, prefer the While <state> form — do not fold it into a When entry statement

Backend Decision Gate

Choose once at the start, then stay on that path.

SituationBackend
User explicitly asks for .slreqx, traceability views, or repo already uses .slreqxRequirements Toolbox — if probe fails, inform the user that Requirements Toolbox is unavailable; do NOT silently fall back
User explicitly asks for .yaml, or repo already uses .yaml requirementsStructured YAML
No format specified — probe for Requirements ToolboxRequirements Toolbox if probe succeeds
No format specified and probe failsStructured YAML (silent fallback is OK here since user had no preference)

Probe (run via evaluate_matlab_code):

hasSlreq = ~isempty(which('slreq.new'));
if hasSlreq, try, slreq.find(Type="Link"); catch, hasSlreq = false; end, end
disp(hasSlreq)

Workflow

  • Call model_overview, model_read, model_query_params, model_resolve_params as MCP tools — never pass their names to evaluate_matlab_code.
  • Use evaluate_matlab_code only for MATLAB code, such as the backend probe and the slreq.* APIs in Path A.
  1. Understand the model — use the model_overview and model_read tools to understand subsystems, interfaces, control logic.

  2. Extract parameters — use the model_query_params / model_resolve_params tools for thresholds, gains, sample times that should appear in requirement text. Record both variable names and resolved values.

  3. Build a capture table (backend-neutral):

    IdParentIdSummaryDescriptionSourceBlockRationaleASILPriorityKeywords
  4. Run the backend path (A or B below).

  5. Review using the gate below.

Path A — Requirements Toolbox (.slreqx)

Use when probe succeeds. For full API patterns see references/slreq-patterns.md.

model = "CruiseControl";
load_system(model);
rs = slreq.new(model + "_Requirements");

% Add requirements with hierarchy — note behavioral "shall" statements
req = add(rs, Id="REQ_CC_001", ...
    Summary="If throttle command exceeds ThrottleMax (1.0) or falls below ThrottleMin (0.0), then the controller shall clamp the output to the valid range.", ...
    Description="Derived from CruiseControl/ThrottleCmd.");
req.Rationale = "Prevents invalid actuator commands that could damage the throttle body.";
req.Keywords = ["draft","auto-generated","control","safety"];

child = add(req, Id="REQ_CC_002", ...
    Summary="When brake pedal input exceeds BrakeThreshold (0.0), the controller shall disengage cruise control.", ...
    Description="Derived from CruiseControl/BrakeLogic.");
child.Keywords = ["draft","auto-generated","safety","brake"];

% Create traceability links: use block handle from SID (blk_X → X) for robustness
lnk = slreq.createLink(Simulink.ID.getHandle(model + ":5"), req);
slreq.createLink(Simulink.ID.getHandle(model + ":8"), child);

save(rs);
% Save all link sets
linkSets = slreq.find(Type="LinkSet");
for i = 1:numel(linkSets), save(linkSets(i)); end

Link rules:

  • Source = model element, destination = requirement → link type is automatically Implement
  • Prefer subsystem-level links; use block-level only when the requirement is block-specific
  • Every model-derived requirement must have at least one traceability link
  • The model must be loaded (load_system) before creating links with block paths

Path B — Structured YAML fallback

Use when Requirements Toolbox is unavailable. For schema and field rules see references/yaml-requirements.md.

  1. Generate a <model>_requirements.yaml file from the capture table
  2. Set status: Draft and include draft in keywords for every requirement
  3. Self-review: all required fields set, asil/status/priority use valid values, IDs sequential, derived_from references valid IDs or is null
  4. Validate:
python -c "import yaml, sys; yaml.safe_load(open(sys.argv[1])); print('OK')" path/to/requirements.yaml

Guardrails

AlwaysNever
Mark every generated requirement as DRAFTEmit markdown or ad hoc text when .slreqx is available and no text format was requested
Write requirements using EARS patternsRestate block topology as the requirement summary
Include parameter name + value: VarName (value)Create both .slreqx and .yaml unless user asks for both
Link direction: model element → requirementReverse the link direction (requirement → block)
load_system before creating traceability linksOver-link every primitive block — prefer subsystem links
Use only R2023a+ APIsSilently fall back to YAML when user explicitly requested .slreqx
Stay consistent with existing repo formatRenumber existing requirement IDs on regeneration

Review Gate

Before finishing, verify (both backends):

  • Every requirement has Id, Summary, and Description
  • Every requirement is marked as DRAFT (via Keywords or status field)
  • Summaries use EARS patterns, not block-topology restatements
  • Numeric values include parameter name + value where a workspace variable exists
  • IDs are stable and sequential; existing IDs preserved on regeneration

slreq path only:

  • Model-derived requirements have a traceability link to the source model element
  • Link direction is model element → requirement (not reversed)
  • Subsystem-level linking preferred over block-level
  • Requirement set and all link sets are saved

YAML path only:

  • File parses without errors
  • asil and priority use valid enum values (or Unset when unknown)

References

  • references/slreq-patterns.md — Requirements Toolbox API cookbook
  • references/yaml-requirements.md — Structured YAML schema and field rules
  • assets/slreq_from_model.m — End-to-end slreq example
  • assets/requirements.yaml — Structured YAML example

Copyright 2026 The MathWorks, Inc.


FAQ

What does the generate-requirement-drafts skill do?

Generates draft requirements from Simulink models. Use when drafting or updating requirement artifacts from a model. Prefers Requirements Toolbox (.slreqx) when available; falls back to structured YAML.

How do I install generate-requirement-drafts?

Run npx skills add https://github.com/matlab/simulink-agentic-toolkit --skill generate-requirement-drafts in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/generate-requirement-drafts/ (personal) or .claude/skills/generate-requirement-drafts/ (project).

Which AI agents can use generate-requirement-drafts?

Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.

Is generate-requirement-drafts safe to install?

No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.

Who maintains generate-requirement-drafts?

It is published by matlab in matlab/simulink-agentic-toolkit. It has 80 recorded installs.

More from matlab/simulink-agentic-toolkit

View all →
matlab avatar

building-simulink-models

matlab/simulink-agentic-toolkit

Builds and edits Simulink, System Composer, Stateflow, and Simscape models. Use when modifying model structure, parameters, ports, connections, or Stateflow chart internals.

AI & Agents185 installs
matlab avatar

simulating-simulink-models

matlab/simulink-agentic-toolkit

Configures Simulink simulations non-destructively using SimulationInput objects — parameter overrides without modifying the model, batch sweeps via parsim, custom input signals via Dataset, and simulation data retrieval via logsout. Use when running sim()/parsim() with setVariable, setBlockParameter, setExternalInput, or when performing parameter sweeps and multi-run analysis. Not needed for one-shot simulations without configuration.

Data & Databases156 installs
matlab avatar

testing-simulink-models

matlab/simulink-agentic-toolkit

Tests Simulink models using either ephemeral Gherkin-based tests (modeltest) for quick validation or persistent tests (Simulink Test API) authored from requirements or behavioral specs. Requires Simulink Test.

Testing & QA124 installs
matlab avatar

specifying-plant-models

matlab/simulink-agentic-toolkit

Specify plant models for closed-loop simulation: system specs, architecture, build plans, validation plans. Use when creating, updating, or reviewing plant model specifications, planning plant model architecture, or planning plant model validation.

matlab avatar

specifying-mbd-algorithms

matlab/simulink-agentic-toolkit

Specify algorithms for Model-Based Design: system specs, architecture specs, implementation plans, test plans. Use when creating specifications for controllers, signal processing, diagnostics, estimators, or other algorithms authored in Simulink, Stateflow, System Composer, or MATLAB Function blocks.

AI & Agents90 installs
matlab avatar

filing-bug-reports

matlab/simulink-agentic-toolkit

Generate a standalone bug report that another developer can use to reproduce, investigate, and fix an issue. Use when the user says 'file a bug', 'write a bug report', 'report this issue', or asks to document a defect for handoff.

Popular ai & agents skills

View category →
google avatar

google-agents-cli-publish

google/agents-cli

This skill should be used when the user wants to "publish an agent", "publish my ADK agent", "register an agent with Gemini", "publish to Gemini" (formerly Gemini Enterprise), or needs guidance on the agents-cli publish gemini command. Also use when the user wants to "manage agents in Agent Registry", "list/update/delete registered agents", or "register an MCP server". Covers ADK vs A2A registration modes, programmatic and interactive usage, flag reference, auto-detection from deployment metadata, Agent Registry fleet management, and troubleshooting. Part of the agents-cli skills suite. Do NOT use for deployment (use google-agents-cli-deploy).

AI & Agents587.3K installs
google avatar

google-agents-cli-eval

google/agents-cli

This skill should be used when the user wants to "run an evaluation", "evaluate my agent", "evaluate my ADK agent", "write an eval dataset", "analyze eval failures", "compare eval results", "optimize agent", or needs guidance on the Gemini platform eval methodology and the Quality Flywheel. Covers eval metrics, dataset schema, LLM-as-judge scoring, and common failure causes. Applies to any agents-cli project, whatever framework the agent is written in. Do NOT use for agent API code patterns (ADK: use google-agents-cli-adk-code), deployment (use google-agents-cli-deploy), or project scaffolding (use google-agents-cli-scaffold).

AI & Agents586.1K installs
anthropics avatar

skill-creator

anthropics/skills

Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.

OfficialAI & Agents438.3K installs
prime-skills avatar

codex-pet

prime-skills/runcomfy-agent-skills

Codex Pet generator on RunComfy. Build a Codex-compatible Codex Pet spritesheet.webp + pet.json from a single reference image, drop it into ${CODEXHOME:-$HOME/.codex}/pets/ / and Codex picks it up as a custom Codex Pet next to the 8 built-ins. This skill produces the exact Codex Pet atlas Codex expects (1536x1872 PNG/WebP, 8 cols x 9 rows, 192x208 cells, 9 animation states — idle, running-right, running-left, waving, jumping, failed, waiting, running, review). Calls OpenAI GPT Image 2 edit ONCE via the local RunComfy CLI as runcomfy run openai/gpt-image-2/edit to produce a canonical Codex Pet pose, then assembles all 9 animation rows programmatically with ImageMagick micro-transforms — no Codex Pro, no $imagegen, no OPENAIAPIKEY required, only RUNCOMFYTOKEN. Triggers on "codex pet", "create codex pet", "make codex pet", "hatch codex pet", "/hatch image", "desktop pet codex", "codex pets", "spritesheet.webp", or any explicit ask to build a custom pet for OpenAI Codex.

AI & Agents412.7K installs
leonxlnx avatar

full-output-enforcement

leonxlnx/taste-skill

Overrides default LLM truncation behavior. Enforces complete code generation, bans placeholder patterns, and handles token-limit splits cleanly. Apply to any task requiring exhaustive, unabridged output.

AI & Agents401.1K installs
obra avatar

executing-plans

obra/superpowers

Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available

AI & Agents268.9K installs