improve-codebase-architecture

Identifies shallow modules and proposes deepening refactors to improve codebase testability and navigability.

Updated May 12, 2026
One-click install
npx skills add https://github.com/eduardtomasek/codex-dev-stack --skill improve-codebase-architecture-eduardtomasek
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: improve-codebase-architecture
Source: https://github.com/eduardtomasek/codex-dev-stack/tree/main/skills/.agents/improve-codebase-architecture
Command: npx skills add https://github.com/eduardtomasek/codex-dev-stack --skill improve-codebase-architecture-eduardtomasek

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Codebases accumulate shallow modules whose interfaces are nearly as complex as their implementations, scattering logic across tightly-coupled files and making testing and navigation difficult. This Skill surfaces that architectural friction and proposes concrete deepening refactors grounded in the project's own domain language and recorded decisions. ## Core Features & Use Cases - Deepening Opportunity Discovery: Explores the codebase with sub-agents to find shallow modules, pass-through abstractions, and tightly-coupled seams, applying the deletion test to validate each candidate. - Consistent Architecture Vocabulary: Enforces a shared glossary (module, interface, depth, seam, adapter, leverage, locality) so every suggestion uses the same precise terms, aligned with the project's CONTEXT.md domain language. - ADR-Aware Recommendations: Reads docs/adr/ before suggesting changes, flags candidates that contradict existing ADRs, and offers to record new ADRs when candidates are rejected for load-bearing reasons. - Parallel Interface Design: Spawns multiple sub-agents to design radically different interfaces for a chosen candidate, then compares them by depth, locality, and seam placement with an opinionated recommendation. - Use Case: A team inherits a service where business logic is smeared across dozens of small handlers. Use this Skill to get a numbered list of consolidation candidates, pick one, and walk through a grilling session that produces a deep module with a small interface and tests written at that interface. ## Quick Start Ask the assistant to review this codebase for architecture improvements and list deepening opportunities using the improve-codebase-architecture skill.

Frequently Asked Questions about improve-codebase-architecture

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find refactoring opportunities in a large codebase?▼

Use this Skill to explore the codebase with sub-agents that look for shallow modules, pass-through abstractions, and tightly-coupled seams. It applies the deletion test to each candidate and presents a numbered list of deepening opportunities with files, problems, and benefits.

What is a deep module versus a shallow module?▼

A deep module hides a large amount of behaviour behind a small interface, giving callers high leverage. A shallow module has an interface nearly as complex as its implementation, so it adds indirection without hiding complexity.

Does this Skill respect existing architecture decision records?▼

Yes. It reads docs/adr/ before proposing changes and only surfaces candidates that contradict an ADR when the friction justifies reopening it, clearly marking the conflict. It can also record new ADRs when a candidate is rejected for a load-bearing reason.

How does the Skill design a new interface for a module?▼

It spawns three or more parallel sub-agents, each designing a radically different interface under distinct constraints such as minimal entry points or maximum flexibility. It then compares the designs by depth, locality, and seam placement and gives an opinionated recommendation.

When should I not introduce a new seam or port?▼

Do not introduce a seam unless at least two adapters justify it, typically a production adapter and a test adapter. A single-adapter seam is just indirection, and the Skill treats one adapter as a hypothetical seam rather than a real one.