Skip to content

matlab/agent-skills-playground / demos/mbse-with-agentic-ai/skills/mbse-architecture

mbse-architecture

Verified

Use this skill for the architecture phases of an MBSE workflow in MATLAB, when writing idempotent buildXxx.m scripts that produce a three-layer RFLPV architecture (Functional, Logical, Physical) with interface dictionaries, stereotype profiles, allocation sets, and requirements Implement links. Trigger for defining stereotype properties, functional-to-logical / logical-to-physical allocation, mapping requirements to components via slreq Implement links, or running quantitative roll-up analysis on the architecture. Do NOT trigger for ad-hoc structural edits to an already-built System Composer model (adding one component, rewiring a port) — use `building-simulink-models` with `model_edit` for that. Works alongside the `system-composer` skill for detailed SC API patterns.

code/buildMyLogical.m

View on GitHub
function buildMyLogical(modelName, dictFile, archDir)
% BUILDMYLOGICAL Create a System Composer logical architecture model.
%   The logical layer captures design-agnostic solution principles — the "what"
%   between functions (F) and physical implementation (P). Components represent
%   solution elements (SensingUnit, ControlUnit, ActuationUnit) without
%   committing to specific hardware or software implementations.
%   Deletes and recreates the logical interface dictionary and model on
%   every run (idempotent). Build after the functional model.
%
%   Inputs:
%     modelName - Name of the logical SC model, e.g. "MyLogical" (string)
%     dictFile  - Full path to the logical interface dictionary (.sldd) (string)
%     archDir   - Directory in which to save the model file (string)

    slxFile = fullfile(archDir, char(modelName) + ".slx");

    if bdIsLoaded(modelName), close_system(modelName, 0); end
    Simulink.data.dictionary.closeAll("-discard");
    if isfile(dictFile), delete(dictFile); end
    if isfile(slxFile),  delete(slxFile);  end

    addpath(archDir);
    dict = systemcomposer.createDictionary(dictFile);

    % Logical interfaces — more concrete than functional (typed signals with
    % semantic fields), but design-agnostic (no hardware specs or datasheet values)
    controlSignalIface = addInterface(dict, "ControlSignal");
    addElement(controlSignalIface, "Value", Type="double");
    % ... more interfaces ...
    dict.save();

    % Re-fetch after save (required before use in setInterface)
    controlSignalIface = dict.getInterface("ControlSignal");

    model = systemcomposer.createModel(modelName);
    arch  = model.Architecture;
    linkDictionary(model, strrep(dictFile, '\', '/'));

    % Logical components are solution principles — nouns describing what kind
    % of element solves the function, not what specific hardware implements it.
    % Examples: SensingUnit, ControlUnit, ActuationUnit, PowerConverter
    sensingUnit = addComponent(arch, "SensingUnit");
    addTypedPort(sensingUnit.Architecture, "SignalOut", "out", controlSignalIface);
    % ... more components, ports, connections ...

    Simulink.BlockDiagram.arrangeSystem(modelName);
    save_system(char(modelName), char(fullfile(archDir, modelName)));
    open_system(char(modelName));
end

% ── Helpers ──────────────────────────────────────────────────────────────────

function addTypedPort(compArch, name, direction, iface)
    port = addPort(compArch, name, direction);
    port.setInterface(iface);
end
brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).Stars: 322kUpdated Claude CodeCodexVerifiedInstall
brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
frontend-designanthropics/skillsGuidance 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.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).Stars: 198kUpdated Claude CodeCodexVerifiedInstall