improve-codebase-architecture

improve-codebase-architecture is a skill for Claude Code, Codex from toverux/cantrips. It costs 32 tokens per session (1,419 once invoked), scanned A, original, MIT.

An architecture review that looks for opportunities to make code modules deeper: easier to test, easier to understand, and able to hide more implementation detail behind simple interfaces. It presents the findings as an HTML report before examining a chosen improvement.

In plain words
What is it for?
Use it to inspect a codebase's frequently changed areas, compare architectural improvements, and investigate one selected refactor.
Why use it?
It helps reveal repeated design friction and gives changes a shared structure instead of suggesting unrelated refactors.

Skill for Claude CodeCodex

Part of the cantrips plugin — 25 skills, 1 agent 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/toverux/cantrips/improve-codebase-architecture
Any agent
npx skills add toverux/cantrips --skill improve-codebase-architecture
Clone the repo
git clone --depth 1 https://github.com/toverux/cantrips

Made for: Claude Code, Codex.

Or install cantrips, the plugin that ships this one along with the rest of its 25 skills, 1 agent.

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/toverux/cantrips/improve-codebase-architecture.svg)](https://agentmods.dev/skills/toverux/cantrips/improve-codebase-architecture)
Your own site
<a href="https://agentmods.dev/skills/toverux/cantrips/improve-codebase-architecture"><img src="https://agentmods.dev/badge/skills/toverux/cantrips/improve-codebase-architecture.svg" alt="Measured on agentmods" height="20"></a>
Per session 32 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,419 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.00032 $0.01419
Opus 5 $0.00016 $0.00709
Sonnet 5 $0.00006 $0.00284
Haiku 4.5 $0.00003 $0.00142

Measured 4d ago against content hash a88959f59f4c, 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 · 76 lines

How it starts

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

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.

Built on a shared design vocabulary: run /codebase-design first and use its terms and principles exactly in every suggestion. Where the project keeps a domain glossary (an AGENTS.md glossary section or CONCEPTS.md), its terms give names to good seams.

Process

1. Explore

Scope before you scan — YAGNI. Deepening a module pays off by making future changes to it easier, so put extra weight on the parts of the codebase that have recently changed. Decide where to look before you look:

  • 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 the commit history (git log --oneline) to find the codebase's 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 project's domain glossary first, then — for whichever of the two stores the loop config enables — search docs/adr/ for standing decisions and docs/solutions/ for learnings and recorded rejections in the area: decisions already settled there should not be re-litigated. The loop config is docs/agents/cantrips-loop.md; when that doc is absent, both stores are off.

Then dispatch an exploration subagent to walk the codebase, in the background where the harness supports it (Claude Code: do not use run_in_background: false). 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?

Read the full file on GitHub · 76 lines

Files

What ships with it

2 files 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 · 76 lines · 32 tokens per session scan A a88959f59f4c

Subscribe to this mod's changes

improve-codebase-architecture is a skill published in the GitHub repository toverux/cantrips (2 stars, last pushed 4d ago), licensed MIT. It adds 32 tokens to every session and 1,419 once invoked, about $0.0002 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-31.

Related

Other skills, from other repositories

git-workflow

This skill should be used when the user asks to "create git commit", "manage branches", "follow git workflow", "use Conventional Commits", "handle merge conflicts", or asks about git branching strategies, version control best practices, pull request workflows. Provides comprehensive Git workflow guidance for team…

Galaxy-Dawn/claude-scholar · 64 tokens

daily-paper-generator

Use when the user asks to generate daily paper digests on a general topic. This skill supports both arXiv and bioRxiv (or either one), then produces structured Chinese/English summaries for selected papers.

Galaxy-Dawn/claude-scholar · 47 tokens

review

5-pass structured code review — correctness, security, performance, readability, consistency.

SethGammon/Citadel · 17 tokens

marshal

Meta-orchestrator that takes any direction — broad, specific, or vague — and autonomously chains skills and context into actionable work. Gathers context from codebase, docs, and memory. Only asks the user when it genuinely cannot proceed. Single-session orchestrator.

SethGammon/Citadel · 56 tokens

codex-autoresearch

Run autonomous, measurable experiments in a Git repository: change one hypothesis, verify a numeric metric, keep improvements, and revert failures. Use when the user wants Codex to keep iterating toward a numeric target in the foreground or as a detached background run. Do not use for ordinary one-shot coding…

leo-lilinxiao/codex-autoresearch · 80 tokens

consult-gov-grant

나에게 맞는 정부·공공기관 지원사업을 찾아주고, 심사 기준에 맞춘 사업계획서·신청서 초안을 만들어 드립니다(Word·한글·Excel 파일까지). 창업자·소상공인·중소기업·연구자·비영리단체·개인 누구나 쓸 수 있습니다. 다음과 같은 요청 시 사용하세요: "정부 지원사업 찾아줘" "우리 상황에 맞는 지원금 있어?" "사업계획서 초안 써줘" "지원서 작성 도와줘" "이 신청서 심사 기준으로 검토해줘" "마감 전에 뭐 준비해야 해?" "예비창업패키지 신청서 만들어줘" "지원금 어떻게 쓰는지 모르겠어" 지원사업 탐색·신청서 작성·서류 검토·일정 관리까지 도와주며, 마지막에…

modu-ai/moai-cowork · 283 tokens