AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Improve Codebase Arch

skill-mateonunez-skills-improve-codebase-arch · by mateonunez

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.

No reviews yet
0 installs
31 views
0.0% view→install

Install

$ agentstack add skill-mateonunez-skills-improve-codebase-arch

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-mateonunez-skills-improve-codebase-arch)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
4mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Improve Codebase Arch? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

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.

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.