Individual skill

codebase-design

设计深度模块的共享词汇。当用户想要设计或改进模块的接口、寻找深化机会、决定 seam 的位置、让代码更可测试或更易被 AI 导航,或者其他 skill 需要深度模块词汇时使用。

skills/engineering/codebase-design/SKILL.md

Read pinned source

Source commit 30fc5dbf9380144598f3593e6c1e22c713a52c2a

What was checked

Matches the observed repository HEAD
Yes
Scanner rules are current
Yes
Repository scan complete
No
Skill scan complete
Yes
Observed behavior
Network or broad shell
Last checked
Nov 10, 2026

These are observations at the recorded commit, not a guarantee of safety. Review the source before running it.

Install this skill

Choose an agent in your Stack or copy a command below. Commands fetch the pinned commit and copy only this skill directory. Existing destinations are refused. Copying a command does not install anything.

An install command is unavailable: current rules, complete repository and skill scans, an eligible behavior level and a permitted license are required.

Repository context

Repository stars (not skill ratings)
538
Repository last updated
Nov 3, 2026
License
MIT

Observed agent integration: No specific integration evidence. Standard SKILL.md installation does not imply verified compatibility.

Files and excerpt

File metadata and permitted, redacted excerpts come from the recorded scan. Source links are pinned to that commit.

Browse files
Read excerpt

# Codebase Design

设计 **深度模块(deep modules)**:一个小接口背后承载大量行为,放置在干净的 seam 处,通过该接口可测试。在设计和重构代码的任何地方,都使用这套语言和原则。目标是:对调用者而言是杠杆效应(leverage),对维护者而言是局部性(locality),对所有人而言是可测试性。

## 词汇表

精确使用以下术语 —— 不要替换为"组件"、"服务"、"API"或"边界"。使用一致的语言正是关键所在。

**Module(模块)** —— 任何具有接口和实现的东西。特意与规模无关:一个函数、类、包或跨层级切片。_避免使用_:单元、组件、服务。

**Interface(接口)** —— 调用者正确使用该模块所需知道的一切:类型签名,还包括不变性约束、顺序约束、错误模式、所需配置和性能特征。_避免使用_:API、签名(过于狭隘 —— 它们仅指类型层面的表面)。

**Implementation(实现)** —— 模块内部的内容,它的代码主体。与 **Adapter(适配器)** 不同:某个东西可以是一个小型适配器配大型实现(如 Postgres 仓库),也可以是一个大型适配器配小型实现(如内存中的假实现)。当讨论重点是 seam 时使用"adapter";否则使用"implementation"。
Back to top