Skip to content

matlab/agent-skills-playground / demos/mbse-with-agentic-ai/skills/system-composer

system-composer

Verified

Use this skill when authoring reusable, idempotent MATLAB scripts that build System Composer architecture models via the architecture-modeling API — `systemcomposer.createModel`, `addComponent`, `addPort`, `setInterface`, `connect(srcPort, dstPort)`, interface dictionaries (.sldd) with `addInterface`/`addElement`, profiles/stereotypes with `Profile.createProfile` and `addStereotype`, or `systemcomposer.allocation.createAllocationSet`. Also trigger when debugging these APIs (connections that don't appear, interfaces that don't resolve, profile save errors, `createAllocationSet` signature-mismatch errors). Do NOT trigger for ad-hoc structural edits to an already-built model (adding one SubSystem, rewiring a port) — use `building-simulink-models` with `model_edit` for that.

code/addCommonInterfaces.m

View on GitHub
function ifaces = addCommonInterfaces(dict)
% ADDCOMMONINTERFACES Add common multi-domain interfaces to a System Composer dictionary.
%   ifaces = addCommonInterfaces(dict) adds Thermal, Electrical, Mechanical, and
%   UserCommand interfaces to dict and returns a struct of the interface objects.
%
%   This function is an illustrative starting point, not a complete recipe.
%   Add, remove, or rename interfaces and elements to suit your architecture.
%
%   NOTE: Call dict.save() and re-fetch interfaces before passing them to
%   setInterface(). See the dict.save() + re-fetch pattern in the skill guide.
%
%   Input:
%     dict   - System Composer data dictionary (systemcomposer.data.Dictionary)
%
%   Output:
%     ifaces - Struct with fields:
%                ThermalFluid, HeatFlow, TemperatureSignal
%                ElectricalPower, ControlSignal
%                RotationalMechanical
%                UserCommand

    %% Thermal
    ifaces.ThermalFluid = addInterface(dict, "ThermalFluid");
    addElement(ifaces.ThermalFluid, "Temperature",  Type="double");   % K
    addElement(ifaces.ThermalFluid, "MassFlowRate", Type="double");   % kg/s

    ifaces.HeatFlow = addInterface(dict, "HeatFlow");
    addElement(ifaces.HeatFlow, "HeatFlowRate", Type="double");       % W

    ifaces.TemperatureSignal = addInterface(dict, "TemperatureSignal");
    addElement(ifaces.TemperatureSignal, "Value", Type="double");     % K

    %% Electrical
    ifaces.ElectricalPower = addInterface(dict, "ElectricalPower");
    addElement(ifaces.ElectricalPower, "Voltage", Type="double");     % V
    addElement(ifaces.ElectricalPower, "Current", Type="double");     % A

    ifaces.ControlSignal = addInterface(dict, "ControlSignal");
    addElement(ifaces.ControlSignal, "Value", Type="double");         % boolean 0/1

    %% Mechanical (rotational)
    ifaces.RotationalMechanical = addInterface(dict, "RotationalMechanical");
    addElement(ifaces.RotationalMechanical, "Torque",          Type="double");   % Nm
    addElement(ifaces.RotationalMechanical, "AngularVelocity", Type="double");   % rad/s

    %% User Interface / Control signals
    ifaces.UserCommand = addInterface(dict, "UserCommand");
    addElement(ifaces.UserCommand, "CommandID", Type="double");       % enumerated code

end
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 322kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 322kUpdated Claude CodeCodexVerifiedInstall
executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is availableStars: 322kUpdated Claude CodeCodexVerifiedInstall