
simscape-write-ssc
Use when writing or editing Simscape Language (.ssc) source files — components, domains, or functions. Triggers include: model a physical component in .ssc; write physical equations for a Simscape block; add or modify physics or parameterization options in a Simscape component; build a composite component. Also use for validating .ssc syntax, fixing Simscape Language errors, or converting governing equations into working Simscape component code. Do NOT use for configuring or connecting existing Simscape blocks in a Simulink model — that is model building, not language authoring.
- Installs
- 0
- 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 simscape-write-ssc- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads simscape-write-ssc automatically when relevant.
- 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.
Simscape Language Authoring
Write .ssc files (components, domains, functions) that pass validation and are physically correct.
When to Use
- Writing a new .ssc component, domain, or function from scratch
- Adding or modifying physics, equations, or parameterization in an existing .ssc file
- Converting governing equations into a working Simscape component
- Adding mode charts, events, or switching logic to a component
- Building a composite component that connects subcomponents together
- Fixing Simscape Language syntax or validation errors
When NOT to Use
- Configuring or connecting existing Simscape blocks in a Simulink model — use
building-simulink-modelsinstead - Simulating a model or inspecting results — use
simulating-simulink-models - Setting block parameters from MATLAB or a script without editing .ssc source
Workflow
Designing a component
Below are the sections that make up a Simscape component. Include only what is needed.
nodes, inputs, outputs
nodes— quantity participates in bilateral energy exchange (the network enforces Across equalization + Through summation).inputs— physical signal imposed from outside (control signal, environment).outputs— physical signal for a measurement or computed result.
Node ports have a domain. Reuse an existing one, especially foundation; author a custom domain only when none covers the physics.
| Physics | Domain path |
|---|---|
| Electrical (single-phase) | foundation.electrical.electrical |
| Rotational mechanical | foundation.mechanical.rotational.rotational |
| Translational mechanical | foundation.mechanical.translational.translational |
| Thermal (heat transfer) | foundation.thermal.thermal |
For fluid domains, polyphase electrical, position/angle-based mechanical variants, or any
domain not in the table, you must read: references/foundation/domain-selection.md.
parameters, variables
Parameters — user-configurable inputs; part of the interface.
- Expose as
parametersfor physical quantities the engineer sets (resistances, dimensions, thresholds). - Use
parameters(Access=private)for quantities computed from other parameters. Useintermediateswhen the value depends on a runtime value. - Defaults: physically typical values, so the component works out of the box.
Variables — differential, algebraic, or event.
- Differential (appear in
der(x)): setpriority.high; use an initial equation only when the start depends on another variable rather than a fixed/parameter value — never both. - Event: declare
(Event = true)
Visibility (both): default Access = public, ExternalAccess = modify for
user-facing items. Access = private + ExternalAccess = none for pure implementation
detail; protected + observe for internal quantities that subclasses or logging should see.
Units — declare everywhere. Every parameter and variable carries a unit
({value, 'unit'}, or '1' for dimensionless). Simscape validates commensurability at
compile time and auto-converts across the network. Declare in the unit the engineer
naturally uses (mm, deg, bar). A bare number is a silent mismatch waiting to happen.
Compile-time vs. runtime conditionals (if)
- Interface items (ports, variables the user sees): declared unconditionally (public).
Use conditional annotations +
ExternalAccessto hide/show them based on a parameter — they remain part of the interface but become invisible in inactive variants. - Internal items (hidden variables, internal equations): prefer compile-time
if(top-level, parameter-guarded) to eliminate them entirely — reduces states, logging, and solver work. - Runtime
if(insideequations): use when the governing equation changes at runtime. Must have anelsebranch. Equation count/dimensionality must be identical in every branch.
equations, intermediates, components, connections, for, modecharts, events, annotations
| Section | Include when |
|---|---|
equations | continuous relationships (== is symmetric equality), assert for parameter validation, equations (Initial=true) for init-only constraints |
intermediates | factor a reused subexpression or want it logged |
components / connections | assembling from existing subcomponents (composite) |
for | arrays of components or nodes |
modecharts | the component has discrete operating states, each with a structurally different equation set (different equation counts, or der terms that come/go) — and transitions between them, possibly with hysteresis. Overkill when a smooth approximation (tanh, tablelookup) or runtime if with identical equation counts fits. |
events | update variables(Event=true) (latches, sample-hold, one-shot triggers) at discrete instants via edge() / initialevent. Prefer modecharts when suitable. |
annotations | conditional visibility (ExternalAccess overrides), icons (Icon), dialog tabs (UILayout), port sides (Side), logging units (LoggingUnit), fault modeling (Faults), or unit dropdowns (UnitDropdown) |
setup | never — deprecated; use assert in equations instead |
Write the .ssc file
Write for textbook readability — equations should read as physics. Match the surrounding library's conventions when editing an existing file.
Validate
simscape.agentic.sscIssues (in scripts/+simscape/+agentic/) takes the fully qualified
name of a Simscape component, domain, or function and prints diagnostics or "No issues
found." Run it with evaluate_matlab_code, project_path set to the skill's scripts/
folder so MATLAB can find the package. Fix reported issues and re-validate until clean.
simscape.agentic.sscIssues("mylib.components.MyComponent")
Pass the fully qualified name — dot-separated namespaces, not a file path. A file at
+mylib/+components/MyComponent.ssc on the MATLAB path is named
mylib.components.MyComponent. The function errors if the name is not on the path or does
not resolve to a .ssc/.sscp file.
Setting project_path changes the current folder, so the working folder and the files
the component references may drop off the path. A not found on the MATLAB search path
error, or a Validation failed: diagnostic naming a missing referenced file, is a path
problem — not a bug in the .ssc. Add necessary folders to the path before treating
diagnostics as real.
Reference files (references/)
Each file is self-contained. Read only what you need.
references/
composition/
arrays-of-nodes.md
composite-components-and-connections.md
composites-member-variable-initialization.md
for-loop-component-arrays.md
inheritance-and-subclassing.md
optional-and-variant-members.md
equations-and-variables/
assertions-and-bounds.md
intermediates-and-let.md
variables-derivatives-initialization.md
foundation/
domain-selection.md
gas.md
isothermal-liquid.md
moist-air.md
thermal-liquid.md
two-phase-fluid.md
language-functions/
matlab-declaration-functions.md
tablelookup.md
writing-simscape-functions.md
modecharts-and-events/
events-and-event-variables.md
modecharts.md
parameters-and-conditionals/
access-and-visibility-attributes.md
conditional-sections-and-hiding-members.md
enumerations.md
parameter-declaration.md
ports-and-nodes/
branches.md
nodes-conserving-ports.md
physical-signal-inputs-and-outputs.md
presentation/
block-appearance-and-ports.md
uilayout-and-dialog-tabs.md
Copyright 2026 The MathWorks, Inc.
FAQ
What does the simscape-write-ssc skill do?
Use when writing or editing Simscape Language (.ssc) source files — components, domains, or functions. Triggers include: model a physical component in .ssc; write physical equations for a Simscape block; add or modify physics or parameterization options in a Simscape component; build a composite component. Also use for validating .ssc syntax, fixing Simscape Language errors, or converting governing equations into working Simscape component code. Do NOT use for configuring or connecting existing Simscape blocks in a Simulink model — that is model building, not language authoring.
How do I install simscape-write-ssc?
Run npx skills add https://github.com/matlab/simulink-agentic-toolkit --skill simscape-write-ssc 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/simscape-write-ssc/ (personal) or .claude/skills/simscape-write-ssc/ (project).
Which AI agents can use simscape-write-ssc?
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 simscape-write-ssc 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 simscape-write-ssc?
It is published by matlab in matlab/simulink-agentic-toolkit. It has 0 recorded installs.
More from matlab/simulink-agentic-toolkit
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.
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.
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.
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.
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.
generate-requirement-drafts
matlab/simulink-agentic-toolkit
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.
Popular frontend & design skills
setup-matt-pocock-skills
mattpocock/skills
Configure this repo for the engineering skills: set up its issue tracker, triage label vocabulary, and domain doc layout. Run once before first use of the other engineering skills.
frontend-design
anthropics/skills
Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.
prototype
mattpocock/skills
Build a throwaway prototype to answer a design question. Use when the user wants to sanity-check whether a state model or logic feels right, or explore what a UI should look like.
ui-taste
uizze.sh
Give your coding agent better UI taste. Build and polish web and iOS interfaces with Uizze's anti-ui-slop playbooks and optional real-product references. Use for UI design, implementation, redesign, critique, or a final visual review in Claude Code, Codex, Cursor, or Copilot.
hyperframes-animation
heygen-com/hyperframes
All animation knowledge for HyperFrames — atomic motion rules, multi-phase scene blueprints, scene transitions, broader motion-design techniques, AND the seven runtime adapters (GSAP default, plus Lottie, Three.js, Anime.js, CSS keyframes, Web Animations API, TypeGPU). Use for any motion or animation task: pick 2-4 rules and compose, or load a blueprint, or look up runtime-specific API (e.g. GSAP eases / Lottie player / Three.js mixer). Also covers auditing an existing composition's choreography (animation map) and 24 named text-animation effects. HyperFrames-native: single paused timeline, seek-safe, deterministic.
hyperframes-core
heygen-com/hyperframes
The HyperFrames composition contract — build one renderable project. Use for composition structure, the data- timing attributes, class="clip", tracks, sub-compositions, variables, framework-owned media playback, deterministic-render rules, and validation. Read before writing composition HTML.