improve-arch
Skill8 starsChanged 6 months agoMITView on GitHub
Find shallow modules in a codebase and propose refactors that make them deep: small interface, deep implementation.
4 other projects use a version of this, 2 of them edited.
Adopted by
Most recently taken up by
- eyeix/skillstheir own version, first seen Oct 13, 2026
- kaelen2026/skillstheir own version, first seen Oct 13, 2026
- evist0/okf-matt-skillsedited, first seen Jul 7, 2026
- wachawo/claude-skillsedited, first seen May 5, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 2
- evist0/okf-matt-skills★ 1335% same
- wachawo/claude-skills★ 029% same
Wrote their own version · 2
- eyeix/skills★ 1same name
- kaelen2026/skills★ 1same 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 repository62 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- address-pr-reviewSkill
- agent-evalSkill
- ai-cost-guardSkill
- autoplanSkill
- aws-costSkill
- bedrock-guardrailsSkill
- benchmarkSkill
- browseSkill
- canarySkill
- carefulSkill
- claudeSkill
- codexSkill
- connect-chromeSkill
- connect-reviewSkill
- context-restoreSkill
- context-saveSkill
- csoSkill
- design-consultationSkill
- design-htmlSkill
- design-reviewSkill
- design-shotgunSkill
- devex-reviewSkill
- diagramSkill
- document-generateSkill
- document-releaseSkill
- freezeSkill
- guardSkill
- healthSkill
- iac-reviewSkill
- investigateSkill
- kb-reviewSkill
- land-and-deploySkill
- landing-reportSkill
- learnSkill
- make-pdfSkill
- mcp-reviewSkill
- office-hoursSkill
- open-browserSkill
- pair-agentSkill
- plan-ceo-reviewSkill
- plan-design-reviewSkill
- plan-devex-reviewSkill
- plan-eng-reviewSkill
- plan-tuneSkill
- pr-summarySkill
- qa-onlySkill
- qaSkill
- retroSkill
- reviewSkill
- scrapeSkill
- setup-browser-cookiesSkill
- setup-deploySkill
- shipSkill
- skillifySkill
- specSkill
- telegramSkill
- unfreezeSkill
- unslopSkill
- vibe-gcSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
11 rules. About 0 are common, 5 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 22
If this session was compacted, the copy of this skill in context may be cut off.
- Very specific: line 23
Read ${CLAUDE_SKILL_DIR}/SKILL.md from disk and resume at the step you are on.
- Distinctive: line 27
Use when asked to "improve architecture", "find refactoring opportunities", "deepen modules", "consolidate tightly-coupled modules", or to …
- Distinctive: line 59
Use these terms exactly in every suggestion.
- Distinctive: line 119
ADR conflicts: if a candidate contradicts an existing ADR, only surface it when the friction is real enough to warrant revisiting the ADR.
- Very specific: line 125
Do NOT propose interfaces yet.
- Very specific: line 131
Keep a numbered frontier of open decisions and ask one at a time, each with a Recommended: answer worded so that a plain yes accepts it.
- Very specific: line 132
Never ask what the code can answer.
- Distinctive: line 135
Stop when no open decision remains, and confirm the resulting design with the user in one summary.
- Very specific: line 139
Naming a deepened module after a concept not yet documented?: Add the term to the glossary (GLOSSARY.md, else CONTEXT.md).
- Distinctive: line 140
Sharpening a fuzzy term during the conversation?: 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
If this session was compacted, the copy of this skill in context may be cut off.
Read ${CLAUDE_SKILL_DIR}/SKILL.md from disk and resume at the step you are on.
When to invoke
Use when asked to "improve architecture", "find refactoring opportunities", "deepen modules", "consolidate tightly-coupled modules", or to make a codebase more testable and AI-navigable.
Preamble
eval "$("${VIBESTACK_HOME:-$HOME/.vibestack}/bin/vibe-slug" 2>/dev/null)" 2>/dev/null || SLUG="unknown"
_LEARN_FILE="${VIBESTACK_HOME:-$HOME/.vibestack}/projects/${SLUG:-unknown}/learnings.jsonl"
if [ -f "$_LEARN_FILE" ]; then
_LEARN_COUNT=$(wc -l < "$_LEARN_FILE" 2>/dev/null | tr -d ' ')
echo "LEARNINGS: $_LEARN_COUNT entries loaded"
if [ "$_LEARN_COUNT" -gt 5 ] 2>/dev/null; then
"${VIBESTACK_HOME:-$HOME/.vibestack}/bin/vibe-learnings-search" --limit 5 2>/dev/null || true
fi
else
echo "LEARNINGS: none yet"
fi{{include lib/snippets/session-host.md}}
{{include lib/snippets/decision-brief.md}}
{{include lib/snippets/working-protocols.md}}
{{include lib/snippets/state-protocols.md}}
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.
Glossary
Use these terms exactly in every suggestion. Consistent language is the point — don't drift into "component," "service," "API," or "boundary." Full definitions in LANGUAGE.md.
- Module — anything with an interface and an implementation (function, class, package, slice).
- Interface — everything a caller must know to use the module: types, invariants, error modes, ordering, config. Not just the type signature.
- Implementation — the code inside.
- Depth — leverage at the interface: a lot of behaviour behind a small interface. Deep = high leverage. Shallow = interface nearly as complex as the implementation.
- Seam — where an interface lives; a place behaviour can be altered without editing in place. (Use this, not "boundary.")
- 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 concentrated in one place.
Key principles (see LANGUAGE.md for the full list):
- Deletion test: imagine deleting the module. If complexity vanishes, it was a pass-through. If complexity reappears across N 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 model. The domain language gives names to good seams; ADRs record decisions the skill should not re-litigate.
Process
1. Scope first
Decide where to look before looking. A refactor in code nobody touches rarely pays for itself, so the scope is either a named direction — the module, feature or pain the user pointed at — or, when the user named none, the files that change most:
git log --since="6 months ago" --name-only --pretty=format: | grep -v '^$' | sort | uniq -c | sort -rn | head -20Widen the window for a quiet repo, narrow it for a busy one. Use the direction, or these hotspots, to seed the Explore brief in step 2. Say which scope you used in one line before exploring.
2. Explore
Read the project's domain glossary first: GLOSSARY.md if it exists, else CONTEXT.md. A repo with several bounded contexts may keep a CONTEXT-MAP.md listing them — pick the context the scope lives in and read that context's glossary, not every one. Read the ADRs (docs/adr/) too.
Then use the Agent tool with subagent_type=Explore to walk the scoped part of the codebase. Don't follow rigid heuristics — explore organically and note where you experience friction:
{{include lib/snippets/foreground-dispatch.md}}
- 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 of the codebase are untested, or hard to test through their current interface?
Apply the deletion test to anything you suspect is shallow: would deleting it concentrate complexity, or just move it? A "yes, concentrates" is the signal you want.
3. Present candidates
Present a numbered list of deepening opportunities. For each candidate:
- Files — which files/modules are involved
- Problem — why the current architecture is causing friction
- Solution — plain English description of what would change
- Benefits — explained in terms of locality and leverage, and also in how tests would improve
- Strength — Strong (the deletion test and the hotspot data both point here), Worth exploring (real friction, unclear payoff) or Speculative (a hunch the exploration did not confirm)
- Dependencies — the dependency category from DEEPENING.md (in-process, local-substitutable, remote but owned, true external), which decides how the deepened module gets tested
Use the project's domain vocabulary (from the glossary, if one exists) for domain concepts, and LANGUAGE.md vocabulary for the architecture. If the domain says "Order," talk about "the Order intake module" — not "the FooBarHandler," and not "the Order service."
ADR conflicts: if a candidate contradicts an existing ADR, only surface it when the friction is real enough to warrant revisiting the ADR. Mark it clearly (e.g. "contradicts ADR-0007 — but worth reopening because…"). Don't list every theoretical refactor an ADR forbids.
End the list with one line:
Top recommendation: <candidate> because <one line>
Do NOT propose interfaces yet. Ask which candidate to explore as a decision brief, one option per candidate, with the top recommendation marked (recommended).
4. 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, what tests survive. Run it the same way every time:
- Keep a numbered frontier of open decisions and ask one at a time, each with a
Recommended:answer worded so that a plain yes accepts it. - Never ask what the code can answer. Look facts up yourself, or dispatch an Explore subagent with
run_in_background: falseand wait for it. - Cross-check what the user says the code does against the code; when they differ, show the difference before deciding.
- For each term the design introduces, walk one edge-case scenario through it to prove the name holds.
- Stop when no open decision remains, and confirm the resulting design with the user in one summary.
Side effects happen inline as decisions crystallize:
- Naming a deepened module after a concept not yet documented? Add the term to the glossary (
GLOSSARY.md, elseCONTEXT.md). CreateGLOSSARY.mdlazily if neither exists. - Sharpening a fuzzy term during the conversation? Update the glossary right there.
- Two rules for every glossary entry. Domain words only — a term goes in only if it is a word a domain expert would say, never a class name or implementation detail. One word per concept — when two words name the same thing, keep one and list the other under Avoid.
- User rejects the candidate, or settles a decision, with a load-bearing reason? Offer an ADR only when the decision is hard to reverse, would be surprising without context, and came from a real trade-off; skip ephemeral reasons ("not worth it right now") and self-evident ones. On yes, hand off to
/document-generate --adrwith the decision and its reason — this skill never writes the ADR itself. - Want to explore alternative interfaces for the deepened module? See INTERFACE-DESIGN.md.
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.

