Skip to content

Shared vocabulary and principles for designing deep modules with small interfaces, well-placed seams, and testable boundaries.

CCM score
61 of 100
skills.sh installs
4.5K
GitHub stars
6.2K
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers module, interface, implementation, depth, seam, adapter, leverage, and locality, with precise definitions for each term
  • Includes a deep-versus-shallow comparison, a deletion test for spotting pass-through modules, and guidance on making interfaces testable
  • Enforces one-adapter-is-hypothetical, two-adapters-is-real as the rule for when to introduce a seam
  • Designed for designing or refactoring modules, and for other skills that need the deep-module vocabulary

Install

$ npx -y skills add vinvcn/mattpocock-skills-zh-cn --skill codebase-design -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

代码库设计

设计 deep modules:把大量行为放在小 interface 之后,把 interface 放在清晰 seam 上,并通过该 interface 测试。凡是在设计或重构代码时,都使用这套语言和原则。目标是给 callers 带来 leverage,给 maintainers 带来 locality,并让每个人都更容易测试。

术语表

准确使用这些术语,不要替换成 "component"、"service"、"API" 或 "boundary"。一致语言就是重点。

Module - 任何拥有 interface 和 implementation 的东西。它故意不限定尺度:function、class、package,或跨层 slice 都可以。Avoid: unit, component, service.

Interface - caller 为了正确使用 module 必须知道的一切:type signature,以及 invariants、ordering constraints、error modes、required configuration 和 performance characteristics。Avoid: API, signature(太窄,只指 type-level surface)。

Implementation - module 内部的代码体。它不同于 Adapter:一个东西可以是小 adapter 但有大 implementation(Postgres repo),也可以是大 adapter 但 implementation 很小(in-memory fake)。讨论 seam 时说 adapter;其他时候说 implementation。

Depth - interface 上的 leverage:caller(或 test)每学习一单位 interface,就能触达多少行为。大量行为藏在小 interface 后面时,module 是 deep;interface 几乎和 implementation 一样复杂时,module 是 shallow。

Seam(Michael Feathers)- 你可以在不编辑当前位置的情况下改变行为的地方;也就是 module 的 interface 所在的 location。seam 放在哪里是独立设计决策,不同于 seam 后面放什么。Avoid: boundary(它和 DDD bounded context 过载)。

Details

Repository
github.com/vinvcn/mattpocock-skills-zh-cn
Categories
Code Review & Quality, Skill & Plugin Building
First seen
Jul 14, 2026

Questions

What does the codebase-design skill do?

It gives agents a shared vocabulary for designing deep modules, meaning a small interface placed on a clear seam that hides a lot of behavior behind it. It is meant for designing or refactoring code so callers get leverage, maintainers get locality, and the code is easier to test and navigate.

When should I use the codebase-design skill?

Use it when you want to design or improve a module interface, find deepening opportunities, decide where a seam should go, or make code easier to test and navigate for AI. Other skills that need deep module vocabulary can also rely on it.

How do I install the codebase-design skill?

Run npx -y skills add vinvcn/mattpocock-skills-zh-cn --skill codebase-design -y inside your project. Once installed, the agent can apply deep module principles such as the deletion test and designing interfaces around seams.

Which skills lead codebase-design in the Code Review & Quality category?

In the Code Review & Quality category, codebase-design sits alongside improve-codebase-architecture, code-review, setup-ts-deep-modules and caveman-review. It stands out by focusing on the design of deep modules and their seams rather than on reviewing finished code.

More from vinvcn/mattpocock-skills-zh-cn

All 24

Similar to Codebase Design

More Code Review & Quality