From specbeads
Reviews code for design issues that static analysis misses. Checks single responsibility, abstraction levels, testability, and meaningful naming. Use when asked to review code, find design problems, or improve code quality.
How this skill is triggered — by the user, by Claude, or both
Slash command
/specbeads:review-codeThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Review code for design and architecture issues that linters and static analysis tools miss.
Review code for design and architecture issues that linters and static analysis tools miss.
[!IMPORTANT] Consult REFERENCE.md for the expected output format and level of detail.
$ARGUMENTS
You MUST consider the user input before proceeding (if not empty).
Parse $ARGUMENTS for:
--create-beads: Create beads for findings (default: report only)This review assumes standard tooling is already running:
If these aren't set up, recommend adding them before this review.
Find all source files in the specified path, excluding test files, vendored/generated code, and files that are purely configuration. Record the full file list and count.
Use this mode when 3 or more source files are discovered.
Group files into batches based on total file count:
| Total files | Files per batch | ~Subagents |
|---|---|---|
| 3–10 | 1 | 3–10 |
| 11–20 | 2 | 6–10 |
| 21+ | 3 | 7–10 |
For each batch, use Agent(subagent_type="general-purpose"). Spawn all subagents in a single message so they run in parallel.
Each subagent prompt MUST include:
bd commands. Return findings only."explanation field: 'a caller/maintainer would likely <specific mistake> because of this.' Omit P3 findings that lack this claim."pattern field, use a short, reusable label that names the underlying anti-pattern (e.g., 'module-scope side effects', 'mixed abstraction in handlers'). If two findings in your batch stem from the same root cause, they MUST use the same pattern label."Instruct each subagent to return findings in this exact delimited format (one block per finding):
---FINDING---
priority: P<1|2|3>
location: <file:line>
title: <short title>
category: <Single Responsibility|Abstraction Levels|Meaningful Naming|Testability|API Design|Error Handling Strategy>
pattern: <short label for the underlying anti-pattern, e.g. "module-scope side effects" or "mixed abstraction in handlers" — use the SAME label across findings that share the same root cause>
explanation: <what is wrong and why it matters>
fix: <concrete prescription>
done_when: <verifiable criterion>
---END---
If the subagent finds no issues for its batch, it should return ---NO-FINDINGS---.
After all subagents return:
location (file:line) AND the same category, keep only the one with the highest prioritypattern label — findings from different subagents that used the same (or very similar) pattern label share a root cause and will be collapsed in the Pattern Collapsing stepIf a subagent fails or returns unparseable output, review those files directly (as in direct mode) and include a note in the report: Note: Files [list] were reviewed directly due to subagent failure.
Both direct mode and parallel mode flow into this step before bead creation.
After merging all findings, look for findings that share the same root cause — i.e., the same design pattern repeated across multiple files. Examples:
When you identify a shared root cause:
This is critical: N beads for N instances of the same pattern creates noise. One bead that names the pattern and lists the affected locations is actionable.
Before creating a bead, check if one already exists:
bd list --status=open to see all open issuesbd list --status=closed to see previously resolved issuesbd show <id> on relevant closed beads and verify the fix actually resolved the issue in the current code. Only suppress if the fix is complete — if the problem still exists (in the same or different locations), create a new bead for the remaining instances. The goal is to prevent flip-flopping on intentional resolutions, not to give closed beads permanent immunity.Flag when a unit has multiple unrelated reasons to change:
Ask: "If requirement X changes, does this code change? What about unrelated requirement Y?"
Flag when a function mixes high-level intent with low-level details:
Good: each function operates at one level, delegating details to helpers.
Linters enforce patterns; this checks meaning:
processData actually explain what processing occurs?handleRequest distinguish itself from other handlers?userService, userManager, userHelper) have clear distinct roles?Flag: names that pass linter rules but don't reveal intent.
Flag architectural decisions that make testing hard:
Ask: "Can I test this unit in isolation with fake dependencies?"
Flag interface issues:
Linters catch empty catches; this checks appropriateness:
vi.mock() or monkey.Patch is not P1 — that's testable, just inconvenient. P1 means "there is no way to isolate this code for testing" or "this design is a security vulnerability."You MUST produce a report following the exact structure shown in REFERENCE.md. When using parallel mode, the lead assembles the unified report from subagent findings. The report format is identical regardless of execution mode.
--create-beads mode: Create beads for P1/P2 issues.
Each bead description MUST be structured in three parts:
<file:line>
<Explanation of the problem: what is wrong and why it matters.>
Fix: <Concrete prescription of the fix. For API design issues, specify the exact
shape — parameter names, types, signatures — not just the general approach.
Example: "Change `Skill(dir string, prefix ...string)` to `Skill(dir, prefix string)`
where empty string means no prefix" rather than "remove the variadic.">
Done when: <A verifiable completion criterion that can be checked by reading the diff.
Must reference specific functions, files, or observable behaviours.
Example: "Both parseSkillFrontmatter and parseAgentFrontmatter delegate to a shared
parseFrontmatterRaw; no duplicated delimiter-scanning code remains in either function."
NOT: "The duplication is removed.">
bd create --type=bug --priority=<1-3> --title="Code: <specific issue>" \
--description="<file:line>
<explanation>
Fix: <concrete prescription>
Done when: <verifiable criterion>"
npx claudepluginhub lumberbarons/lumber-mart --plugin specbeadsEvaluates code complexity, readability, design principles, error handling, and testability. Designed for use by review orchestrators to assess maintainability.
Reviews code for bugs, security issues, bad patterns, and untested code. Delegates fixes, tests, and security scans to specialized skills.
Reviews code for quality issues: architecture conformance, anti-patterns, performance, maintainability. Read-only analysis, never modifies code.