Agent skill · Code Review & Quality

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

matlabgithub.com/matlabGitHub ↗
claude-codecodexcopilotNOASSERTION
Install
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.

Facts
Files in the skill folder: 3
SKILL.md size: 13 KB
Bundled scripts: none
Version: 1.0
Declared author: MathWorks
Path: skills-catalog/parallel-computing/matlab-diagnose-parfor/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 868
Language: MATLAB

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# 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

What's inside
Steps it walks through
  1. When to Use
  2. When NOT to Use
  3. Workflow
  4. Error Messages and Root Causes
  5. Variable Classification Rules (Reference)
  6. Patterns
  7. Fix 1: Struct field as sliced output → plain array
  8. Fix 2: Multiple sliced subscripts → single assignment
  9. Fix 3: Invalid sliced subscript patterns
  10. Fix 4: Sliced write combined with full read
  11. Fix 5: Reduction not in standard form
  12. Fix 6: Temporary variable incorrectly flagged
  13. Fix 7: Conditional update that needs to survive the loop
  14. Conventions
Ships with 2 files
  • manifest.yaml
  • references/parfor-analyser-messages.md
More from matlab-agentic-toolkit
All skills →
About this skill
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.

Keep going