Skip to content

matlab/agent-skills-playground / demos/mbse-with-agentic-ai/skills/simulink-requirements

simulink-requirements

Verified

Use this skill for all requirements-related work in a MATLAB MBSE project using the Requirements Toolbox (slreq). Covers creating and populating requirement sets, derivation links, test case requirements, verification coverage, reading and tracing links across requirement sets and models, checking link health, allocating requirements to components (Implement links), and building traceability reports. Trigger when the user asks about slreq API, slreqx files, slmx link files, outLinks/inLinks, traceability matrices, coverage analysis, broken links, or mapping requirements to architecture components. Use proactively for any requirements or traceability task.

code/buildMyTestCases.m

View on GitHub
function buildMyTestCases(srFile, tcFile)
% BUILDMYTESTCASES Create test case requirements linked to system requirements.
%   Loads the system requirements set and recreates the test case set and its
%   paired .slmx link file on every run (idempotent).
%
%   Inputs:
%     srFile - Full path to the System Requirements file (.slreqx) (string)
%     tcFile - Full path to the Test Cases file (.slreqx) to create (string)

    tcLink = strrep(tcFile, '.slreqx', '~slreqx.slmx');

    slreq.clear();
    srSet = slreq.load(srFile);   % slreq.load() for scripts; slreq.open() opens the UI
    if isfile(tcFile), delete(tcFile); end
    if isfile(tcLink), delete(tcLink); end
    tcSet = slreq.new(tcFile);

    % { TC-ID, Summary, Description, SR-ID }
    testCases = {
        'TC-SYS-001', 'Verify SR-001', ...
            'Apply stimulus X. Measure Y. Pass if Y meets criterion Z.', ...
            'SR-SYS-001';
    };

    for i = 1:size(testCases, 1)
        tc             = tcSet.add();
        tc.Id          = testCases{i, 1};
        tc.Summary     = testCases{i, 2};
        tc.Description = testCases{i, 3};
        tc.Rationale   = ['Verifies ', testCases{i, 4}];
        sr             = srSet.find('Id', testCases{i, 4});
        lnk            = slreq.createLink(tc, sr);
        lnk.Type       = 'Verify';
    end
    slreq.saveAll();
end
finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the workStars: 322kUpdated Claude CodeCodexVerifiedInstall
systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixesStars: 322kUpdated Claude CodeCodexVerifiedInstall
test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation codeStars: 322kUpdated Claude CodeCodexVerifiedInstall
skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.Stars: 198kUpdated Claude CodeCodexVerifiedInstall