ask-matt
Ask which skill or flow fits your situation. A router over the skills in this repo.
Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.
Claude Code
$ npx -y skills add mattpocock/skills --skill improve-codebase-architecture --agent claude-code
Codex
$ npx skills add mattpocock/skills --skill improve-codebase-architecture -a codex -y
Cursor
$ npx skills add mattpocock/skills --skill improve-codebase-architecture -a cursor -y
Gemini CLI
$ npx skills add mattpocock/skills --skill improve-codebase-architecture -a gemini-cli -y
GitHub Copilot
$ npx skills add mattpocock/skills --skill improve-codebase-architecture -a github-copilot -y
OpenCode
$ npx skills add mattpocock/skills --skill improve-codebase-architecture -a opencode -y
Windsurf
$ npx skills add mattpocock/skills --skill improve-codebase-architecture -a windsurf -y
name: improve-codebase-architecture description: Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick. disable-model-invocation: true
Surface architectural friction and propose **deepening opportunities**: refactors that turn shallow modules into deep ones. The aim is testability and AI-navigability.
This command is _informed_ by the project's domain model and built on a shared design vocabulary:
**Scope before you scan: YAGNI.** Deepening a module pays off by making future changes to it easier, so put extra weight on the parts of the codebase that have recently changed. Decide *where* to look before you look:
Read the project's domain glossary (`GLOSSARY.md`) and any ADRs in the area you're touching first.
Then spawn a sub-agent with a fresh context window 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 OS temp directory so nothing lands in the repo. Resolve the temp dir from `$TMPDIR`, falling back to `/tmp` (or `%TEMP%` on Windows), and write to `<tmpdir>/architecture-review-<timestamp>.html` so each run gets a fresh file. Open it for the user (`xdg-open <path>` on Linux, `open <path>` on macOS, `start <path>` on Windows) and tell them the absolute path.
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:
End the report with a **Top recommendation** section: which candidate you'd tackle first and why.
**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](HTML-REPORT.md) for the full HTML scaffold, diagram patterns, and styling guidance.
Do NOT propose interfaces yet. After the file is written, ask the user: "Which of these would you like to explore?"
Once the user picks 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.
Side effects happen inline as decisions crystallize; call the Skill tool with "domain-modeling" to keep the domain model current as you go:
My agent skills that I use every day to do real engineering - not vibe coding. Developing real applications is hard. Approaches like GSD, BMAD, and Spec-Kit try to help by owning the process.
Ask which skill or flow fits your situation. A router over the skills in this repo.
Review the changes since a fixed point (commit, branch, tag, or merge-base) along two axes: Standards (does the code follow this…
Shared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening…
Diagnosis loop for hard bugs and performance regressions. Use when the user says "diagnose"/"debug this", or reports something…
Build and sharpen a project's domain model. Use when discussing codebase terminology, writing or editing a GLOSSARY.md, or…
A relentless interview to sharpen a plan or design, which also creates docs (ADR's and glossary) as we go.
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
Act on user feedback attached to the current session. Use when the user submits feedback on the session's changes via the Submit…