/codebase-architecture:improve-codebase-architecturefrom codebase-architecture
Scan for deepening, testability, and AI-navigability refactors. Use when asking for an architecture improvement review.
Ships in codebase-architecture. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Surface architectural friction and propose deepening opportunities — refactors that turn shallow modules into deep ones. Aim: testability and AI-navigability.
Before suggestions, invoke skill codebase-design (glossary + principles: deletion test, interface is the test surface, one adapter = hypothetical seam). Use those terms exactly — do not drift into "component," "service," "API," or "boundary."
Domain language: project CONTEXT.md when present. ADRs under docs/adr/ (or wiki architecture ADRs) are decisions not to re-litigate lightly.
Scope before scanning — YAGNI. Deepening pays off where future change is likely. Decide where to look first:
git log --oneline over a useful stretch) for hot spots — files/areas that keep changing — and prefer those paths.Read domain glossary and relevant ADRs in the scoped area first.
Walk the codebase (Explore subagent when available; e.g. subagent_type=Explore). Note friction organically:
Apply the deletion test to suspected shallow modules: would deleting it concentrate complexity, or only move it?
Write self-contained HTML to OS temp — not wiki, not docs/. See html-report.md.
Path: {TMPDIR}/architecture-review-{timestamp}.html. Open it; tell the user the absolute path.
Offline / no-CDN: if the environment blocks CDN scripts, or the user asks for offline output, write Markdown to {TMPDIR}/architecture-review-{timestamp}.md with the same candidate cards and Mermaid fences instead of HTML. Prefer HTML when the browser path works.
Each candidate card:
Strong | Worth exploring | SpeculativeUse CONTEXT.md domain names on cards (e.g. "Order intake module", not only handler class names).
Top recommendation section at end.
ADR conflicts: only surface when friction warrants reopening; mark clearly.
Do not propose full interfaces yet. Ask: "Which of these would you like to explore?"
When the user picks a candidate:
grill-me / grilling if available — design tree, constraints, tests that survive.CONTEXT.md or wiki concept terms).codebase-design vocabulary).Durable decisions from the grill may be written as markdown ADRs using output-routing.md (wiki architecture or docs/architecture/), not as HTML.
Optional branch of the playbook: analyze extracts first if docs are missing, then improve, then architecture-to-spec for the chosen deepen. See playbook-chain.md.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub karlorz/agent-skills --plugin codebase-architecture5 skills in this plugin
/architecture-to-specTurn architecture analysis into a PRD or spec without interviewing. Use after codebase-architecture-analyze or for a feature spec./codebase-architectureRoute architecture work to analyze, design, improve, or to-spec. Use when the user asks for codebase-architecture./codebase-architecture-analyzeAnalyze architecture into C4, ADRs, debt, and reimplementation maps. Use when documenting or reverse-engineering a repo.Other plugins' skills for the same job