From supergraph
Performs graph-enhanced code review with plan awareness, blocking merge on critical issues. Uses code graph analysis and optional Serena intelligence for impact detection.
How this skill is triggered — by the user, by Claude, or both
Slash command
/supergraph:reviewThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Final gate before merge. Graph-enhanced review with plan awareness.
Final gate before merge. Graph-enhanced review with plan awareness.
/supergraph:fix completed (tests pass, lint clean)/supergraph:review | plan auth-login | plan auth-login task 2
"🔍 /supergraph:review — starting graph-enhanced code review..."
0 plans → skip | 1 → use | >1 → ask | plan <slug> → match.
Parse tasks, scope to task N if provided.
BASE_SHA=$(git rev-parse origin/master || git rev-parse origin/main || git rev-parse HEAD~1)
HEAD_SHA=$(git rev-parse HEAD)
git diff --stat "$BASE_SHA..$HEAD_SHA" && git diff --name-only "$BASE_SHA..$HEAD_SHA"
Use plan checkpoint commits as range if available. No changed files → check plan for incomplete tasks.
mcp__code-review-graph__detect_changes_tool()
mcp__code-review-graph__get_impact_radius_tool(files=[changed], depth=3)
mcp__code-review-graph__get_surprising_connections_tool()
mcp__code-review-graph__get_affected_flows_tool(files=[changed])
mcp__code-review-graph__get_knowledge_gaps_tool()
Per file: query_graph(query_type="tests", target=file).
3b. Serena code intelligence (optional):
If /supergraph:scan was not run this session, call mcp__serena__initial_instructions() first.
For each changed symbol/function:
mcp__serena__find_referencing_symbols(symbol=<changed_symbol>)
mcp__serena__find_implementations(symbol=<changed_symbol>)
For each changed file:
mcp__serena__get_diagnostics_for_file(file=<changed_file>)
Pass results to code-reviewer agent prompt under "Serena findings: [callers, implementations, diagnostics]". Skip gracefully if Serena unavailable — log "Serena unavailable, skipping code intelligence".
Stage 1 — Spec Compliance: Verify implementation matches plan requirements. Stage 2 — Code Quality: Verify code is clean, tested, maintainable.
Never start code quality review before spec compliance is verified.
Agent(
subagent_type="supergraph:code-reviewer",
description="Independent review: [plan-name or scope]",
prompt="Review BASE_SHA..HEAD_SHA. First verify spec compliance, then code quality.
BASE_SHA: [base] | HEAD_SHA: [head]
Changes:
[git diff --stat + git diff output]
Graph context:
- Hub/Bridge affected: [list/none]
- Surprise connections: [list/none]
- Affected flows: [list/none]
- Knowledge gaps: [list/none]
Serena findings (if available):
- find_referencing_symbols: [callers per changed symbol]
- get_diagnostics_for_file: [diagnostics per changed file]
Plan requirements: [task sections or none]
Focus: plan alignment, bugs, security, architecture, tests, graph risks, Serena diagnostics (if provided).
Output: strengths, Critical, Important, Minor, verdict (YES|WITH_FIXES|NO)"
)
Run $TEST_CMD and $LINT_CMD. Failures → add to Critical.
| Severity | Sources | Action |
|---|---|---|
| Critical | Reviewer Critical, tests/lint fail, circular deps, broken hub API, surprise>0.7, in_progress tasks | Block merge |
| Important | Reviewer Important, surprise 0.5-0.7, missing hotspot tests, bridge node without validation, stuck tasks | Fix unless risk accepted |
| Minor | Reviewer Minor, clean graph, good coverage | Note only |
| Gate | Check |
|---|---|
| Blast radius | All affected files handled? Unexpected files? |
| Hub safety | Callers tested? API backward-compatible? Breaking changes documented? |
| Bridge nodes | Cross-community impact assessed? |
| Surprise | >0.7: investigate coupling. 0.5-0.7: document or refactor. <0.5: ok |
| Knowledge gaps | Untested hotspots changed? Add tests or accept risk |
| TDD | RED/GREEN evidence per behavior? Regression tests for bugs? Tests assert behavior not internals? |
Critical → fix immediately, no exceptions. Important → fix unless user accepts risk. Push back with evidence, not opinion. Minor → note, optional.
When human gives review feedback:
## Review Report
- Verdict: PASS | NEEDS_CHANGES | BLOCKED
- Changed: N files | Blast radius: M
- Hub/Bridge: [list/none] | Surprise: [list/none]
- Tests: PASS|FAIL | Lint: PASS|FAIL
- Critical: N | Important: N | Minor: N
- Reasoning: [summary]
Verdict rules:
PASS → 0 Critical, reviewer YESNEEDS_CHANGES → 0 Critical, >0 Important or reviewer WITH_FIXESBLOCKED → >0 Critical or reviewer NOPASS + all tasks reviewed → mark Status: completed, add review log.
BLOCKED → mark affected tasks stuck, append blocker list.
If review revealed undocumented domain rules, invariants, or terminology:
printf '\n## <term or invariant>\n[what was discovered]\n' >> CONTEXT.md
Examples: hidden ordering constraints, shared state assumptions, boundary rules between modules.
Serena memory (optional — for non-PASS verdicts): On BLOCKED or NEEDS_CHANGES, persist findings for the next fix cycle:
mcp__serena__write_memory(
title="<plan-slug>-review-verdict",
content="Verdict: [BLOCKED|NEEDS_CHANGES]. Critical: [...]. Callers affected: [...]. Diagnostics: [...]"
)
Skip if Serena unavailable or verdict is PASS.
PASS → ready to merge.
NEEDS_CHANGES → /supergraph:fix, then re-review. Max 2 cycles, then escalate.
BLOCKED → escalate immediately, no auto-fix.
npx claudepluginhub datit309/supergraph --plugin supergraphReviews code, plans, and scope from multiple angles before acceptance, with security and quality checks. Auto-detects review targets or prompts for clarification.
Performs structured code reviews on git branches or PRs using tiered persona agents, confidence-gated findings, and a merge/dedup pipeline. Use before creating PRs or for feedback on changes.
Performs code reviews using Codex MCP with severity-grouped findings and a merge gate. Supports fast (diff-only), full (diff + lint/build), and branch review variants.