/corynaegle-agent-skills:improve-codebase-architecture [full] [scope]from corynaegle-agent-skills
Review architecture in a visual HTML report; use full for the whole codebase or omit it for a focused review.
Ships in corynaegle-agent-skills. 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.
If the host has no Skill tool, read the named installed skill’s SKILL.md and relevant references directly.
Surface architectural friction and propose deepening opportunities: refactors that turn shallow modules into deep ones. The aim is testability and AI-navigability.
Resolve the mode before choosing where to look. Read the invocation arguments from $ARGUMENTS when the host expands them, or from the user's invocation message otherwise. A leading standalone full argument selects the full invocation below; it is a mode keyword, not a subsystem name. Without full, use the default invocation. A path or phrase that merely contains the word "full" does not select full mode.
Review the current project. Use recent Git history to select one frequently changed subsystem unless the user specifies a scope.
Present up to three worthwhile improvements with concrete file and call-site references, tradeoffs, testing benefits, and before/after diagrams. Generate the HTML report in the project's docs/ folder (see Report location) and open it.
Apart from adding the report file, leave repository files, tickets, and Git state unchanged. Stop after the report; begin the design interview only when requested. If no worthwhile opportunities exist, say so rather than inventing candidates.
For improve-codebase-architecture full, apply this embedded prompt:
Review the entire project codebase.
Override the default focus on one recently changed subsystem.
Map the major applications, shared packages, and their dependencies,
then examine each area for architectural friction.
Include stable and older code. Remove the three-recommendation limit
and report all worthwhile findings, ranked by impact and effort.
Include a coverage summary showing which areas were examined and
which remain unchecked. Keep the run report-only.
Both modes preserve existing repository files, tickets, and Git state, write the report to the project's docs/ folder, open it, and stop. The full invocation overrides the default scope and candidate limit. It does not start the design interview or authorize implementation. If no worthwhile opportunities exist, report that finding.
This command is informed by the project's domain model and built on a shared design vocabulary:
GLOSSARY.md gives names to good seams; ADRs in docs/adr/ record decisions this command should not re-litigate.Scope before you scan: YAGNI. Decide where to look using the selected invocation mode:
git log --oneline) to find the files and areas that keep coming up. Select one frequently changed subsystem for this review. If no clear hot spot emerges, choose one coherent subsystem and explain the choice in the report.Read the project's domain glossary (GLOSSARY.md) and any ADRs in the area you're touching first.
Then spawn a sub-agent to walk the codebase. Don't follow rigid heuristics; explore organically and note where you experience friction:
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.
Write a self-contained HTML file to the path described in Report location. Open it for the user (xdg-open <path> on Linux, open <path> on macOS, start <path> on Windows) and tell them the absolute path.
Always write the report into the reviewed project's docs/ folder:
<project-root>/docs/architecture-review-<project>-<MMDDYYYY>-<HHMM>.html
<project-root>: git rev-parse --show-toplevel, or the current directory outside Git. Create docs/ if it doesn't exist.<project>: the basename of <project-root> (for example termight).<MMDDYYYY>-<HHMM>: local date and 24-hour time when the report is written, from date +%m%d%Y-%H%M (for example 10132026-1145 at 11:45 am, 10132026-1300 at 1 pm).-2, -3, and so on before .html.Reports must never be committed, pushed, or merged. Before writing the report in a Git repository, keep it out of Git locally:
git rev-parse --git-path info/exclude (this is correct in linked worktrees too)./docs/architecture-review-*.html, append that line, creating the file if needed. Don't edit .gitignore or any other tracked file.git check-ignore -q <report-path> succeeds. If git ls-files 'docs/architecture-review-*.html' lists any report, it is already tracked and the exclude won't hide it; tell the user rather than untracking it yourself.Never stage or commit the report.
The report uses Tailwind via CDN for layout and styling, and Mermaid via CDN for diagrams where a graph/flow/sequence reliably communicates the structure. Mix Mermaid with hand-crafted CSS/SVG visuals: use Mermaid when relationships are graph-shaped (call graphs, dependencies, sequences), and hand-built divs/SVG when you want something more editorial (mass diagrams, cross-sections, collapse animations). Each candidate gets a before/after visualisation. Be visual.
For each candidate, render a card with:
implement-recommendationStrong, Worth exploring, Speculative, rendered as a badgeIn full mode, include the project/dependency map and coverage summary from the exploration ledger. Show examined, unchecked, blocked, and excluded areas with paths and reasons where applicable. Include every worthwhile finding without the default three-candidate cap. Give each finding an impact and effort estimate with a short rationale, then rank by impact first and effort second. Assign recommendation numbers after ranking so report order and follow-up selections agree.
End the report with a Top recommendation section: which candidate you'd tackle first and why. If no candidate is worthwhile, explain that finding instead.
Use GLOSSARY.md vocabulary for the domain, and the /codebase-design vocabulary for the architecture. If GLOSSARY.md defines "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 in the card (e.g. a warning callout: "contradicts ADR-0007, but worth reopening because…"). Don't list every theoretical refactor an ADR forbids.
See HTML-REPORT.md for the full HTML scaffold, diagram patterns, and styling guidance.
Do NOT propose interfaces yet. After opening the report, tell the user its absolute path and stop. The user can request a design interview about a candidate in a follow-up.
Only when the user requests a design interview about a candidate, call the Skill tool with "grilling" to walk the decision tree with them: constraints, dependencies, the shape of the deepened module, what sits behind the seam, what tests survive. Picking a candidate for discussion does not authorize implementation or repository edits.
Keep proposed glossary and ADR changes in the conversation unless the user authorizes documentation edits. When those edits are authorized, call the Skill tool with "domain-modeling" to keep the domain model current as decisions crystallize:
GLOSSARY.md? Add the term to GLOSSARY.md. Create the file lazily if it doesn't exist.GLOSSARY.md right there.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub corynaegle-ai/agent-skills --plugin corynaegle-agent-skills40 skills in this plugin
/ask-mattAsk which skill or flow fits your situation. A router over the skills in this repo./chief-of-staffPursue a long-running goal in a single session by co-ordinating subagents./claude-handoffHand the current conversation off to a fresh background agent that picks up the work immediately./codebase-designShared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a seam goes, make code more testable or AI-navigable, or when another skill needs the deep-module vocabulary./code-reviewReview a branch, PR, or uncommitted work against repository standards, requested behavior, and test quality. Includes staged, unstaged, and untracked changes for work in progress./diagnosing-bugsDiagnosis loop for hard bugs and performance regressions. Use when the user says "diagnose"/"debug this", or reports something broken/throwing/failing/slow.