system-composer

Create idempotent System Composer architecture models with the architecture-modeling API.

18|4|Updated Jul 20, 2023
One-click install
npx skills add https://github.com/simulink/blog --skill system-composer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: system-composer
Source: https://github.com/simulink/blog/tree/main/2026_04_27_MBSE_GenAI/matlab-mbse-skills/skills/system-composer
Command: npx skills add https://github.com/simulink/blog --skill system-composer

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps authors create reusable, idempotent MATLAB scripts to build System Composer architecture models using the architecture-modeling API.

Core Features & Use Cases

  • Create System Composer models programmatically using the architecture-modeling API: systemcomposer.createModel, addComponent, addPort, connect, setInterface, and manage interface dictionaries (.sldd) with addInterface/addElement.
  • Apply profiles and stereotypes via Profile.createProfile and addStereotype, and handle allocation sets with systemcomposer.allocation.createAllocationSet.
  • Debug and guard against common API failures (unresolved interfaces, profile save errors, allocation-signature mismatches) and enforce idempotent rebuilds.
  • Ensure reliable layout by calling Simulink.BlockDiagram.arrangeSystem before saving, and keep edits deterministic by rebuilding from scratch rather than ad-hoc edits.

Quick Start

Create a buildMySystemModel.m that uses the architecture-modeling APIs (systemcomposer.createModel, addComponent, addPort, connect, setInterface, createDictionary) and call arrangeSystem before saving to ensure idempotent, reproducible results.

Frequently Asked Questions about system-composer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create idempotent System Composer architecture models programmatically in MATLAB?

Idempotent System Composer architecture modeling uses MATLAB scripts to rebuild models deterministically from scratch, preventing ad-hoc edits. By leveraging the architecture-modeling API, you ensure reproducible builds across revisions without manual reconfiguration.

What is the best way to automate multi-domain System Composer model creation?

Automating multi-domain System Composer models involves using the architecture-modeling API to programmatically add components, ports, and connections. Calling Simulink.BlockDiagram.arrangeSystem before saving ensures reliable, deterministic layout for reproducible builds.

Why do my System Composer API scripts fail with unresolved interfaces or profile save errors?

System Composer API failures often stem from unresolved interfaces, profile save errors, or allocation-signature mismatches. Debugging these requires guarding against common API pitfalls by rebuilding models from scratch and ensuring interface dictionaries are properly configured.

Can I apply stereotypes and manage interface dictionaries when building System Composer models?

Yes, building System Composer models programmatically supports applying profiles and stereotypes via Profile.createProfile and addStereotype. You can also manage interface dictionaries (.sldd) using addInterface and addElement for robust architecture definitions.

How do I handle allocation sets in System Composer using MATLAB scripts?

Handling allocation sets in System Composer scripts uses systemcomposer.allocation.createAllocationSet to define allocations. Ensuring idempotent rebuilds from scratch prevents allocation-signature mismatches and maintains reproducible architecture definitions across model revisions.

Do I need MATLAB and System Composer to use the architecture-modeling API for programmatic builds?

Yes, using the architecture-modeling API for programmatic builds requires both MATLAB and System Composer. These platforms provide the necessary APIs like systemcomposer.createModel and connect to automate idempotent architecture generation and enforce reproducible layouts.