codebase-design
Installation
SKILL.md
Codebase Design — Deep Modules & Clean Seams
Mandatory Pre-Flight Context Inspection
Before designing module boundaries or internal libraries, you MUST inspect:
- Deep Module Ratio Rule → Create deep modules (small simple interface hiding heavy internal complexity); ban shallow 1-line wrapper functions
- Strict Information Hiding → Keep internal data structures and vendor clients strictly private (
#privateField); ban leaking internal ORM/DB entities in public APIs - Ports & Adapters Isolation → Define abstract interfaces for external services (storage, payments, email); keep core business domain logic decoupled from vendor SDKs
- Policy vs Mechanism Separation → Separate generic execution mechanisms (SQL queries, HTTP fetches) from domain business policies (retry rules, pricing models)
Activation Boundaries
- Activate when: Structuring new software packages, refactoring monolithic files into modular boundaries, designing internal SDKs, and decoupling domain logic from third-party dependencies.
- DO NOT activate when: Writing localized one-off utility helper functions or pure CSS styles.