wzyn20051216/matlab-agent-skills / skills/matlab-testing-ci
matlab-testing-ci
VerifiedMATLAB testing, validation, and CI workflow for matlab.unittest, MATLAB Test, Simulink Test, coverage, artifact generation, GitHub Actions, and open-source reproducibility. Use whenever MATLAB work needs verification, regression tests, CI, GitHub publication, or acceptance criteria.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 5.5 KB |
| assets/install-roots.json | config | 2.9 KB |
| scripts/mas_bench_record.m | other | 11.5 KB |
| scripts/mas_capability_check.m | other | 12.7 KB |
| scripts/mas_delivery_check.m | other | 32.2 KB |
| scripts/mas_grade.m | other | 5.5 KB |
| scripts/mas_phase43_grade.m | other | 12.4 KB |
| scripts/mas_ref_derive.m | other | 21.7 KB |
| scripts/mas_ref_spec.m | other | 6.3 KB |
| scripts/mas_refcheck.m | other | 10.7 KB |
| scripts/mas_skill_audit.m | other | 10.9 KB |
| scripts/mas_skill_install_audit.m | other | 13.7 KB |
| scripts/mas_verify_task.m | other | 3.9 KB |
| tests/test_bench.m | other | 5.4 KB |
| tests/test_capability.m | other | 6.1 KB |
| tests/test_delivery_check.m | other | 22.0 KB |
| tests/test_grade.m | other | 3.0 KB |
| tests/test_phase43_grade.m | other | 9.1 KB |
| tests/test_refcheck.m | other | 5.0 KB |
| tests/test_skill_install_audit.m | other | 8.7 KB |
tests/test_grade.m
View on GitHubfunction res = test_grade(verbose)
%TEST_GRADE Pins the three-level verdict, including the combinations that used
%to be reported as "PASS".
%
% res = test_grade()
if nargin < 1, verbose = true; end
here = fileparts(mfilename('fullpath'));
addpath(fullfile(fileparts(here),'scripts'));
T = struct('name',{},'checks',{},'expect',{},'expectCorrect',{},'expectMeets',{});
T(end+1) = mk('all good', [ ...
chk('v',true,'numeric',1.00,1.00,0.01,NaN,'le')
chk('d',true,'domain',0.4,NaN,NaN,0.5,'le') ], 'PASS', true, true);
T(end+1) = mk('skipped check', [ ...
chk('v',true,'numeric',1.00,1.00,0.01,NaN,'le')
chk('d',false,'domain',NaN,NaN,NaN,0.5,'le') ], 'FAIL', true, 'UNDETERMINED');
% "meets" cannot be TRUE when a required check never ran: the evidence is
% missing, not satisfactory. The verdict is still FAIL because ran = false.
T(end+1) = mk('wrong number', [ ...
chk('v',true,'numeric',1.30,1.00,0.01,NaN,'le')
chk('d',true,'domain',0.4,NaN,NaN,0.5,'le') ], 'FAIL', false, true);
T(end+1) = mk('correct but not accepted', [ ...
chk('v',true,'numeric',47.884,47.884,1e-3,NaN,'le')
chk('recovery',true,'domain',2.252,NaN,NaN,2.0,'le') ], ...
'CORRECT_NOT_ACCEPTED', true, false);
T(end+1) = mk('no numeric check', [ ...
chk('d',true,'domain',0.4,NaN,NaN,0.5,'le') ], ...
'UNDETERMINED', 'UNDETERMINED', true);
T(end+1) = mk('no reference', [ ...
chk('v',true,'numeric',1.00,NaN,0.01,NaN,'le') ], ...
'FAIL', false, 'UNDETERMINED');
nP = 0;
if verbose, fprintf('=== grading tests ===\n'); end
R = struct('case',{},'overall',{},'correct',{},'meets',{},'pass',{});
for k = 1:numel(T)
t = T(k);
r = mas_grade(t.checks);
ok = strcmp(r.overall, t.expect);
if ischar(t.expectCorrect), ok = ok && strcmp(r.correct, t.expectCorrect);
else, ok = ok && isequal(r.correct, t.expectCorrect); end
if ischar(t.expectMeets), ok = ok && strcmp(r.meets, t.expectMeets);
else, ok = ok && isequal(r.meets, t.expectMeets); end
nP = nP + ok;
if verbose
fprintf(' [%s] %-26s -> %-22s correct=%s meets=%s\n', tern(ok,'PASS','FAIL'), ...
t.name, r.overall, val2s(r.correct), val2s(r.meets));
end
R(end+1) = struct('case',t.name,'overall',r.overall,'correct',val2s(r.correct), ...
'meets',val2s(r.meets),'pass',ok); %#ok<AGROW>
end
res = struct('nPass',nP,'nTotal',numel(T),'cases',R,'pass',nP==numel(T));
if verbose, fprintf('\n---- %d / %d grading cases passed ----\n', nP, numel(T)); end
end
function c = chk(id, executed, kind, value, reference, tol, limit, cmp)
c = struct('id',id,'executed',executed,'kind',kind,'value',value, ...
'reference',reference,'tol',tol,'limit',limit,'cmp',cmp,'reason','');
end
function t = mk(name, checks, overall, correct, meets)
t = struct('name',name,'checks',checks,'expect',overall, ...
'expectCorrect',correct,'expectMeets',meets);
end
function s = val2s(v)
if ischar(v), s = v; else, s = mat2str(v); end
end
function s = tern(c,a,b)
if c, s = a; else, s = b; 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 |