improve-codebase-architecture
Skill0 starsChanged 6 months agoMITView on GitHub
Find deepening opportunities in a codebase. Use when improving architecture, refactoring shallow modules, reducing coupling, or making code more testable and AI-navigable.
195 other projects use a version of this, 163 of them edited.
Adopted by
Most recently taken up by
- chrysogonus/power-agentsedited, first seen Nov 8, 2026
- caidanw/skillsedited, first seen Nov 8, 2026
- domengabrovsek/agent-configedited, first seen Nov 8, 2026
- domengabrovsek/claudeedited, first seen Nov 8, 2026
- The-Vibe-Company/quivredited, first seen Nov 8, 2026
- miklschmidt/archboardedited, first seen Nov 8, 2026
Used with
Projects with it also use migrate-to-shoehorn, writing-beats and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
simo97Skillmigrate-to-shoehorn
Migrate test files from `as` type assertions to @total-typescript/shoehorn. Use when user mentions shoehorn, wants to replace `as` in tests, or needs partial test data.
Also in 73 projects that use this
LesaniSkillwriting-beats
Shape an article as a journey of beats, choose-your-own-adventure style. The user picks a starting beat from the raw material, you write only that beat, then offer options for where to pivot next, beat by beat, until the article reaches a natural end. Use when the user has raw material and wants to assemble it as a narrative rather than an argument.
Also in 68 projects that use this
simo97Skillrequest-refactor-plan
Use this skill when user wants to create a refactor plan.
Also in 43 projects that use this
liufeng1976Skillsetup-ts-deep-modules
Wire dependency-cruiser into a TypeScript repo so each package is a deep module — implementation hidden in subfolders, reachable only through its entry-point files. User-invoked.
Also in 43 projects that use this
FabienDehopreSkilldecision-mapping
Turn a loose idea into a sequenced map of investigation tickets, then drive them to resolution one at a time.
Also in 8 projects that use this
LesaniSkillwriting-shape
Take a markdown file of raw material and shape it into an article through a conversational session — drafting candidate openings, growing the piece paragraph by paragraph, arguing about format (lists, tables, callouts, quotes) at each step. Use when the user has a pile of notes, fragments, or a rough draft and wants help turning it into something publishable.
Also in 65 projects that use this
- +2 more from simo97
Other versions195 projects use a version of this.
Word for word · 0
None found.
Edited · 163
- mattpocock/skills★ 309k25% same
- danny-avila/LibreChat★ 47k26% same
- LibreChat-AI/LibreChat★ 47k26% same
- QuivrHQ/quivr★ 40k25% same
- The-Vibe-Company/quivr★ 40k25% same
- windmill-labs/windmill★ 18k24% same
- GreyDGL/PentestGPT★ 16k30% same
- humanlayer/humanlayer★ 13k26% same
- sanity-io/sanity★ 6.4k12% same
- ArcReel/ArcReel★ 6.3k25% same
153 more not listed
Wrote their own version · 32
- vinvcn/mattpocock-skills-zh-CN★ 5.5ksame name
- stevesolun/ctx★ 583same name
- devcxl/mattpocock-skills-zh★ 522same name
- drvoss/everything-copilot-cli★ 48same name
- WenWuZhiDao/mattpocock-skills-zh★ 27same name
- aveproject/ave★ 24same name
- Integralist/agent-skills★ 23same name
- narumiruna/skills★ 17same name
- allemaar/open-skills★ 15same name
- lox/agent-skills★ 15same name
22 more not listed
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 repository45 other files it gives its agents.
- AGENTS.mdAGENTS.md
- plugin-v2/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- plugin-v2/CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- .cursor/rules/agents.mdcCursor rule
- agentic-security-reviewSkill
- arc42-baselineSkill
- caveman-commitSkill
- caveman-helpSkill
- caveman-reviewSkill
- cavemanSkill
- create-goalSkill
- design-twiceSkill
- discovery-sprintSkill
- domain-contextSkill
- github-project-setupSkill
- grillSkill
- issue-breakdownSkill
- issue-draftSkill
- issue-pr-syncSkill
- new-adrSkill
- new-glossary-entrySkill
- orchestrateSkill
- portfolio-trackSkill
- product-pageSkill
- project-reviewSkill
- project-runSkill
- project-scaffoldingSkill
- quality-assuranceSkill
- quality-metricsSkill
- record-decisionSkill
- review-fixSkill
- roadmap-managementSkill
- sales-cycleSkill
- specorator-designSkill
- specorator-improvementSkill
- specorator-onboardSkill
- stock-takingSkill
- tackle-issueSkill
- tdd-cycleSkill
- token-budget-reviewSkill
- tracer-bulletSkill
- ubiquitous-languageSkill
- verifySkill
The file
We split this skill into the rules it gives an agent
11 rules. 1 is common, 9 are distinctive, and 1 is very specific to this project.
1
Common
Most of the 184 edited versions we read keep these.
9
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
- Distinctive: line 14
Use these architecture terms exactly in every suggestion.
- Distinctive: line 37
Read the project's domain language and architecture decisions first:
- Distinctive: line 46
Do not follow rigid heuristics.
- Very specific: line 65
Use docs/glossary/ and docs/CONTEXT.md vocabulary for the domain, and LANGUAGE.md vocabulary for the architecture.
- Distinctive: line 67
If a candidate contradicts an existing ADR, surface it only when the friction is real enough to warrant revisiting the ADR.
- Common: line 69
Do not propose interfaces yet.
- Distinctive: line 78
Sharpening a fuzzy term during the conversation?: Update the appropriate glossary or context entry in the same branch.
- Distinctive: line 84
Do not bypass Specorator stage ownership.
- Distinctive: line 85
Do not propose seams for their own sake.
- Distinctive: line 86
Do not relitigate accepted ADRs unless the observed friction is strong enough to justify reopening the decision.
- Distinctive: line 87
Do not bundle the refactor into unrelated feature work.
“Common” is measured: kept by at least 6 in 10 of the 184 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.
Files
Improve Codebase Architecture
Surface architectural friction and propose deepening opportunities: refactors that turn shallow modules into deep ones.
The aim is testability and AI-navigability. This skill is adapted from Matt Pocock's improve-codebase-architecture skill and aligned to Specorator's glossary, ADR, and stage-gate conventions.
Glossary
Use these architecture terms exactly in every suggestion. Consistent language is the point. Full definitions live in LANGUAGE.md.
- Module: anything with an interface and an implementation.
- Interface: everything a caller must know to use the module: types, invariants, error modes, ordering, configuration.
- Implementation: the code inside.
- Depth: leverage at the interface. Deep means high leverage; shallow means the interface is nearly as complex as the implementation.
- Seam: where an interface lives; a place behavior can be altered without editing in place. Use this term instead of "boundary" unless referring to a documented bounded context.
- Adapter: a concrete thing satisfying an interface at a seam.
- Leverage: what callers get from depth.
- Locality: what maintainers get from depth: change, bugs, knowledge, and verification concentrated in one place.
Key principles:
- Deletion test: imagine deleting the module. If complexity vanishes, it was a pass-through. If complexity reappears across callers, it was earning its keep.
- The interface is the test surface.
- One adapter = hypothetical seam. Two adapters = real seam.
This skill is informed by the project's domain language. Domain glossary entries give names to good seams; ADRs record decisions the skill should not re-litigate.
Process
1. Explore
Read the project's domain language and architecture decisions first:
docs/glossary/for domain terms.docs/CONTEXT.mdordocs/CONTEXT-MAP.mdif present.docs/adr/for constraints and decisions.- The relevant
specs/<feature>/design.mdorspec.mdwhen the review is tied to active feature work.
Then walk the codebase with the exploration tools available in the current agent environment. In Claude Code, dispatch an Explore subagent when available. In Codex, Cursor, Aider, Copilot, or Gemini, load this file as context and inspect the relevant files directly.
Do not follow rigid heuristics. Explore organically 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 are called?
- Where do tightly-coupled modules leak across their seams?
- Which parts of the codebase are untested, or hard to test through their current interface?
Apply the deletion test to anything that looks shallow: would deleting it concentrate complexity, or just move it? A "yes, concentrates" answer is the signal.
2. Present candidates
Present a numbered list of deepening opportunities. For each candidate, include:
- Files: which files or modules are involved.
- Problem: why the current architecture is causing friction.
- Solution: plain-English description of what would change.
- Benefits: explain locality, leverage, and how tests would improve.
Use docs/glossary/ and docs/CONTEXT.md vocabulary for the domain, and LANGUAGE.md vocabulary for the architecture. If the glossary defines "Order," talk about "the Order intake module," not a framework-shaped name.
If a candidate contradicts an existing ADR, surface it only when the friction is real enough to warrant revisiting the ADR. Mark it clearly, for example: "Contradicts ADR-0007, but worth reopening because..."
Do not propose interfaces yet. Ask the user: "Which of these would you like to explore?"
3. Grilling loop
Once the user picks a candidate, walk the design tree with them: constraints, dependencies, the shape of the deepened module, what sits behind the seam, and what tests survive.
Side effects happen inline as decisions crystallize:
- Naming a deepened module after a concept not in
docs/glossary/? Add the term through thenew-glossary-entryskill, or create/updatedocs/CONTEXT.mdif the project uses a context file. - Sharpening a fuzzy term during the conversation? Update the appropriate glossary or context entry in the same branch.
- User rejects the candidate with a load-bearing reason? Offer an ADR, framed as: "Want me to record this as an ADR so future architecture reviews do not re-suggest it?" Only offer when the reason would help a future explorer avoid the same recommendation. Use the
new-adrskill or the repository's ADR template. - Want to explore alternative interfaces for the deepened module? Use INTERFACE-DESIGN.md.
Do not
- Do not bypass Specorator stage ownership. If this uncovers a missing requirement or architecture decision, update the upstream artifact before implementation.
- Do not propose seams for their own sake. One production adapter without a test or alternate adapter is usually indirection, not depth.
- Do not relitigate accepted ADRs unless the observed friction is strong enough to justify reopening the decision.
- Do not bundle the refactor into unrelated feature work. Turn the selected opportunity into its own task, issue, or PR.
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.

