# Building Simulink Models

Builds and edits Simulink, System Composer, Stateflow, and Simscape models.

- Repository: https://github.com/matlab/simulink-agentic-toolkit (1305 stars)
- Category: Engineering
- License: see repository
- Last updated: 2026-10-29
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add matlab/simulink-agentic-toolkit --skill building-simulink-models -g -a claude-code -y`
Codex: `npx skills add matlab/simulink-agentic-toolkit --skill building-simulink-models -g -a codex -y`
Cursor: `npx skills add matlab/simulink-agentic-toolkit --skill building-simulink-models -g -a cursor -y`
Gemini CLI: `npx skills add matlab/simulink-agentic-toolkit --skill building-simulink-models -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add matlab/simulink-agentic-toolkit`

## Description

Builds and edits Simulink, System Composer, Stateflow, and Simscape models. Use when modifying model structure, parameters, ports, connections, or Stateflow chart internals.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Building Models

Use `model_edit` for all structural changes, Simulink, System Composer, Simscape, and Stateflow chart internals

## When to Use

- Adding, connecting, deleting, or replacing blocks in a model
- Configuring block parameters, signal properties, or model settings
- Creating or editing Stateflow chart internals (states, transitions, junctions, data, events, messages, functions)
- Building System Composer architecture models
- Wiring Simscape physical connections

## When NOT to Use

- Querying parameter values → use `model_query_params`
- Resolving variable references to numeric values → use `model_resolve_params`

## Library & Policy Prerequisites, BLOCKING GATE

**Do this FIRST, evaluate the result before any other tool call.** Do not narrate the gate check to the user; proceed silently based on the result.

Call `library.settingsLookup()` to check for custom library configuration. It returns a struct with resolved absolute paths:
- `found`, whether a libraries file was located (satk-libraries.json or legacy reuse-libraries.json)
- `enabled`, whether custom libraries are configured
- `gatePass`, whether the gate is satisfied (can proceed to build)
- `kgIndexPath`, absolute path to `library-kg/index.md`
- `librariesPath`, absolute path to the libraries file
- `policyPath`, absolute path to `block-policy.json`
- `dataRoot`, absolute path to the directory containing `.satk/`

**Interpret the result:**

- **`found: false`** → no custom libraries configured. Proceed with standard Simulink blocks.
- **`gatePass: true, found: true`** → read `kgIndexPath` for block lookup, then plan and edit.
- **`gatePass: false`** → invoke `setup-custom-libraries` to populate the Knowledge Index.

Display meaningful description of each check and result instead of stating gate Pass/fail.


No model reading, planning, or editing begins until the gate passes.

## Workflow

The rest: https://github.com/matlab/simulink-agentic-toolkit/blob/HEAD/skills-catalog/model-based-design-core/building-simulink-models/SKILL.md
