/ab-method:improve-codebase-architecturefrom ab-method
Scans a codebase for architectural friction, generates a visual HTML report of deepening opportunities, and guides you through selecting and delegating refactors to /create-task. Best for deliberate repo-wide reviews or consolidating tightly-coupled modules.
Ships in ab-method. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Surface architectural friction and propose deepening opportunities — refactors that turn shallow modules into deep ones. The aim is testability and AI-navigability.
Optional. Every task already deepens the modules it touches: create-task § 3 runs a deepening scan over the task's blast radius and plans the refactors as missions placed first. Reach for this skill only for a deliberate review wider than one task — a whole subsystem, the repo, or the drift several tasks have piled up.
This skill is built on a shared design vocabulary and informed by the project's domain model:
codebase-design skill for the terms (module, interface, depth, seam, adapter, leverage, locality) and the principles (the deletion test, "the interface is the test surface", "one adapter = hypothetical seam, two = real"). Use those terms exactly in every suggestion — don't drift into "component," "service," "API," or "boundary." It is the single source; this skill doesn't restate it.codebase-design skill's RED-FLAGS.md. Every candidate names the symptom it causes (change amplification, cognitive load, unknown unknowns), not a feeling.docs/seams/ records the app's seams (format: codebase-design's SEAM-FORMAT.md). A caller that bypasses one, or a seam still migrating, is a candidate; a settled seam is not re-proposed.CONTEXT.md gives names to good seams; ADRs in docs/adr/ record decisions this skill should not re-litigate. See CONTEXT-FORMAT.md and ADR-FORMAT.md.Scope before you scan — YAGNI. Deepening a module pays off by making future changes to it easier, so weight the parts of the codebase that keep changing. Decide where to look before looking:
git log --oneline) to find the hot spots — the files and areas that keep coming up — and let those paths pull your attention first. If the changes are scattered with no clear hot spot, widen the net.docs/tasks/*/change-map.md records the modules that task planned to touch and the ones it actually touched. A module that shows up as unplanned across several tasks is a sharper hot-spot signal than raw commit frequency: it isn't just where changes land, it's where changes land that nobody expected them to. That is a locality problem by definition, and it's the highest-value place to start. (change-map only reports it — acting on it is this skill's job.)Read the existing documentation first:
CONTEXT.md (or CONTEXT-MAP.md + each CONTEXT.md in a multi-context repo)docs/adr/ (and any context-scoped docs/adr/ directories)docs/seams/index.md, then the seam docs in the area you're scanningIf any of these files don't exist, proceed silently — don't flag their absence or suggest creating them upfront.
Then use the Agent tool with subagent_type=Explore 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 — open on macOS, xdg-open on Linux, start on Windows — and tell the user the absolute path.
The report uses Tailwind via CDN for layout and Mermaid via CDN for graph-shaped diagrams. Each candidate gets a before/after visualisation. Be visual — the diagrams carry the weight, the prose is sparse.
For each candidate, render a card with:
RED-FLAGS.md) and the symptom it causesStrong, Worth exploring, or Speculative, rendered as a badgeEnd with a Top recommendation section: which candidate you'd tackle first, and why.
See HTML-REPORT.md for the scaffold, diagram patterns, and styling guidance.
No network? Fall back to markdown. The Tailwind and Mermaid CDNs are the only external dependency; if the environment is offline or the user asks for it, present the same candidate cards as a numbered markdown list in the conversation — same fields, same badges, same Top recommendation. The report format is a presentation choice, not the substance.
Use CONTEXT.md vocabulary for the domain and codebase-design vocabulary for the architecture. If CONTEXT.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. an amber callout: "contradicts ADR-0007 — but worth reopening because…"). Don't list every theoretical refactor an ADR forbids.
Do NOT propose interfaces yet. After the file is written, ask: "Which of these would you like to explore?"
Once the user picks a candidate, invoke the grill-with-docs skill 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 — the grill maintains the domain model as it goes:
CONTEXT.md? Add the term to CONTEXT.md — same discipline as /domain-model (see CONTEXT-FORMAT.md). Create the file lazily if it doesn't exist.CONTEXT.md right there.codebase-design skill and use its DESIGN-IT-TWICE.md parallel sub-agent pattern.This skill proposes and designs; it does not implement. Once the shape is agreed, hand it to /create-task, seeded with the agreed shape: the module, its interface, what sits behind the seam, and the callers to migrate. A shape that introduces or changes a seam enters create-task's seam design gate with the interface already picked. Don't start editing source here.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
architecture-review, refactoring, codebase-analysis, deepening
npx claudepluginhub ayoubben18/ab-method --plugin ab-method36 skills in this plugin
/ab-analyze-backendAnalyze and document a project's backend patterns — API design, data access, service structure. Use when the user wants a backend-only architecture analysis./ab-analyze-frontendAnalyze and document a project's frontend patterns — component structure, state management, conventions. Use when the user wants a frontend-only architecture analysis./ab-analyze-projectAnalyze a project's architecture end to end — extract domain language, map the tech stack, document frontend and backend patterns. Use when onboarding a new codebase or refreshing the architecture baseline.Other plugins' skills for the same job