improve-codebase-arch
Find deepening opportunities in a codebase, informed by domain language in CONTEXT.md and decisions in docs/adr/.
Skill by mateonunez
Chalk Labs
Need help deploying improve-codebase-arch?
Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/mateonunez-improve-codebase-arch
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/improve-codebase-arch
What's inside
- Skill name
improve-codebase-arch- Description
- Find deepening opportunities in a codebase, informed by domain language in CONTEXT.md and decisions in docs/adr/. Use when you want to improve architecture, find refactoring opportunities, consolidate tightly-coupled modules, or make a codebase more testable and AI-navigable.
- License
- MIT
- Instructions
- 66 lines in SKILL.md · view on GitHub
Files (1)
- SKILL.md
SKILL.md (first lines)
# Improve Codebase Architecture
Surface architectural friction and propose **deepening opportunities** — refactors that turn shallow modules into deep ones. Goal: testability and AI-navigability.
## Glossary
Use these terms exactly. Consistent language matters — don't drift into "component," "service," "API," or "boundary." Full definitions in CONTEXT.md.
- **Module** — anything with an interface and implementation (function, class, package, slice)
- **Interface** — everything a caller must know: types, invariants, error modes, ordering, config
- **Implementation** — the code inside
- **Depth** — leverage at the interface: a lot of behaviour behind a small interface
- **Shallow** — interface nearly as complex as the implementation
- **Seam** — where an interface lives; a place behavior can be altered without editing in place
- **Adapter** — a concrete thing satisfying an interface at a seam
- **Deep module** — high functionality, simple interface, rarely changing. Wins: locality + leverage for callers
Key principle: **Deletion test**. Imagine deleting the module. If complexity vanishes, it was a pass-through. If complexity reappears across N callers, it was earning its keep.
## Process
### 1. Explore
Read CONTEXT.md (domain glossary) and ADRs in the touched area first. Then explore the codebase organically. 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 implementation?
- Where have pure functions been extracted just for testability, but real bugs hide in how they're called (no locality)?
- Where do tightly-coupled modules leak across seams?
- Which parts 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? "Yes, concentrates" is the signal you want.
### 2. Present candidates
Present a numbered list of deepening opportunities. For each candidate:
- **Files** — which files/modules are involved
- **Problem** — why current architecture causes friction
- **Solution** — plain English description of what would change
- **Benefits** — in terms of locality and leverage, and how tests would improve
**Use CONTEXT.md vocabulary for the domain.** 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 reopening the ADR. Mark it clearly (e.g. _"contradicts ADR-0007 — but worth reopening because…"_). Don't list every theoretical refactor an ADR forbids.
Do NOT propose interfaces yet. Ask: "Which of these would you like to explore?"
### 3. Grilling loop
Once user picks a candidate, drop into grilling conversation. Walk the design tree — constraints, dependencies, the shape of the deepened module, what sits behind the seam, what tests survive.
Side effects happen inline as decisions crystallize:
- **Naming a deepened module after a concept not in `CONTEXT.md`?** Add the term to `CONTEXT.md` — same discipline as creating a new glossary entry. Create the file lazily if it doesn't exist.
- **Sharpening a fuzzy term during 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 prevent future re-suggestion — skip ephemeral reasons ("not worth it right now") and self-evident ones.
- **Want to explore alternative interfaces?** Dive into design iterations, surface tradeoffs.
## Anti-patterns
- **Don't refactor without understanding the failure mode first.** I've watched agents refactor by aesthetic rules, then discover the friction was elsewhere.
- **Don't propose microservices to solve a monolith problem.** The issue is usually interface design or locality, not physical separation. Separation without a seam just spreads the mess.
- **Don't rename things and call it refactoring.** Renaming is hygiene, not architecture. Real refactors change how code is organized, tested, or reasoned about.From mateonunez/skills, MIT.
More from mateonunez/skills
- 0.536score
code-review
mateonunez
Review a diff or PR against my conventions — Result not throw, vertical slices, AItError codes, node:test, Biome, entity normalisation, a11y.
SkillCFreshness: C★ 8Claude Code +9 - 0.536score
result-not-throw
mateonunez
I return Result<T, E extends Error> from business logic — never throw.
SkillCFreshness: C★ 8Claude Code +9 - 0.536score
vertical-slices
mateonunez
I organise code by feature, not by layer.
SkillCFreshness: C★ 8Claude Code +9 - 0.536score
entity-normalization
mateonunez
When data crosses a system boundary into my code, I normalise it into a typed entity with a __type discriminator and a fixed common shape.
SkillCFreshness: C★ 8Claude Code +9 - 0.536score
production-observability
mateonunez
Include error telemetry, request context, and queue visibility in production code.
SkillCFreshness: C★ 8Claude Code +9 - 0.536score
prototyping
mateonunez
Build a throwaway prototype to flush out a design before committing.
SkillCFreshness: C★ 8Claude Code +9 - 0.536score
single-tool-per-job
mateonunez
Biome is enough.
SkillCFreshness: C★ 8Claude Code +9 - 0.536score
setup-mateonunez-skills
mateonunez
Scaffold the per-repo conventions my other engineering skills assume — pnpm + corepack, Biome (1.9 legacy or 2.x new), node:test posture, CONTEXT.md, docs/adr/.
SkillCFreshness: C★ 8Claude Code +9 - 0.536score
node-native-tests
mateonunez
I use node:test + borp + c8, not Jest or Vitest.
SkillCFreshness: C★ 8Claude Code +9 - 0.536score
fastify-plugin-shape
mateonunez
How I write Fastify plugins — fastify-plugin wrapper, idempotency guard, decorator pattern, withX() helper for TS narrowing, module augmentation.
SkillCFreshness: C★ 8Claude Code +9 - 0.535score
fastify-orama
mateonunez
Knowledge pack for fastify-orama — a Fastify plugin that integrates Orama full-text search with persistence support.
SkillCFreshness: C★ 8Claude Code +9 - 0.531score
grill-me-mateo
mateonunez
Grill me on a plan or change before I write code, but with my canonical four questions baked in — package boundary, error code, vertical slice, ADR.
SkillCFreshness: C★ 8Claude Code +9
Signals
- Stars
- 8
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- Jul 21, 2026 (3 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/mateonunez/skills
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from mateonunez
- 0.536score
entity-normalization
mateonunez
When data crosses a system boundary into my code, I normalise it into a typed entity with a __type discriminator and a fixed common shape.
SkillCFreshness: C★ 8Claude Code +9 - 0.536score
code-review
mateonunez
Review a diff or PR against my conventions — Result not throw, vertical slices, AItError codes, node:test, Biome, entity normalisation, a11y.
SkillCFreshness: C★ 8Claude Code +9 - 0.536score
result-not-throw
mateonunez
I return Result<T, E extends Error> from business logic — never throw.
SkillCFreshness: C★ 8Claude Code +9 - 0.536score
production-observability
mateonunez
Include error telemetry, request context, and queue visibility in production code.
SkillCFreshness: C★ 8Claude Code +9 - 0.536score
prototyping
mateonunez
Build a throwaway prototype to flush out a design before committing.
SkillCFreshness: C★ 8Claude Code +9 - 0.536score
fastify-plugin-shape
mateonunez
How I write Fastify plugins — fastify-plugin wrapper, idempotency guard, decorator pattern, withX() helper for TS narrowing, module augmentation.
SkillCFreshness: C★ 8Claude Code +9
Done for you
Rather not set it up yourself?
Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.
See how we build AI agents →Read the case studies
Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.
- launches shipped
- 50+
- launches shipped
- media placements
- 500+
- media placements
- founders on every account
- 2
- founders on every account
Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block
Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.
Get improve-codebase-arch running in your business
Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.
Cite this page
improve-codebase-arch skill. Agent Mart. https://agentmart.dev/skills/mateonunez-improve-codebase-arch (last updated 2026-10-24)