codebase-architecture
Skill1 starsChanged 6 months agoMITView on GitHub
Expert guidance for codebase architecture: refactoring, modular boundaries, clean architecture, deep modules. Use when improving code structure or evaluating tech debt.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- realityforge/skillstheir own version, first seen Oct 20, 2026
- mblode/agent-skillstheir own version, first seen Sep 11, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- mblode/agent-skills★ 189same name
- realityforge/skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository41 other files it gives its agents.
- AGENTS.mdAGENTS.md
- academic-evaluationSkill
- academic-writingSkill
- agent-orchestrationSkill
- agents-md-writerSkill
- algorithmic-artSkill
- brand-guidelinesSkill
- code-reviewSkill
- commit-workflowSkill
- context-checkpointSkill
- doc-coauthoringSkill
- docxSkill
- etl-runnerSkill
- eval-runnerSkill
- feature-devSkill
- frontend-designSkill
- hpc-deucalionSkill
- internal-commsSkill
- langchainSkill
- langfuseSkill
- langgraphSkill
- llm-observability-stackSkill
- mcp-builderSkill
- neo4j-verifySkill
- pdfSkill
- pptxSkill
- project-conventionsSkill
- python-best-practicesSkill
- react-namingSkill
- security-hooksSkill
- service-verifySkill
- skill-creatorSkill
- skill-inspectorSkill
- slack-gif-creatorSkill
- sprint-contractSkill
- theme-factorySkill
- uml-modelingSkill
- webapp-testingSkill
- web-artifacts-builderSkill
- web-debugSkill
- xlsxSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 3 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
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
- Distinctive: line 51
Read the project's domain glossary and any ADRs first.
- Distinctive: line 61
One adapter = hypothetical seam. Two adapters = real seam: Don't introduce a port unless at least two adapters are justified (typically …
- Very specific: line 67
Read the project's domain glossary (CONTEXT.md, glossary files) and any ADRs in docs/adr/.
- Distinctive: line 90
Sharpening a fuzzy term?: Update the glossary right there.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Surface architectural friction and propose deepening opportunities — refactors that turn shallow modules into deep ones. The aim is testability, maintainability, and navigability.
When to Use
- A module's interface is nearly as complex as its implementation (shallow).
- Understanding one concept requires bouncing between many small modules.
- Pure functions were extracted "for testability" but the real bugs hide in callers.
- Tightly-coupled modules leak across their seams.
- Tech debt is accumulating and you need a structured pass.
When NOT to Use
- Trivial renames or single-line cleanups — just edit.
- The user has a specific design in mind and only wants implementation →
feature-dev. - Bug-hunting, not structure → diagnose first with the project's tooling.
- Greenfield design where no module exists yet — wait until something is concrete.
Hard Rules
- Depth is a property of the interface, not the implementation — a deep module hides complexity behind a small interface; a shallow one has an interface nearly as complex as its implementation.
- Apply the deletion test to suspected shallow modules — if complexity vanishes when you delete it, the module was a pass-through; if complexity reappears across N callers, it was earning its keep.
- The interface is the test surface — if you need to test past the interface, the module is probably the wrong shape.
- Wait for two adapters before introducing a port — one adapter is hypothetical seam; two (typically production + test) is real seam. Indirection without justification is overhead.
- Use the project's vocabulary exactly — call a "module" a "module", not a "component" or "service" — because consistent language is the whole point of a glossary.
- Record load-bearing rejections as ADRs — when the user rejects a candidate with a non-obvious reason, write an ADR so future reviews do not re-suggest it.
- Propose candidates first, design interfaces after the user picks one — proposing interfaces too early is the most common pitfall.
Examples
Candidate card format (one per deepening):
Title: <short name>
Files: <which files/modules>
Problem: <why the current architecture causes friction>
Solution: <what changes, in plain English>
Benefits: <locality, leverage>
Before/After: <visual diagram>
Strength: Strong / Worth exploring / SpeculativeTop recommendation goes at the end.
Quick Start
- Read the project's domain glossary and any ADRs first.
- Explore the codebase noting friction points (see Process below).
- Present candidates as a structured report.
- Enter the grilling loop with the user to refine.
Core Principles
- Depth is a property of the interface, not the implementation. A deep module hides complexity behind a small interface. A shallow module has an interface nearly as complex as its implementation.
- The deletion test. Imagine deleting a module. If complexity vanishes, the module was a pass-through. If complexity reappears across N callers, it was earning its keep.
- The interface is the test surface. Callers and tests cross the same seam. If you need to test past the interface, the module is probably the wrong shape.
- One adapter = hypothetical seam. Two adapters = real seam. Don't introduce a port unless at least two adapters are justified (typically production + test).
Process
1. Orient
Read the project's domain glossary (CONTEXT.md, glossary files) and any ADRs in docs/adr/. The domain language gives names to good seams; ADRs record decisions not to re-litigate.
2. Explore
Walk the codebase and note where you experience friction:
- Where does understanding one concept require bouncing between many small modules?
- Where are modules shallow — interface nearly as complex as the implementation?
- Where have pure functions been extracted just for testability, but the real bugs hide in how they're called (no locality)?
- Where do tightly-coupled modules leak across their seams?
- Which parts are untested or hard to test through their current interface?
Apply the deletion test to anything you suspect is shallow.
3. Report
Present candidates using the card format above. End with a Top recommendation section.
4. Grilling Loop
Once the user picks a candidate, walk the design tree with them:
- Naming a deepened module after a concept not in the glossary? Add the term to the glossary.
- Sharpening a fuzzy term? Update the glossary right there.
- User rejects with a load-bearing reason? Offer to record an ADR so future reviews don't re-suggest it.
- Want to explore alternative interfaces? See
references/INTERFACE-DESIGN.md.
Side effects happen inline as decisions crystallize.
References
Load these files when you reach the relevant stage:
| File | When to read |
references/LANGUAGE.md | Before making any suggestion. Contains the precise vocabulary (Module, Seam, Depth, Leverage, Locality). Use these terms exactly. |
references/DEEPENING.md | When evaluating a deepening candidate. Classifies dependencies and guides testing strategy. |
references/INTERFACE-DESIGN.md | When the user wants to explore alternative interfaces. Spawns parallel sub-agents with different design constraints. |
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
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.

