From mella
Use when reviewing code, checking code quality, or before committing/creating a PR. Runs when the user says things like "review my code", "check my changes", "review what I've done", "can you look over this", "run a code review", or "check for issues". Analyzes all branch changes against main, selects the appropriate review agents, and presents a consolidated report with optional fixes. Supports loop mode for iterative auto-fixing.
How this skill is triggered — by the user, by Claude, or both
Slash command
/mella:reviewThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
This skill has two modes:
This skill has two modes:
/review — Interactive mode. Run agents, present findings, apply fixes, and automatically re-review until clean (up to 3 passes)./review loop — Loop mode. Auto-fix issues iteratively until clean or stuck. Used by the review-loop script for overnight/batch runs.When the user runs /review, follow these steps exactly. For loop mode differences, see the "Loop Mode" section at the end.
If you are currently in plan mode, stop immediately. Tell the user:
"/review requires Edit and Write access to apply fixes and re-review. You're in plan mode, which blocks those tools. Please exit plan mode first, then re-run
/review."
Do not proceed to Step 1. The fix→re-review loop (Steps 3–9) cannot work without write access.
Run git branch --show-current to get the current branch name.
main or master and the user did NOT pass --force (or -f): warn the user: "You're on main — nothing to review." and stop.main or master with --force/-f: continue, but use HEAD~1 instead of main as the diff base in Step 3 (since you can't diff main against itself).Also parse --stack if provided (e.g. --stack laravel or --stack laravel,ios). Split the value by comma to get an explicit stack list. If provided, this overrides auto-detection in Step 4.
Check if .claude/review-history.json exists in the repo root. If it does, read it and check if the branch field matches the current branch.
pass field is present and the head_commit matches the current HEAD, this is a mid-cycle recovery (context compaction occurred) — resume the cycle at pass pass + 1 using fixed_files to scope the next diff.The history file structure is:
{
"branch": "feature/example",
"reviewed_at": "2026-02-05T10:30:00Z",
"head_commit": "a1b2c3d",
"pass": 1,
"fixed_files": ["src/Example.php", "src/Controller.php"],
"findings": [
{
"id": "f1",
"file": "src/Example.php",
"lines": "45-52",
"agents": ["laravel-simplifier"],
"action": "remove",
"summary": "Remove unused variable",
"status": "pending"
}
]
}
Status values: pending (not yet addressed), applied (fix was applied), dismissed (user chose to ignore).
Steps 3 through 9 form a review cycle that runs up to 3 passes. Track the current pass number starting at 1. After fixes are applied in Step 9, loop back to Step 3 for another pass. The cycle exits early when no new findings are found or the user says "done" / "stop".
Every pass must execute Steps 3 through 8 fully — no shortcuts. Do not skip agent execution because the diff "looks clean" to you. The agents exist precisely because a single review (including yours) misses things. If Step 3 produces a non-empty diff, you must classify (Step 4), select agents (Step 5), run them (Step 6), consolidate (Step 7), and present findings (Step 8). The only valid short-circuit is if the scoped diff in Step 3 is completely empty.
To keep context usage under control across passes:
.claude/review-history.json at the start of the next pass to recover the pass number and which findings have already been addressed.Run the following to get all changes (committed and uncommitted) compared to the base:
git diff main...HEAD # or git diff HEAD~1...HEAD if --force on main/master
git diff
git diff --cached
git rev-parse HEAD
Use main as the diff base normally. If --force was used on main/master, use HEAD~1 instead (review the latest commit).
Combine these into the full set of changed files and their diffs. Store the HEAD commit hash. If there are no changes at all, tell the user and stop.
Only review files that were modified by fixes in the previous pass — do NOT re-diff the entire branch. This keeps context lean and focused on what actually changed.
For each file in the fixed_files list, check if it is tracked or untracked:
git diff and git diff --cached filtered to those specific files.git diff cannot see these. Instead, read the file contents directly (they are new files — the entire content is the "diff").If all fixed files are tracked and the filtered diff is empty, the cycle is done — proceed to Step 10.
Scan the combined diff to detect the presence of:
.catch(), fallback logic, empty catch, error suppression*Test.php, *_test.go, *.test.ts, *.spec.ts, tests/, test/)If --stack was provided in Step 1, use those stacks directly and skip auto-detection.
Otherwise, auto-detect the project's stack(s):
laravel: Check for an artisan file in the repo root OR read composer.json and look for laravel/framework in require or require-dev. If found and .php files are in the diff, add laravel to the detected stacks.ios: If .swift files are in the diff, add ios to the detected stacks.Store the detected stacks for use in Step 5. A project can have multiple stacks (e.g. a Laravel backend + Swift iOS app in the same repo).
Based on the classification, build a list of agents to run. Do NOT ask the user to confirm — simply tell them which agents will run and why, then proceed immediately to Step 6.
Always include:
| Agent | Reason |
|---|---|
pr-review-toolkit:code-reviewer | General code quality, style, best practices |
feature-dev:code-reviewer | Bugs, logic errors, security vulnerabilities |
general-purpose agent with standards compliance prompt | CLAUDE.md/MEMORY.md compliance, convention drift, tooling conflicts |
Stack-specific (only if stack detected or specified via --stack):
| Agent | Condition |
|---|---|
general-purpose agent with stack reference prompt | For each detected stack, load its reference file and run as a separate agent |
laravel-simplifier:laravel-simplifier | laravel in detected stacks |
Conditionally include (only if detected):
| Agent | Condition |
|---|---|
pr-review-toolkit:silent-failure-hunter | Error handling patterns detected |
pr-review-toolkit:type-design-analyzer | New type/interface definitions detected |
pr-review-toolkit:pr-test-analyzer | Test files changed or added |
pr-review-toolkit:comment-analyzer | Any comments or docstrings added/modified |
Before running agents, locate this skill's reference files. Use Glob with pattern **/skills/review/references/*.md to find the references/ directory. Read the following files from it:
standards-reviewer.md — use its full contents as the prompt for a general-purpose Task agent. Pass the agent the list of all changed files and their diffs. (Code reuse, quality, and efficiency checks are handled by /simplify in Step 11.)laravel, ios), read <stack>.md from the references directory and use its full contents as the prompt for a general-purpose Task agent. Pass the agent the list of changed files and their diffs.Present a brief summary of which agents will run and why (e.g. "Running 7 agents: code-reviewer, laravel stack reviewer (detected Laravel project), laravel-simplifier, ..."). Then immediately continue to Step 6.
Launch all confirmed agents using the Task tool in a single message so they run concurrently. Pass each agent the list of changed files and the relevant diff context so they know what to review.
Before presenting findings, review all agent outputs together to ensure coherence:
tooling-conflict vs. simplifier: Keep the standards-reviewer's finding (it cites the specific tool configuration).Compare current findings against previous review history:
Contradictions with applied fixes: If a previous finding with status applied is now contradicted (e.g., "add X" was applied, now an agent says "remove X"):
Previously dismissed: If a finding matches one with status dismissed, skip it — the user already said no.
Still pending: If a finding from the previous review is still relevant (same file/lines, issue still exists), mark as "Still outstanding from previous review".
Resolved: If a previous pending finding no longer applies (code was changed/removed), it will naturally not appear.
Assign each new finding a unique ID (e.g., f1, f2, ...) and classify its action type:
add — suggesting new code be addedremove — suggesting code be deletedchange — suggesting code be modifiedflag — pointing out an issue without specific fixOnce consolidation is complete, present a single report. On pass 2+, prefix the report with "Pass N" so the user knows which iteration they're on. Present in this order:
### ⚠️ Contradicts previous review
| ID | File | Previously | Now | Decision needed |
|----|------|-----------|-----|-----------------|
| f3 | src/Api/Client.php:60-65 | Added null check (applied) | Remove null check | Which to keep? |
### Outstanding from previous review
| ID | File | Issue | Status |
|----|------|-------|--------|
| f1 | src/Api/Client.php:45-52 | Remove unused $config | pending |
### New findings
| ID | File | Issue | Agents | Action |
|----|------|-------|--------|--------|
| f4 | src/Http/Controller.php:23 | Missing return type | code-reviewer | add |
| f5 | src/Models/User.php:45-50 | Simplify conditional | laravel-simplifier, code-simplifier | change |
### ⚠️ Conflicting advice (this review)
| File | Agent A says | Agent B says |
|------|--------------|--------------|
| src/Example.php:10 | Add validation | Remove validation (redundant) |
List each agent that ran and how many issues it found (including "0 issues" for agents that found nothing).
After presenting the report, use the AskUserQuestion tool to prompt the user:
The tool automatically adds an "Other" option — use that for specific ID inputs like "fix f1, f4" or "dismiss f2".
Then handle the response per the decision table below. Track their decisions:
applied.applied.dismissed.Do NOT apply fixes that contradict each other — resolve conflicts first.
After applying fixes, immediately save review history to disk (same format as Step 10). Include a pass field and a fixed_files array listing the files modified in this pass. This ensures progress survives context compaction.
If any fixes were applied and the current pass is less than 3, loop back to Step 3 for a scoped re-review of only the files just modified.
If no fixes were applied (all findings dismissed or only flags), or the user said "done"/"stop", or this is pass 3, exit the cycle and proceed to Step 10. On the final pass, if findings remain, note them in the report so the user is aware.
After the review cycle completes (clean, user stopped, or 3 passes done), save the consolidated history from all passes to .claude/review-history.json:
{
"branch": "<current branch>",
"reviewed_at": "<ISO timestamp>",
"head_commit": "<HEAD commit hash>",
"findings": [
{
"id": "f1",
"file": "src/Example.php",
"lines": "45-52",
"agents": ["agent-name"],
"action": "remove|add|change|flag",
"summary": "Brief description of the issue",
"status": "pending|applied|dismissed"
}
]
}
Only save findings from the current review session. Previous history is replaced, not appended — we only track the most recent review per branch.
Create the .claude/ directory if it doesn't exist. Ensure .claude/review-history.json is in .gitignore if the user doesn't want it committed (ask on first save if .gitignore exists but doesn't include it).
After the review cycle is complete and history is saved, run the built-in /simplify skill as a final polish pass. This covers code reuse, quality, and efficiency checks that the review cycle's remaining agents do not.
Use the Skill tool to invoke simplify. It will review the changed code and fix any reuse, quality, or efficiency issues it finds.
Skip this step if the user said "done"/"stop" during Step 9 — they want to exit, not run more checks.
When invoked with /review loop (or when called from the review-loop script), behavior changes as follows:
| Step | Interactive | Loop |
|---|---|---|
| Step 8 (Report) | Full formatted report | Brief summary only |
| Step 9 (Await) | Wait for user input | Auto-decide and fix immediately |
| Exit | Continue conversation | Create state file and exit |
After consolidation (Step 7), proceed automatically:
.review-clean with message "No issues found" and exit immediately..review-stuck with conflict details and exit.Apply fixes automatically using these rules:
dismissed in previous history.If a fix fails 3 times on the same issue, create .review-stuck with the issue details and error, then exit.
Save review history as normal (Step 10), marking fixed items as applied.
Use the Skill tool to invoke simplify. It will review and fix reuse, quality, and efficiency issues. Any files it modifies should be added to the fixed_files list for the next iteration's scoped re-review.
Create .review-continue containing a brief summary of what was fixed:
Fixed 3 issues:
- f1: Removed unused variable (src/Example.php:45)
- f2: Added return type (src/Controller.php:23)
- f3: Simplified conditional (src/User.php:50)
Then exit. The calling script will run another iteration.
The loop mode communicates with the calling script via state files in the repo root:
| File | Meaning | Script action |
|---|---|---|
.review-clean | No issues found | Exit successfully |
.review-stuck | Can't proceed (conflicts or repeated failures) | Exit with error |
.review-continue | Fixes applied, may need another pass | Run next iteration |
These files are temporary and deleted by the script after reading.
Located at ~/.local/bin/review-loop. Usage:
review-loop [-f|--force] [iterations]
-f, --force: Allow running on main/master (passed through to /review loop --force)iterations: Maximum review cycles (default: 5)/review loop repeatedly until clean, stuck, or max iterationsnpx claudepluginhub cjmellor/mella-marketplace --plugin mellaReviews local changes, PRs/MRs, or branch diffs against project coding guidelines using 5-7 parallel review agents (bug detection, security/logic, guideline compliance, code simplification, test coverage, contract quality). High-signal findings only.
Reviews code changes using parallel personas for correctness, testing, maintainability, and conditional areas like security, performance, APIs. Merges into P0-P3 severity reports for PR prep and iterative feedback.
Performs multi-agent code review of current git branch against main: detects bugs via specialist agents, verifies findings, ranks severity, generates persistent report before push/merge.