Codebase design

From stevesolun/ctx · View interactive version

Codebase design is an AI agent skill from the GitHub repository stevesolun/ctx. Design or improve module interfaces using deep-module heuristics. Use when deciding where a seam belongs, reducing caller-facing complexity, improving testability or navigability, or comparing module designs.

How to use this skill

Skill file

Codebase Design

Seek deep modules: substantial useful behavior behind a small, stable

interface. Use the concepts below as design lenses, while matching the

repository's established domain language.

Working vocabulary

modes—not just a type signature.

concentrated for maintainers.

Translate these terms to the project's vocabulary when that makes the design

clearer. Consistency with the codebase is more valuable than enforcing a private

lexicon.

Design workflow

  1. Map representative callers, responsibilities, dependencies, and existing

contracts.

  1. Look for coordination or policy that can move behind a smaller interface.
  2. Place seams where variation, ownership, or test isolation justifies them.
  3. Compare alternatives when the choice is consequential.
  4. Validate the candidate with representative caller code and tests.

Heuristics, not laws

must understand.

across callers, it was likely earning its keep.

compatibility, ownership, policy, or navigation boundary.

indirection; avoid interfaces justified only by hypothetical futures.

tests when they provide cheaper or more precise feedback.

testability; side effects and internally created dependencies can still be

appropriate at well-defined boundaries.

Read DEEPENING.md when consolidating a cluster across dependency

boundaries. Read DESIGN-IT-TWICE.md when materially

different interface designs can be explored independently.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.