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:

  1. Deep Module Ratio Rule → Create deep modules (small simple interface hiding heavy internal complexity); ban shallow 1-line wrapper functions
  2. Strict Information Hiding → Keep internal data structures and vendor clients strictly private (#privateField); ban leaking internal ORM/DB entities in public APIs
  3. Ports & Adapters Isolation → Define abstract interfaces for external services (storage, payments, email); keep core business domain logic decoupled from vendor SDKs
  4. 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.

2026 Architecture & Module Invariants

Installs
1
GitHub Stars
7
First Seen
Sep 13, 2026