matlab/agent-skills-playground / demos/requirements-based-verification/skills/simulink-test-sequence-from-ears
simulink-test-sequence-from-ears
VerifiedGenerate 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.
| File | Kind | Size |
|---|---|---|
| LICENSE.md | markdown | 1.4 KB |
| SKILL.md | skill md | 5.6 KB |
| references/workflow-details.md | markdown | 15.1 KB |
| scripts/addPreconditionSteps.m | other | 1.4 KB |
| scripts/analizeRequirements.m | other | 2.9 KB |
| scripts/analyzeRequirements.m | other | 279 B |
| scripts/buildHarnessesFromApprovedYaml.m | other | 6.7 KB |
| scripts/collectSkillContext.m | other | 29.7 KB |
| scripts/compileHarnessModel.m | other | 326 B |
| scripts/configureEventDriven.m | other | 1.8 KB |
| scripts/configureStateDriven.m | other | 1.9 KB |
| scripts/configureTestSequence.m | other | 1.6 KB |
| scripts/configureUbiquitous.m | other | 1.5 KB |
| scripts/configureUnwantedBehavior.m | other | 1.9 KB |
| scripts/generateMappingReviewFromRequirements.m | other | 29.7 KB |
| scripts/generateSignalMappingsFromYaml.m | other | 4.3 KB |
| scripts/generateTestSequencesFromRequirements.m | other | 4.7 KB |
| scripts/parseEARSPattern.m | other | 2.3 KB |
| scripts/prepareWritableBuildWorkspace.m | other | 1.5 KB |
| scripts/readMappingReviewYaml.m | other | 6.6 KB |
| scripts/writeMappingReviewYaml.m | other | 9.2 KB |
scripts/parseEARSPattern.m
View on GitHubfunction [pattern, trigger, behavior] = parseEARSPattern(reqText)
%PARSEEARSPATTERN Extract EARS pattern components from requirement text
%
% Supported EARS patterns:
% Ubiquitous: "The system shall [behavior]"
% Event-Driven: "When [trigger], the system shall [behavior]"
% State-Driven: "While [state], the system shall [behavior]"
% Unwanted Behavior: "If [condition], then the system shall [behavior]"
% Optional: "Where [feature], the system shall [behavior]"
%
% Returns empty strings for pattern/trigger/behavior if no pattern matched.
pattern = '';
trigger = '';
behavior = '';
% Event-Driven: "When [trigger], the system shall [behavior]"
tok = regexp(reqText, 'When\s+(.+?),\s+the\s+system\s+shall\s+(.+?)\.?$', ...
'tokens', 'ignorecase');
if ~isempty(tok)
pattern = 'Event-Driven';
trigger = strtrim(tok{1}{1});
behavior = strtrim(tok{1}{2});
return;
end
% State-Driven: "While [state], the system shall [behavior]"
tok = regexp(reqText, 'While\s+(.+?),\s+the\s+system\s+shall\s+(.+?)\.?$', ...
'tokens', 'ignorecase');
if ~isempty(tok)
pattern = 'State-Driven';
trigger = strtrim(tok{1}{1});
behavior = strtrim(tok{1}{2});
return;
end
% Unwanted Behavior: "If [condition], then the system shall [behavior]"
tok = regexp(reqText, 'If\s+(.+?),\s+then\s+the\s+system\s+shall\s+(.+?)\.?$', ...
'tokens', 'ignorecase');
if ~isempty(tok)
pattern = 'Unwanted Behavior';
trigger = strtrim(tok{1}{1});
behavior = strtrim(tok{1}{2});
return;
end
% Optional: "Where [feature], the system shall [behavior]"
tok = regexp(reqText, 'Where\s+(.+?),\s+the\s+system\s+shall\s+(.+?)\.?$', ...
'tokens', 'ignorecase');
if ~isempty(tok)
pattern = 'Optional';
trigger = strtrim(tok{1}{1});
behavior = strtrim(tok{1}{2});
return;
end
% Ubiquitous: "The system shall [behavior]" (no trigger condition)
tok = regexp(reqText, 'The\s+system\s+shall\s+(.+?)\.?$', ...
'tokens', 'ignorecase');
if ~isempty(tok)
pattern = 'Ubiquitous';
trigger = '';
behavior = strtrim(tok{1}{1});
return;
end
end
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the work | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation code | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| 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: 198k | Updated | Claude CodeCodex | Verified | Install |