improve-codebase-architecture
Skill1 starsChanged 16 days agoMITView on GitHub
Find structural improvements, compare designs, and produce evidence-backed architecture recommendations or migration plans. HTML reports are optional.
195 other projects use a version of this, 155 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 · 155
- mattpocock/skills★ 309k45% same
- danny-avila/LibreChat★ 47k41% same
- LibreChat-AI/LibreChat★ 47k41% same
- QuivrHQ/quivr★ 40k42% same
- The-Vibe-Company/quivr★ 40k42% same
- windmill-labs/windmill★ 18k37% same
- GreyDGL/PentestGPT★ 16k33% same
- humanlayer/humanlayer★ 13k41% same
- ArcReel/ArcReel★ 6.3k45% same
- withcoral/coral★ 4.9k45% same
145 more not listed
Wrote their own version · 40
- sanity-io/sanity★ 6.4ksame name
- vinvcn/mattpocock-skills-zh-CN★ 5.5ksame name
- openstatusHQ/data-table-filters★ 2.3ksame 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
30 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 repository57 other files it gives its agents.
- AGENTS.mdAGENTS.md
- agent-loginSkill
- animateSkill
- app-intentsSkill
- app-store-connectSkill
- architectSkill
- arenaSkill
- blast-radiusSkill
- codebase-designSkill
- code-qualitySkill
- correctSkill
- diagnosing-bugsSkill
- domain-modelingSkill
- eli5Skill
- engineering-principlesSkill
- gauntlet-loopSkill
- gh-stackSkill
- goal-swarmSkill
- grillingSkill
- grill-with-docsSkill
- handoffSkill
- howSkill
- ios-hapticsSkill
- koubouSkill
- mergeSkill
- orchestrationSkill
- prototypeSkill
- prSkill
- react-best-practicesSkill
- react-doctorSkill
- reframeSkill
- repo-cleanupSkill
- researchSkill
- retroSkill
- review-fix-loopSkill
- reviewSkill
- review-sweepSkill
- seoSkill
- setup-sreestackSkill
- show-dont-tellSkill
- showroomSkill
- snipsnap-do-choresSkill
- snip-snapSkill
- swift-testing-modernizationSkill
- swiftuiSkill
- tddSkill
- to-specSkill
- to-ticketsSkill
- triageSkill
- ui-designSkill
- uikitSkill
- verifySkill
- wayfinderSkill
- web-component-inspirationSkill
- whySkill
- writing-for-agentsSkill
- xcode-security-auditSkill
The file
We split this skill into the rules it gives an agent
11 rules. 0 are common, 7 are distinctive, and 4 are very specific to this project.
0
Common
Most of the 184 edited versions we read keep these.
7
Distinctive
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 17
Use Redesign From First Principles when shaping a candidate, Model the Domain when ownership changes, and [Migrate Callers
- Distinctive: line 27
Default to interactive exploration: present candidates, let the user select one, then explore its design together.
- Distinctive: line 47
If the user named a direction (a module, a subsystem, a pain point), take it, and skip the inference below.
- Very specific: line 50
Read the project's domain glossary (GLOSSARY.md) and any ADRs in the area you're touching first.
- Distinctive: line 77
Default to a concise, high-level response in chat.
- Very specific: line 86
Use the project's domain terms and the /codebase-design vocabulary.
- Distinctive: line 90
If a candidate conflicts with an ADR, explain why the observed friction warrants revisiting that decision.
- Very specific: line 93
Create an HTML report only when the user asks for one.
- Distinctive: line 112
When a decision rests on an untested technical assumption, run a focused architecture experiment.
- Very specific: line 121
Sharpening a fuzzy term during the conversation?: Update GLOSSARY.md right there.
- Distinctive: line 132
When a migration plan is requested, connect the finding to the recommended interface and owner, affected callers and compatibility paths, …
“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
Resolve project, legacy, or custom glossary paths with glossary paths before reading or writing the domain vocabulary.
Surface architectural friction and propose deepening opportunities: refactors that turn shallow modules into deep ones. The aim is testability and AI-navigability.
Own structural improvement. Correct owns mining repeated agent mistakes and proving their prevention. Use its findings as inputs when the requested architecture work addresses an evidenced failure class.
Use Redesign From First Principles when shaping a candidate, Model the Domain when ownership changes, and Migrate Callers Then Delete Legacy APIs when moving callers. Codebase Design supplies the module vocabulary and interface techniques used below.
Choose the finish line
Default to interactive exploration: present candidates, let the user select one, then explore its design together. When the user requests an autonomous investigation or a plan backed by experiments, carry promising candidates through design and technical checks before returning the recommendation. Resolve routine technical questions from the repository and experiments. Ask only when a missing product choice, access, or scope decision changes the result. Both paths produce recommendations; a planning request does not authorize production refactoring.
This command is informed by the project's domain model and built on a shared design vocabulary:
- Apply the skill "codebase-design" for the architecture vocabulary (module, interface, depth, seam, adapter, leverage, locality) and its principles (the deletion test, "the interface is the test surface", "one adapter = hypothetical seam, two = real"). Use these terms exactly in every suggestion, and don't drift into "component," "service," "API," or "boundary."
- The domain language in
GLOSSARY.mdgives names to good seams; ADRs indocs/adr/record decisions this command should not re-litigate.
Process
1. Explore
Scope before you scan: YAGNI. Deepening a module pays off by making future changes to it easier, so put extra weight on the parts of the codebase that have recently changed. Decide where to look before you look:
- If the user named a direction (a module, a subsystem, a pain point), take it, and skip the inference below.
- Otherwise, walk back a good stretch of the commit history (
git log --oneline) to find the codebase's hot spots, the files and areas that keep coming up, and let those paths pull your attention first. If the changes are scattered with no clear hot spot, widen the net.
Read the project's domain glossary (GLOSSARY.md) and any ADRs in the area you're touching first.
Then use orchestration to assign a read-only exploration of that scope, with paths, domain vocabulary, ADRs, and an evidence-backed findings report as its completion criterion. Give the child these friction questions and ask it to explore organically:
- Where does understanding one concept require bouncing between many small modules?
- Where are modules shallow, with an 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 of the codebase are untested, or hard to test through their current interface?
Have the child also apply Codebase Design's ownership and enforcement checks and architecture signals to evidenced friction in this scope. Use caller traces, constructible states, and maintenance history to distinguish worthwhile candidates from layout or size preferences. The child returns recommendations without implementing them.
Include the deletion test in the brief: would deleting a suspected shallow module concentrate complexity, or just move it? A "yes, concentrates" is the signal to investigate. Accept the child's findings against the assigned scope and evidence before making recommendations.
2. Share findings and recommendations
Default to a concise, high-level response in chat. Lead with the change you recommend first and why it matters. For each worthwhile candidate, explain:
- Finding — where the current design causes friction, with a brief example or file link that supports it.
- Recommendation — what should change, in plain language.
- Why — the expected benefit, key tradeoffs, and why it is worth doing.
- Confidence —
Strong,Worth exploring, orSpeculative.
Use the project's domain terms and the /codebase-design vocabulary. Keep
implementation detail for the follow-up discussion. If no change is worth
recommending, say so and explain why.
If a candidate conflicts with an ADR, explain why the observed friction warrants revisiting that decision. Only include conflicts worth reopening.
Create an HTML report only when the user asks for one. For that path, read
HTML-REPORT.md for the format and diagrams. Write it to
<tmpdir>/architecture-review-<timestamp>.html, using $TMPDIR or /tmp
(%TEMP% on Windows). Open it with the platform's file opener and share its
absolute path. Include the high-level recommendation in chat too.
For interactive exploration, ask which candidate the user wants to explore before designing interfaces. For an autonomous investigation, select the strongest candidate or compare candidates when the evidence leaves a real tradeoff, then continue below.
3. Explore the design
For interactive exploration, apply "grilling" after the user picks a candidate: constraints, dependencies, the shape of the deepened module, what sits behind the seam, and what tests survive. For autonomous investigation, work through those questions from the code, ADRs, and evidence; bring back only questions that require the user's judgment or unavailable access.
When a decision rests on an untested technical assumption, run a focused architecture experiment. Compare actual caller requirements, migration cost, and enforceable invariants. Use the shared measurement guidance linked there for performance claims. Return commands, observations, and limits; keep unrun proposals distinct from checked designs.
During interactive design, apply "domain-modeling" as decisions crystallize:
- Naming a deepened module after a concept not in
GLOSSARY.md? Add the term toGLOSSARY.md. Create the file lazily if it doesn't exist. - Sharpening a fuzzy term during the conversation? Update
GLOSSARY.mdright there. - 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 don't re-suggest it?" Only offer when the reason would actually be needed by a future explorer to avoid re-suggesting the same thing; skip ephemeral reasons ("not worth it right now") and self-evident ones.
For autonomous planning, record proposed glossary and ADR changes in the plan for review. When exploring alternative interfaces, use Codebase Design's design-it-twice guidance to compare structurally distinct designs through arena; check technical assumptions with experiments where proposals alone cannot distinguish the options.
4. Return a usable plan
When a migration plan is requested, connect the finding to the recommended interface and owner, affected callers and compatibility paths, migration order, enforcement, and verification. Explain tradeoffs and rejected alternatives using the evidence actually gathered. Include experiment artifacts and commands, and label checks still proposed. State any ADR or domain vocabulary changes needed.
Interactive findings are complete when worthwhile candidates have evidence, reasons, and confidence. A requested design or plan is complete when its technical uncertainties have been checked or have explicit evidence gaps and next checks, and the migration and proof are concrete enough to review. Production implementation follows only within the user's requested scope and uses the existing implementation, review, and verification workflows. Use architect when the selected design needs to guide implementation; carry forward the findings and experiments already checked.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
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.

