Detects design errors in Simulink models using SLDV Design Error Detection (DED), including division-by-zero, overflow, dead logic, and out-of-bounds defects. Performs root cause analysis and suggests fixes for findings.
Ships in verification-validation-and-test. 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; scripts run unread.
.mat file) and wants analysis without re-running DEDRequires: MATLAB R2023b+, Simulink Design Verifier, Simulink Check / Model Slicer.
All script functions live in the skill's scripts/ directory. Use evaluate_matlab_code with project_path set to that folder so MATLAB can find them.
This skill provides two functions that automate SLDV-driven analysis the agent otherwise gets wrong when hand-rolling it, then hands you the facts to classify and fix findings. The workflow is four steps:
1. Detect errors → sldv_run_defect_checker (use the function; don't hand-roll DED)
2. Root cause errors → sldv_find_de_root_cause (use the function; don't hand-roll slicing)
3. Classify errors → agent step (dead logic: intentional vs. design_error)
4. Fix errors → agent step (propose, get approval, clone-fix-verify)
Steps 1–2 are the two functions. Steps 3–4 are agent judgment based on their output. Full API
detail (return fields, options, caching, sub-functions) is in references/api-reference.md —
load it when you need exact fields or options.
Call sldv_run_defect_checker(model) instead of writing your own SLDV DED invocation or
parsing objectives by hand — it configures the analysis, runs DED, and auto-loads cached
*_sldvdata.mat results when available.
result = sldv_run_defect_checker("my_model", OutputDir="artifacts/ded")
If result.Status == "pass": STOP. Report "No design errors of the checked types were
detected" and end the workflow. Do NOT call sldv_find_de_root_cause or investigate further.
DED is a quick scan, not an exhaustive proof — tell the user no defects of the checked types
were found, not that the model is error-free.
Proceed to Step 2 only when result.Status == "fail".
Call sldv_find_de_root_cause(model, DedResult=result.DedResult) instead of hand-building
slices — it returns backward slices, counterexamples, locality (blast-radius) measures, and
shared-root cascade annotations for every finding.
rca = sldv_find_de_root_cause("my_model", DedResult=result.DedResult, OutputDir="artifacts/ded")
Then trace each finding to its root cause:
rca.SliceBlocks to find which block produces the
defect-triggering valuemodel_overview / model_read to understand each block's roleLocality blocks (narrow blast radius, safer) and high-FindingCount blocks
(fix resolves more defects); check rca.Cascades — a shared-root fix resolves multiple
findings at onceWhen the slice is shallow (< 3 blocks) or stops at a Stateflow / MATLAB Function block:
the Model Slicer cannot trace through those constructs. Do NOT stop and report only what the
tool returned — fall back to model_read / model_overview to interpret the finding: read
the defect block and its upstream connections, read the Stateflow chart or MATLAB Function
logic the slice stopped at, and cross-reference counterexample values to see which branch is
active.
Classification happens after root cause analysis — you need to see the root cause (which block, what value) before deciding whether dead logic is intentional.
Findings arrive pre-enriched. For every dead logic finding, sldv_find_de_root_cause
attaches on the finding struct:
finding.ModelContext — a model_read dump of the block's surrounding scope. You do not
need to call model_read again for this. (If empty — model_read was unavailable — fall back
to model_overview / model_read yourself for that block.)finding.PatternCatalog — the entire dead-logic pattern library (catalog index + every
pattern), concatenated. You do not need to open the YAML files yourself.finding.Classification — "pending", awaiting your decision.How to classify. For each dead logic finding, using ModelContext and PatternCatalog:
PatternCatalog.Set the classification:
"intentional" — defensive logic, enable-as-input, negation guard pairs → no fix needed;
report to the user as expected behavior"design_error" — wrong parameter, cascading dead logic, short-circuit → fix the root cause"unclassified" — unclear → ask the userOnly apply fixes for "design_error" findings.
The functions provide facts; you identify root causes and decide fixes — there is no hardcoded defect-to-fix mapping.
When you are ready to propose or apply a fix, load and follow references/fix-strategy.md.
It covers root-cause identification, the clone-fix-verify procedure, fix principles, and the
blast-radius discussion required for every proposal.
Two rules that always apply (see Safety Rules): present findings and wait for explicit approval
before applying anything, and propose a fix for every design_error finding — 2–3 ranked
options each when possible — rather than stopping after only some.
| Mistake | Fix |
|---|---|
Continuing after Status == "pass" | STOP. Zero falsified objectives = no defects. Do not call sldv_find_de_root_cause or investigate further. Report "no defects found" and end. |
Calling sldv_find_de_root_cause without DedResult or DataFile | Pass one of the two — check result.DedResult from the checker |
| Running on an unsaved model | Save first; DED needs a file on disk |
| Applying fixes without presenting findings to user | Always show root cause analysis results first, get approval before fixing |
| Stopping at a shallow slice | Fall back to model_read / model_overview (Step 2) |
Running on large models without OutputDir | Set OutputDir to avoid temp-dir clutter |
Copyright 2026 The MathWorks, Inc.
assets/design_error_assumption.yaml (opens in a new tab)assets/design_error_cascading.yaml (opens in a new tab)assets/design_error_conditionally_executed.yaml (opens in a new tab)assets/design_error_enable_as_input.yaml (opens in a new tab)assets/design_error_parameter.yaml (opens in a new tab)assets/design_error_short_circuit_and.yaml (opens in a new tab)assets/design_error_short_circuit_or.yaml (opens in a new tab)assets/intentional_defensive_logic.yaml (opens in a new tab)assets/intentional_negation_guard_stateflow.yaml (opens in a new tab)assets/pattern_catalog.yaml (opens in a new tab)manifest.yaml (opens in a new tab)references/api-reference.md (opens in a new tab)references/fix-strategy.md (opens in a new tab)scripts/buildDepthLimitedTrace.p (opens in a new tab)scripts/buildSlice.p (opens in a new tab)scripts/checkEnvironment.p (opens in a new tab)scripts/classifyDeadLogic.p (opens in a new tab)scripts/computeReach.p (opens in a new tab)scripts/defaultConfig.p (opens in a new tab)scripts/detectCascade.p (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
/verification-validation-and-test:resolve-design-errorsfrom verification-validation-and-test
npx claudepluginhub matlab/simulink-agentic-toolkit --plugin verification-validation-and-test9 skills in this plugin
/author-modeladvisor-checksAuthor or upgrade Model Advisor checks for Simulink and System Composer models. Covers the full lifecycle: guideline authoring, check specification, Model Advisor check implementation, and qualification testing. Use when creating new checks (edit-time, standard batch, config-parameter, auto-fix), converting legacy StyleOne/StyleTwo/StyleThree checks to modern DetailStyle, creating a guideline for modeling, enforcing a modeling rule, or testing/qualifying a check. Triggers on any modeling constraint (e.g., "blocks shall...", "signals must match...", "parameters shall be set to...").
/checking-model-complianceUse this skill when the user asks to check Simulink model compliance against a standard (MISRA, MAB, JMAAB, ISO, DO, IEC, EN, CERT C/CWE, AUTOSAR, Simulink Code Inspector (SLCI)), wants to run Model Advisor checks, or needs a compliance report with fix suggestions. For JMAAB/MAB, supplement deterministic checks with agentic review of uncheckable guidelines./fix-sldv-incompatibilityUse when a Simulink model is incompatible with Simulink Design Verifier (sldvcompat returns false, or an SLDV analysis errors out on an unsupported construct) and needs to be made analyzable. Diagnoses the incompatibility, applies the matching fix to a copy, and confirms the copy is compatible; optionally raises confidence the fix preserved behavior via a back-to-back consistency replay (agreement on the generated tests, not a proof of equivalence). Do NOT use for running test generation, design error detection, or requirement verification themselves — only for making a model compatible so those can proceed./inject-faultsAdd, configure, and manage faults on Simulink, Simscape, and System Composer model signals for robustness analysis and safety validation. Use when injecting faults (stuck, noise, gain, offset) onto block inports/outports, enabling fault simulation, or analyzing fault effects. Covers sensor failures, signal corruptions, actuator faults, FMEA validation, and robustness testing. Requires Simulink Fault Analyzer./manage-safety-analysisCreate, populate, and manage safety analysis spreadsheets (FMEA, FHA, HARA, custom) and fault trees (FTA) in Safety Analysis Manager. Use when the user asks to perform FMEA, hazard analysis, fault tree analysis, safety analysis, or work with Safety Analysis Manager documents. Requires Simulink Fault Analyzer./simulink-collect-metricsCollect and assess quality metrics for Simulink models using the metric.Engine API. Use when evaluating model design quality (maintainability, complexity, architecture) or testing completeness (unit testing, SIL, PIL, coverage, pass rates) after edits or test runs. Covers metric discovery, collection, report generation, and diagnostics. Triggers on: "collect metrics", "quality metrics", "metric.Engine", "testing metrics", "maintainability metrics", "SIL metrics", "PIL metrics", "what metrics are available", "assess quality", "coverage metrics", "generate metric report", "diagnose metric errors".
Other plugins' skills for the same job