From supergraph
Proactive architecture review that explores codebase structure, generates self-contained HTML reports with Mermaid diagrams and candidate improvements, then grills findings. Use when planning large refactors, onboarding to unfamiliar codebases, or before major architectural changes.
How this skill is triggered — by the user, by Claude, or both
Slash command
/supergraph:architectureThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Three phases: explore → HTML report → grilling loop.
Three phases: explore → HTML report → grilling loop.
Announce: "🏛️ /supergraph:architecture — mapping codebase structure..."
1a. Read CONTEXT.md:
cat CONTEXT.md 2>/dev/null || echo "No CONTEXT.md"
1b. Graph overview (optional — skip gracefully if MCP unavailable):
mcp__code-review-graph__get_architecture_overview_tool()
mcp__code-review-graph__get_hub_nodes_tool()
mcp__code-review-graph__get_bridge_nodes_tool()
mcp__code-review-graph__list_communities_tool()
mcp__code-review-graph__get_surprising_connections_tool()
mcp__code-review-graph__get_knowledge_gaps_tool()
If graph MCP unavailable → log "Graph MCP unavailable, using filesystem exploration only" and proceed with 1c/1d. Generate Mermaid diagrams from directory/import structure instead of graph data.
1c. Serena structure (optional):
mcp__serena__get_symbols_overview()
1d. Read 3-5 hub node files — understand actual structure, naming, patterns.
Write a self-contained HTML file to docs/supergraph/architecture-review-<YYYY-MM-DD>.html.
Structure:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Architecture Review — [Project] — [Date]</title>
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js"></script>
</head>
<body class="bg-gray-50 p-8 font-sans">
<!-- Header -->
<h1>Architecture Review: [Project]</h1>
<p>[Date] | [N communities] | [N hub nodes] | [N bridge nodes]</p>
<!-- Current Architecture Diagram -->
<h2>Current Architecture</h2>
<div class="mermaid">
graph TD
[community nodes and edges from graph data]
</div>
<!-- Candidate Improvements -->
<!-- One card per candidate -->
<div class="candidate-card">
<h3>[Candidate N]: [Short name]</h3>
<span class="badge">[Strong / Worth exploring / Speculative]</span>
<p><strong>Problem:</strong> [what's wrong now]</p>
<p><strong>Proposal:</strong> [what to change]</p>
<h4>Before</h4>
<div class="mermaid">graph TD; [before state]</div>
<h4>After</h4>
<div class="mermaid">graph TD; [after state]</div>
<p><strong>Impact:</strong> [blast radius, effort, risk]</p>
<p><strong>Trade-offs:</strong> [pros / cons]</p>
</div>
<!-- Knowledge Gaps -->
<h2>Test Coverage Gaps</h2>
[table of untested hotspot files]
<!-- Surprising Connections -->
<h2>Unexpected Coupling</h2>
[list of surprise connections with scores]
</body>
</html>
Recommendation strength badges:
Strong — clear problem, low risk, high ROIWorth exploring — plausible improvement, some uncertaintySpeculative — possible but needs investigationOpen report automatically:
open docs/supergraph/architecture-review-<date>.html \
|| xdg-open docs/supergraph/architecture-review-<date>.html \
|| echo "Report saved: docs/supergraph/architecture-review-<date>.html"
For each Strong candidate, ask one focused question:
"Candidate N proposes [X]. Is this consistent with [constraint from CONTEXT.md / known business rule]?"
Incorporate answers to refine the candidate cards. Mark dismissed candidates as Rejected — [reason].
After grilling, present final prioritized list:
Strong candidates (ready for /supergraph:plan):
1. [Name] — [one-line rationale]
Worth exploring (needs spike first):
2. [Name] — [open question to resolve]
Speculative (park for later):
3. [Name] — [what would need to be true]
✅ /supergraph:architecture complete
- Report: docs/supergraph/architecture-review-<date>.html
- Communities: N | Hub nodes: N | Bridge nodes: N
- Candidates: N Strong, N Worth exploring, N Speculative
- Next: /supergraph:plan (for Strong candidates) or /supergraph:prototype (for uncertain ones)
printf '\n## <invariant>\n[description]\n' >> CONTEXT.md
npx claudepluginhub datit309/supergraph --plugin supergraphScans a codebase for architectural friction, presents candidates as a visual HTML report with before/after diagrams, and guides you through deepening refactors.
Maps codebase architecture, layers, dependencies, and tech debt hotspots then generates a visual HTML report with a Mermaid diagram and opens it for review.
Scans a codebase for architectural deepening opportunities, generates an interactive HTML report, and guides developers through ranked refactoring candidates.