Agent skill

Improve Codebase Architecture

by TwiTech-LAB in TwiTech-LAB/devchain

Plan architecture improvements and refactoring for a codebase: scan for deepening opportunities (shallow modules, leaky seams, low-leverage interfaces), present candidates as a markdown report with…

MITAuto-check passedDevelopment

Install Improve Codebase Architecture

skills CLI
$ npx skills add TwiTech-LAB/devchain --skill improve-codebase-architecture -a claude-code

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

GitHub CLI
$ gh skill install TwiTech-LAB/devchain 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/TwiTech-LAB/devchain.git skills-src && mkdir -p .claude/skills && cp -r skills-src/apps/local-app/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
101
Token cost
~3k tokens
SKILL.md length
1,521 words
Files
5
Skills in repo
6
Repo updated
First seen
Licence
MIT

At a glance

Plan architecture improvements and refactoring for a codebase: scan for deepening opportunities (shallow modules, leaky seams, low-leverage interfaces), present candidates as a markdown report with…

  • Asked to review
  • SKILL.md covers Step 0 — Load supporting files…, When to Use, When NOT to Use and Essential Principles, plus 3 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Improve code architecture

What it does

Improve Codebase Architecture is an agent skill from TwiTech-LAB/devchain. Plan architecture improvements and refactoring for a codebase: scan for deepening opportunities (shallow modules, leaky seams, low-leverage interfaces), present candidates as a markdown report with before/after diagrams, interview the user through the chosen design, and decompose the outcome into devchain epics. Optionally reviews the test suite too: duplicate and tautological tests, rules tested at several layers, mergeable spec files and fixture cost. Use when asked to review or improve code architecture, plan…

Its SKILL.md is about 3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 4 other files (for example `DESIGN-IT-TWICE.md`, `REPORT-FORMAT.md` and `TEST-REFACTORING.md`). Compatibility notes: Any devchain-managed project; intended for architect/planner agent roles

It sits in Development, covering Refactoring, Test generation and User stories. The repository describes itself as: Run a team of AI coding agents. On your machine. Local-first orchestration for Claude Code, Codex, OpenCode, Antigravity, and Copilot. The licence is MIT.

When your agent uses it

  • Asked to review
  • Improve code architecture
  • Plan a project refactoring
  • Refactor for testability

Example prompts

  • “/improve-codebase-architecture”

Requirements

  • Compatibility (from SKILL.md): Any devchain-managed project; intended for architect/planner agent roles

What it can do on your machine

Read from SKILL.md and the folder at commit 172b47c. 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

    No scripts in the folder and no shell commands in SKILL.md.

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

  • Network

    Links to these hosts (documentation or services it may open):

    • github.com

    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.

  • Compatibility

    Any devchain-managed project; intended for architect/planner agent roles

    From compatibility in the SKILL.md frontmatter.

Context cost

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

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

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 TwiTech-LAB/devchain at commit 172b47c, republished under its MIT licence (© TwiTech-LAB). 1,521 words, ~2,953 tokens.

Download SKILL.mdSave it as .claude/skills/improve-codebase-architecture/SKILL.md (or your agent's skills folder). This skill also uses 4 other files; get the full folder from GitHub.
name
improve-codebase-architecture
description
Plan architecture improvements and refactoring for a codebase: scan for deepening opportunities (shallow modules, leaky seams, low-leverage interfaces), present candidates as a markdown report with before/after diagrams, interview the user through the chosen design, and decompose the outcome into devchain epics. Optionally reviews the test suite too: duplicate and tautological tests, rules tested at several layers, mergeable spec files and fixture cost. Use when asked to review or improve code architecture, plan a project refactoring, refactor for testability or maintainability, hunt design debt or technical debt, or prepare an architecture-improvement plan.
compatibility
Any devchain-managed project; intended for architect/planner agent roles
displayName
Improve Codebase Architecture
license
MIT — adapted from mattpocock/skills (https://github.com/mattpocock/skills)
resources
VOCABULARY.md, REPORT-FORMAT.md, DESIGN-IT-TWICE.md, TEST-REFACTORING.md

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. The output is not code: it is a validated design plus a devchain epic breakdown a worker agent can execute.

Step 0 — Load supporting files (mandatory, do this first)

This skill is multi-file. Call devchain_get_skill with slug devchain/improve-codebase-architecture and note the returned contentPath. Then, with your file-read tool:

  1. Read <contentPath>/VOCABULARY.md now — every term you use in this workflow comes from it.
  2. Read <contentPath>/REPORT-FORMAT.md before writing the Phase 2 report.
  3. Read <contentPath>/DESIGN-IT-TWICE.md only if the optional exploration in Phase 3 is invoked.
  4. Read <contentPath>/TEST-REFACTORING.md only if the user includes test refactoring (Phase 0).

Do not proceed to Phase 1 until VOCABULARY.md is read. Use its terms exactly — module, interface, implementation, depth, seam, adapter, leverage, locality — and never substitute "component," "service," "API," or "boundary."

When to Use

  • The user asks to review, assess, or improve the architecture of a project.
  • Planning a refactor whose goal is testability, maintainability, or easier navigation.
  • A codebase feels hard to change and the user wants to know where the friction lives.
  • Preparing an architecture-improvement phase that must end as devchain epics.
  • The user wants to reduce, merge or clean up a test suite.

When NOT to Use

  • Bug hunting or correctness review — use a code-review skill instead.
  • Security auditing — use a security-review skill instead.
  • Small, pre-scoped refactors where the design is already decided — go straight to epic decomposition.
  • Greenfield design with no existing code — there is nothing to deepen yet.

Essential Principles

  1. Vocabulary discipline. All architectural claims use VOCABULARY.md terms exactly. Consistent language is what makes candidates comparable and the report legible. Project-native names stay as-is when citing concrete artifacts (a NestJS service class, a docs section that says "boundary") — the vocabulary governs your claims and never overrides the target project's documented standards (see the Scope section of VOCABULARY.md).
  2. Diagnose before prescribing. Phases 0–2 name problems and sketch solutions in one sentence each; interfaces are designed only in Phase 3, after the user picks a candidate.
  3. Evidence over vibes. Every candidate cites concrete files. Apply the deletion test before calling a module shallow.
  4. Decisions get recorded. Accepted designs become epics; load-bearing rejections are recorded where the project already keeps decisions, so future reviews don't re-suggest them. Recording is a byproduct — it never gates the work.
  5. This skill never writes application code. The end state is a report, recorded decisions, and epics for worker agents.

Workflow (linear — run the phases in order)

Phase 0 — Context intake

Entry: user has named a target project/codebase.

  1. Read the project's documentation entry point if one exists (docs/AGENTS.md, docs/README.md, or the repo root README) and its architecture docs.
  2. Read the domain glossary if one exists (CONTEXT.md, a glossary section, or equivalent). Use its terms for domain concepts throughout.
  3. Read the project's standing decisions wherever they live — the standards doc, architecture doc, or a decision-record folder. List them as context you must not re-derive. They are not vetoes: a candidate may contradict one, it just has to say so.
  4. Note any documented architectural guardrails (module-boundary rules, dependency policies, cycle allowlists).
  5. Ask once: "Include test refactoring in this run?" Recommend yes when the test suite is large or slow. If yes, read TEST-REFACTORING.md.

Exit: you can name the project's documented conventions, glossary terms (or their absence), and standing decisions, and you know whether test refactoring is included.

Phase 1 — Explore for deepening opportunities

Entry: Phase 0 complete; VOCABULARY.md read.

If your environment provides read-only exploration subagents (an Agent/Explore tool), fan the sweep out; otherwise explore sequentially yourself. Don't follow rigid heuristics — walk the code organically and note where you experience friction:

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

Apply the deletion test (VOCABULARY.md) to anything you suspect is shallow: would deleting it concentrate complexity, or just move it? "Concentrates" is the signal you want. Classify each candidate's dependencies using the dependency categories in VOCABULARY.md — the category determines the testing story you'll claim.

If test refactoring is included, also run the test sweep in TEST-REFACTORING.md.

Exit: a list of 3–7 candidates, each with concrete file references, a suspected diagnosis in vocabulary terms, and a dependency category.

Phase 2 — Candidate report

Entry: Phase 1 candidate list exists; REPORT-FORMAT.md read.

  1. Write the report in markdown exactly per REPORT-FORMAT.md: one card per candidate (files, problem, solution, wins, before/after diagram, recommendation strength, standing-decision callout where applicable) and a closing Top recommendation section.
  2. Standing-decision conflicts: if a candidate contradicts a recorded decision, surface it only when the friction is real enough to warrant revisiting; mark the card clearly. Don't list every theoretical refactor a past decision forbids — and don't drop a candidate merely because one does. The user decides; a past record never has a veto.
  3. Deliver the report as a chat message. If the user wants it persisted, write it to docs/architecture-reviews/<YYYY-MM-DD>.md in the target project.
  4. Do NOT propose interfaces yet. End by asking: "Which of these would you like to explore?"
  5. If test refactoring is included, add the test candidate cards from TEST-REFACTORING.md.

Exit: report delivered; user has picked a candidate (or ended the session).

Show full SKILL.md (591 more words)Show less
Phase 3 — Design interview (per chosen candidate)

Entry: user picked a candidate.

Interview the user relentlessly about the design until you reach shared understanding. Walk down each branch of the design tree — constraints, dependencies, the shape of the deepened module, what sits behind the seam, which tests survive — resolving dependencies between decisions one by one.

  1. Ask one question at a time; wait for the answer before the next. Multiple questions at once is bewildering.
  2. For every question, state your recommended answer and why.
  3. If a question can be answered by exploring the codebase, explore instead of asking.
  4. Optional: if the user wants to compare radically different interfaces for the deepened module, run the process in DESIGN-IT-TWICE.md. It is an advanced side-path — the core workflow never depends on it.

Exit: the deepened module's interface, seam placement, adapter set, and test surface are agreed with the user.

Phase 4 — Record decisions

Entry: the design interview produced agreements or load-bearing rejections.

  1. If the project keeps a domain glossary, add or sharpen terms that crystallized during the interview — the moment they crystallize, not batched.
  2. If the user rejects a candidate for a load-bearing reason, record it only when all three hold: hard to reverse, surprising without context, the result of a real trade-off. Write it where that project already keeps decisions — the topic doc that owns the rule, its progress log, or a backlog entry (see VOCABULARY.md Scope: follow the project's own conventions; don't introduce a decision-record format it doesn't use). One or two sentences. Skip ephemeral reasons.
  3. Never ask the user to review, approve, or sign a decision record, and never make one a precondition for the epics in Phase 5. The user's decision in the interview is the approval; the record just remembers it.

Exit: glossary and decision notes written or explicitly declined.

Phase 5 — Decompose into epics

Entry: an accepted design from Phases 3–4.

  1. Decompose the accepted design into devchain epics following your architect profile's decomposition SOP if you have one; otherwise create a parent epic for the improvement with sub-epics per independently testable step (verb-first titles, file references, acceptance criteria stated as observable behavior through the deepened module's interface).
  2. Testing tasks follow the replace, don't layer rule from VOCABULARY.md: new tests at the deepened interface; deleting obsolete shallow-module tests is part of the work, not an afterthought.
  3. Attach relevant skills to sub-epics via skillsRequired, including this skill's slug devchain/improve-codebase-architecture where the worker benefits from the vocabulary.
  4. Out-of-scope discoveries go to a backlog epic, not into the sub-epics.
  5. If test refactoring is included, create the test cleanup sub-epics from TEST-REFACTORING.md.

Exit: epics exist and reference the recorded decisions; nothing is left only in chat.

Success Criteria

  • VOCABULARY.md terms used exactly; no substitute terminology anywhere in the report or epics.
  • Every candidate has concrete file references, a dependency category, and passed (or explicitly failed) the deletion test.
  • Report follows REPORT-FORMAT.md, ends with a top recommendation, and proposes no interfaces.
  • The design interview asked one question at a time, each with a recommended answer.
  • Load-bearing rejections were recorded in the project's own decision home; accepted designs are traceable to epics.
  • No application code was written by this workflow.
  • If test refactoring was included, each removal follows the TEST-REFACTORING.md removal rule, and its epics carry before/after evidence.

Attribution

Adapted for DevChain from the MIT-licensed skill family by Matt Pocock — improve-codebase-architecture, codebase-design, grilling, and domain-modeling at github.com/mattpocock/skills. Key adaptations: markdown report instead of HTML, devchain epics as the execution sink, and provider-agnostic subagent guidance.

© TwiTech-LAB, 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 4 other files in apps/local-app/skills/improve-codebase-architecture of TwiTech-LAB/devchain.

  • SKILL.md
  • DESIGN-IT-TWICE.md
  • REPORT-FORMAT.md
  • TEST-REFACTORING.md
  • VOCABULARY.md

Open the folder on GitHubat commit 172b47c

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 skillTwiTech-LAB/devchain101—~3kAutomated safety check: PassMIT
Improve Appwondelai/skills2.4k—~6.1kAutomated safety check: PassMIT
Systematic Code Refactoringluongnv89/claude-howto42k—~3kAutomated safety check: PassMIT
Code Simplification for ego-litecitrolabs/ego-lite17k—~1.2kAutomated safety check: PassMIT
Code Refactoring Workflowluongnv89/claude-howto42k—~3.1kAutomated safety check: PassMIT
Tech Debt Analyzerailabs-393/ai-labs-claude-skills4542 repos~3.9kAutomated safety check: PassMIT

Similar skills

  • Improve App

    wondelai/skills

    Guided journey from a shipped app that works but feels rough to a product that fits the job, flows without friction, reads clearly, and persuades honestly.

    2.4k GitHub stars~6.1k tokensUpdated 27 days ago
    DevelopmentAuto-check passed
  • Systematic Code Refactoring

    luongnv89/claude-howto

    Guides refactoring in phases based on Martin Fowler's method: research, test coverage check, planning and small tested steps, with your approval at each phase.

    42k GitHub stars~3k tokensUpdated 7 days ago
    DevelopmentAuto-check passed
  • Finds and implements evidence-backed simplifications in the ego-lite repository, such as dead code, duplicated state and speculative abstractions, without hiding behavior changes.

    17k GitHub stars~1.2k tokensUpdated 15 days ago
    DevelopmentAuto-check passed
  • Code Refactoring Workflow

    luongnv89/claude-howto

    Guides systematic, test-backed refactoring in the style of Martin Fowler, moving through research, planning and small incremental changes with your approval at each phase.

    42k GitHub stars~3.1k tokensUpdated 7 days ago
    DevelopmentAuto-check passed
  • Tech Debt Analyzer

    ailabs-393/ai-labs-claude-skills

    This skill should be used when analyzing technical debt in a codebase, documenting code quality issues, creating technical debt registers, or assessing code maintainability.

    454 GitHub starsUsed in 2 repos~3.9k tokens
    DevelopmentAuto-check passed
  • FIXME Resolver

    tailcallhq/forgecode

    Finds every FIXME comment in a codebase, groups related ones across files into one task, implements the work they describe and removes the comments once it is done.

    7.6k GitHub stars~1.1k tokensUpdated today
    DevelopmentAuto-check passed

More from TwiTech-LAB/devchain

  • Asd Ste100 Skill

    TwiTech-LAB/devchain

    Write or rewrite English with ASD-STE100 Simplified Technical English rules: one meaning per word, active voice, simple tenses, one instruction per sentence.

    101 GitHub stars~1.2k tokensUpdated yesterday
    Auto-check passed
  • Vm Provisioning

    TwiTech-LAB/devchain

    Prepare a DevChain remote VM for development of a project. An agent skill from TwiTech-LAB/devchain.

    101 GitHub stars~1.8k tokensUpdated yesterday
    Auto-check: notes
  • Code Simplifier

    TwiTech-LAB/devchain

    Review a change set for reuse, simplification, efficiency, and altitude problems, then apply the fixes while preserving exact behavior.

    101 GitHub stars~2k tokensUpdated yesterday
    Auto-check passed
  • Create Commit

    TwiTech-LAB/devchain

    Create a git commit whose message records why the change exists, not just what changed.

    101 GitHub stars~1.2k tokensUpdated yesterday
    Auto-check passed
  • Project Skill Review

    TwiTech-LAB/devchain

    Review the skills stored for a project. An agent skill from TwiTech-LAB/devchain.

    101 GitHub stars~2k tokensUpdated yesterday
    Auto-check passed

Categories

Questions about Improve Codebase Architecture

What does Improve Codebase Architecture do?

Plan architecture improvements and refactoring for a codebase: scan for deepening opportunities (shallow modules, leaky seams, low-leverage interfaces), present candidates as a markdown report with…. Improve Codebase Architecture is an agent skill from TwiTech-LAB/devchain. Plan architecture improvements and refactoring for a codebase: scan for deepening opportunities (shallow modules, leaky seams, low-leverage interfaces), present candidates as a markdown report with before/after diagrams, interview the user through the chosen design, and decompose the outcome into devchain epics.

When should I use Improve Codebase Architecture?

Improve Codebase Architecture fits situations like: asked to review; improve code architecture; plan a project refactoring; refactor for testability.

How do I install Improve Codebase Architecture in Claude Code?

Run `npx skills add TwiTech-LAB/devchain --skill improve-codebase-architecture -a claude-code`. Or copy the skill folder (apps/local-app/skills/improve-codebase-architecture in TwiTech-LAB/devchain) 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 TwiTech-LAB/devchain --skill improve-codebase-architecture -a codex`. Or copy the skill folder (apps/local-app/skills/improve-codebase-architecture in TwiTech-LAB/devchain) 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 TwiTech-LAB/devchain --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?

SKILL.md names no scripts, command-line tools or credentials: Improve Codebase Architecture is instructions for the agent only. Compatibility (from SKILL.md): Any devchain-managed project; intended for architect/planner agent roles.

Does Improve Codebase Architecture access the network?

SKILL.md names 1 domain. As links in the text: github.com. 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 (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Improve Codebase Architecture use?

About 3k tokens (SKILL.md is roughly 12k 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 App (wondelai/skills, 2.4k stars), Systematic Code Refactoring (luongnv89/claude-howto, 42k stars), Code Simplification for ego-lite (citrolabs/ego-lite, 17k stars) and Code Refactoring Workflow (luongnv89/claude-howto, 42k 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?

TwiTech-LAB (a GitHub organization) maintains it in TwiTech-LAB/devchain, which has 101 GitHub stars. The repository holds 6 skills in this directory. The repository was last updated on October 7, 2026.

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