Install
$ agentstack add skill-mateonunez-skills-improve-codebase-arch ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo 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.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
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 →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 toCONTEXT.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.mdright 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.
- Author: mateonunez
- Source: mateonunez/skills
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.