Improve codebase architecture
Skill dayfinggg/claude-code-codex-skills/claude/skills/improve-codebase-architecture
Audit a codebase for evidence-backed architectural friction and rank bounded improvement candidates before implementation. Use when the user requests an architecture health review or repeated change difficulty spans modules and the boundary is not yet known. Do not use when the interface or refactor is already selected; use codebase-design instead.From its SKILL.md
npx -y skills add dayfinggg/claude-code-codex-skills --skill improve-codebase-architectureAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- 22 days oldThe repository was created 22 days ago. New is not bad, but a brand new repository carrying a familiar-sounding name is the shape a typosquat arrives in, and there has been no time for anyone else to find a problem with it.
- 4 stars4 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
5.1 KB, 890 tokens by cl100k_base, as published. Nobody here has run it
Improve Codebase Architecture
Find the smallest architectural changes that would make important future work safer and cheaper. Diagnose before designing and stop before implementation.
Read references/evidence.md when choosing signals or ranking candidates.
Respect the Assessment Contract
- Work read-only unless the user explicitly asks to implement a selected change.
- Produce candidates, evidence, and a recommendation. Do not silently begin a refactor, create architecture documents, or rewrite domain terminology.
- Keep the main agent responsible for scope, synthesis, and the final recommendation.
- Use
codebase-designafter a specific module boundary or interface is chosen. - Use
plan-taskwhen the selected change needs an execution-ready migration plan.
Choose the Review Surface
Use the user's named module, subsystem, pain point, or change direction when one exists.
Otherwise, identify likely change pressure from repository evidence:
- recent history and repeatedly changed paths;
- defect-prone or rollback-prone areas;
- features that require edits across many unrelated files;
- duplicated invariants or policy;
- tests that must reach through several layers;
- architecture records, ownership boundaries, and active roadmap work.
Do not equate age, file size, dependency count, or unfamiliar style with an architectural problem. Widen the scan only when the initial evidence does not identify a useful surface.
Explore the Current Design
Read applicable instructions, architecture records, domain documentation, tests, public interfaces, callers, dependencies, and recent relevant changes. Trace representative behavior end to end.
If delegation is explicitly authorized, apply delegate-work and assign
independent read-only areas to Explore subagents only when parallel
investigation will reduce context noise. Give each one a non-overlapping scope
and require file-level evidence. Do not ask several subagents to repeat the same
scan, and do not delegate a scan you can finish in a handful of tool calls.
Look for concrete friction:
- understanding one behavior requires bouncing across many shallow modules;
- callers reconstruct policy that should be hidden;
- one invariant or failure policy is duplicated across boundaries;
- an interface exposes ordering, configuration, or provider details callers do not naturally own;
- related changes and defects repeatedly scatter across the same paths;
- testing important behavior requires internal access or excessive mocking;
- a dependency direction forces unrelated modules to change together;
- a temporary adapter or parallel implementation has become permanent.
Apply the deletion test to suspected shallow modules: if deletion merely moves their complexity into callers, the module may concentrate useful knowledge; if the complexity disappears, it may be pass-through structure.
Build Bounded Candidates
Keep only candidates supported by current pain or credible near-term change. Reject speculative platform work, universal abstractions, technology-driven rewrites, and microservice extraction without operational evidence.
For each candidate, state:
- affected files, modules, callers, and tests;
- observed friction and the evidence establishing it;
- the responsibility that should become more local;
- the likely deepened module or corrected dependency direction;
- complexity that would be hidden from callers;
- compatibility, migration, performance, and operational implications;
- how verification would improve;
- recommendation strength:
Strong,Worth exploring, orSpeculative.
Do not finalize a new interface during this assessment. Describe the direction only far enough to compare candidates honestly.
Compare and Present
Rank no more than three useful candidates. Prefer fewer strong candidates over a catalog of code smells.
Lead with the top recommendation and explain why it has the best combination of change pressure, leverage, locality, safety, and bounded migration cost. Use a small before-and-after diagram only when relationships are materially clearer than prose. Do not create an HTML report unless the user requests an artifact or the number of candidates genuinely requires an interactive comparison.
After presenting the assessment, ask which candidate to develop only when the user has not already selected one. Ask one material decision at a time and continue from discoverable repository evidence instead of conducting an unbounded interview.
Completion Standard
Finish only when every candidate is tied to repository evidence, speculative
ideas are labeled or removed, the top recommendation is explicit, and the next
step can proceed through codebase-design or plan-task without rescanning the
entire codebase.
Gives 0 of the 12 instructions most architecture codebase skills give in 890 tokens
Counted across 811 of the 1,134 authors here whose files we hold, read 2026-08-07
- Ask the user which candidate to explorein 45 of 811, across 15 files
- Apply the deletion test to suspected shallow modulesin 43 of 811, across 15 files
- Read any relevant architecture decision records firstin 31 of 811, across 8 files
- Use exact glossary terms in every suggestionin 30 of 811, across 10 files
- Accept dependencies instead of creating themin 24 of 811, across 5 files
- Include before and after visualisations for each candidatein 24 of 811, across 5 files
- Read the domain glossary before exploringin 24 of 811, across 6 files
- Return results instead of producing side effectsin 23 of 811, across 4 files
- Explore the codebase for shallow modules and frictionin 23 of 811, across 3 files
- Introduce seams only where things varyin 22 of 811, across 3 files
- Reduce the number of methodsin 21 of 811, across 2 files
- Design deep modules with small interfacesin 21 of 811, across 3 files
Said here and by no other author read
- work read-only unless implementing an explicit request
- read reference guidance on evidence and ranking
- trace behavior end-to-end across dependencies
- require file-level evidence for every candidate
- rank a maximum of three bounded candidates
- state friction evidence for each candidate
Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once. Length counted with cl100k_base; the agent that loads this file may tokenize it differently.