[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M75MJ2W4ZT4M0297331VJWT0":3,"skill-same:01M75MJ2W4ZT4M0297331VJWT0":79},{"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":16,"sourceHtmlUrl":17,"categories":18,"keywords":19,"publishedAt":20,"linkOnly":21,"markdownContent":22,"markdownBody":23,"frontMatter":24,"refName":30,"commitSha":31,"skillDirectory":32,"forksCount":33,"repositoryHtmlUrl":34,"repositoryHomepageUrl":6,"ownerHtmlUrl":35,"ownerBlogUrl":36,"ownerDescription":6,"updatedAt":37,"install":38,"resources":51},"01M75MJ2W4ZT4M0297331VJWT0","matlab-validate-function-arguments",null,"Use when writing MATLAB functions with arguments blocks — repeating arguments (arguments (Repeating)), .?ClassName property import in constructors, name-value forwarding with namedargs2cell, or migrating from inputParser or validateattributes. Also when reviewing signatures for implicit-conversion pitfalls (size reshaping, class coercion, computed defaults), or when restricting, constraining, or validating function inputs — scalar vs vector enforcement, type rejection, size checking. Also when asked to harden inputs, make a function more robust, tighten input checking, or rewrite for safer input acceptance — even without \"validation\" or \"arguments block\" wording. Triggers on: arguments block, mustBe validators, name-value arguments, varargin, inputParser, nargin\u002Fnarginchk, restrict input, type checking, scalar constraint, harden inputs, defensive programming. Not for: App Designer callbacks, Simulink mask parameters, class inheritance, or runtime validation outside function or property declarations.","stanfish06\u002Fskillquarium","stanfish06","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F93099613?v=4","01M75F1CK4ZW109ZK3T26VN52F","Zhiyuan","01M75F1CM53VH6F79DZ8GXKKES",12,"BSD-2-Clause","https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fmatlab-validate-function-arguments\u002FLICENSE.md","https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fmatlab-validate-function-arguments\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: matlab-validate-function-arguments\ndescription: >\n  Use when writing MATLAB functions with arguments blocks — repeating arguments\n  (arguments (Repeating)), .?ClassName property import in constructors,\n  name-value forwarding with namedargs2cell, or migrating from inputParser or\n  validateattributes. Also when reviewing signatures for implicit-conversion\n  pitfalls (size reshaping, class coercion, computed defaults), or when\n  restricting, constraining, or validating function inputs — scalar vs vector\n  enforcement, type rejection, size checking. Also when asked to harden inputs,\n  make a function more robust, tighten input checking, or rewrite for safer\n  input acceptance — even without \"validation\" or \"arguments block\" wording.\n  Triggers on: arguments block, mustBe validators, name-value arguments,\n  varargin, inputParser, nargin\u002Fnarginchk, restrict input, type checking,\n  scalar constraint, harden inputs, defensive programming. Not for: App\n  Designer callbacks, Simulink mask parameters, class inheritance, or runtime\n  validation outside function or property declarations.\nlicense: MathWorks BSD-3-Clause\nmetadata:\n  author: MathWorks\n  version: \"1.1\"\n---\n\n# MATLAB Function Argument Validation\n\nWrite robust MATLAB functions using `arguments` blocks with correct semantics for size, class, repeating arguments, and property import.\n\n## When to Use\n\n- Writing a function with an `arguments` block\n- Using repeating arguments (`arguments (Repeating)`)\n- Writing a class constructor that accepts name-value arguments\n- Migrating from `inputParser` or `validateattributes`\n- Reviewing a function signature for implicit conversion pitfalls\n- Choosing between class specs, `mustBeA`, and validators\n\n## When NOT to Use\n\n- Basic MATLAB programming without argument validation\n- App building or UI components (use `matlab-building-apps`)\n- Unit testing (use `matlab-testing`)\n- General OOP class design unrelated to argument validation\n- Simple `if`\u002F`error` guard clauses for runtime invariants inside a function body\n  (those aren't input validation — leave them as-is unless the user asks for an\n  `arguments` block specifically)\n- **`.mlx` (Live Script) or `.mlapp` (App Designer) files** — these are binary\n  ZIP containers. Don't unzip them or attempt structural edits. If the user\n  asks to add an `arguments` block to a function inside one, ask them to\n  export to plain `.m` first, or open the file in MATLAB and edit it there.\n\n## Critical Misconceptions\n\nThese are things the agent commonly gets wrong. Read these FIRST.\n\n### Size specs RESHAPE, not reject\n\n**WRONG belief:** `(1,:)` rejects column vectors with an error.\n\n**ACTUAL behavior:** MATLAB silently reshapes the input to fit the declared size.\n\n```matlab\nfunction out = myFunc(x)\n    arguments\n        x (1,:) double\n    end\n    out = x;\nend\n\nmyFunc([1; 2; 3])  % Does NOT error! Returns [1 2 3] (reshaped to row)\n```\n\nA column vector `[1;2;3]` passed to `(1,:)` becomes a row vector `[1 2 3]`. To actually reject column vectors, use a validator:\n\n```matlab\nfunction out = myFunc(x)\n    arguments\n        x {mustBeNumeric, mustBeRow}\n    end\n    out = x;\nend\n```\n\n### Class specs CONVERT, not reject\n\n**WRONG belief:** `double` in the arguments block rejects non-double inputs.\n\n**ACTUAL behavior:** MATLAB attempts implicit conversion to the declared class.\n\n```matlab\nfunction out = myFunc(x)\n    arguments\n        x double\n    end\n    out = x;\nend\n\nmyFunc('hello')  % Does NOT error! Returns [104 101 108 108 111] (ASCII codes)\nmyFunc(single(3.14))  % Does NOT error! Returns double(3.14)\n```\n\nTo reject without converting, use `mustBeA` or `mustBeFloat`:\n\n```matlab\nx {mustBeA(x, \"double\")}           % Rejects single, char, int32, etc.\nx {mustBeFloat}                     % Accepts single OR double, rejects char\u002Fint\nx {mustBeNumeric}                   % Accepts any numeric, rejects char\u002Fstring\n```\n\n### Numeric validators don't reject complex values\n\n**WRONG belief:** `mustBeNumeric`, `mustBeFinite`, and `mustBeInteger` reject\ncomplex inputs like `1+2i`.\n\n**ACTUAL behavior:** Complex values are numeric, finite, and (when their real\nand imaginary parts are integer-valued) integer — so `1+2i` passes all three\nsilently. Sizes, indices, counts, and most physical scalars should reject\ncomplex values explicitly:\n\n```matlab\nfunction H = hilb2(n)\n    arguments\n        n (1,1) {mustBeInteger, mustBePositive, mustBeReal}\n    end\n    H = 1.\u002F((1:n)' + (0:n-1));\nend\n```\n\nAdd `mustBeReal` whenever a complex input would be nonsensical for the\nfunction's contract.\n\n### Computed defaults see PASSED values, not declared defaults\n\n**WRONG belief:** Default expressions use the declared default values of earlier arguments.\n\n**ACTUAL behavior:** Default expressions evaluate using the actual passed values.\n\n```matlab\nfunction out = myFunc(fs, windowSize)\n    arguments\n        fs (1,1) double {mustBePositive}\n        windowSize (1,1) double {mustBePositive} = round(fs \u002F 10)\n    end\n    out = windowSize;\nend\n\nmyFunc(8000)      % windowSize = round(8000\u002F10) = 800 (uses passed fs)\nmyFunc(8000, 256) % windowSize = 256 (explicitly passed)\n```\n\nThis eliminates the need for sentinel values (`[]`) and post-validation fixup.\n\n### `~` is a valid placeholder — don't rename it\n\n**WRONG belief:** A name in the `arguments` block is mandatory, so a `~`\nplaceholder in the function signature must be renamed to `obj`\u002F`this`\u002Fetc.\n\n**ACTUAL behavior:** `~` is valid as an argument-block name (R2019b+). Keep it.\n\n```matlab\nfunction normalize(~, results)\n    arguments\n        ~\n        results (1,:) struct\n    end\n    ...\nend\n```\n\nWhen a method signature uses `~` to mark an unused input (e.g. an unused\nclass instance), **preserve the `~`** in the arguments block:\n\n- **No class or size spec on `~`** — type specs like `(1,1) MetricCalculator`\n  require a name, so adding one forces a rename. Skip the spec entirely.\n- **No `%#ok\u003CINUSL>` \u002F `%#ok\u003CINUSA>` \u002F `%#ok\u003CMANU>` pragma** — `~` already\n  tells the lint pass the input is intentionally unused.\n- **Don't rename `~` to `obj`** to \"tighten validation.\" Renaming reintroduces\n  the lint warning the original `~` was suppressing, with no contract benefit.\n\n## Patterns\n\n### Repeating Arguments\n\nUse `arguments (Repeating)` for functions accepting variable groups of arguments (like `plot(x1,y1,x2,y2,...)`). Each declared variable becomes a **cell array** in the function body.\n\n```matlab\nfunction plotMultiSeries(x, y)\n    arguments (Repeating)\n        x (1,:) double {mustBeFinite}\n        y (1,:) double {mustBeFinite}\n    end\n\n    figure;\n    hold on;\n    for i = 1:numel(x)\n        plot(x{i}, y{i});\n    end\n    hold off;\nend\n```\n\nKey rules:\n- Variables become cell arrays — access with `x{i}`, not `x(i)`\n- All variables in the group repeat together (complete sets)\n- Repeating arguments cannot have default values\n- Zero repetitions is valid (produces empty cell arrays)\n\n### Output Argument Validation — `arguments (Output)` and `(Output, Repeating)`\n\n> **R2022b+.** Output argument validation is unavailable in earlier releases —\n> input validation (the bulk of this skill) works from R2019b onward.\n\nUse `arguments (Output, Repeating)` to declare a function whose output count\nscales with `nargout`. The block must declare **exactly one** name — MATLAB\nrejects multi-name repeating output blocks with\n`MATLAB:functionValidation:MultipleRepeatingOutputs`. To return groups of\nrelated values (e.g. triples), pack them into the single output and have the\ncaller request `N * groupSize` outputs.\n\n```matlab\nfunction out = productTriples()\n    arguments (Output, Repeating)\n        out (1,1) double\n    end\n    out = cell(1, nargout);\n    for k = 1:3:nargout\n        b = rand;\n        c = rand;\n        out{k}   = b * c;\n        out{k+1} = b;\n        out{k+2} = c;\n    end\nend\n```\n\nCaller: `[p1, a1, b1, p2, a2, b2] = productTriples();`\n\nKey rules:\n- **One name only** — `arguments (Output, Repeating) a; b; c; end` errors at parse\n- The output is assigned a `1×nargout` cell array; comma-list expansion at the\n  call site distributes its contents across the requested LHS variables\n- Validators on the single declared name apply to **each cell element**\n- `nargout` tells the body how many outputs were requested; zero is valid\n\n### Composition Rules — What Can Coexist\n\nA function may have **multiple `arguments` blocks**. The rules below apply to\nthe function as a whole — argument categories must appear in this order across\nall blocks combined:\n\n```\nrequired → optional (with defaults) → repeating → name-value\n```\n\nViolating the order at any point — even across separate blocks — fails to\nparse. Don't trust intuition: **all of these compose legally in one function**:\n\n- required + optional + repeating + name-value (`.?ClassName` allowed too)\n- required + repeating + name-value\n- repeating + name-value\n- `(Output, Repeating)` plus any combination of input blocks\n- `~` placeholders inside a `(Repeating)` block\n\n**Multiplicity:**\n\n| Block kind | How many allowed |\n|------------|------------------|\n| Plain `arguments` (positional and\u002For name-value) | Multiple, in order |\n| `arguments (Repeating)` (input) | **Exactly one** per function |\n| `arguments (Output, Repeating)` | **Exactly one** per function |\n| Name-value structs across plain blocks | Multiple — different struct names |\n\n**Parse-time error identifiers** — when in doubt, write the function and let\nMATLAB tell you. These are the only errors composition can produce; the names\nspell out the rule:\n\n| Identifier | Means |\n|------------|-------|\n| `MATLAB:functionValidation:RequiredAfterOptional` | A required arg appears after one with a default |\n| `MATLAB:functionValidation:OptionalAfterRepeating` | An optional\u002Fpositional arg appears after the repeating block |\n| `MATLAB:functionValidation:PositionalAfterNamed` | A positional or repeating arg appears after a name-value arg |\n| `MATLAB:functionValidation:MultipleRepeatingBlocks` | More than one `(Repeating)` block (input or output) |\n| `MATLAB:functionValidation:RepeatingHasDefault` | A `(Repeating)` arg has a default value |\n\nIf you're unsure whether a combination is legal, **don't fabricate a\nrestriction** — write a minimal version and run it. The error identifier (or\nits absence) is the answer.\n\n#### Maximal example\n\nA single function with required + optional + ignored + repeating + ignored\nrepeating + name-value + class-imported name-value (here `SensorConfig` —\nthe class defined in the `.?ClassName` section above):\n\n```matlab\nfunction maximal(req, opt, ~, x, ~, options, classArg)\n    arguments\n        req (1,1) double\n        opt (1,1) double = 7\n        ~\n    end\n    arguments (Repeating)\n        x (1,1) double\n        ~\n    end\n    arguments\n        options.Title (1,1) string = \"default\"\n        options.Verbose (1,1) logical = false\n        classArg.?SensorConfig\n    end\n    % function body\nend\n```\n\nCall: `maximal(1, 2, 3, 4, 'a', 5, 'b', Title=\"t\", SampleRate=44100)` —\nparses and runs. `SampleRate` is one of the name-value args imported from\n`SensorConfig` by the `.?` line.\n\n**Don't pick a class with no public-settable properties** for `.?ClassName` —\n`onCleanup`, for example, has only `task` (private set), so `.?onCleanup`\nimports zero name-value args. The line is syntactically valid but a no-op,\nand any \"name-value\" the caller writes against it is treated as an unknown\nname — see \"unknown `Name=Value` is silently swallowed\" in Common Mistakes.\n\nFor combining repeating args with name-value options, see the Maximal\nexample above and [references\u002Fexamples\u002Frepeating-args.md](references\u002Fexamples\u002Frepeating-args.md).\n\n### .?ClassName — Import Properties as Name-Value Args\n\nUse `.?ClassName` in constructors to derive name-value arguments directly from property definitions. This avoids redeclaring properties in the arguments block.\n\nFor additional patterns — overriding specific properties, static factory with forwarding, and wrapping graphics-class properties — see [references\u002Fexamples\u002Fdot-question-syntax.md](references\u002Fexamples\u002Fdot-question-syntax.md).\n\n```matlab\nclassdef SensorConfig\n    properties\n        SampleRate (1,1) double {mustBePositive} = 1000\n        Resolution (1,1) double {mustBePositive, mustBeInteger} = 16\n        FilterOrder (1,1) double {mustBePositive, mustBeInteger} = 4\n        Label (1,1) string = \"unnamed\"\n    end\n\n    methods\n        function obj = SensorConfig(nvArgs)\n            arguments\n                nvArgs.?SensorConfig\n            end\n            props = fieldnames(nvArgs);\n            for i = 1:numel(props)\n                obj.(props{i}) = nvArgs.(props{i});\n            end\n        end\n    end\nend\n```\n\nBenefits:\n- No duplication of size, class, validators, or defaults\n- Constructor stays in sync when properties are added or removed\n- Tab completion shows all settable properties automatically\n\n### namedargs2cell — Forward Name-Value Args\n\nUse `namedargs2cell` to convert a validated struct back to a name-value cell array for forwarding to other functions:\n\n```matlab\nfunction obj = fromPreset(presetName, nvArgs)\n    arguments\n        presetName (1,1) string\n        nvArgs.?SensorConfig\n    end\n\n    switch presetName\n        case \"audio\"\n            defaults = struct(SampleRate=44100, Resolution=24, Label=\"audio\");\n        case \"vibration\"\n            defaults = struct(SampleRate=10000, Resolution=16, Label=\"vibration\");\n    end\n\n    % Apply overrides\n    overrides = fieldnames(nvArgs);\n    for i = 1:numel(overrides)\n        defaults.(overrides{i}) = nvArgs.(overrides{i});\n    end\n\n    args = namedargs2cell(defaults);\n    obj = SensorConfig(args{:});\nend\n```\n\n## Migration Decision Framework\n\nWhen migrating from `inputParser` or `validateattributes`, use this decision tree for class handling:\n\n| Original check | What it does | Arguments block equivalent | Why |\n|---------------|-------------|---------------------------|-----|\n| `@isnumeric` | Accepts any numeric, no conversion | `{mustBeNumeric}` | No class spec — avoids conversion |\n| `@ischar` | Accepts char only | `{mustBeA(label, 'char')}` or `(1,:) char` | `mustBeText`\u002F`mustBeTextScalar` widens to accept string |\n| `@islogical` | Accepts logical only | `(1,1) logical` | Safe — nothing converts TO logical implicitly |\n| `{'numeric'}` | Accepts any numeric, no conversion | `{mustBeNumeric}` | `validateattributes` meta-class — same set as `@isnumeric` |\n| `{'float'}` | Accepts single or double | `{mustBeFloat}` | Equivalent to `{'single','double'}` |\n| `{'integer'}` (class spec, rare) | Accepts only integer types (int8…uint64) | Usually `{mustBeNumeric, mustBeInteger}`. Strict-only-if-intentional: `{mustBeA(x, [\"int8\",\"int16\",\"int32\",\"int64\",\"uint8\",\"uint16\",\"uint32\",\"uint64\"])}` | The class-only form rejects integer-valued doubles like `5.0` — usually accidental. Widen to the lenient pairing unless the original code clearly meant to reject doubles. |\n| `{'numeric'}, {'integer'}` (class+attr) | Numeric, integer-valued | `{mustBeNumeric, mustBeInteger}` | Common pairing — accepts both int types and integer-valued floats |\n| `{'single','double'}` | Restricts to float types | `{mustBeFloat}` | Class spec `double` would convert single→double |\n| `{'double'}` exact | Rejects single, int, char | `{mustBeA(x, \"double\")}` | Class spec `double` would convert, not reject |\n| `@(x) isa(x,'MyClass')` | Class membership | `{mustBeA(x, \"MyClass\")}` | Validates without conversion |\n\n**Key principle:** If the original code REJECTS mismatched types, use validators (`mustBeA`, `mustBeFloat`, `mustBeNumeric`). If you WANT automatic conversion for caller convenience, use a class spec.\n\n### Anonymous-Function Validators\n\nDon't drop these on migration — each has a built-in equivalent:\n\n| `inputParser` validator | Arguments block equivalent |\n|-------------------------|----------------------------|\n| `@(x) ~isempty(x)` | `{mustBeNonempty}` |\n| `@(x) x > 0` | `{mustBePositive}` |\n| `@(x) x >= 0` | `{mustBeNonnegative}` |\n| `@(x) x \u003C 0` | `{mustBeNegative}` |\n| `@(x) x \u003C= 0` | `{mustBeNonpositive}` |\n| `@(x) isfinite(x)` | `{mustBeFinite}` |\n| `@(x) isreal(x)` | `{mustBeReal}` |\n| `@(x) isnumeric(x) && isreal(x)` | `{mustBeNumeric, mustBeReal}` |\n| `@(x) ismember(x, set)` | `{mustBeMember(x, set)}` |\n| `validatestring(x, set)` | **Don't replace with `mustBeMember`.** `validatestring` does case-insensitive prefix matching and returns the canonical form; `mustBeMember` is exact-match only. Keep the call inside the body and use the arguments block only for `{mustBeTextScalar}`. |\n\nFor detailed migration examples, see [references\u002Fmigration-guide.md](references\u002Fmigration-guide.md).\n\n## Conventions\n\n- **Prefer `string` over `char`** for new code (not migrations)\n- **Never use `varargin` with manual parsing** when `arguments (Repeating)` or name-value blocks can express the same interface\n- **Use `.?ClassName`** in constructors rather than redeclaring properties\n- **Prefer computed defaults** (`= expression`) over sentinel values with `isempty` checks, when the default depends only on earlier arguments\n- **Don't combine `mustBeNumeric` with a `double` class spec to reject non-numeric input** — the class spec converts char (`'A'` → `65`) before the validator runs, defeating the check. Drop the class spec: `x {mustBeNumeric}` not `x (1,1) double {mustBeNumeric}`\n- **Don't combine text validators with a `string` class spec** — the class spec converts non-text (e.g., `42` → `\"42\"`) before the validator runs, defeating the check. Use text validators alone: `p {mustBeTextScalar}` not `p (1,1) string {mustBeTextScalar}`\n- **Never reach for `varargin` + manual `class()` checks to reject types.** When a class spec like `double` would convert (rather than reject) char\u002Fsingle\u002Fint input, the right answer is a validator (`mustBeNumeric`, `mustBeFloat`, `mustBeA`), not a fallback to `varargin`. Falling back to `varargin` defeats the entire point of the arguments block.\n\n## Common Mistakes\n\n| Mistake | Why It's Wrong | Correct Approach |\n|---------|---------------|-----------------|\n| Using `varargin` for repeated arg groups | Requires 30+ lines of manual parsing | `arguments (Repeating)` — 3 lines |\n| Redeclaring properties in constructor | Duplication drifts out of sync | `nvArgs.?ClassName` |\n| Believing `(1,:)` rejects columns | It silently reshapes them | Use `mustBeRow` to reject |\n| Believing `double` rejects char | It silently converts to ASCII before validators run | Drop the `double` class spec and use `{mustBeNumeric}` alone, or `{mustBeA(x,\"double\")}` for strict class check |\n| Using `[]` sentinel for computed defaults | Over-engineered, needs custom validator | `= expression` referencing earlier args |\n| Replacing `@ischar` with `mustBeTextScalar` | Widens contract to accept strings | Use `mustBeA(x,'char')` for strict fidelity |\n| Using `(1,1) string {mustBeTextScalar}` | Class spec converts `42` → `\"42\"` before validator | Use `{mustBeTextScalar}` alone (no class spec) |\n| Replacing `validatestring` with `mustBeMember` | `validatestring` does case-insensitive prefix matching (`'AU'` → `'auto'`) and returns the canonical form; `mustBeMember` is exact-match only | Keep `validatestring` inside the body. Use the arguments block only for the type\u002Fsize guard: `mode {mustBeTextScalar}` then `mode = validatestring(mode, {...})` |\n| Omitting `mustBeReal` for numeric args | Complex values pass `mustBeNumeric`, `mustBeFinite`, and `mustBeInteger` silently — `1+2i` is a finite numeric integer | Add `mustBeReal` whenever a complex input would be nonsensical (indices, sizes, counts, physical scalars) |\n| Renaming `~` to `obj`\u002F`this` in arguments block | `~` is a valid placeholder name in arguments blocks — renaming reintroduces the lint warning the original `~` suppressed | Keep `~`, no class\u002Fsize spec, no `%#ok` pragma |\n| Declaring multiple names in `arguments (Output, Repeating)` | MATLAB errors with `MultipleRepeatingOutputs` — only one name is allowed | Declare a single output name; pack groups of values into that one cell array and have the caller request `N * groupSize` outputs |\n| Claiming optional positional args and `(Repeating)` are mutually exclusive | They aren't — required + optional + repeating + name-value all compose legally in order | See \"Composition Rules\". When unsure, write the function and let MATLAB's parse-time error identifier (e.g. `OptionalAfterRepeating`, `PositionalAfterNamed`) tell you what's actually wrong |\n| Assuming an unknown `Name=Value` errors loudly when the function has `arguments (Repeating)` | It doesn't. With a `(Repeating)` block present, an unrecognized `Name=Value` is silently absorbed as two **positional** repeating args (name token, then value). One bad pair also reclassifies preceding **valid** name-value args back to positional, so set options revert to their defaults. (Without `(Repeating)`, the same call errors with `MATLAB:TooManyInputs`.) | A common way to land here: `.?ClassName` against a class with no public-settable properties (e.g. `.?onCleanup`) — the import exposes nothing, so every NV the caller writes against it is unknown. Pick a class with public-set properties. When debugging \"why is my NV default showing up?\", check the call for **any** unrecognized `Name=` — one bad name poisons the whole NV section |\n\n## Validators Quick Reference\n\n| Validator | Purpose | Note |\n|-----------|---------|------|\n| `mustBeFloat` | Accept single or double only | Rejects int, char |\n| `mustBeA(x, classes)` | Strict class check, no conversion | `mustBeA(x, [\"single\",\"double\"])` |\n| `mustBeBetween(x, lo, hi, type)` | Range check | R2025a+. Pre-R2025a: use `mustBeGreaterThan`\u002F`mustBeLessThan` |\n| `mustBeNonNan` | Reject NaN values | Built-in, not custom |\n| `mustBeMatrix` | Require 2D (M-by-N) | R2024b+ |\n| `mustBeRow` | Require 1-by-N | R2024b+. Rejects columns unlike `(1,:)` |\n| `mustBeVector` | Accept row or column | Flexible orientation |\n| `mustBeSorted` | Elements in sorted order | R2026a+ |\n\nFor the complete validator reference, see [references\u002Fvalidators-reference.md](references\u002Fvalidators-reference.md).\n\n----\n\nCopyright 2026 The MathWorks, Inc.\n\n----\n","# MATLAB Function Argument Validation\n\nWrite robust MATLAB functions using `arguments` blocks with correct semantics for size, class, repeating arguments, and property import.\n\n## When to Use\n\n- Writing a function with an `arguments` block\n- Using repeating arguments (`arguments (Repeating)`)\n- Writing a class constructor that accepts name-value arguments\n- Migrating from `inputParser` or `validateattributes`\n- Reviewing a function signature for implicit conversion pitfalls\n- Choosing between class specs, `mustBeA`, and validators\n\n## When NOT to Use\n\n- Basic MATLAB programming without argument validation\n- App building or UI components (use `matlab-building-apps`)\n- Unit testing (use `matlab-testing`)\n- General OOP class design unrelated to argument validation\n- Simple `if`\u002F`error` guard clauses for runtime invariants inside a function body\n  (those aren't input validation — leave them as-is unless the user asks for an\n  `arguments` block specifically)\n- **`.mlx` (Live Script) or `.mlapp` (App Designer) files** — these are binary\n  ZIP containers. Don't unzip them or attempt structural edits. If the user\n  asks to add an `arguments` block to a function inside one, ask them to\n  export to plain `.m` first, or open the file in MATLAB and edit it there.\n\n## Critical Misconceptions\n\nThese are things the agent commonly gets wrong. Read these FIRST.\n\n### Size specs RESHAPE, not reject\n\n**WRONG belief:** `(1,:)` rejects column vectors with an error.\n\n**ACTUAL behavior:** MATLAB silently reshapes the input to fit the declared size.\n\n```matlab\nfunction out = myFunc(x)\n    arguments\n        x (1,:) double\n    end\n    out = x;\nend\n\nmyFunc([1; 2; 3])  % Does NOT error! Returns [1 2 3] (reshaped to row)\n```\n\nA column vector `[1;2;3]` passed to `(1,:)` becomes a row vector `[1 2 3]`. To actually reject column vectors, use a validator:\n\n```matlab\nfunction out = myFunc(x)\n    arguments\n        x {mustBeNumeric, mustBeRow}\n    end\n    out = x;\nend\n```\n\n### Class specs CONVERT, not reject\n\n**WRONG belief:** `double` in the arguments block rejects non-double inputs.\n\n**ACTUAL behavior:** MATLAB attempts implicit conversion to the declared class.\n\n```matlab\nfunction out = myFunc(x)\n    arguments\n        x double\n    end\n    out = x;\nend\n\nmyFunc('hello')  % Does NOT error! Returns [104 101 108 108 111] (ASCII codes)\nmyFunc(single(3.14))  % Does NOT error! Returns double(3.14)\n```\n\nTo reject without converting, use `mustBeA` or `mustBeFloat`:\n\n```matlab\nx {mustBeA(x, \"double\")}           % Rejects single, char, int32, etc.\nx {mustBeFloat}                     % Accepts single OR double, rejects char\u002Fint\nx {mustBeNumeric}                   % Accepts any numeric, rejects char\u002Fstring\n```\n\n### Numeric validators don't reject complex values\n\n**WRONG belief:** `mustBeNumeric`, `mustBeFinite`, and `mustBeInteger` reject\ncomplex inputs like `1+2i`.\n\n**ACTUAL behavior:** Complex values are numeric, finite, and (when their real\nand imaginary parts are integer-valued) integer — so `1+2i` passes all three\nsilently. Sizes, indices, counts, and most physical scalars should reject\ncomplex values explicitly:\n\n```matlab\nfunction H = hilb2(n)\n    arguments\n        n (1,1) {mustBeInteger, mustBePositive, mustBeReal}\n    end\n    H = 1.\u002F((1:n)' + (0:n-1));\nend\n```\n\nAdd `mustBeReal` whenever a complex input would be nonsensical for the\nfunction's contract.\n\n### Computed defaults see PASSED values, not declared defaults\n\n**WRONG belief:** Default expressions use the declared default values of earlier arguments.\n\n**ACTUAL behavior:** Default expressions evaluate using the actual passed values.\n\n```matlab\nfunction out = myFunc(fs, windowSize)\n    arguments\n        fs (1,1) double {mustBePositive}\n        windowSize (1,1) double {mustBePositive} = round(fs \u002F 10)\n    end\n    out = windowSize;\nend\n\nmyFunc(8000)      % windowSize = round(8000\u002F10) = 800 (uses passed fs)\nmyFunc(8000, 256) % windowSize = 256 (explicitly passed)\n```\n\nThis eliminates the need for sentinel values (`[]`) and post-validation fixup.\n\n### `~` is a valid placeholder — don't rename it\n\n**WRONG belief:** A name in the `arguments` block is mandatory, so a `~`\nplaceholder in the function signature must be renamed to `obj`\u002F`this`\u002Fetc.\n\n**ACTUAL behavior:** `~` is valid as an argument-block name (R2019b+). Keep it.\n\n```matlab\nfunction normalize(~, results)\n    arguments\n        ~\n        results (1,:) struct\n    end\n    ...\nend\n```\n\nWhen a method signature uses `~` to mark an unused input (e.g. an unused\nclass instance), **preserve the `~`** in the arguments block:\n\n- **No class or size spec on `~`** — type specs like `(1,1) MetricCalculator`\n  require a name, so adding one forces a rename. Skip the spec entirely.\n- **No `%#ok\u003CINUSL>` \u002F `%#ok\u003CINUSA>` \u002F `%#ok\u003CMANU>` pragma** — `~` already\n  tells the lint pass the input is intentionally unused.\n- **Don't rename `~` to `obj`** to \"tighten validation.\" Renaming reintroduces\n  the lint warning the original `~` was suppressing, with no contract benefit.\n\n## Patterns\n\n### Repeating Arguments\n\nUse `arguments (Repeating)` for functions accepting variable groups of arguments (like `plot(x1,y1,x2,y2,...)`). Each declared variable becomes a **cell array** in the function body.\n\n```matlab\nfunction plotMultiSeries(x, y)\n    arguments (Repeating)\n        x (1,:) double {mustBeFinite}\n        y (1,:) double {mustBeFinite}\n    end\n\n    figure;\n    hold on;\n    for i = 1:numel(x)\n        plot(x{i}, y{i});\n    end\n    hold off;\nend\n```\n\nKey rules:\n- Variables become cell arrays — access with `x{i}`, not `x(i)`\n- All variables in the group repeat together (complete sets)\n- Repeating arguments cannot have default values\n- Zero repetitions is valid (produces empty cell arrays)\n\n### Output Argument Validation — `arguments (Output)` and `(Output, Repeating)`\n\n> **R2022b+.** Output argument validation is unavailable in earlier releases —\n> input validation (the bulk of this skill) works from R2019b onward.\n\nUse `arguments (Output, Repeating)` to declare a function whose output count\nscales with `nargout`. The block must declare **exactly one** name — MATLAB\nrejects multi-name repeating output blocks with\n`MATLAB:functionValidation:MultipleRepeatingOutputs`. To return groups of\nrelated values (e.g. triples), pack them into the single output and have the\ncaller request `N * groupSize` outputs.\n\n```matlab\nfunction out = productTriples()\n    arguments (Output, Repeating)\n        out (1,1) double\n    end\n    out = cell(1, nargout);\n    for k = 1:3:nargout\n        b = rand;\n        c = rand;\n        out{k}   = b * c;\n        out{k+1} = b;\n        out{k+2} = c;\n    end\nend\n```\n\nCaller: `[p1, a1, b1, p2, a2, b2] = productTriples();`\n\nKey rules:\n- **One name only** — `arguments (Output, Repeating) a; b; c; end` errors at parse\n- The output is assigned a `1×nargout` cell array; comma-list expansion at the\n  call site distributes its contents across the requested LHS variables\n- Validators on the single declared name apply to **each cell element**\n- `nargout` tells the body how many outputs were requested; zero is valid\n\n### Composition Rules — What Can Coexist\n\nA function may have **multiple `arguments` blocks**. The rules below apply to\nthe function as a whole — argument categories must appear in this order across\nall blocks combined:\n\n```\nrequired → optional (with defaults) → repeating → name-value\n```\n\nViolating the order at any point — even across separate blocks — fails to\nparse. Don't trust intuition: **all of these compose legally in one function**:\n\n- required + optional + repeating + name-value (`.?ClassName` allowed too)\n- required + repeating + name-value\n- repeating + name-value\n- `(Output, Repeating)` plus any combination of input blocks\n- `~` placeholders inside a `(Repeating)` block\n\n**Multiplicity:**\n\n| Block kind | How many allowed |\n|------------|------------------|\n| Plain `arguments` (positional and\u002For name-value) | Multiple, in order |\n| `arguments (Repeating)` (input) | **Exactly one** per function |\n| `arguments (Output, Repeating)` | **Exactly one** per function |\n| Name-value structs across plain blocks | Multiple — different struct names |\n\n**Parse-time error identifiers** — when in doubt, write the function and let\nMATLAB tell you. These are the only errors composition can produce; the names\nspell out the rule:\n\n| Identifier | Means |\n|------------|-------|\n| `MATLAB:functionValidation:RequiredAfterOptional` | A required arg appears after one with a default |\n| `MATLAB:functionValidation:OptionalAfterRepeating` | An optional\u002Fpositional arg appears after the repeating block |\n| `MATLAB:functionValidation:PositionalAfterNamed` | A positional or repeating arg appears after a name-value arg |\n| `MATLAB:functionValidation:MultipleRepeatingBlocks` | More than one `(Repeating)` block (input or output) |\n| `MATLAB:functionValidation:RepeatingHasDefault` | A `(Repeating)` arg has a default value |\n\nIf you're unsure whether a combination is legal, **don't fabricate a\nrestriction** — write a minimal version and run it. The error identifier (or\nits absence) is the answer.\n\n#### Maximal example\n\nA single function with required + optional + ignored + repeating + ignored\nrepeating + name-value + class-imported name-value (here `SensorConfig` —\nthe class defined in the `.?ClassName` section above):\n\n```matlab\nfunction maximal(req, opt, ~, x, ~, options, classArg)\n    arguments\n        req (1,1) double\n        opt (1,1) double = 7\n        ~\n    end\n    arguments (Repeating)\n        x (1,1) double\n        ~\n    end\n    arguments\n        options.Title (1,1) string = \"default\"\n        options.Verbose (1,1) logical = false\n        classArg.?SensorConfig\n    end\n    % function body\nend\n```\n\nCall: `maximal(1, 2, 3, 4, 'a', 5, 'b', Title=\"t\", SampleRate=44100)` —\nparses and runs. `SampleRate` is one of the name-value args imported from\n`SensorConfig` by the `.?` line.\n\n**Don't pick a class with no public-settable properties** for `.?ClassName` —\n`onCleanup`, for example, has only `task` (private set), so `.?onCleanup`\nimports zero name-value args. The line is syntactically valid but a no-op,\nand any \"name-value\" the caller writes against it is treated as an unknown\nname — see \"unknown `Name=Value` is silently swallowed\" in Common Mistakes.\n\nFor combining repeating args with name-value options, see the Maximal\nexample above and [references\u002Fexamples\u002Frepeating-args.md](references\u002Fexamples\u002Frepeating-args.md).\n\n### .?ClassName — Import Properties as Name-Value Args\n\nUse `.?ClassName` in constructors to derive name-value arguments directly from property definitions. This avoids redeclaring properties in the arguments block.\n\nFor additional patterns — overriding specific properties, static factory with forwarding, and wrapping graphics-class properties — see [references\u002Fexamples\u002Fdot-question-syntax.md](references\u002Fexamples\u002Fdot-question-syntax.md).\n\n```matlab\nclassdef SensorConfig\n    properties\n        SampleRate (1,1) double {mustBePositive} = 1000\n        Resolution (1,1) double {mustBePositive, mustBeInteger} = 16\n        FilterOrder (1,1) double {mustBePositive, mustBeInteger} = 4\n        Label (1,1) string = \"unnamed\"\n    end\n\n    methods\n        function obj = SensorConfig(nvArgs)\n            arguments\n                nvArgs.?SensorConfig\n            end\n            props = fieldnames(nvArgs);\n            for i = 1:numel(props)\n                obj.(props{i}) = nvArgs.(props{i});\n            end\n        end\n    end\nend\n```\n\nBenefits:\n- No duplication of size, class, validators, or defaults\n- Constructor stays in sync when properties are added or removed\n- Tab completion shows all settable properties automatically\n\n### namedargs2cell — Forward Name-Value Args\n\nUse `namedargs2cell` to convert a validated struct back to a name-value cell array for forwarding to other functions:\n\n```matlab\nfunction obj = fromPreset(presetName, nvArgs)\n    arguments\n        presetName (1,1) string\n        nvArgs.?SensorConfig\n    end\n\n    switch presetName\n        case \"audio\"\n            defaults = struct(SampleRate=44100, Resolution=24, Label=\"audio\");\n        case \"vibration\"\n            defaults = struct(SampleRate=10000, Resolution=16, Label=\"vibration\");\n    end\n\n    % Apply overrides\n    overrides = fieldnames(nvArgs);\n    for i = 1:numel(overrides)\n        defaults.(overrides{i}) = nvArgs.(overrides{i});\n    end\n\n    args = namedargs2cell(defaults);\n    obj = SensorConfig(args{:});\nend\n```\n\n## Migration Decision Framework\n\nWhen migrating from `inputParser` or `validateattributes`, use this decision tree for class handling:\n\n| Original check | What it does | Arguments block equivalent | Why |\n|---------------|-------------|---------------------------|-----|\n| `@isnumeric` | Accepts any numeric, no conversion | `{mustBeNumeric}` | No class spec — avoids conversion |\n| `@ischar` | Accepts char only | `{mustBeA(label, 'char')}` or `(1,:) char` | `mustBeText`\u002F`mustBeTextScalar` widens to accept string |\n| `@islogical` | Accepts logical only | `(1,1) logical` | Safe — nothing converts TO logical implicitly |\n| `{'numeric'}` | Accepts any numeric, no conversion | `{mustBeNumeric}` | `validateattributes` meta-class — same set as `@isnumeric` |\n| `{'float'}` | Accepts single or double | `{mustBeFloat}` | Equivalent to `{'single','double'}` |\n| `{'integer'}` (class spec, rare) | Accepts only integer types (int8…uint64) | Usually `{mustBeNumeric, mustBeInteger}`. Strict-only-if-intentional: `{mustBeA(x, [\"int8\",\"int16\",\"int32\",\"int64\",\"uint8\",\"uint16\",\"uint32\",\"uint64\"])}` | The class-only form rejects integer-valued doubles like `5.0` — usually accidental. Widen to the lenient pairing unless the original code clearly meant to reject doubles. |\n| `{'numeric'}, {'integer'}` (class+attr) | Numeric, integer-valued | `{mustBeNumeric, mustBeInteger}` | Common pairing — accepts both int types and integer-valued floats |\n| `{'single','double'}` | Restricts to float types | `{mustBeFloat}` | Class spec `double` would convert single→double |\n| `{'double'}` exact | Rejects single, int, char | `{mustBeA(x, \"double\")}` | Class spec `double` would convert, not reject |\n| `@(x) isa(x,'MyClass')` | Class membership | `{mustBeA(x, \"MyClass\")}` | Validates without conversion |\n\n**Key principle:** If the original code REJECTS mismatched types, use validators (`mustBeA`, `mustBeFloat`, `mustBeNumeric`). If you WANT automatic conversion for caller convenience, use a class spec.\n\n### Anonymous-Function Validators\n\nDon't drop these on migration — each has a built-in equivalent:\n\n| `inputParser` validator | Arguments block equivalent |\n|-------------------------|----------------------------|\n| `@(x) ~isempty(x)` | `{mustBeNonempty}` |\n| `@(x) x > 0` | `{mustBePositive}` |\n| `@(x) x >= 0` | `{mustBeNonnegative}` |\n| `@(x) x \u003C 0` | `{mustBeNegative}` |\n| `@(x) x \u003C= 0` | `{mustBeNonpositive}` |\n| `@(x) isfinite(x)` | `{mustBeFinite}` |\n| `@(x) isreal(x)` | `{mustBeReal}` |\n| `@(x) isnumeric(x) && isreal(x)` | `{mustBeNumeric, mustBeReal}` |\n| `@(x) ismember(x, set)` | `{mustBeMember(x, set)}` |\n| `validatestring(x, set)` | **Don't replace with `mustBeMember`.** `validatestring` does case-insensitive prefix matching and returns the canonical form; `mustBeMember` is exact-match only. Keep the call inside the body and use the arguments block only for `{mustBeTextScalar}`. |\n\nFor detailed migration examples, see [references\u002Fmigration-guide.md](references\u002Fmigration-guide.md).\n\n## Conventions\n\n- **Prefer `string` over `char`** for new code (not migrations)\n- **Never use `varargin` with manual parsing** when `arguments (Repeating)` or name-value blocks can express the same interface\n- **Use `.?ClassName`** in constructors rather than redeclaring properties\n- **Prefer computed defaults** (`= expression`) over sentinel values with `isempty` checks, when the default depends only on earlier arguments\n- **Don't combine `mustBeNumeric` with a `double` class spec to reject non-numeric input** — the class spec converts char (`'A'` → `65`) before the validator runs, defeating the check. Drop the class spec: `x {mustBeNumeric}` not `x (1,1) double {mustBeNumeric}`\n- **Don't combine text validators with a `string` class spec** — the class spec converts non-text (e.g., `42` → `\"42\"`) before the validator runs, defeating the check. Use text validators alone: `p {mustBeTextScalar}` not `p (1,1) string {mustBeTextScalar}`\n- **Never reach for `varargin` + manual `class()` checks to reject types.** When a class spec like `double` would convert (rather than reject) char\u002Fsingle\u002Fint input, the right answer is a validator (`mustBeNumeric`, `mustBeFloat`, `mustBeA`), not a fallback to `varargin`. Falling back to `varargin` defeats the entire point of the arguments block.\n\n## Common Mistakes\n\n| Mistake | Why It's Wrong | Correct Approach |\n|---------|---------------|-----------------|\n| Using `varargin` for repeated arg groups | Requires 30+ lines of manual parsing | `arguments (Repeating)` — 3 lines |\n| Redeclaring properties in constructor | Duplication drifts out of sync | `nvArgs.?ClassName` |\n| Believing `(1,:)` rejects columns | It silently reshapes them | Use `mustBeRow` to reject |\n| Believing `double` rejects char | It silently converts to ASCII before validators run | Drop the `double` class spec and use `{mustBeNumeric}` alone, or `{mustBeA(x,\"double\")}` for strict class check |\n| Using `[]` sentinel for computed defaults | Over-engineered, needs custom validator | `= expression` referencing earlier args |\n| Replacing `@ischar` with `mustBeTextScalar` | Widens contract to accept strings | Use `mustBeA(x,'char')` for strict fidelity |\n| Using `(1,1) string {mustBeTextScalar}` | Class spec converts `42` → `\"42\"` before validator | Use `{mustBeTextScalar}` alone (no class spec) |\n| Replacing `validatestring` with `mustBeMember` | `validatestring` does case-insensitive prefix matching (`'AU'` → `'auto'`) and returns the canonical form; `mustBeMember` is exact-match only | Keep `validatestring` inside the body. Use the arguments block only for the type\u002Fsize guard: `mode {mustBeTextScalar}` then `mode = validatestring(mode, {...})` |\n| Omitting `mustBeReal` for numeric args | Complex values pass `mustBeNumeric`, `mustBeFinite`, and `mustBeInteger` silently — `1+2i` is a finite numeric integer | Add `mustBeReal` whenever a complex input would be nonsensical (indices, sizes, counts, physical scalars) |\n| Renaming `~` to `obj`\u002F`this` in arguments block | `~` is a valid placeholder name in arguments blocks — renaming reintroduces the lint warning the original `~` suppressed | Keep `~`, no class\u002Fsize spec, no `%#ok` pragma |\n| Declaring multiple names in `arguments (Output, Repeating)` | MATLAB errors with `MultipleRepeatingOutputs` — only one name is allowed | Declare a single output name; pack groups of values into that one cell array and have the caller request `N * groupSize` outputs |\n| Claiming optional positional args and `(Repeating)` are mutually exclusive | They aren't — required + optional + repeating + name-value all compose legally in order | See \"Composition Rules\". When unsure, write the function and let MATLAB's parse-time error identifier (e.g. `OptionalAfterRepeating`, `PositionalAfterNamed`) tell you what's actually wrong |\n| Assuming an unknown `Name=Value` errors loudly when the function has `arguments (Repeating)` | It doesn't. With a `(Repeating)` block present, an unrecognized `Name=Value` is silently absorbed as two **positional** repeating args (name token, then value). One bad pair also reclassifies preceding **valid** name-value args back to positional, so set options revert to their defaults. (Without `(Repeating)`, the same call errors with `MATLAB:TooManyInputs`.) | A common way to land here: `.?ClassName` against a class with no public-settable properties (e.g. `.?onCleanup`) — the import exposes nothing, so every NV the caller writes against it is unknown. Pick a class with public-set properties. When debugging \"why is my NV default showing up?\", check the call for **any** unrecognized `Name=` — one bad name poisons the whole NV section |\n\n## Validators Quick Reference\n\n| Validator | Purpose | Note |\n|-----------|---------|------|\n| `mustBeFloat` | Accept single or double only | Rejects int, char |\n| `mustBeA(x, classes)` | Strict class check, no conversion | `mustBeA(x, [\"single\",\"double\"])` |\n| `mustBeBetween(x, lo, hi, type)` | Range check | R2025a+. Pre-R2025a: use `mustBeGreaterThan`\u002F`mustBeLessThan` |\n| `mustBeNonNan` | Reject NaN values | Built-in, not custom |\n| `mustBeMatrix` | Require 2D (M-by-N) | R2024b+ |\n| `mustBeRow` | Require 1-by-N | R2024b+. Rejects columns unlike `(1,:)` |\n| `mustBeVector` | Accept row or column | Flexible orientation |\n| `mustBeSorted` | Elements in sorted order | R2026a+ |\n\nFor the complete validator reference, see [references\u002Fvalidators-reference.md](references\u002Fvalidators-reference.md).\n\n----\n\nCopyright 2026 The MathWorks, Inc.\n\n----\n",{"name":5,"license":25,"metadata":26,"description":29},"MathWorks BSD-3-Clause",{"author":27,"version":28},"MathWorks","1.1","Use when writing MATLAB functions with arguments blocks — repeating arguments (arguments (Repeating)), .?ClassName property import in constructors, name-value forwarding with namedargs2cell, or migrating from inputParser or validateattributes. Also when reviewing signatures for implicit-conversion pitfalls (size reshaping, class coercion, computed defaults), or when restricting, constraining, or validating function inputs — scalar vs vector enforcement, type rejection, size checking. Also when asked to harden inputs, make a function more robust, tighten input checking, or rewrite for safer input acceptance — even without \"validation\" or \"arguments block\" wording. Triggers on: arguments block, mustBe validators, name-value arguments, varargin, inputParser, nargin\u002Fnarginchk, restrict input, type checking, scalar constraint, harden inputs, defensive programming. Not for: App Designer callbacks, Simulink mask parameters, class inheritance, or runtime validation outside function or property declarations.\n","master","49e49abf2f670d429e0b7e2c0349739c3fdd5cbe","skills\u002Fmatlab-validate-function-arguments",5,"https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium","https:\u002F\u002Fgithub.com\u002Fstanfish06","https:\u002F\u002Fwww.stanfish.dev\u002F","2026-11-14 21:31:37",{"source":8,"skillName":5,"commands":39,"prompt":49,"zipAvailable":50},[40,43,46],{"tool":41,"command":42},"npx","npx skills add stanfish06\u002Fskillquarium --skill matlab-validate-function-arguments",{"tool":44,"command":45},"bunx","bunx skills add stanfish06\u002Fskillquarium --skill matlab-validate-function-arguments",{"tool":47,"command":48},"pnpm","pnpm dlx skills add stanfish06\u002Fskillquarium --skill matlab-validate-function-arguments","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fmatlab-validate-function-arguments\u002FSKILL.md",true,[52,57,63,67,71,75],{"path":53,"resourceType":54,"resourceTypeDesc":55,"sizeBytes":56,"sourceHtmlUrl":16},"LICENSE.md","LICENSE","许可证",1482,{"path":58,"resourceType":59,"resourceTypeDesc":60,"sizeBytes":61,"sourceHtmlUrl":62},"manifest.yaml","REFERENCE","参考文档",339,"https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fmatlab-validate-function-arguments\u002Fmanifest.yaml",{"path":64,"resourceType":59,"resourceTypeDesc":60,"sizeBytes":65,"sourceHtmlUrl":66},"references\u002Fexamples\u002Fdot-question-syntax.md",2728,"https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fmatlab-validate-function-arguments\u002Freferences\u002Fexamples\u002Fdot-question-syntax.md",{"path":68,"resourceType":59,"resourceTypeDesc":60,"sizeBytes":69,"sourceHtmlUrl":70},"references\u002Fexamples\u002Frepeating-args.md",3861,"https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fmatlab-validate-function-arguments\u002Freferences\u002Fexamples\u002Frepeating-args.md",{"path":72,"resourceType":59,"resourceTypeDesc":60,"sizeBytes":73,"sourceHtmlUrl":74},"references\u002Fmigration-guide.md",6172,"https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fmatlab-validate-function-arguments\u002Freferences\u002Fmigration-guide.md",{"path":76,"resourceType":59,"resourceTypeDesc":60,"sizeBytes":77,"sourceHtmlUrl":78},"references\u002Fvalidators-reference.md",7166,"https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fmatlab-validate-function-arguments\u002Freferences\u002Fvalidators-reference.md",[80,88,97,104,111,118],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":84,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":20},"01M76ZJTRVA456GD7K8Y3EP82H","zarr-python","Stores and queries chunked N-D scientific arrays with Zarr-Python 3, including codecs, sharding, S3\u002FGCS storage, and NumPy\u002FDask\u002FXarray integration. Use for array layout, bounded I\u002FO, format migration, or scientific metadata preservation.","MIT","https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fzarr-python\u002FSKILL.md",[],[],{"skillNo":89,"name":90,"nameZh":6,"description":91,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":92,"licenseFileUrl":93,"sourceHtmlUrl":94,"categories":95,"keywords":96,"publishedAt":20},"01M76ZJQZ15Q1HKC5V85NHE325","yeet","Publish local changes to GitHub by confirming scope, committing intentionally, pushing the branch, and opening a draft PR through the GitHub app from this plugin, with `gh` used only as a fallback where connector coverage is insufficient.","Apache-2.0","https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fyeet\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fyeet\u002FSKILL.md",[],[],{"skillNo":98,"name":99,"nameZh":6,"description":100,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":92,"licenseFileUrl":6,"sourceHtmlUrl":101,"categories":102,"keywords":103,"publishedAt":20},"01M76ZJ8ASZ4QYQ70Y6SBA4Z4S","xarray","N-dimensional labeled arrays and datasets in Python. Built on top of NumPy and Dask. It introduces labels in the form of dimensions, coordinates, and attributes on top of raw NumPy-like arrays, making data analysis in physical sciences more intuitive and less error-prone. Use for working with multi-dimensional scientific data, NetCDF\u002FGRIB\u002FZarr files, climate\u002Fweather\u002Foceanographic datasets, remote sensing, geospatial imaging, large out-of-memory datasets with Dask, and labeled array operations.","https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fxarray\u002FSKILL.md",[],[],{"skillNo":105,"name":106,"nameZh":6,"description":107,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":84,"licenseFileUrl":6,"sourceHtmlUrl":108,"categories":109,"keywords":110,"publishedAt":20},"01M76ZHFBXD6VXPQ02VCEG202B","writing-mstest-tests","Use when asked to fix, rewrite, update, improve, modernize, show corrected code for, or explain existing MSTest tests or MSTest-specific configuration. Use for \"review\" when corrected code or edits are wanted, even for one pasted assertion or passing tests with bad failure output. Covers expected\u002Factual labels; generic Boolean, collection, string, numeric, null, identity, exception, hard-cast, and object[] checks; TestContext\u002Flifecycle; timeout\u002Fcancellation; OS\u002FCI conditions, retry, cleanup, parallelization, MSTest.Sdk project setup, and MSTESTxxxx. Honor the installed MSTest version. DO NOT USE to design new test cases (code-testing), perform report-only audits, create project files rather than explain MSTest setup, run tests, migrate frameworks, or handle non-MSTest\u002Fnon-.NET code.","https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fwriting-mstest-tests\u002FSKILL.md",[],[],{"skillNo":112,"name":113,"nameZh":6,"description":114,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":84,"licenseFileUrl":6,"sourceHtmlUrl":115,"categories":116,"keywords":117,"publishedAt":20},"01M76ZDFDF4N88RH6HSYGS7GP2","wgs-prs","End-to-end WGS to polygenic risk score pipeline. Takes paired-end FASTQ files (or a pre-existing VCF) through nf-core\u002Fsarek for variant calling, applies VCF QC (normalisation, hard filtering, Ti\u002FTv and Het\u002FHom checks), then computes polygenic risk scores via the PGS Catalog. Fills the FASTQ to VCF gap upstream of the gwas-prs skill.","https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fwgs-prs\u002FSKILL.md",[],[],{"skillNo":119,"name":120,"nameZh":6,"description":121,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":92,"licenseFileUrl":122,"sourceHtmlUrl":123,"categories":124,"keywords":125,"publishedAt":20},"01M76ZCC1SC68J42QK4MDC8RCG","webapp-testing","Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.","https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fwebapp-testing\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fstanfish06\u002Fskillquarium\u002Fblob\u002Fmaster\u002Fskills\u002Fwebapp-testing\u002FSKILL.md",[],[]]