Agent skill

Improve Codebase Architecture

by ayoubben18 in ayoubben18/ab-method

Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.

MITAuto-check passedDevelopment

Install Improve Codebase Architecture

skills CLI
$ npx skills add ayoubben18/ab-method --skill improve-codebase-architecture -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install ayoubben18/ab-method improve-codebase-architecture --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/ayoubben18/ab-method.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/improve-codebase-architecture .claude/skills/improve-codebase-architecture && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
improve-codebase-architecture
GitHub stars
192
Token cost
~1.9k tokens
SKILL.md length
1,024 words
Files
2
Skills in repo
26
Repo updated
First seen
Licence
MIT

At a glance

Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.

  • Works in 3 steps: Explore → Present candidates as an HTML report → Grilling loop
  • The user wants to improve architecture
  • Calls git
  • Find refactoring opportunities

What it does

Improve Codebase Architecture is an agent skill from ayoubben18/ab-method. Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick. Informed by the domain language in CONTEXT.md and the decisions in docs/adr/. Use when the user wants to improve architecture, find refactoring opportunities, consolidate tightly-coupled modules, or make a codebase more testable and AI-navigable.

Its SKILL.md is about 1.9k tokens, which your agent loads only when the skill is triggered. The skill folder holds 1 other file (for example `HTML-REPORT.md`).

It sits in Development, covering Architecture decision records and Refactoring. The repository describes itself as: A workflow system for Claude Code and Codex. It grills a problem into a domain-grounded plan, then either drives it through test-driven missions you review one at a time, or… The licence is MIT.

When your agent uses it

  • The user wants to improve architecture
  • Find refactoring opportunities
  • Consolidate tightly-coupled modules
  • Make a codebase more testable and AI-navigable

Example prompts

  • “/improve-codebase-architecture”

Workflow steps

3 steps, taken from the step headings in SKILL.md.

  1. Explore
  2. Present candidates as an HTML report
  3. Grilling loop

What it can do on your machine

Read from SKILL.md and the folder at commit 85946e3. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • git

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Improve Codebase Architecture loads about 1.9k tokens when it runs. Until then it costs about 101 tokens; SKILL.md has 1,024 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~101
When it runs · the whole SKILL.md, loaded when a task matches
~1.9k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from ayoubben18/ab-method at commit 85946e3, republished under its MIT licence (© ayoubben18). 1,024 words, ~1,914 tokens.

Download SKILL.mdSave it as .claude/skills/improve-codebase-architecture/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
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. Informed by the domain language in CONTEXT.md and the decisions in docs/adr/. Use when the user wants to improve architecture, find refactoring opportunities, consolidate tightly-coupled modules, or make a codebase more testable and AI-navigable.

Improve Codebase Architecture

Surface architectural friction and propose deepening opportunities — refactors that turn shallow modules into deep ones. The aim is testability and AI-navigability.

This skill is built on a shared design vocabulary and informed by the project's domain model:

  • Architecture vocabulary — run the 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.
  • Domain language — 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.

Process

1. Explore

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:

  • If the user named a direction — a module, a subsystem, a pain point — take it and skip the inference below.
  • Otherwise walk back a good stretch of history (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.
  • Read the accumulated drift first if the project has it. Every task's 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)
  • Relevant ADRs in docs/adr/ (and any context-scoped docs/adr/ directories)

If 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:

  • Where does understanding one concept require bouncing between many small modules?
  • Where are modules shallow — interface nearly as complex as the implementation?
  • Where have pure functions been extracted just for testability, but the real bugs hide in how they're called (no locality)?
  • Where do tightly-coupled modules leak across their seams?
  • Which parts of the codebase are untested, or hard to test through their current interface?

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.

Show full SKILL.md (560 more words)Show less
2. Present candidates as an HTML report

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:

  • Files — which files/modules are involved
  • Problem — why the current architecture is causing friction
  • Solution — plain English description of what would change
  • Benefits — in terms of locality and leverage, and how tests would improve
  • Before / After diagram — side by side, illustrating the shallowness and the deepening
  • Recommendation strength — Strong, Worth exploring, or Speculative, rendered as a badge

End 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?"

3. Grilling loop

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:

  • Naming a deepened module after a concept not in 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.
  • Sharpening a fuzzy term during the conversation? Update CONTEXT.md right there.
  • User rejects the candidate with a load-bearing reason? Offer an ADR, framed as: "Want me to record this as an ADR so future architecture reviews don't re-suggest it?" Only offer when the reason would actually be needed by a future explorer to avoid re-suggesting the same thing — skip ephemeral reasons ("not worth it right now") and self-evident ones. See ADR-FORMAT.md.
  • Want to explore alternative interfaces for the deepened module? Run the codebase-design skill and use its DESIGN-IT-TWICE.md parallel sub-agent pattern.
  • Deepening a cluster with awkward dependencies? DEEPENING.md has the four dependency categories and the seam discipline for each.

This skill proposes and designs; it does not implement. Once the shape is agreed, the work becomes a task — /create-task grills it into missions and tdd builds it. Don't start editing source here.

© ayoubben18, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in .agents/skills/improve-codebase-architecture of ayoubben18/ab-method.

  • SKILL.md
  • HTML-REPORT.md

Open the folder on GitHubat commit 85946e3

Compare with similar skills

Improve Codebase Architecture next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Improve Codebase Architecture compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Improve Codebase Architecture this skillayoubben18/ab-method192—~1.9kAutomated safety check: PassMIT
Improve Codebase Architectureywwynm/EverythingDone14415 repos~1.3kAutomated safety check: PassGPL-3.0
Learning OpportunitiesDrCatHicks/learning-opportunities2.5k—~2.5kAutomated safety check: PassCC-BY-4.0
Task Workflowikarenkov/Modo343—~2.4kAutomated safety check: PassNone
Ad Deepenalexandremendoncaalvaro/CorridorKey-Runtime7551 repos~2kAutomated safety check: PassCustom licence
Vibe CodingOfficeDev/microsoft-365-agents-toolkit781—~5.5kAutomated safety check: PassCustom licence

Similar skills

  • Improve Codebase Architecture

    ywwynm/EverythingDone

    Find deepening opportunities in a codebase, informed by the domain language in CONTEXT.md and the decisions in docs/adr/.

    144 GitHub starsUsed in 15 repos~1.3k tokens
    DevelopmentAuto-check passed
  • Learning Opportunities

    DrCatHicks/learning-opportunities

    Facilitates deliberate skill development during AI-assisted coding.

    2.5k GitHub stars~2.5k tokensUpdated 1 mo ago
    DevelopmentAuto-check passed
  • Task Workflow

    ikarenkov/Modo

    Spec-driven workflow for non-trivial work. An agent skill from ikarenkov/Modo.

    343 GitHub stars~2.4k tokensUpdated 3 mo ago
    DevelopmentAuto-check passed
  • Ad Deepen

    alexandremendoncaalvaro/CorridorKey-Runtime

    Surface deepening opportunities in the codebase using the Ousterhout/Feathers vocabulary from WORKFLOW §8 (Module / Interface / Depth / Seam / Adapter / Leverage / Locality).

    755 GitHub starsUsed in 1 repo~2k tokens
    DevelopmentAuto-check passed
  • Vibe Coding

    OfficeDev/microsoft-365-agents-toolkit

    End-to-end workflow for agent-driven changes that add or modify behavior in the toolkit packages.

    781 GitHub stars~5.5k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Squid Architecture Review

    iusztinpaul/squid

    Periodic architectural sweep — reads existing ADRs, maps modules/dependencies/layering, and reports up to 10 prioritised findings shaped as refactor proposals /squid-refactor can consume directly.

    203 GitHub stars~2.6k tokensUpdated 1 mo ago
    DevelopmentAuto-check passed

More from ayoubben18/ab-method

All 26 skills in this repo
  • Codebase Design

    ayoubben18/ab-method

    Shared vocabulary and principles for designing deep modules — small interfaces, clean seams, testable through the interface.

    192 GitHub stars~1.7k tokensUpdated 6 days ago
    Auto-check passed
  • Grill With Docs

    ayoubben18/ab-method

    Grilling session that challenges your plan against the existing domain model, sharpens terminology, and updates documentation (CONTEXT.md, ADRs) inline as decisions crystallise.

    192 GitHub stars~2.1k tokensUpdated 6 days ago
    Auto-check passed
  • Change Map

    ayoubben18/ab-method

    Draw a task's blast radius twice. An agent skill from ayoubben18/ab-method.

    192 GitHub stars~2.9k tokensUpdated 6 days ago
    Auto-check passed
  • Handoff

    ayoubben18/ab-method

    Compact the current conversation (or a side-topic that surfaced mid-grill) into a handoff document another agent can pick up.

    192 GitHub stars~696 tokensUpdated 6 days ago
    Auto-check passed
  • Reconcile Roadmap

    ayoubben18/ab-method

    Cross-plan coherence critic for a whole roadmap. An agent skill from ayoubben18/ab-method.

    192 GitHub stars~2.8k tokensUpdated 6 days ago
    Auto-check passed
  • Review Implementation

    ayoubben18/ab-method

    Post-implementation review. An agent skill from ayoubben18/ab-method.

    192 GitHub stars~1.5k tokensUpdated 6 days ago
    Auto-check passed

Categories

Questions about Improve Codebase Architecture

What does Improve Codebase Architecture do?

Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick. Improve Codebase Architecture is an agent skill from ayoubben18/ab-method. Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.

When should I use Improve Codebase Architecture?

Improve Codebase Architecture fits situations like: the user wants to improve architecture; find refactoring opportunities; consolidate tightly-coupled modules; make a codebase more testable and AI-navigable.

How do I install Improve Codebase Architecture in Claude Code?

Run `npx skills add ayoubben18/ab-method --skill improve-codebase-architecture -a claude-code`. Or copy the skill folder (.agents/skills/improve-codebase-architecture in ayoubben18/ab-method) into .claude/skills/improve-codebase-architecture in your project. Claude Code loads it when a task matches its description.

How do I install Improve Codebase Architecture in Codex?

Run `npx skills add ayoubben18/ab-method --skill improve-codebase-architecture -a codex`. Or copy the skill folder (.agents/skills/improve-codebase-architecture in ayoubben18/ab-method) into .agents/skills/improve-codebase-architecture in your project. Codex loads it when a task matches its description.

Can I use Improve Codebase Architecture in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add ayoubben18/ab-method --skill improve-codebase-architecture -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/improve-codebase-architecture, .gemini/skills/improve-codebase-architecture, .github/skills/improve-codebase-architecture and .opencode/skills/improve-codebase-architecture in your project.

What does Improve Codebase Architecture need to run?

Going by SKILL.md and its folder, Improve Codebase Architecture needs the command-line tools its instructions call (git).

Does Improve Codebase Architecture access the network?

SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Improve Codebase Architecture safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Improve Codebase Architecture use?

Improve Codebase Architecture is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Improve Codebase Architecture use?

About 1.9k tokens (SKILL.md is roughly 7.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Improve Codebase Architecture?

Skills that share tags, products or a category with Improve Codebase Architecture: Improve Codebase Architecture (ywwynm/EverythingDone, 144 stars), Learning Opportunities (DrCatHicks/learning-opportunities, 2.5k stars), Task Workflow (ikarenkov/Modo, 343 stars) and Ad Deepen (alexandremendoncaalvaro/CorridorKey-Runtime, 755 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Improve Codebase Architecture?

ayoubben18 (a GitHub user) maintains it in ayoubben18/ab-method, which has 192 GitHub stars. The repository holds 26 skills in this directory. The repository was last updated on October 1, 2026.

Source: ayoubben18/ab-method on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.