improve-codebase-architecture

improve-codebase-architecture is a skill for Claude Code, Codex from aethrox/doctrine. It costs 73 tokens per session (1,173 once invoked), scanned A, original, MIT.

A codebase review that looks for design problems, explains why they happened, and ranks opportunities to improve the structure.

In plain words
What is it for?
Use it to review a whole codebase or a specific area, identify architectural friction, and prioritize design improvements.
Why use it?
It helps distinguish deliberate trade-offs from accidental problems, so technical debt can be addressed in a sensible order.

Skill for Claude CodeCodex

Part of the doctrine plugin — 33 skills shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/aethrox/doctrine/improve-codebase-architecture
Any agent
npx skills add aethrox/doctrine --skill improve-codebase-architecture
Clone the repo
git clone --depth 1 https://github.com/aethrox/doctrine

Made for: Claude Code, Codex.

Or install doctrine, the plugin that ships this one along with the rest of its 33 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for improve-codebase-architecture

README.md
[![agentmods](https://agentmods.dev/badge/skills/aethrox/doctrine/improve-codebase-architecture.svg)](https://agentmods.dev/skills/aethrox/doctrine/improve-codebase-architecture)
Your own site
<a href="https://agentmods.dev/skills/aethrox/doctrine/improve-codebase-architecture"><img src="https://agentmods.dev/badge/skills/aethrox/doctrine/improve-codebase-architecture.svg" alt="Measured on agentmods" height="20"></a>
Per session 73 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,173 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00073 $0.01173
Opus 5 $0.00036 $0.00587
Sonnet 5 $0.00015 $0.00235
Haiku 4.5 $0.00007 $0.00117

Measured 4d ago against content hash 9ffe390d003f, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

improve-codebase-architecture scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/improve-codebase-architecture/SKILL.md · 69 lines

How it starts

The opening of the file, as written. The whole thing — 69 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Improve Codebase Architecture

Not every rough edge is the same kind of problem. This skill's defining constraint, from Martin Fowler's technical debt quadrant: every finding is classified on two axes before it's prioritized: deliberate vs. inadvertent (was the tradeoff known at the time) and prudent vs. reckless (was it a reasoned tradeoff or a corner cut under pressure). A knowingly-accepted tradeoff and an accidental mistake call for different responses even when the resulting code looks identical.

This skill finds what's shallow; codebase-design supplies the vocabulary (module, interface, depth, seam, the deletion test) for describing why. Use that skill's terms exactly rather than drifting into generic words like "component" or "service."

Phase 1: Scope the scan

Decide where to look before looking everywhere, scanning a whole codebase uniformly dilutes attention across places that don't need it:

  • If the user named a module, subsystem, or pain point, take it directly.
  • Otherwise, walk back through recent commit history to find hot spots (files and areas that keep recurring) since a module actively being changed pays back a deepening investment faster than a stable, rarely-touched one.

Read any existing domain glossary or ADRs covering the scoped area first, so findings don't re-litigate a decision already made deliberately.

Phase 2: Find the friction

Walk the scoped code looking for Ousterhout-style red flags (see codebase-design for the full vocabulary):

  • A module whose interface is nearly as complex as its implementation; shallow, not deep.
  • Understanding one concept requires bouncing across many small modules to assemble the picture.
  • Logic extracted into "testable" pure functions while the real bugs live in how and where they're called; no locality.
  • A seam that's leaking implementation details across it instead of hiding them.

For each candidate, apply the deletion test: would removing it concentrate the complexity somewhere sensible, or just relocate the same mess? Only "concentrates" candidates are worth writing up.

Read the full file on GitHub · 69 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 69 lines · 73 tokens per session scan A 9ffe390d003f

Subscribe to this mod's changes

improve-codebase-architecture is a skill published in the GitHub repository aethrox/doctrine (18 stars, last pushed 22d ago), licensed MIT. It adds 73 tokens to every session and 1,173 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

debug-optimize-lcp

Guides debugging and optimizing Largest Contentful Paint (LCP) using Chrome DevTools MCP tools. Use this skill whenever the user asks about LCP performance, slow page loads, Core Web Vitals optimization, or wants to understand why their page's main content takes too long to appear. Also use when the user mentions…

ChromeDevTools/chrome-devtools-mcp · 99 tokens

specflow-use

To connect Rosetta with Grid Dynamics SpecFlow MCP; only when SpecFlow is mentioned and the MCP is installed.

griddynamics/rosetta · 27 tokens

opik-diagnose

Surface the Opik traces worth a developer's attention, ranked by signal — errors, failed tool calls, latency, regressions, and low online-eval scores — plus Diagnostics issues. Reads live/production traces via the SDK (searchtraces and agentinsights) and works with no MCP; uses the MCP issue entity when connected.…

comet-ml/opik-mcp · 147 tokens

ue-mcp-epic-routing

Use when deciding between ue-mcp's native category actions and Epic's wrapped ToolsetRegistry tools (the epic actions, incl. the Blueprint graph DSL) for a task in Unreal. Pulls in when authoring Blueprint graph bodies, or any time both a native action and an epic action could do the job and you need to pick.

db-lyon/ue-mcp · 81 tokens

mcp-google-map-project

Project knowledge for developing and maintaining @cablate/mcp-google-map. Architecture, Google Maps API guide, GIS domain knowledge, and design decisions. Read this skill to onboard onto the project or make informed development decisions.

cablate/mcp-google-map · 49 tokens

patsnap-maintain-payment

Patsnap Maintain Payment MCP for AI agents. A global patent search tool for freedom-to-operate assessment. It supports query-based, semantic, and image search, and can be combined with patent family, legal status, and analytics views to help users identify patents that may create FTO barriers more systematically. It…

patsnap/mcp · 84 tokens