---
title: "improve-codebase-architecture"
type: entity
tags: [catalog, invocation, advanced, well-established]
created: 2026-08-02
updated: 2026-11-09
sources: ["raw/github_doc-skills-engineering-improve-codebase-architecture-skill-md.md", "raw/github_doc-v1-3-2-skills-engineering-improve-codebase-architecture-skill-md-2026-11-09.md", "raw/github_release-v1-3-0-2026-11-09.md", "raw/github_release-v1-3-2-2026-11-09.md"]
confidence: high
skills_snapshot: "2ab958093e83e0ec752e6c1c5932da465bf23e0c"
---

# improve-codebase-architecture

## Overview

`improve-codebase-architecture` scans a codebase for "deepening opportunities" — refactors that turn shallow modules into deep ones — presents them as a visual HTML report, then runs a grilling loop through whichever candidate the user picks. It is codebase upkeep, not feature work: the survey that finds candidates for `/codebase-design` to design and `/grill-with-docs` to sharpen into an idea.

## Characteristics

**User-invoked** — frontmatter carries `disable-model-invocation: true`. Uses the `/codebase-design` vocabulary (module, interface, depth, seam, adapter, leverage, locality) for every suggestion, and `GLOSSARY.md`/ADRs for domain naming and prior decisions. Since v1.3.2 it walks the codebase with a sub-agent started in a fresh context window, not a fork of the conversation. Writes a self-contained HTML report (Tailwind CDN + Mermaid CDN) to the OS temp directory as `<tmpdir>/architecture-review-<timestamp>.html` — never into the repo — and opens it via `xdg-open`/`open`/`start`.

## How to Use

Process: (1) **Explore** — scope by user direction or by walking `git log --oneline` for hot spots, read `GLOSSARY.md`/ADRs, then have that fresh-context sub-agent note friction (concept understanding scattered across modules, shallow interfaces, extracted-for-testability functions with no locality, leaky seams, untested/hard-to-test areas), applying the deletion test to anything suspected shallow; (2) **present candidates** as HTML cards — Files, Problem, Solution, Benefits, a before/after diagram, and a Recommendation strength badge (`Strong` / `Worth exploring` / `Speculative`) — ending with a Top recommendation, then ask "Which of these would you like to explore?"; (3) **grilling loop** — run `/grilling` on the chosen candidate, updating `GLOSSARY.md` inline and offering an ADR when the user rejects a candidate for a load-bearing reason. Picking a candidate generates an idea to take into the main flow at `/grill-with-docs`.

## Related Entities

- [[entities/codebase-design]] — the vocabulary this skill's report and grilling loop use throughout.
- [[entities/domain-modeling]] — kept current inline as decisions crystallize during the grilling loop.
- [[entities/diagnosing-bugs]] — a bug that exposes a missing seam is a reason to run this skill (the automatic hand-off was removed in v1.3.0).
- [[entities/grill-with-docs]] — where a chosen candidate feeds back into the main flow.
- [[entities/ask-matt]] — names this as the codebase-health loop.
- [[entities/promoted-catalog]] — full inventory.
