Generates draft requirements from Simulink models using Requirements Toolbox (.slreqx) or structured YAML. Applies EARS syntax patterns and stable ID conventions.
Ships in model-based-design-core. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Generate draft requirements from Simulink models using the richest artifact the environment supports. All outputs are drafts requiring human review and approval before baselining.
.slreqx or .yaml requirements artifactstesting-simulink-models skill<Model>_Requirements.slreqx or <model>_requirements.yamlREQ_<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)..slreqx or .yaml files already exist"draft" in Keywords (slreq) or status: Draft + keywords: [draft] (YAML)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:
Choose the pattern that best fits the model behavior:
| Pattern | Template | When to Use |
|---|---|---|
| Ubiquitous | The <system> shall <response>. | Always-on behavior, invariants |
| Event-driven | When <trigger>, the <system> shall <response>. | A momentary trigger causes a one-time response: input events, entering a Stateflow state (the transition itself) |
| State-driven | While <state>, the <system> shall <response>. | Behavior that holds continuously while in a Stateflow state or mode — the ongoing response, not the entry transition |
| Unwanted behavior | If <condition>, then the <system> shall <response>. | Error handling, safety limits, saturation |
| Optional feature | Where <feature>, the <system> shall <response>. | Variant subsystems, configurable features |
| Combined | While <state>, when <trigger>, the <system> shall <response>. | State + event combinations |
| ❌ 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." |
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.)VarName (value). If the model uses a literal with no variable, record the numeric literal directlyRationale, not in the requirement statementWhen <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 statementChoose once at the start, then stay on that path.
| Situation | Backend |
|---|---|
User explicitly asks for .slreqx, traceability views, or repo already uses .slreqx | Requirements 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 requirements | Structured YAML |
| No format specified — probe for Requirements Toolbox | Requirements Toolbox if probe succeeds |
| No format specified and probe fails | Structured 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)
model_overview, model_read, model_query_params, model_resolve_params as MCP tools — never pass their names to evaluate_matlab_code.evaluate_matlab_code only for MATLAB code, such as the backend probe and the slreq.* APIs in Path A.Understand the model — use the model_overview and model_read tools to understand subsystems, interfaces, control logic.
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.
Build a capture table (backend-neutral):
| Id | ParentId | Summary | Description | SourceBlock | Rationale | ASIL | Priority | Keywords |
|---|
Run the backend path (A or B below).
Review using the gate below.
.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:
Implementload_system) before creating links with block pathsUse when Requirements Toolbox is unavailable. For schema and field rules see references/yaml-requirements.md.
<model>_requirements.yaml file from the capture tablestatus: Draft and include draft in keywords for every requirementasil/status/priority use valid values, IDs sequential, derived_from references valid IDs or is nullpython -c "import yaml, sys; yaml.safe_load(open(sys.argv[1])); print('OK')" path/to/requirements.yaml
| Always | Never |
|---|---|
| Mark every generated requirement as DRAFT | Emit markdown or ad hoc text when .slreqx is available and no text format was requested |
| Write requirements using EARS patterns | Restate 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 → requirement | Reverse the link direction (requirement → block) |
load_system before creating traceability links | Over-link every primitive block — prefer subsystem links |
| Use only R2023a+ APIs | Silently fall back to YAML when user explicitly requested .slreqx |
| Stay consistent with existing repo format | Renumber existing requirement IDs on regeneration |
Before finishing, verify (both backends):
Id, Summary, and Descriptionslreq path only:
YAML path only:
asil and priority use valid enum values (or Unset when unknown)references/slreq-patterns.md — Requirements Toolbox API cookbookreferences/yaml-requirements.md — Structured YAML schema and field rulesassets/slreq_from_model.m — End-to-end slreq exampleassets/requirements.yaml — Structured YAML exampleCopyright 2026 The MathWorks, Inc.
What SKILL.md sets; muted values are Claude Code's defaults
12 skills in this plugin
/arranging-simulink-layoutsArranges Simulink block diagram layout to improve readability using the model_edit layout engine. Use when the user asks to fix, clean up, tidy, straighten, or rearrange a layout, or to run Simulink's Auto Arrange, when blocks overlap or lines cross, when specific blocks need repositioning, or when grouping blocks into or expanding a subsystem./building-simulink-modelsBuilds and edits Simulink, System Composer, Stateflow, and Simscape models. Use when modifying model structure, parameters, ports, connections, or Stateflow chart internals./filing-bug-reportsGenerate 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./managing-simulink-projectsManages MATLAB projects for Simulink workflows: path management, file registration, labels, source control configuration, and project lifecycle. Use when creating projects, adding models/dictionaries/requirements to projects, configuring labels for automation, fixing broken model references, or setting up source control for Simulink artifacts./setup-custom-librariesRegister, add, or update existing custom Simulink block libraries and configure block policy and knowledge index. Use when a user wants to register, set up, configure, or add existing .slx library files for agent-assisted model building. Do NOT use when the user wants to create or author a new library from scratch — that requires building-simulink-models./simulating-simulink-modelsConfigures 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./model-based-design-core:generate-requirement-draftsfrom model-based-design-core
npx claudepluginhub matlab/simulink-agentic-toolkit --plugin model-based-design-coreOther plugins' skills for the same job