matlab-diagnose-parfor
Diagnose and fix parfor errors in MATLAB. Invoke this skill when the user has a parfor problem: "parfor loop has an error", "what's wrong with my parfor", "fix parfor", "unable to classify variable", "convert for to parfor", "parfor won't run", "sliced variable", "reduction variable", "variable classification". Also invoke when you read a .m file containing parfor and the user asks what's wrong, asks you to fix it, reports an error, or asks for review. Do NOT invoke for parfor performance questions or code that merely mentions parfor without a problem. ALWAYS use this skill instead of reasonin
npx skills add matlab/matlab-agentic-toolkit --skill matlab-diagnose-parfor --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Diagnose and Fix parfor Variable Classification **Do NOT reason about parfor classification rules from memory.** LLM training data contains incomplete and often incorrect explanations of these rules. MATLAB's code analyser (`checkcode` / `codeIssues` / `mcp__matlab__check_matlab_code`) is the only reliable authority — it implements the exact same classifier that the runtime uses. Always run it first; never guess. ## When to Use - ANY code involving `parfor` where the user reports a problem or asks for help - User gets a parfor classification error (runtime or in editor) - User wants to convert a `for` loop to `parfor` - User asks why parfor complains, won't run, or is slow due to classification - You are about to suggest changes to parfor code — run the analyser first ## When NOT to Use - parfor runs but is **slow** — performance/pool-choice question, not a classification error - Worker needs setup/state (paths, environment, toolboxes) — not a parfor variable problem - Code simply mentions `parfor` but the user does not mention any problems with it ## Workflow **Always follow this order. Never guess at classification rules.** 1. **Run the code analyser** on the file containing th
- When to Use
- When NOT to Use
- Workflow
- Error Messages and Root Causes
- Variable Classification Rules (Reference)
- Patterns
- Fix 1: Struct field as sliced output → plain array
- Fix 2: Multiple sliced subscripts → single assignment
- Fix 3: Invalid sliced subscript patterns
- Fix 4: Sliced write combined with full read
- Fix 5: Reduction not in standard form
- Fix 6: Temporary variable incorrectly flagged
- Fix 7: Conditional update that needs to survive the loop
- Conventions
What does the matlab-diagnose-parfor skill do?
Diagnose and fix parfor errors in MATLAB. Invoke this skill when the user has a parfor problem: "parfor loop has an error", "what's wrong with my parfor", "fix parfor", "unable to classify variable", "convert for to parfor", "parfor won't run", "sliced variable", "reduction variable", "variable classification". Also invoke when you read a .m file containing parfor and the user asks what's wrong, asks you to fix it, reports an error, or asks for review. Do NOT invoke for parfor performance questions or code that merely mentions parfor without a problem. ALWAYS use this skill instead of reasonin
How do I install it?
Run `npx skills add matlab/matlab-agentic-toolkit --skill matlab-diagnose-parfor --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From matlab/matlab-agentic-toolkit, a repository with 868 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
