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

architecture-audit

Skill16 starsChanged 7 months agoMITView on GitHub

Surface architectural friction across a codebase and propose refactors toward deep modules as RFCs. Use when asked to audit architecture, find structural friction, or spot refactor opportunities. Don't use for one module's interface (/codebase-design) or a diff (/code-review).

7 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, 3 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 7 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use the Agent tool with subagent_type=Explore to navigate the codebase organically.

    line 17
  2. Distinctive:

    Do NOT propose interfaces yet.

    line 37
  3. Distinctive:

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

    line 52

“Common” is measured: kept by at least 6 in 10 of the 7 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 — see 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

Use the Agent tool with subagent_type=Explore 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: see codebase-design DEEPENING.md
  • Test impact: what existing tests would be replaced by tests at the new seam

Do NOT propose interfaces yet. Ask which candidate to explore.

3. Design the interface

For the chosen candidate, run the Design-It-Twice procedure in codebase-design DESIGN-IT-TWICE.md: 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. If .specs/specs/ exists, save there; otherwise, save in specs/.

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

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.