matlab-review-code
Review MATLAB code for quality, performance, maintainability, and adherence to MathWorks coding standards. Uses check_matlab_code and matlab_coding_guidelines
Install / Use
npx skills add matlab/matlab-agentic-toolkit --skill matlab-review-codeInstalls into whichever agent you are using.
SKILL.md
Installable skill definition
Quality Score
Category
Development & EngineeringSupported Platforms
Our assessment of matlab-review-code
matlab-review-code scores 91/100 on our quality scale, 1110th of 4,646 Development & Engineering skills we index (top 24%).
Its SKILL.md is 7.1 KB long, well organised into 23 sections with 5 code examples: a thorough specification that gives an agent plenty to work with.
With 1,098 GitHub stars, it is one of the more widely adopted skills in the catalogue.
Maintenance, license and trust
- The repository was last updated 18 days ago, so matlab-review-code is actively maintained.
- No license is declared. By default that means all rights are reserved: you can read it, but reusing or redistributing it is not clearly permitted. Ask the author before building on it commercially.
- Its trust signals score 88/100, with 1 caution from licensing, adoption, age or documentation. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
matlab-review-code compared with similar skills
All 4 of these similar skills score higher than matlab-review-code; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| matlab-review-code (this skill)by matlab | 91 | 1.1k | 18d ago | SKILL.md |
| ai-job-searchby MadsLorentzen | 100 | 44.9k | today | CLAUDE.md |
| claude-howtoby luongnv89 | 100 | 41.7k | 3d ago | CLAUDE.md |
| algorithmic-artby anthropics | 100 | 177.9k | 11d ago | SKILL.md |
| pptxby anthropics | 100 | 177.9k | 11d ago | SKILL.md |
Frequently asked questions
- How do I install matlab-review-code?
- Run
npx skills add matlab/matlab-agentic-toolkit --skill matlab-review-code. The install tabs above show the steps for each supported agent. - Which AI agents does matlab-review-code work with?
- It is written for Universal, as a SKILL.md file. Other agents that read the same format can often use it too.
- Is matlab-review-code safe to use?
- It declares no license and scores 88/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is matlab-review-code still maintained?
- The repository was last updated 18 days ago, so matlab-review-code is actively maintained.
Skill content
View source on GitHubname: matlab-review-code description: Review MATLAB code for quality, performance, maintainability, and adherence to MathWorks coding standards. Uses check_matlab_code and matlab_coding_guidelines. Use when reviewing code, checking style, finding code smells, assessing quality, or preparing code for handoff or publication. license: https://www.mathworks.com/content/dam/mathworks/license/pmrl/license.md metadata: author: MathWorks version: "1.1"
Code Review
Systematically review MATLAB code for quality, correctness, performance, and adherence to MathWorks coding conventions using static analysis and manual inspection patterns.
When to Use
- User asks to review, audit, or improve code quality
- User wants to check adherence to MathWorks coding standards
- Preparing code for handoff, publication, or open-source release
- After a significant implementation — verify before committing
- User reports "code smells" or asks for cleanup suggestions
When NOT to Use
- User wants to debug a runtime error — use
matlab-debug-codeinstead - User wants to optimize performance — use performance profiling skills
- User wants to generate tests — use
matlab-write-testsinstead
Workflow
- Run static analysis — Use
check_matlab_codeMCP tool on all target files - Load coding standards — Read the
matlab_coding_guidelinesMCP resource - Check naming — Verify functions, classes, variables, and files follow conventions
- Review function signatures — Arguments blocks, input/output counts, name-value patterns
- Assess structure — Function length, nesting depth, complexity
- Check patterns — Vectorization, preallocation, modern API usage
- Summarize — Report findings by severity: errors > warnings > suggestions
Step 1: Static Analysis
Use the check_matlab_code MCP tool on each file. Then inspect results programmatically:
info = checkcode("src/computeArea.m", "-struct");
for k = 1:numel(info)
fprintf('Line %d (col %d-%d): %s\n', ...
info(k).line, info(k).column(1), info(k).column(end), info(k).message);
end
For directory-wide analysis (R2022b+):
issues = codeIssues("src");
disp(issues.Issues);
Step 2: Load Coding Standards
Read the matlab_coding_guidelines MCP resource to get the authoritative MathWorks coding standards. Use these as the baseline for all naming, formatting, and structural checks.
Review Checklist
Naming
| Element | Convention | Example |
|---------|-----------|---------|
| Functions | lowerCamelCase, verb phrase | computeArea, loadData |
| Classes | PascalCase | SensorReader, DataProcessor |
| Variables | lowerCamelCase, descriptive | sampleRate not sr |
| Constants | UPPER_SNAKE or Constant property | MAX_ITERATIONS |
| Test files | t prefix | tComputeArea.m |
| App files | PascalCase | DashboardApp.m |
| File = function | File name matches primary function | computeArea.m → function computeArea |
Function Quality
| Check | Standard | Severity |
|-------|----------|----------|
| Input count | Max 6 positional inputs | Warning |
| Output count | Max 4 outputs | Warning |
| Validation | arguments block present | Warning |
| Name-value args | options.Name pattern (not varargin) | Suggestion |
| Length | Flag if >50 lines | Suggestion |
| Nesting | Flag if >3 levels deep | Warning |
| end keyword | All functions terminated with end | Warning |
| Help text | H1 line present for public functions | Suggestion |
Code Patterns
| Check | Modern | Legacy (flag it) |
|-------|--------|-------------------|
| Multi-panel figures | tiledlayout/nexttile | subplot |
| Date/time | datetime | datenum/datestr |
| Strings | string type | char arrays for text |
| Vectorization | .*, ./, logical indexing | Loops over elements |
| Preallocation | zeros(n,1) before loop | Growing arrays in loops |
| Data containers | table/timetable | Raw matrices for named data |
| Dynamic eval | Direct function calls | eval, evalin, assignin |
High-Severity Flags
These should always be reported as errors:
- Use of
eval,assignin, orevalin— security and maintainability risk - Growing arrays inside loops without preallocation — performance
- Shadowing built-in functions —
sum = 5shadowssum() - Missing
argumentsblock in public-facing functions - Hardcoded file paths with backslashes
What checkcode Misses
check_matlab_code does NOT catch all issues. After running static analysis, always scan the source code for these common problems that require visual inspection:
subplotusage — not flagged by checkcode, but should usetiledlayout/nexttile- Shadowed builtin variables —
sum = 0shadowssum(), checkcode may not flag it - Deep nesting (>3 levels) — checkcode does not measure nesting depth
- Hardcoded backslash paths — checkcode flags unused variables but not path style
- Magic numbers — unlabeled constants in code (e.g.,
if length(x) > 10) - Missing H1 help text — checkcode does not require help text
Do not skip Steps 3-6 of the workflow just because checkcode returns few results.
Patterns
Complexity Assessment
function complexity = assessComplexity(filePath)
%assessComplexity Estimate cyclomatic complexity of a MATLAB function.
arguments
filePath (1,1) string {mustBeFile}
end
code = fileread(filePath);
branchKeywords = ["if " "elseif " "case " "while " "for " "catch "];
complexity = 1;
for kw = branchKeywords
complexity = complexity + numel(strfind(code, kw));
end
end
Check Toolbox Dependencies
[files, products] = matlab.codetools.requiredFilesAndProducts('src/myFunction.m');
fprintf('Required products:\n');
for k = 1:numel(products)
fprintf(' %s (ID: %d)\n', products(k).Name, products(k).ProductNumber);
end
Review Report Format
Present findings in this format:
## Code Review: computeArea.m
### Static Analysis (checkcode)
- 2 warnings, 0 errors
### Naming ✓
- [x] Function: lowerCamelCase
- [x] Variables: descriptive
- [x] File name matches function
### Structure
- [x] arguments block present
- [x] Function under 50 lines
- [ ] ⚠ Nesting depth reaches 4 levels (line 32)
### Patterns
- [x] Vectorized
- [x] Modern graphics API
- [ ] ⚠ Uses datenum (line 18) — migrate to datetime
### Suggestions
1. Extract nested logic at line 32 into a local function
2. Replace datenum with datetime for date handling
Conventions
- Always run
check_matlab_codeas the first step — it catches issues automatically - Load
matlab_coding_guidelinesfor the authoritative standard - Report findings by severity: errors (must fix) > warnings (should fix) > suggestions (nice to have)
- Flag any use of
eval,assignin, orevalinas high-severity - Check
requiredFilesAndProductsto verify toolbox dependencies are documented - Verify every public function has an H1 help text line
- Use
codeIssuesfor directory-wide analysis (R2022b+) - Do not suggest changes that alter behavior — review is read-only assessment
- For deprecated API migration details, use the
matlab-modernize-codeskill
Copyright 2026 The MathWorks, Inc.
Related Skills
ai-job-search
44.9kThe job search that runs on your machine. AI job application framework built on Claude Code: evaluate postings, tailor CVs, write cover letters, prep interviews. Fork it and own it.
claude-howto
41.7kA visual, example-driven guide to Claude Code — from basic concepts to advanced agents, with copy-paste templates that bring immediate value.
algorithmic-art
177.9kCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems.
pptx
177.9kUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx or .potx file (even if the extracted content will be used elsewhere, like in an em…
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
