[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6MMYT8933JQ75R5E7M76ZYD":3,"skill-same:01M6MMYT8933JQ75R5E7M76ZYD":66},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":23,"publishedAt":37,"linkOnly":38,"markdownContent":39,"markdownBody":40,"frontMatter":41,"refName":42,"commitSha":43,"skillDirectory":44,"forksCount":45,"repositoryHtmlUrl":46,"repositoryHomepageUrl":47,"ownerHtmlUrl":48,"ownerBlogUrl":49,"ownerDescription":50,"updatedAt":51,"install":52,"resources":65},"01M6MMYT8933JQ75R5E7M76ZYD","simulink-baseline-test",null,"Create a MATLAB baseline regression test class for a Simulink model. Use when asked to create a baseline test, golden-reference test, or regression test for a Simulink model.","hashgraph-online\u002Fawesome-codex-plugins","hashgraph-online","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F160371962?v=4","01M6CNB6NRJVNNGN14TR01Q6D3","HOL (Hashgraph Online)","01M6JT1HSKKG9V68KQAQGBA7XP",1575,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fsummer521521\u002FMATLAB_Simulink_plugin\u002Fskills\u002Fsimulink-baseline-test\u002FSKILL.md",[18],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000008","测试与质量","SCENARIO","使用场景",[24,25,26,27,28,29,30,31,32,33,34,35,36],"test","baseline","simulink baseline test","create","model","regression","use","regression test","reference","matlab","golden","for","when","2026-11-10 10:12:30",false,"---\nname: simulink-baseline-test\ndescription: Create a MATLAB baseline regression test class for a Simulink model. Use when asked to create a baseline test, golden-reference test, or regression test for a Simulink model.\n---\n\n# Simulink Baseline Test Creation\n\nCreates a MATLAB test class that captures and validates Simulink model outputs against a saved baseline.\n\n## Workflow\n\n### Step 1: Analyze the Model\n\nResolve the model name and explore its structure to select 2–5 signals representative of the model's key behavior.\n\n```matlab\nmodelName = bdroot(gcs);\n\n% List top-level subsystems\nopts = Simulink.FindOptions;\nopts.SearchDepth = 1;\ntopBlocks = getfullname(Simulink.findBlocks(modelName, opts));\nfor i = 1:numel(topBlocks)\n    bt = get_param(topBlocks{i}, 'BlockType');\n    fprintf('  [%s] %s\\n', bt, topBlocks{i});\nend\n```\n\nExplore subsystem ports, bus selectors, scopes, and outports to understand signal flow. Look for signals that best represent the model's overall behavior — plant outputs, actuator commands, sensor readings, or any other meaningful quantities.\n\n### Step 2: Configure Signal Logging\n\nEnable logging on selected output ports:\n\n```matlab\nph = get_param('\u003Cblock path>', 'PortHandles');\nset(ph.Outport(1), 'DataLogging', 'on');\nset(ph.Outport(1), 'Name', '\u003CsignalName>');\n```\n\n**Never** use To Workspace blocks for signal capture.\n\n### Step 3: Capture Baseline\n\nSimulate and save the full `logsout` Dataset — not individual timeseries:\n\n```matlab\nin = Simulink.SimulationInput(modelName);\nout = sim(in);\n\nbaselineLogsout = out.logsout;\nsave(fullfile(modelDir, 'baselineData.mat'), 'baselineLogsout');\n```\n\n### Step 4: Write the Test Class\n\nFollow these mandatory conventions:\n\n#### Inherit from `sltest.TestCase`\n\n```matlab\nclassdef MyModelBaselineTest \u003C sltest.TestCase\n```\n\nNot `matlab.unittest.TestCase`. This gives access to `verifySignalsMatch`.\n\n#### Single simulation, single comparison\n\nSimulate the model **once**. Compare **all** signals in one call using `verifySignalsMatch`:\n\n```matlab\ntestCase.verifySignalsMatch(out.logsout, S.baselineLogsout, ...\n    'RelTol', testCase.RelTol, ...\n    'AbsTol', testCase.AbsTol);\n```\n\n**Never** loop through individual signals. **Never** simulate once per signal.\n\n#### Use `RelTol` and `AbsTol` directly\n\nPass `'RelTol'` and `'AbsTol'` as name-value arguments. MATLAB applies `RelTol` element-wise per sample; `AbsTol` acts as a floor for values near zero. **Never** manually scale tolerances (e.g., `max(abs(data)) * relTol`).\n\n#### Smart model teardown with `bdIsLoaded`\n\nOnly close the model if it was not already loaded before the test:\n\n```matlab\nwasLoaded = bdIsLoaded(testCase.ModelName);\nload_system(testCase.ModelName);\nif ~wasLoaded\n    testCase.addTeardown(@()close_system(testCase.ModelName, 0));\nend\n```\n\n#### Do NOT manually run `PreLoadFcn`\n\n`load_system` automatically triggers the model's `PreLoadFcn` callback. Never call `evalin('base', get_param(model, 'PreLoadFcn'))`.\n\n#### Include a static `generateBaseline()` method\n\nFor easy re-baselining after intentional changes:\n\n```matlab\nmethods (Static)\n    function generateBaseline()\n        modelName = MyModelBaselineTest.ModelName;\n        load_system(modelName);\n        in = Simulink.SimulationInput(modelName);\n        out = sim(in);\n        baselineLogsout = out.logsout; %#ok\u003CNASGU>\n        save(MyModelBaselineTest.BaselineFile, 'baselineLogsout');\n        close_system(modelName, 0);\n    end\nend\n```\n\n### Step 5: Run and Verify\n\nExecute the test and confirm all signals match:\n\n```matlab\nresults = runtests('MyModelBaselineTest');\n```\n\n## Complete Test Class Template\n\n```matlab\nclassdef MyModelBaselineTest \u003C sltest.TestCase\n\n    properties (Constant)\n        ModelName    = 'MyModel'\n        BaselineFile = fullfile(fileparts(mfilename('fullpath')), 'baselineData.mat')\n        RelTol = 1e-6\n        AbsTol = 1e-8\n    end\n\n    methods (TestClassSetup)\n        function loadModelAndBaseline(testCase)\n            wasLoaded = bdIsLoaded(testCase.ModelName);\n            load_system(testCase.ModelName);\n            if ~wasLoaded\n                testCase.addTeardown(@()close_system(testCase.ModelName, 0));\n            end\n\n            testCase.assertTrue(isfile(testCase.BaselineFile), ...\n                sprintf('Baseline not found: %s\\nRun %s.generateBaseline() first.', ...\n                testCase.BaselineFile, mfilename('class')));\n        end\n    end\n\n    methods (Test)\n        function testAllSignalsMatchBaseline(testCase)\n            in  = Simulink.SimulationInput(testCase.ModelName);\n            out = sim(in);\n\n            S = load(testCase.BaselineFile, 'baselineLogsout');\n\n            testCase.verifySignalsMatch(out.logsout, S.baselineLogsout, ...\n                'RelTol', testCase.RelTol, ...\n                'AbsTol', testCase.AbsTol);\n        end\n    end\n\n    methods (Static)\n        function generateBaseline()\n            modelName = MyModelBaselineTest.ModelName;\n            load_system(modelName);\n\n            in  = Simulink.SimulationInput(modelName);\n            out = sim(in);\n\n            baselineLogsout = out.logsout; %#ok\u003CNASGU>\n            save(MyModelBaselineTest.BaselineFile, 'baselineLogsout');\n            fprintf('Baseline saved to: %s\\n', MyModelBaselineTest.BaselineFile);\n\n            close_system(modelName, 0);\n        end\n    end\nend\n```\n\n## Anti-Patterns — Do NOT\n\n- **Simulate once per signal** (parameterized tests calling `sim` each time)\n- **Loop through signals** to verify individually — use `verifySignalsMatch`\n- **Manually scale tolerances** (`max(abs(data)) * relTol`) — use `'RelTol'` directly\n- **Save individual timeseries** — save the full `logsout` Dataset\n- **Unconditionally close the model** — check `bdIsLoaded` first\n- **Manually call `PreLoadFcn`** — `load_system` handles it\n- **Use `matlab.unittest.TestCase`** — use `sltest.TestCase` for `verifySignalsMatch`\n","# Simulink Baseline Test Creation\n\nCreates a MATLAB test class that captures and validates Simulink model outputs against a saved baseline.\n\n## Workflow\n\n### Step 1: Analyze the Model\n\nResolve the model name and explore its structure to select 2–5 signals representative of the model's key behavior.\n\n```matlab\nmodelName = bdroot(gcs);\n\n% List top-level subsystems\nopts = Simulink.FindOptions;\nopts.SearchDepth = 1;\ntopBlocks = getfullname(Simulink.findBlocks(modelName, opts));\nfor i = 1:numel(topBlocks)\n    bt = get_param(topBlocks{i}, 'BlockType');\n    fprintf('  [%s] %s\\n', bt, topBlocks{i});\nend\n```\n\nExplore subsystem ports, bus selectors, scopes, and outports to understand signal flow. Look for signals that best represent the model's overall behavior — plant outputs, actuator commands, sensor readings, or any other meaningful quantities.\n\n### Step 2: Configure Signal Logging\n\nEnable logging on selected output ports:\n\n```matlab\nph = get_param('\u003Cblock path>', 'PortHandles');\nset(ph.Outport(1), 'DataLogging', 'on');\nset(ph.Outport(1), 'Name', '\u003CsignalName>');\n```\n\n**Never** use To Workspace blocks for signal capture.\n\n### Step 3: Capture Baseline\n\nSimulate and save the full `logsout` Dataset — not individual timeseries:\n\n```matlab\nin = Simulink.SimulationInput(modelName);\nout = sim(in);\n\nbaselineLogsout = out.logsout;\nsave(fullfile(modelDir, 'baselineData.mat'), 'baselineLogsout');\n```\n\n### Step 4: Write the Test Class\n\nFollow these mandatory conventions:\n\n#### Inherit from `sltest.TestCase`\n\n```matlab\nclassdef MyModelBaselineTest \u003C sltest.TestCase\n```\n\nNot `matlab.unittest.TestCase`. This gives access to `verifySignalsMatch`.\n\n#### Single simulation, single comparison\n\nSimulate the model **once**. Compare **all** signals in one call using `verifySignalsMatch`:\n\n```matlab\ntestCase.verifySignalsMatch(out.logsout, S.baselineLogsout, ...\n    'RelTol', testCase.RelTol, ...\n    'AbsTol', testCase.AbsTol);\n```\n\n**Never** loop through individual signals. **Never** simulate once per signal.\n\n#### Use `RelTol` and `AbsTol` directly\n\nPass `'RelTol'` and `'AbsTol'` as name-value arguments. MATLAB applies `RelTol` element-wise per sample; `AbsTol` acts as a floor for values near zero. **Never** manually scale tolerances (e.g., `max(abs(data)) * relTol`).\n\n#### Smart model teardown with `bdIsLoaded`\n\nOnly close the model if it was not already loaded before the test:\n\n```matlab\nwasLoaded = bdIsLoaded(testCase.ModelName);\nload_system(testCase.ModelName);\nif ~wasLoaded\n    testCase.addTeardown(@()close_system(testCase.ModelName, 0));\nend\n```\n\n#### Do NOT manually run `PreLoadFcn`\n\n`load_system` automatically triggers the model's `PreLoadFcn` callback. Never call `evalin('base', get_param(model, 'PreLoadFcn'))`.\n\n#### Include a static `generateBaseline()` method\n\nFor easy re-baselining after intentional changes:\n\n```matlab\nmethods (Static)\n    function generateBaseline()\n        modelName = MyModelBaselineTest.ModelName;\n        load_system(modelName);\n        in = Simulink.SimulationInput(modelName);\n        out = sim(in);\n        baselineLogsout = out.logsout; %#ok\u003CNASGU>\n        save(MyModelBaselineTest.BaselineFile, 'baselineLogsout');\n        close_system(modelName, 0);\n    end\nend\n```\n\n### Step 5: Run and Verify\n\nExecute the test and confirm all signals match:\n\n```matlab\nresults = runtests('MyModelBaselineTest');\n```\n\n## Complete Test Class Template\n\n```matlab\nclassdef MyModelBaselineTest \u003C sltest.TestCase\n\n    properties (Constant)\n        ModelName    = 'MyModel'\n        BaselineFile = fullfile(fileparts(mfilename('fullpath')), 'baselineData.mat')\n        RelTol = 1e-6\n        AbsTol = 1e-8\n    end\n\n    methods (TestClassSetup)\n        function loadModelAndBaseline(testCase)\n            wasLoaded = bdIsLoaded(testCase.ModelName);\n            load_system(testCase.ModelName);\n            if ~wasLoaded\n                testCase.addTeardown(@()close_system(testCase.ModelName, 0));\n            end\n\n            testCase.assertTrue(isfile(testCase.BaselineFile), ...\n                sprintf('Baseline not found: %s\\nRun %s.generateBaseline() first.', ...\n                testCase.BaselineFile, mfilename('class')));\n        end\n    end\n\n    methods (Test)\n        function testAllSignalsMatchBaseline(testCase)\n            in  = Simulink.SimulationInput(testCase.ModelName);\n            out = sim(in);\n\n            S = load(testCase.BaselineFile, 'baselineLogsout');\n\n            testCase.verifySignalsMatch(out.logsout, S.baselineLogsout, ...\n                'RelTol', testCase.RelTol, ...\n                'AbsTol', testCase.AbsTol);\n        end\n    end\n\n    methods (Static)\n        function generateBaseline()\n            modelName = MyModelBaselineTest.ModelName;\n            load_system(modelName);\n\n            in  = Simulink.SimulationInput(modelName);\n            out = sim(in);\n\n            baselineLogsout = out.logsout; %#ok\u003CNASGU>\n            save(MyModelBaselineTest.BaselineFile, 'baselineLogsout');\n            fprintf('Baseline saved to: %s\\n', MyModelBaselineTest.BaselineFile);\n\n            close_system(modelName, 0);\n        end\n    end\nend\n```\n\n## Anti-Patterns — Do NOT\n\n- **Simulate once per signal** (parameterized tests calling `sim` each time)\n- **Loop through signals** to verify individually — use `verifySignalsMatch`\n- **Manually scale tolerances** (`max(abs(data)) * relTol`) — use `'RelTol'` directly\n- **Save individual timeseries** — save the full `logsout` Dataset\n- **Unconditionally close the model** — check `bdIsLoaded` first\n- **Manually call `PreLoadFcn`** — `load_system` handles it\n- **Use `matlab.unittest.TestCase`** — use `sltest.TestCase` for `verifySignalsMatch`\n",{"name":5,"description":7},"main","2b63f856ce19c2a797929cacabd9e0fc936812fa","plugins\u002Fsummer521521\u002FMATLAB_Simulink_plugin\u002Fskills\u002Fsimulink-baseline-test",491,"https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins","https:\u002F\u002Fhol.org\u002Fplugins\u002Fbest-codex-plugins","https:\u002F\u002Fgithub.com\u002Fhashgraph-online","https:\u002F\u002Fhol.org","Open-source standards and developer tools for interoperable AI agents: discovery, identity, communication, payments, privacy and security.","2026-11-14 14:06:13",{"source":8,"skillName":5,"commands":53,"prompt":63,"zipAvailable":64},[54,57,60],{"tool":55,"command":56},"npx","npx skills add hashgraph-online\u002Fawesome-codex-plugins --skill simulink-baseline-test",{"tool":58,"command":59},"bunx","bunx skills add hashgraph-online\u002Fawesome-codex-plugins --skill simulink-baseline-test",{"tool":61,"command":62},"pnpm","pnpm dlx skills add hashgraph-online\u002Fawesome-codex-plugins --skill simulink-baseline-test","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fsummer521521\u002FMATLAB_Simulink_plugin\u002Fskills\u002Fsimulink-baseline-test\u002FSKILL.md",true,[],[67,77,85,93,101,109],{"skillNo":68,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":71,"licenseFileUrl":72,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":76},"01M7DV332YQMGD8WTRJ9DZQXTB","worktable-review-with-annotations","Create, inspect, reply to, update, or resolve situated Worktable annotations. Use when feedback belongs to a Doc section, block, text range, or HTML Doc, or when the user asks to address existing review feedback and coordinate a requested artifact edit.","MIT","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-review-with-annotations\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-review-with-annotations\u002FSKILL.md",[],[],"2026-11-15 14:19:17",{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":71,"licenseFileUrl":81,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":76},"01M7DV2YGHCZVBEB1AHYB6CGHE","worktable-find-and-synthesize-context","Find, assess, and synthesize context from Worktable Docs and Records. Use when the user asks what a workspace contains, wants workspace-backed research, needs current facts reconciled across artifacts, or requests a cited synthesis without changing workspace state.","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-find-and-synthesize-context\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-find-and-synthesize-context\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":71,"licenseFileUrl":89,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":76},"01M7DV2TQN1H11ME2SAF9MXN7V","worktable-create-or-update-docs","Create, edit, rename, or maintain narrative Worktable Docs. Use for plans, decisions, briefs, notes, research syntheses, and other durable prose when the user requests a new artifact or a safe update to an existing one.","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-create-or-update-docs\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-create-or-update-docs\u002FSKILL.md",[],[],{"skillNo":94,"name":95,"nameZh":6,"description":96,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":71,"licenseFileUrl":97,"sourceHtmlUrl":98,"categories":99,"keywords":100,"publishedAt":76},"01M7DV2NE452NEA8TXATKSNAJH","worktable-create-or-manage-records","Organize repeated structured information as durable Worktable Records. Use for research datasets, inventories, directories, pipelines, trackers, and other collections whose items need identity, fields, filtering, links, validation, or individual updates.","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-create-or-manage-records\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-create-or-manage-records\u002FSKILL.md",[],[],{"skillNo":102,"name":103,"nameZh":6,"description":104,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":71,"licenseFileUrl":105,"sourceHtmlUrl":106,"categories":107,"keywords":108,"publishedAt":76},"01M7DV2HENRBR2KSCVM064WH0Y","worktable-create-or-manage-interactive-html","Create or improve durable visual and interactive artifacts in Worktable. Use for dashboards, trackers, calculators, mini apps, slide presentations, and other requests that benefit from a polished HTML Doc.","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-create-or-manage-interactive-html\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-create-or-manage-interactive-html\u002FSKILL.md",[],[],{"skillNo":110,"name":111,"nameZh":6,"description":112,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":71,"licenseFileUrl":113,"sourceHtmlUrl":114,"categories":115,"keywords":116,"publishedAt":76},"01M7DV2CADR5R7RQFFYPNAGR9Y","worktable-collaborate-threads","Read, answer, and hand off messages through durable Worktable threads with users or other authenticated participants. Use when the user asks to check addressed messages, reply to a participant, continue a thread, request another agent's help, wait briefly for a response, or watch for comments and messages sent to the agent.","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-collaborate-threads\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-collaborate-threads\u002FSKILL.md",[],[]]