Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

codebase-design

БесплатноБез исполняемых скриптовНе проверен

Shared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a…

PaulRBergот PaulRBerg★ 109 звёзд на GitHub

Об этом скилле

Codebase Design

Design deep modules: substantial behaviour behind a small interface at a clean seam, testable through that interface. Use this vocabulary when it clarifies a design decision. The aim is leverage for callers, locality for maintainers, and testability.

Glossary

Use these terms consistently where their distinctions matter.

Module: anything with an interface and an implementation. Deliberately scale-agnostic: a function, class, package, or tier-spanning slice. Avoid: unit, component, service.

Interface: everything a caller must know to use the module correctly: the type signature, but also invariants, ordering constraints, error modes, required configuration, and performance characteristics. Avoid: API, signature (too narrow because they refer only to the type-level surface).

Implementation: what is inside a module, its body of code. Distinct from Adapter: a thing can be a small adapter with a large implementation (a Postgres repo) or a large adapter with a small implementation (an in-memory fake). When the seam is the topic, use "adapter". Otherwise, use "implementation".

Depth: leverage at the interface. The amount of behaviour a caller (or test) can exercise per unit of interface they have to learn. A module is deep when a large amount of behaviour sits behind a small interface, shallow when the interface is nearly as complex as the implementation.

Seam (Michael Feathers): a place where you can alter behaviour without editing in that place. It is the location at which a module's interface lives. Where to put the seam is its own design decision, distinct from what goes behind it. Avoid: boundary (overloaded with DDD's bounded context).

Adapter: a concrete thing that satisfies an interface at a seam. Describes role (what slot it fills), not substance (what is inside).

Leverage: what callers get from depth. More capability per unit of interface they learn. One implementation pays back across N call sites and M tests.

Locality: what maintainers get from depth. Change, bugs, knowledge, and verification concentrate in one place rather than spreading across callers. Fix once, fixed everywhere.

Deep vs shallow

Deep module: small interface (few methods, simple params) hiding a lot of implementation.

Shallow module (avoid): interface nearly as large as its thin, pass-through implementation.

When designing an interface, ask:

  • Can I reduce the number of methods?
  • Can I simplify the parameters?
  • Can I hide more complexity inside?

Principles

  • Depth is a property of the interface, not the implementation. A deep module can contain small, mockable, swappable parts internally. These parts are not part of the interface. A module can have internal seams (private to its implementation, used by its own tests) as well as the external seam at its interface.
  • The deletion test. Imagine deleting the module. If complexity vanishes, it was a pass-through. If complexity reappears across N callers, the module was useful.
  • The interface is the test surface. Callers and tests cross the same seam. If you want to test past the interface, the module is probably the wrong shape.
  • One adapter means a hypothetical seam. Two adapters means a real one. Do not introduce a seam unless something actually varies across it.

Designing for testability

Good interfaces make testing natural:

  • At a real seam, accept the dependency as a parameter instead of constructing it inside the module.
  • Prefer returning results to side effects when that keeps the interface simpler.
  • Keep the surface small: fewer methods and parameters mean fewer, simpler tests.

Agent legibility

A codebase is agent-legible when an agent can reason about the full business domain directly from the repository.

  • The repository is the agent's only context. For the agent, knowledge in chat threads, external documents, or people's heads effectively does not exist. Record architecture decisions, norms, and plans as versioned artifacts in the repository.
  • Enforce invariants, not implementations. Encode layer dependency direction and the single seam for cross-cutting concerns as custom lints and structural tests. Inside those constraints, leave implementation choices free. For example, require parsing where data enters the system. Do not prescribe the parsing library.
  • Write custom lint errors as remediation instructions. These error messages land in agent context.
  • Centralize invariants in shared modules, not in hand-rolled helpers. This is locality. Validate data where it enters the system, or use typed SDKs. Never build on guessed data shapes.
  • Prefer dependencies that the agent can fully internalize. Choose stable, composable technologies that are well represented in training data. When a workaround for opaque upstream behavior costs more than a reimplementation, reimplement a sm
Полный SKILL.md на GitHub

Установить codebase-design в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

agents/openai.yamlreferences/AGENT-LEGIBILITY.mdreferences/DEEPENING.mdreferences/DESIGN-IT-TWICE.md

FAQ

Что делает скилл codebase-design?

Shared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a seam goes, make code more testable, AI-navigable, or agent-legible, choose which invariants to enforce mechanically, or when another skill needs the deep-module vocabulary.

Как установить скилл codebase-design?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл codebase-design запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить codebase-design с