A collection of skills for AI coding agents by Guy on Simulink.
The skills are designed to guide AI agents to interact with Simulink models programmatically via the MATLAB MCP server. These skills encode best practices and guard against common pitfalls so the agent produces correct MATLAB/Simulink code on the first try.
More specifically, they force the agent to generate code that uses what I consider modern best practices and that keeps the code short and simple.
Disclaimer: This set of skills is not an official MathWorks product and might not be appropriate for all users and use cases. They are useful for me, for the kind of code and Simulink models I publish on Guy on Simulink. As the disclaimer on the blog says: These postings are the author's and don't necessarily represent the opinions of MathWorks.
Interact with a Simulink model that is already open in MATLAB — inspect blocks, change parameters, add and connect blocks, log signals, and create subsystems.
Triggers on: "change the gain", "color all Sum blocks", "find all integrators", "add a Scope here", or any reference to "this model / block / subsystem".
Key conventions enforced:
- Resolve context with
bdroot,gcs,gcbbefore acting - Use
Simulink.connectBlocksinstead ofadd_line - Position blocks with bundled
setBlockPosition/setBlockDimensionsutilities — never raw'Position'vectors - Log signals via port handles — never To Workspace blocks
Run simulations the right way using the Simulink.SimulationInput / SimulationOutput API.
Triggers on: any request involving sim(), SimulationInput, logsout, setExternalInput, parameter sweeps, or parsim.
Key conventions enforced:
- Always drive simulations through
SimulationInput— never bareset_param+sim - Pass inputs via
Simulink.SimulationData.Datasetwith correctly named timeseries - Discover logged signal names before accessing them
- Use
parsimfor batch / parallel runs
Generate a MATLAB baseline (golden-reference) regression test for a Simulink model using sltest.TestCase and verifySignalsMatch.
Triggers on: "create a baseline test", "golden-reference test", or "regression test" for a Simulink model.
Key conventions enforced:
- Inherit from
sltest.TestCase, notmatlab.unittest.TestCase - Simulate once, compare all signals in a single
verifySignalsMatchcall - Use
RelTol/AbsToldirectly — no manual scaling - Smart teardown with
bdIsLoadedcheck - Include a static
generateBaseline()method for easy re-baselining
Profile and analyze the initialization (compile) phase of a Simulink model. Collects timing metadata, Performance Tracer data, and MATLAB Profiler results, then generates interactive HTML flamegraph reports highlighting user-actionable bottlenecks.
Triggers on: "profile model initialization", "why is my model slow to compile", or when existing profiling files (out_after.mat, perfTracer.mat, profilerResults.mat) are provided.
Analyze Simulink Profiler data to find simulation-time bottlenecks, or compare two profiler sessions side-by-side to pinpoint performance regressions between releases or design changes.
Triggers on: "profile this model", "find what is slow", "compare profiler sessions", or when a Simulink.profiler.Data variable or MAT-file is provided.
Run the Simulink Solver Profiler and interpret the results — solver resets, exceptions, zero crossings, Jacobian updates, and algebraic loops — with prioritized recommendations and a standalone HTML report.
Triggers on: "run the solver profiler", "diagnose solver issues", or when solver profiler session data is provided.
- MATLAB with Simulink (and Simulink Test for the baseline-test skill)
- The MATLAB MCP server configured in your agentic coding tool environment
- An agentic coding tool: Claude code, Sourcegraph Amp, GitHub® Copilot, Cursor, OpenAI® Codex, Gemini™ CLI
Copy the skill folders you need into your project's skills directory. The location depends on your coding agent:
| Agent | Skills directory |
|---|---|
| Amp | .amp/skills/ |
| Claude Code | .claude/skills/ |
| Cursor | .cursor/skills/ |
| Other agents | Check your agent's documentation |
Copy the skill folders into your global skills directory:
| Agent | Windows | macOS / Linux |
|---|---|---|
| Amp | %USERPROFILE%\.amp\skills\ |
~/.amp/skills/ |
| Claude Code | %USERPROFILE%\.claude\skills\ |
~/.claude/skills/ |
| Cursor | %USERPROFILE%\.cursor\skills\ |
~/.cursor/skills/ |
Once installed, skills are activated automatically when your prompt matches their trigger description. You can also invoke them explicitly:
> Use the simulink-simulation skill to sweep the gain from 1 to 10 and plot the step response for each value.
> Use the simulink-baseline-test skill to create a regression test for this model.
MathWorks Products (https://www.mathworks.com)
The license is available in the License.txt file in this GitHub repository.
Copyright 2026 The MathWorks, Inc.