codebase-design

codebase-design is a skill for Claude Code, Codex from vinvcn/mattpocock-skills-zh-CN. It costs 56 tokens per session (1,386 once invoked), scanned A, original, MIT.

A shared vocabulary and design guide for shaping code modules: small interfaces hide substantial behavior, with clear seams where behavior can be changed or tested.

In plain words
What is it for?
Use it when designing or refactoring interfaces, choosing where behavior can be replaced in tests, or making a codebase easier for people and AI tools to navigate.
Why use it?
It gives developers precise terms for discussing code structure, instead of using broad words that can mean different things. This helps reveal designs that are hard to test, understand, or change.

Skill for Claude CodeCodex

Written for Claude Code and Codex: shipped in a Claude Code plugin, but also agents/openai.yaml present. Also seen: mentions subagents.

Part of the mattpocock-skills plugin — 38 skills shipped together

Good fit Use it when designing or refactoring interfaces, choosing where behavior can be replaced in tests, or making a codebase easier for people and AI tools to navigate.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/vinvcn/mattpocock-skills-zh-cn/codebase-design
About the project

mattpocock-skills-zh-CN is a Simplified Chinese localization of a collection of reusable instructions for coding agents. Chinese-speaking developers use the translated skills to support engineering workflows while keeping their original commands, paths, identifiers, and behavior. The catalogue contains the localized skills, instructions, and plugin components.

vinvcn/mattpocock-skills-zh-CN · 5,277 stars · on GitHub · skills.sh

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add vinvcn/mattpocock-skills-zh-CN --skill codebase-design
Clone the repo
git clone --depth 1 https://github.com/vinvcn/mattpocock-skills-zh-CN

Made for: Claude Code, Codex.

Or install mattpocock-skills, the plugin that ships this one along with the rest of its 38 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for codebase-design

README.md
[![agentmods](https://agentmods.dev/badge/skills/vinvcn/mattpocock-skills-zh-cn/codebase-design/github.svg)](https://agentmods.dev/skills/vinvcn/mattpocock-skills-zh-cn/codebase-design)
Your own site
<a href="https://agentmods.dev/skills/vinvcn/mattpocock-skills-zh-cn/codebase-design"><img src="https://agentmods.dev/badge/skills/vinvcn/mattpocock-skills-zh-cn/codebase-design/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for codebase-design

Your own site · 80×15
<a href="https://agentmods.dev/skills/vinvcn/mattpocock-skills-zh-cn/codebase-design"><img src="https://agentmods.dev/badge/skills/vinvcn/mattpocock-skills-zh-cn/codebase-design.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 56 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,386 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • Socket pass 9 Oct 2026
  • Snyk pass 9 Oct 2026
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00056 $0.01386
Opus 5.5 $0.00022 $0.00554
Sonnet 5.5 $0.00011 $0.00277
Haiku 4.5 $0.00006 $0.00139

Measured 17d ago against content hash 7f3980323c33, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

codebase-design scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 17d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/engineering/codebase-design/SKILL.md · 116 lines

How it starts

The opening of the file, as written. The whole thing — 116 lines — stays where its author put it; the contents beside it link to each section on GitHub.

代码库设计

设计 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 过载)。

Adapter - 在 seam 上满足某个 interface 的具体东西。描述的是 role(填哪个槽位),不是 substance(内部是什么)。

Leverage - callers 从 depth 获得的收益:每学习一单位 interface,就得到更多能力。一个 implementation 会在 N 个 call sites 和 M 个 tests 中回本。

Locality - maintainers 从 depth 获得的收益:change、bugs、knowledge 和 verification 集中在一个地方,而不是散到 callers 里。修一次,到处都修好。

Deep 与 shallow

Deep module = small interface + lots of implementation:

+------------------+
| Small Interface  | -> few methods, simple params
+------------------+
|                  |
| Deep             | -> complex logic hidden
| Implementation   |
|                  |
+------------------+

Shallow module = large interface + little implementation(避免):

+-------------------------------+
| Large Interface               | -> many methods, complex params
+-------------------------------+
| Thin Implementation           | -> mostly pass-through
+-------------------------------+

Read the full file on GitHub · 116 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 17d ago Changed 7f3980323c33
  2. 1mo ago First seen · 116 lines · 56 tokens per session scan A d6a6fafb940c

Subscribe to this mod's changes

codebase-design is a skill published in the GitHub repository vinvcn/mattpocock-skills-zh-CN (5,277 stars, last pushed 6d ago), licensed MIT. It adds 56 tokens to every session and 1,386 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

claude-handoff

A handoff tool that prepares a summary of the current conversation for another coding agent and starts that agent in the background.

devcxl/mattpocock-skills-zh · 25 tokens

wayfinder

A planning method for large or unclear work that maps the decisions needed between the current situation and a defined destination. It records the map and decision tickets in an issue tracker.

devcxl/mattpocock-skills-zh · 57 tokens

setup-matt-pocock-skills

A setup skill that configures engineering skills for a repository, including its issue tracker, labels, and documentation layout. A repository is the project folder managed by version control.

devcxl/mattpocock-skills-zh · 43 tokens

setup-ts-deep-modules

A setup for TypeScript packages that hides their implementation behind files at the package root. Dependency-cruiser checks that outside code uses these entry points, prevents dependency cycles, and keeps internal folders private.

devcxl/mattpocock-skills-zh · 49 tokens

codebase-design

A design vocabulary and set of principles for organizing software modules, meaning pieces of code with an interface and an implementation. It focuses on small interfaces that hide substantial behavior, clear points for changing behavior, and code that is easier to test.

devcxl/mattpocock-skills-zh · 59 tokens

triage

A structured issue-triage process that moves issues and, where configured, pull requests through classification and status steps. Triage means deciding what a report is, whether more information is needed, and who should handle it.

devcxl/mattpocock-skills-zh · 39 tokens