/nlsmdn:review-cleancode [--staged | --unpushed | --changed | --all | --multi]from nlsmdn
Review code for clean-code principles — SOLID, DRY, YAGNI, KISS, code smells. Triggers "review clean code", "check DRY/SOLID", "code smells".
Ships in nlsmdn. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Language-agnostic clean code review covering SOLID, DRY, YAGNI, KISS, design principles, and code smells.
Use only these finding priorities, in descending order:
Grade the demonstrated consequence, realistic reachability, and available recovery against project priorities. A category, missing convention, hypothetical future problem, or confidence that a claim is true does not set its priority. Do not assign automatic severity floors or ceilings. Keep unverified claims in validation gaps, outside the graded finding count; distinguish suggestions from defects. For plans, trace the consequence if implemented and state the assumptions.
Use the short labels Must Fix, Should Fix, and Nice to Have in summaries and ledgers.
Keep effort, verification status, user-facing change size, and tool/vendor diagnostic ratings
separate. When called by code-review, return its requested evidence and impact fields; the parent
owns scoring and final triage. Otherwise apply this rubric directly. Omit empty priority sections.
/review-cleancode # Review context-related code
/review-cleancode --staged # Review staged changes
/review-cleancode --unpushed # Review files changed across all unpushed commits
/review-cleancode --changed # Review unstaged changes
/review-cleancode --all # Full codebase audit (parallel agents)
/review-cleancode --multi # Also get external advisor opinions
| Flag | Scope | Method |
|---|---|---|
| (none) | Context-related code | Files from the current conversation context. If no context, ask the user to specify files or use --staged/--changed/--all. |
--staged | Staged changes | git diff --cached --name-only |
--unpushed | Files changed across unpushed commits | git diff --name-only $(git rev-list HEAD --not --remotes | tail -1)^..HEAD |
--changed | Unstaged changes | git diff --name-only |
--all | Full codebase | Glob source files, parallel agents |
--multi | Add external opinions | Combines with any scope above; invokes second-opinion --quick |
--unpushed derives its range from git rev-list HEAD --not --remotes (oldest unpushed commit's parent → HEAD). If nothing is unpushed, or there is no remote/upstream (or the range walks back to the root commit) so it can't be determined reliably, stop and ask the user to pick another scope.
Like --staged, it reviews full file content, not just the diff.
--all scope. Staged reviews only catch duplication within the diff.Determine scope based on flags (see Scope table above)
Read CLAUDE.md in the repository root to understand project-specific conventions
Review each file against all 5 categories in the Clean Code Checklist below
Parallelize if scope has >5 files: spawn one sub-agent per category, each scanning all files for that category. Merge results and deduplicate.
Dispatch workers that return findings without editing files. Disable delegation tools where supported; read-only access alone does not prevent delegation. Any coordinating role needs explicit subtasks, a descendant limit, and a stopping condition in its brief.
External opinions (if --multi): invoke second-opinion --quick, which queries every advisor it has configured, in parallel (the roster lives in the second-opinion skill), with this prompt:
Read-only clean code review. Review the code in this repository (use `git diff --cached` for `--staged`, `git diff` for `--changed`, or read the relevant files). Evaluate against clean code principles: SOLID, DRY, YAGNI, KISS, Law of Demeter, code smells (god classes, long methods, feature envy, primitive obsession, shotgun surgery). Provide a focused review in 300 words or less.
Wait for all external results before proceeding to step 6.
<input type="date"> over a date-picker lib, CSS over JS, a DB constraint over app code), or (4) an already-installed dependency? Hand-rolling what one of these already ships is the most common avoidable bloat; a new dependency added for what a few lines or a present dep covers is its inverse. When flagging, name the specific replacement, not just "this is complex."review-correctness.a.getB().getC().getValue()?data, info, process)For annotated BAD/GOOD code examples for each category, see references/cleancode-checklist.md.
## Clean Code Review: {scope}
### Critical Issues (Must Fix)
- {file}:{line} - {category}: {description}
**Impact:** {why it matters}
**Fix:** {solution with code example}
### Improvements (Should Fix)
- {file}:{line} - {category}: {description}
**Fix:** {solution}
### Suggestions (Nice to Have)
- {file} - {category}: {description}
**Net:** ~{N} lines removable across the findings above (omit if nothing is cuttable).
If --multi was used, append:
### External Opinions
Add one subsection per advisor that responded, titled with the advisor's name as reported by `second-opinion`:
#### {advisor name}
{that advisor's review}
#### Cross-Model Agreement
{areas where the external advisors agree/disagree with the Claude review — consensus issues (flagged by multiple models) get higher confidence}
Staged changes with DRY violation:
/review-cleancode --staged
Reviews staged files and catches the same email validation logic duplicated in createUser and updateUser. Reports Nice to Have if this is only local duplication; Should Fix requires evidence that the copies drift or create meaningful maintenance cost. Suggests a shared validateEmail function.
Full codebase audit finds god class:
/review-cleancode --all
Parallel agents scan by category. Finds AppService handling auth, payments, notifications, and reporting — four distinct responsibilities. Reports Should Fix if the mixed responsibilities cause meaningful change coupling, with a split plan. The number of responsibilities alone does not establish a finding.
Get external opinions on clean code quality:
/review-cleancode --multi --staged
Runs the 5-category review plus the external advisors. Cross-model agreement highlights a SOLID violation multiple reviewers independently flagged.
Solution: Check whether the code is a library or framework consumed by external callers. Flexibility is expected in public APIs. Add context in a code comment (e.g., // Public API: consumers use these options) and re-run.
Solution: Use --all scope. The default, --staged, and --changed scopes only see a subset of the codebase, so cross-file duplication requires the full scan.
Solution: The ~300 line / ~20 line guidelines are heuristics, not rules. A 25-line method that does one clear thing is fine. The real signal: can you describe what it does in one sentence without "and"?
--all, use parallel agents per category (5 agents)What SKILL.md sets; muted values are Claude Code's defaults
highOther plugins' skills for the same job
65 skills in this plugin
/blind-spotsSurface consequential decisions a plan, design, or research brief left silently assumed, by interviewing the user in dependency order. Use when the user says "blind spots", "grill me", "stress-test this plan", "poke holes in this", "what am I missing", "interrogate this design", "what haven't I decided", or needs a loose idea or research brief clarified before work begins. Do NOT use for a clear factual lookup, to explain a previous reply in more detail (use `huh`), to generate ideas when it is unclear what to build (use `ideation`), or to review an already-written plan with agents (use `review-plan`)./brainstormWork out how to solve a problem the user can already name — interview them with `blind-spots` to understand it, generate structurally different approaches, validate each with an independent critic, then present the survivors with trade-offs and a recommendation. Use when the user says "brainstorm", "brainstorm approaches", "how should we solve/approach/tackle X", "what are our options", "compare approaches", "think this through with me", or wants solutions weighed before committing. Works on any topic, with codebase recon when a repo is involved; `--debate` adds external advisors for high-stakes calls. Do NOT use when stuck on what to build or what the problem is (use `ideation`), to probe an already-chosen plan (use `blind-spots`), or to pick a library or service (use `evaluate-tech`).npx claudepluginhub nielsmadan/skills --plugin nlsmdn