matlab/author-modeladvisor-checks
> Author or upgrade Model Advisor checks for Simulink and System Composer models. Use when creating new checks (edit-time, standard batch, config-parameter, auto-fix) or converting legacy StyleOne/StyleTwo/StyleThree checks to modern DetailStyle. Covers DetailStyle callbacks, ResultDetail reporting, sl_customization registration, and edit-time EdittimeCheck classes.
npx skills add https://github.com/matlab/simulink-agentic-toolkit --skill author-modeladvisor-checks
Create or upgrade Model Advisor checks to use modern DetailStyle callbacks and ResultDetail reporting. This skill prevents common authoring mistakes: using deprecated StyleOne/StyleTwo patterns, incorrect registration, missing result formatting, and wrong callback contexts. When upgrading legacy checks, read the existing code, identify the legacy pattern, and rewrite using the modern patterns below.
model_query_paramsreferences/.m file(s) following the Code Generation section belowsl_customization.mcheck_matlab_code on each generated .m fileWhen converting existing StyleOne/StyleTwo/StyleThree checks to DetailStyle, follow references/workflow-legacy-conversion.md.
This skill covers check authoring only. To run checks on a model, use the checking-model-compliance skill.
| If the user mentions... | Use Pattern | Reference |
|-------------------------|-------------|-----------|
| On-demand check, batch check, or nothing specific | Standard check (Default) | references/pattern-standard.md — full template with DetailStyle callback and ResultDetail reporting |
| "edit-time", "live", "real-time", "canvas warning" | Edit-time check | references/pattern-edittime.md — EdittimeCheck class with blockDiscovered/finishedTraversal |
| Config parameters, solver settings, diagnostics, model settings | Config parameter check | references/pattern-config-param.md — get_param/set_param with auto-fix action |
| "custom table", "formatted report", "custom columns" | + FormatTemplate | references/pattern-format-template.md — combine with standard or edit-time pattern for custom tables |
| "convert", "upgrade", "legacy", "StyleOne", "StyleTwo", "StyleThree" | Legacy conversion | references/workflow-legacy-conversion.md — infrastructure mapping, strategy choice, and result-layer replacement |
FormatTemplate is an add-on, not standalone.
| If the check inspects... | Reference |
|--------------------------|-----------|
| Blocks (properties, types, names, positions, masks) | references/api-blocks.md — find_system patterns and block property access |
| Signals (line names, labels, propagation, connections) | references/api-signals.md — line handle queries and signal tracing |
| Stateflow (charts, states, transitions, junctions, data) | references/api-stateflow.md — Stateflow.find and chart traversal |
| Data types, workspace, variables (resolution, data dictionary) | references/api-data-resolution.md — workspace variable resolution and storage class |
| MATLAB code analysis (checkcode, codeIssues, mtree) | references/api-code-analysis.md — static analysis of .m files |
| System Composer (components, ports, connectors, interfaces) | references/api-system-composer.md — architecture model queries |
All check types can also use references/api-framework.md — consult for input parameters, auto-fix actions, exclusion filtering, and result formatting.
get_param(system, paramName) — refer to the config parameter pattern and framework API.'None' callback context (architecture models do not compile).'DetailStyle' callback style — legacy styles cannot use ResultDetail reportingsl_customization.m registration — checks are invisible without itModelAdvisor.ResultDetail for reporting — only API that populates results pane correctlyModelAdvisor.Check(id) constructor — never use ModelAdvisor.Registration'StyleOne'/'StyleTwo'/'StyleThree' — deprecated and incompatible with ResultDetailcom.company.checkarea.checknamedefine<CheckName>.mSignalLabels.m, placed in +PackageName/.m)sl_customization.m — create new or append to existing (only one per folder)+PackageName/ModelAdvisor.Action setup and action callbackAfter generating all files:
check_matlab_code on each .m file — zero warnings requiredAdvisor.Manager.refresh_customizationsTest model creation and functional testing are out of scope for this skill (handled separately). Static analysis via check_matlab_code is the default verification step.
After generating check code, verify:
'DetailStyle' (not 'StyleOne'/'StyleTwo'/'StyleThree')'None' for structural checks, 'PostCompile' for compiled propertiesViolationType = 'Passed' with a status messagesetData type: 'SID' for blocks, 'Signal' for linessl_customization.m registers the check with correct function handlefinishedTraversal is implemented, execution is lightweight'None' context, reports component SID (not port/connector)checkcode warnings in generated files----
Copyright 2026 The MathWorks, Inc.
----
Take matlab/author-modeladvisor-checks from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.