agentleFS
helderbertohelderberto/agent-skills/skills/architecture-audit/SKILL.md

architecture-audit

Skill19 starsChanged 32 days agoMITView on GitHub

Surface architectural friction across a codebase and propose deep-module refactors as RFCs.

16 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

3 rules. 0 are common, 2 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 11 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use a read-only explore subagent to navigate the codebase organically.

    line 21
  2. Very specific:

    Do NOT propose interfaces yet.

    line 44
  3. Distinctive:

    Don't introduce a new seam unless something actually varies across it (one adapter = hypothetical, two = real)

    line 59

“Common” is measured: kept by at least 6 in 10 of the 11 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Architecture Audit

Audit a codebase for architectural friction and propose refactors toward deep modules (simple interface, large implementation). Deep modules are more testable, more AI-navigable, and let you test at the seam instead of inside.

Uses the deep-module vocabulary and principles — call the Skill tool with codebase-design for the canonical glossary (module, interface, depth, seam, adapter, leverage, locality) and core principles (deletion test, interface-as-test-surface, one-adapter-is-hypothetical). Use those terms exactly in every suggestion. For audit-specific examples and anti-patterns (pass-through, temporal decomposition, classitis, signs a module is too shallow), see references/deep-modules.md.

Workflow

1. Explore

Scope first (YAGNI). Deepening pays off where code keeps changing. A direction in $ARGUMENTS (module, subsystem, pain point) → take it. Otherwise read a good stretch of git log --oneline for hot spots, the files and areas that keep coming up, and start there; no clear hot spot → widen the net. Read the ADRs in the area: a candidate an ADR already rejected comes back only when the friction is worth reopening it.

Use a read-only explore subagent to navigate the codebase organically. Note where you experience friction:

  • Understanding one concept requires bouncing between many small modules
  • A module's interface is nearly as complex as its implementation (shallow module)
  • Pure functions extracted just for testability, but real bugs hide in how they're called
  • Tightly-coupled modules create integration risk at the seams between them
  • A module fails the deletion test — deleting it makes complexity vanish (pass-through), or its complexity is duplicated across N callers (earning its keep but in the wrong place)
  • Areas that are untested or hard to test

The friction you encounter IS the signal.

2. Present candidates

Show a numbered list. For each candidate:

  • Cluster: which modules/concepts are involved
  • Why they're coupled: shared types, call patterns, co-ownership of a concept
  • Dependency category: from the DEEPENING reference in codebase-design
  • Test impact: what existing tests would be replaced by tests at the new seam
  • Strength: Strong, Worth exploring, or Speculative

--html → also render the candidates as a report with before/after diagrams, per references/html-report.md.

Do NOT propose interfaces yet. Ask which candidate to explore. The user rejects one for a load-bearing reason → offer to record it (call the Skill tool with to-adr) so later audits don't re-suggest it. Skip ephemeral reasons ("not now").

3. Design the interface

For the chosen candidate, run the Design-It-Twice procedure from the DESIGN-IT-TWICE reference in codebase-design: frame the problem space, spawn 3+ sub-agents with radically different constraints, compare, recommend. Then ask which design to use — your recommendation first, marked (Recommended).

4. Write improvement PRD

Save a markdown file named architecture-<cluster-name>.md using the template in references/improvement-template.md. Save it in .specs/specs/, creating the directory if missing.

Fill with concrete details: file paths, function names, migration steps. Share the file path with the user when done.

Rules

  • Old unit tests on shallow modules are waste once seam tests exist — note them for deletion
  • Don't introduce a new seam unless something actually varies across it (one adapter = hypothetical, two = real)
  • Candidate scope turns out much larger than expected → surface it and re-scope before designing

Next: /hb:to-tickets architecture-<cluster-name> to slice the improvement PRD.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.