with one click
architecture-audit
// Audits codebase for architectural friction, shallow modules; proposes RFCs. Triggers: improve architecture, shallow modules, deepen modules, reduce coupling.
// Audits codebase for architectural friction, shallow modules; proposes RFCs. Triggers: improve architecture, shallow modules, deepen modules, reduce coupling.
[HINT] Download the complete skill directory including SKILL.md and all related files
| name | architecture-audit |
| description | Audits codebase for architectural friction, shallow modules; proposes RFCs. Triggers: improve architecture, shallow modules, deepen modules, reduce coupling. |
| user-invocable | true |
| effort | high |
| argument-hint | [area to audit or 'full codebase'] |
| allowed-tools | Read, Grep, Glob, Bash, Agent |
$ARGUMENTS
Explore a codebase organically, surface architectural friction, and propose module-deepening refactors as GitHub issue RFCs.
/architecture-audit [area to audit or 'full codebase']
A deep module (Ousterhout) has a small interface hiding a large implementation. Deep modules enhance testability, AI navigation, and enable boundary testing.
A shallow module has a large interface with thin implementation — avoid.
Use Agent (subagent_type=Explore) to navigate the codebase naturally. Note friction:
Numbered list. For each candidate show:
| Field | Content |
|---|---|
| Cluster | Which modules/concepts are involved |
| Why coupled | Shared types, call patterns, co-ownership |
| Dependency category | In-process, Local-substitutable, Ports & Adapters, or True external (see reference/) |
| Test impact | What existing tests would be replaced by boundary tests |
Do NOT propose interfaces yet. Ask: "Which would you like to explore?"
For the chosen candidate, write a user-facing explanation:
Show to user, then immediately proceed to step 4.
Spawn 3+ sub-agents in parallel via Agent tool. Each gets a different constraint:
| Agent | Constraint |
|---|---|
| Agent 1 | Minimize interface — 1-3 entry points max |
| Agent 2 | Maximize flexibility — many use cases and extension |
| Agent 3 | Optimize for most common caller — default case trivial |
| Agent 4 | Ports & adapters pattern (if cross-boundary) |
Each outputs: interface signature, usage example, what it hides, dependency strategy, trade-offs.
Present sequentially, compare in prose, give opinionated recommendation.
Use gh issue create with template below. Don't ask for review.
Architectural friction:
Durable guidance NOT coupled to file paths:
| Category | Description | Deepenable? |
|---|---|---|
| In-process | Pure computation, no I/O | Always |
| Local-substitutable | Has local test stand-ins (PGLite, in-memory FS) | If stand-in exists |
| Remote but owned | Your services across network (Ports & Adapters) | Via port injection |
| True external | Third-party (Stripe, Twilio) — mock at boundary | Via mock injection |
Replace, don't layer. Old unit tests on shallow modules are waste once boundary tests exist — delete them. Tests assert on observable outcomes through public interface, not internal state.
gh issue create. Never open a PR from this skill.gh issue create without --body or --body-file opens $EDITOR. In automated flows this hangs the skill indefinitely. Always pass the body explicitly./refactor (direct edits) or /refactor-plan (incremental)/design-an-interface/architecture-decision/analyze/explore