improve-codebase-architecture
Skill4 starsChanged 3 months agoApache-2.0View on GitHub
Surface architectural friction and propose module-deepening opportunities that improve locality, leverage, testability, and AI navigability.
195 other projects use a version of this, 14 of them edited.
Adopted by
Most recently taken up by
- chrysogonus/power-agentstheir own version, first seen Nov 8, 2026
- caidanw/skillstheir own version, first seen Nov 8, 2026
- domengabrovsek/agent-configtheir own version, first seen Nov 8, 2026
- domengabrovsek/claudetheir own version, first seen Nov 8, 2026
- The-Vibe-Company/quivrtheir own version, first seen Nov 8, 2026
- miklschmidt/archboardtheir own version, 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 · 14
- windmill-labs/windmill★ 18k10% same
- GreyDGL/PentestGPT★ 16k10% same
- Tiberriver256/mcp-server-azure-devops★ 39910% same
- ninehills/skills★ 28010% same
- walidboulanouar/maestro★ 6210% same
- panando/APIBypass★ 810% same
- yuchenmiao04/My_skills★ 810% same
- lkangd/cc-settings-preset★ 510% same
- hjdspace/SpaceCode★ 410% same
- Roentek/Claude_Code_Boilerplate_Framework★ 410% same
4 more not listed
Wrote their own version · 181
- mattpocock/skills★ 309ksame name
- danny-avila/LibreChat★ 47ksame name
- LibreChat-AI/LibreChat★ 47ksame name
- QuivrHQ/quivr★ 40ksame name
- The-Vibe-Company/quivr★ 40ksame name
- humanlayer/humanlayer★ 13ksame name
- sanity-io/sanity★ 6.4ksame name
- ArcReel/ArcReel★ 6.3ksame name
- vinvcn/mattpocock-skills-zh-CN★ 5.5ksame name
- withcoral/coral★ 4.9ksame name
171 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 repository51 other files it gives its agents.
- AGENTS.mdAGENTS.md
- architecture-remediationSkill
- attentionSkill
- classify-docSkill
- codebase-designSkill
- codebase-memory-mcpSkill
- codegraphSkill
- coding-standardsSkill
- contract-ledgerSkill
- conventional-commitsSkill
- database-migrationsSkill
- deduplicate-codeSkill
- diagnosing-bugsSkill
- domain-modelingSkill
- format-codeSkill
- github-issue-dependenciesSkill
- graphifySkill
- grillingSkill
- grill-meSkill
- grill-with-docsSkill
- handoffSkill
- implement-ticketSkill
- project-delivery-managementSkill
- project-trackingSkill
- prototypeSkill
- repowiseSkill
- researchSkill
- resolving-merge-conflictsSkill
- review-architectureSkill
- review-specSkill
- setup-matt-pocock-skillsSkill
- spec-contractSkill
- spec-merge-cleanupSkill
- tddSkill
- teachSkill
- to-adr-docSkill
- to-docSkill
- to-specsSkill
- to-ticketsSkill
- triageSkill
- verify-architectureSkill
- verify-codeSkill
- verify-spec-closureSkill
- verify-specSkill
- verify-ticket-closureSkill
- verify-ticket-decompositionSkill
- wayfinderSkill
- wiki-lintSkill
- wiki-syncSkill
- wiki-synthesizeSkill
- writing-great-skillsSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
34 rules. 0 are common, 16 are distinctive, and 18 are very specific to this project.
0
Common
Most of the 184 edited versions we read keep these.
16
Distinctive
This author's own choices. Worth a look.
18
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 14
Run $codebase-design for the architecture vocabulary (module, interface, depth, seam, adapter, leverage, locality) and its principles, …
- Very specific: line 15
Use canonical domain language from CONTEXT.md.
- Distinctive: line 16
Treat accepted ADRs and applicable current architecture as constraints, not suggestions.
- Distinctive: line 17
If the Living Entity Wiki exists, consult relevant Strict Invariants, Rejected Approaches, Open Questions, and Planned entries before …
- Very specific: line 18
If authoritative sources materially disagree, surface [source-conflict] rather than designing around one side.
- Distinctive: line 26
If the user names a module, subsystem, or pain point, use that scope.
- Very specific: line 29
Read the relevant CONTEXT.md, accepted ADRs, and current architecture docs first.
- Very specific: line 31
If the Living Entity Wiki exists, use wiki/index.md to locate the relevant entity page(s).
- Distinctive: line 35
Look organically for friction:
- Distinctive: line 46
Do not recommend refactors merely to reduce file count or create speculative abstractions.
- Distinctive: line 50
Do not casually re-litigate accepted ADRs.
- Distinctive: line 52
If a candidate conflicts with one, normally omit it.
- Distinctive: line 56
if the rejection still applies, do not recommend it.
- Very specific: line 57
if its Reconsider when: condition appears satisfied, it may be surfaced for reconsideration.
- Distinctive: line 60
Do not override accumulated architectural memory silently.
- Distinctive: line 64
Write a self-contained HTML report to the OS temporary directory:
- Very specific: line 74
Follow HTML-REPORT.md for established report patterns.
- Very specific: line 76
Prefer self-contained HTML/CSS/SVG.
- Very specific: line 91
Use CONTEXT.md terminology for the domain and $codebase-design terminology for architecture.
- Distinctive: line 93
Do not design interfaces yet.
- Very specific: line 111
Use $codebase-design when exploring alternative interfaces.
- Very specific: line 113
Use $domain-modeling only when the discussion actually changes or sharpens domain meaning.
- Distinctive: line 117
If the user rejects the candidate:
- Very specific: line 120
if the rejection warrants an ADR, use $to-adr-doc.
- Very specific: line 125
Add Reconsider when: only if the owner actually establishes such a condition.
- Distinctive: line 127
If a real experiment failed for a concrete architectural reason, use:
- Distinctive: line 131
Do not turn unsupported agent judgment into a Rejected Approach.
- Distinctive: line 135
If the review produces a durable architectural outcome:
- Very specific: line 137
use $to-adr-doc for an ADR-worthy decision.
- Very specific: line 138
use $to-doc for durable current or proposed architecture that does not warrant an ADR.
- Very specific: line 139
use $classify-doc if an existing document needs reclassification.
- Very specific: line 141
Do not edit entity pages directly.
- Distinctive: line 147
Do not perform topology changes during candidate discovery.
- Very specific: line 149
If the owner approves such a change, use $wiki-sync according to wiki/_schema.md.
“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 informed by the project's domain model and shared design vocabulary:
- Run
$codebase-designfor the architecture vocabulary (module, interface, depth, seam, adapter, leverage, locality) and its principles, including the deletion test, "the interface is the test surface," and "one adapter = hypothetical seam, two = real." Use those terms consistently in suggestions. - Use canonical domain language from
CONTEXT.md. - Treat accepted ADRs and applicable current architecture as constraints, not suggestions.
- If the Living Entity Wiki exists, consult relevant Strict Invariants, Rejected Approaches, Open Questions, and Planned entries before proposing changes.
- If authoritative sources materially disagree, surface
[source-conflict]rather than designing around one side.
1. Explore
Scope before scanning — YAGNI.
Deepening pays off when it makes recurring future changes easier, so prioritize areas that actually matter.
- If the user names a module, subsystem, or pain point, use that scope.
- Otherwise inspect enough Git history to identify recurring hot spots. If changes are scattered, widen the search deliberately.
Read the relevant CONTEXT.md, accepted ADRs, and current architecture docs first.
If the Living Entity Wiki exists, use wiki/index.md to locate the relevant entity page(s). This is a read-only consultation, not a $wiki-sync invocation.
Then explore using the project's repository-analysis tools such as $repowise, $codegraph, $codebase-memory-mcp, or $graphify.
Look organically for friction:
- Where does understanding one concept require bouncing between many modules?
- Where are modules shallow — interface nearly as complex as implementation?
- Where were functions extracted mainly for testability while the real bugs live in their composition?
- Where is locality poor?
- Where do supposedly separate modules leak knowledge across their seams?
- Which behavior is hard to test through its real interface?
Apply the deletion test to serious candidates: would deleting the shallow module concentrate complexity behind a deeper interface, or merely move the same complexity elsewhere?
Do not recommend refactors merely to reduce file count or create speculative abstractions.
Existing decisions
Do not casually re-litigate accepted ADRs.
If a candidate conflicts with one, normally omit it. Surface it only when concrete changed circumstances make reconsideration genuinely warranted, and mark the conflict explicitly.
Apply the same rule to Rejected Approaches:
- if the rejection still applies, do not recommend it;
- if its
Reconsider when:condition appears satisfied, it may be surfaced for reconsideration; - without an explicit condition, require concrete changed circumstances rather than elapsed time alone.
Do not override accumulated architectural memory silently.
2. Present Candidates as an HTML Report
Write a self-contained HTML report to the OS temporary directory:
<tmpdir>/architecture-review-<timestamp>.htmlNothing from the review should land in the repository.
Open the report for the user with the platform's normal local-file opener and report its absolute path.
Follow HTML-REPORT.md for established report patterns.
Prefer self-contained HTML/CSS/SVG. Do not make the report's core usefulness depend on network-only assets.
For each candidate include:
- Files — principal modules involved.
- Problem — why the architecture creates friction.
- Solution — the deepening direction, without designing the final interface yet.
- Benefits — locality, leverage, testability, and AI navigability.
- Before / After — visual comparison.
- Evidence — concrete dependency, change, call-flow, or testing evidence.
- Constraints — relevant ADRs, invariants, rejected approaches, Planned work, or
[source-conflict]. - Recommendation strength —
Strong,Worth exploring, orSpeculative.
End with a Top recommendation and explain which candidate is most worth exploring first.
Use CONTEXT.md terminology for the domain and $codebase-design terminology for architecture.
Do not design interfaces yet.
Ask:
Which of these would you like to explore?
3. Grilling Loop
Once the user selects a candidate, run $grilling.
Explore:
- constraints and dependencies;
- what complexity belongs behind the deeper module;
- what should remain visible through the seam;
- what tests should survive;
- whether alternative interfaces should be compared.
Use $codebase-design when exploring alternative interfaces.
Use $domain-modeling only when the discussion actually changes or sharpens domain meaning. A new module name alone is not automatically a new domain concept.
Rejected candidate
If the user rejects the candidate:
- ephemeral reasons such as "not now" or "not worth it this release" are not durable architecture knowledge;
- if the rejection warrants an ADR, use
$to-adr-doc; - otherwise, if the rejection is load-bearing and the Living Entity Wiki exists, use
$wiki-syncto record a Rejected Approach with:
source: owner-confirmed session decision, undocumented
Add Reconsider when: only if the owner actually establishes such a condition.
If a real experiment failed for a concrete architectural reason, use:
source: session experiment, undocumented
Do not turn unsupported agent judgment into a Rejected Approach.
Accepted direction
If the review produces a durable architectural outcome:
- use
$to-adr-docfor an ADR-worthy decision; - use
$to-docfor durable current or proposed architecture that does not warrant an ADR; - use
$classify-docif an existing document needs reclassification.
Do not edit entity pages directly. Normal $wiki-sync triggers own derived wiki updates.
4. Entity Topology
A review may reveal that an entity should be split, merged, renamed, added, removed, or have its Boundary Rationale changed.
Do not perform topology changes during candidate discovery.
If the owner approves such a change, use $wiki-sync according to wiki/_schema.md.
A module, package, bounded context, or graph cluster is not automatically a wiki entity.
5. Implementation Handoff
This skill reviews and shapes architecture; it does not implement the selected refactor.
Production implementation must enter the normal implementation workflow and perform its own $wiki-sync pre-change audit.
The read-only wiki consultation performed during architecture review does not satisfy that later implementation check.
Handoff
Report:
- candidates considered;
- selected candidate, if any;
- supporting evidence;
- relevant ADRs/invariants/rejections;
- any
[source-conflict]; - architectural decision reached;
- any
$domain-modeling,$to-adr-doc,$to-doc,$classify-doc, or$wiki-syncoutcome; - whether implementation has actually occurred.
Distinguish clearly between reviewed, architecturally decided, documented, and implemented.
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.

