Help us improve
Share bugs, ideas, or general feedback.
From claude-agent-dev
Mandatory quality gate before delivery. Trigger on 'code review', 'review this diff', 'any issues with this', 'check for bugs', 'quality review', 'ready to merge'. ALSO trigger automatically: (1) after verification-before-completion confirms tests pass, (2) before opening a PR/shipping the change, (3) on any non-trivial change that will be committed. Do not skip — correctness bugs and security issues discovered here are cheaper to fix than after merge.
npx claudepluginhub j0hanz/claude-agent-dev-pluginHow this skill is triggered — by the user, by Claude, or both
Slash command
/claude-agent-dev:code-review [target: branch, commit, file, or "current diff"][target: branch, commit, file, or "current diff"]This skill is limited to the following tools:
These tools are removed from Claude's available pool while this skill is active:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Code review is not verification (does it work?) and not architecture (is it well-designed?). It is a focused scan for **correctness bugs, security risks, missed reuse, and API hygiene** that survived testing. Catching these in the diff is 10× cheaper than after merge.
Provides behavioral guidelines to reduce common LLM coding mistakes, focusing on simplicity, surgical changes, assumption surfacing, and verifiable success criteria.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Guides systematic root-cause debugging when tests fail, builds break, or unexpected errors occur. Provides a structured triage checklist to preserve evidence, localize, and fix issues instead of guessing.
Share bugs, ideas, or general feedback.
Code review is not verification (does it work?) and not architecture (is it well-designed?). It is a focused scan for correctness bugs, security risks, missed reuse, and API hygiene that survived testing. Catching these in the diff is 10× cheaper than after merge.
Integration Check: Before proceeding, verify that associated unit tests have passed. If you are unsure, ask the user to confirm that tests passed in the current session or run them using verification-before-completion. Do not perform a review if the code hasn't been verified.
In scope — hunt for these:
Out of scope — route elsewhere:
architecture skillverification-before-completionrefactor skillGet the exact diff that is being reviewed. Use the argument if provided; otherwise default to comparing against the main branch.
git diff origin/main..HEAD # full branch diff (most common)
git diff HEAD~1 # last commit only
git diff <commit-sha> # specific commit
git show <commit-sha> # show single commit with context
git diff --stat origin/main..HEAD # summary of what changed (run first)
Run --stat first to understand the shape of the change before reading the full diff.
If no git history is available: ask the user for the diff using this format:
File: <path/to/file>
Before:
<paste before-code block>
After:
<paste after-code block>
Note explicitly that you are reviewing without the before/after context and your confidence is lower.
Plugin-specific: For agent-dev plugin files, validate frontmatter in addition to logic — see Phase 2 section.
Scan in this order. Higher tiers surface issues earlier. Do not skip to lower tiers until you have cleared the ones above.
| Pattern | Check |
|---|---|
| Shell / exec call | Are arguments shell-escaped? Is shell interpolation needed at all? |
| New SQL / query construction | Are all values parameterized — no string concatenation? |
| Auth / permission check | Is the check before the action, not after? |
| Secrets / credentials | Are any tokens, keys, or passwords hardcoded or logged? |
| Deserialization (JSON.parse, pickle, yaml.load) | Is input validated before deserializing? |
| File path construction | Is user input sanitized against path traversal? |
Any Tier 1 finding is a blocking issue — stop and flag immediately.
| Pattern | Check |
|---|---|
| Empty catch / swallowed error | Is the error logged or re-raised with context? |
| Off-by-one in loops / slices | Check boundary conditions: < n vs <= n, [i:] vs [i+1:] |
| Null / undefined access | Is the value checked before use? |
| State mutation in unexpected places | Does the function mutate its input? Is that documented? |
| Async / await gaps | Are all async calls awaited? Is error handling on the awaited value? |
| Boolean logic | De Morgan's law: !(A && B) ≠ !A && !B; verify complex conditions |
Check only for regressions (new problems introduced by this diff), not pre-existing inefficiency.
Missed reuse: Grep the codebase for the function's purpose before declaring it new.
# Example: looking for existing date formatting utilities
git grep -n "formatDate\|format_date\|dateToString" --
API hygiene (public interface changes only):
When the diff touches agent-dev plugin files, run these additional checks:
Skills (skills/*/SKILL.md):
name: kebab-case, max 64 chars, no spacesdescription: no angle brackets, max 1024 chars, ends with a triggering phrasedisable-model-invocation: true skills must not be in another skill's skills: preload listAgents (agents/*.md):
color: must be a named color — red blue green yellow purple orange pink cyantype: agent presentname matches filename (minus .md)Hooks (hooks/hooks.json):
SessionStart, PreToolUse, PostToolUse, PostToolUseFailure, UserPromptSubmit, Stop${CLAUDE_PLUGIN_ROOT} not hardcoded paths_comment key documenting intentCommands (commands/*.md):
description, argument-hint, allowed-toolsname: field (name is derived from filename)Always conclude with this exact structure. Do not omit it even when there are no findings.
## Code Review Result
**Status**: PASS ✓ | FAIL ✗ ([N] blocking)
### Blocking Issues
<!-- One per bullet. Empty if none. -->
- [file:line] [Issue type] — [what the problem is] → [what to fix]
### Advisory Issues
<!-- One per bullet. Empty if none. -->
- [file:line] [Issue type] — [observation] → [suggested improvement]
### What Was Checked
<!-- Provide a concise summary of checks performed per tier. -->
- Tier 1 (Security): [summary]
- Tier 2 (Correctness): [summary]
- Tier 3 (Performance): [summary]
- Tier 4 (Reuse/API): [summary]
- Plugin checks: [if applicable]
Status definitions:
PASS — zero blocking issues; advisory issues may exist but do not stop deliveryFAIL — one or more blocking issues; delivery must not proceed until all are resolved| Category | Blocking | Advisory |
|---|---|---|
| Security vulnerabilities | Always | — |
| Data loss / corruption bug | Always | — |
| Crash in a code path reachable by input | Always | — |
| Breaking API change without migration | Always | — |
| Swallowed error hiding a real failure | Usually | If debug-only path |
| Missed reuse of an existing utility | Rarely | Normally |
| Confusing name on internal helper | Never | Yes |
| Performance concern (non-regression) | Never | Yes |
When in doubt, lean advisory — the goal is to unblock delivery, not to gatekeep.
After Phase 3:
Do not merge or submit the pull request until code review returns PASS with zero blocking issues.
Do NOT load these by default. Load only when needed:
references/patterns.md when a finding needs a precise name, canonical anti-pattern description, or example fix.