Skip to content

matlab/agent-skills-playground / demos/requirements-based-verification/skills/simulink-test-sequence-from-ears

simulink-test-sequence-from-ears

Verified

Generate Simulink Test Sequence blocks and harnesses from EARS requirements. Use when asked to create a test case from a requirement, generate tests from a .slreqx file, or verify a Simulink model with requirement-based tests.

scripts/prepareWritableBuildWorkspace.m

View on GitHub
function buildInfo = prepareWritableBuildWorkspace(sourceDir, varargin)
%PREPAREWRITABLEBUILDWORKSPACE Copy project artifacts to a writable folder.
%   BUILDINFO = prepareWritableBuildWorkspace(SOURCEDIR) stages the source
%   directory in a temporary writable location for staged validation or
%   copy-only harness export workflows when the source model cannot be
%   updated directly.

    if nargin < 1 || strlength(string(sourceDir)) == 0
        sourceDir = pwd;
    end

    parser = inputParser;
    addParameter(parser, 'DestinationRoot', tempdir, @(x) ischar(x) || isstring(x));
    addParameter(parser, 'Exclude', {'slprj', 'test_harnesses', '.git'}, @(x) iscell(x) || isstring(x));
    parse(parser, varargin{:});

    sourceDir = char(sourceDir);
    destinationRoot = char(parser.Results.DestinationRoot);
    excludeNames = string(parser.Results.Exclude);

    buildDir = tempname(destinationRoot);
    mkdir(buildDir);

    entries = dir(sourceDir);
    copied = strings(0,1);
    for i = 1:numel(entries)
        name = string(entries(i).name);
        if name == "." || name == ".." || any(name == excludeNames)
            continue;
        end
        copyfile(fullfile(sourceDir, char(name)), fullfile(buildDir, char(name)));
        copied(end+1,1) = name; %#ok<AGROW>
    end

    buildInfo = struct();
    buildInfo.source_dir = string(sourceDir);
    buildInfo.build_dir = string(buildDir);
    buildInfo.copied_entries = copied;
    buildInfo.instructions = "Use build_dir as the MATLAB project_path for harness generation.";
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