Community编程与开发github.com

mattpocock/领域建模

构建并精炼项目的领域模型。当用户需要确定领域术语或通用语言、记录架构决策,或其他技能需要维护领域模型时使用。

领域建模 是什么?

该技能旨在帮助AI代理在项目开发过程中主动构建和完善领域模型。它不仅仅是读取词汇表,而是在术语出现时立即挑战、澄清并记录。技能要求代理在用户使用与现有术语冲突的词汇时立即指出,将模糊或过载的术语精确化,并通过具体场景验证领域关系。同时,代理需检查代码与实际描述是否一致,一旦发现矛盾就提出。术语解析后立即更新CONTEXT.md,而ADR(架构决策记录)只有在满足三个条件(难以撤销、缺乏上下文会令人费解、真实权衡的结果)时才创建,避免不必要的文档负担。该技能支持单上下文和多上下文项目结构,文件按需创建。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/mattpocock/skills/tree/main/skills/engineering/domain-modeling

Installed? Explore more 编程与开发 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

领域建模 是做什么的?

在设计过程中主动构建并精炼项目的领域模型。这是一项主动的规范 —— 质疑术语、发明边界场景,并在概念形成的那一刻立即记录术语和决策。(仅仅阅读 CONTEXT.md 中的词汇并非此技能——那是任何技能都能做到的一行习惯。本技能适用于当你在改变模型,而不仅仅是消费它时。)

文件结构

大多数仓库只有一个上下文:

/
├── CONTEXT.md
├── docs/
│   └── adr/
│       ├── 0001-event-sourced-orders.md
│       └── 0002-postgres-for-write-model.md
└── src/

如果根目录存在 CONTEXT-MAP.md,则表示仓库有多个上下文。该文件指向每个上下文所在位置:

/
├── CONTEXT-MAP.md
├── docs/
│   └── adr/                          ← 系统级决策
├── src/
│   ├── ordering/
│   │   ├── CONTEXT.md
│   │   └── docs/adr/                 ← 上下文特定决策
│   └── billing/
│       ├── CONTEXT.md
│       └── docs/adr/

在你有内容需要写入之前,请懒惰地创建文件。如果 CONTEXT.md 不存在,则在解析第一个术语时创建。如果 docs/adr/ 不存在,则在需要第一个 ADR 时创建。

在会话期间

对照术语表进行质疑

当用户使用的术语与 CONTEXT.md 中已有语言冲突时,立即指出。“你的术语表将‘取消’定义为 X,但你似乎指的是 Y —— 实际是哪一个?”

精炼模糊语言

当用户使用模糊或过载的术语时,提出一个精确的规范术语。“你说的是‘账户’—— 你指的是客户还是用户?这两者是不同的。”

讨论具体场景

当讨论领域关系时,用具体场景对其进行压力测试。构思能够探测边界情况的场景,迫使用户精确界定概念之间的界限。

与代码交叉引用

当用户陈述某个功能的运作方式时,检查代码是否一致。如果发现矛盾,提出来:“你的代码取消了整个订单,但你刚刚说可以部分取消 —— 哪个是正确的?”

内联更新 CONTEXT.md

当某个术语被解析时,立即更新 CONTEXT.md。不要批量处理——在它们发生时捕获。使用 CONTEXT-FORMAT.md 中的格式。

CONTEXT.md 应完全不含实现细节。切勿将 CONTEXT.md 视为规范、草稿或实现决策的存储库。它仅且仅是一个术语表。

谨慎提供 ADR

仅在以下三个条件同时满足时才提出创建 ADR:

  1. 难以撤销 —— 日后改变主意的成本很大
  2. 缺乏上下文则令人费解 —— 未来的读者会疑惑“他们为什么这样做?”
  3. 真实权衡的结果 —— 存在真正的备选方案,并且你基于特定原因选择了其中一个

如果缺少任何一条,则跳过 ADR。使用 ADR-FORMAT.md 中的格式。

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

mattpocock/ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

mattpocock/caveman

Ultra-compressed communication mode. Cuts token usage ~75% by dropping filler, articles, and pleasantries while keeping full technical accuracy. Use when user says "caveman mode", "talk like caveman", "use caveman", "less tokens", "be brief", or invokes /caveman.

mattpocock/claude-handoff

Hand the current conversation off to a fresh background agent that picks up the work immediately.

mattpocock/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 or AI-navigable, or when another skill needs the deep-module vocabulary.

mattpocock/design-an-interface

Generate multiple radically different interface designs for a module using parallel sub-agents. Use when user wants to design an API, explore interface options, compare module shapes, or mentions "design it twice".

mattpocock/diagnose

Disciplined diagnosis loop for hard bugs and performance regressions. Reproduce → minimise → hypothesise → instrument → fix → regression-test. Use when user says "diagnose this" / "debug this", reports a bug, says something is broken/throwing/failing, or describes a performance regression.

mattpocock/diagnosing-bugs

Diagnosis loop for hard bugs and performance regressions. Use when the user says "diagnose"/"debug this", or reports something broken/throwing/failing/slow.

mattpocock/edit-article

Edit and improve articles by restructuring sections, improving clarity, and tightening prose. Use when user wants to edit, revise, or improve an article draft.

mattpocock/git-guardrails-claude-code

Set up Claude Code hooks to block dangerous git commands (push, reset --hard, clean, branch -D, etc.) before they execute. Use when user wants to prevent destructive git operations, add git safety hooks, or block git push/reset in Claude Code.

mattpocock/grilling

Grill the user relentlessly about a plan or design. Use when the user wants to stress-test a plan before building, or uses any 'grill' trigger phrases.

mattpocock/grill-me

Interview the user relentlessly about a plan or design until reaching shared understanding, resolving each branch of the decision tree. Use when user wants to stress-test a plan, get grilled on their design, or mentions "grill me".

mattpocock/grill-with-docs

Grilling session that challenges your plan against the existing domain model, sharpens terminology, and updates documentation (CONTEXT.md, ADRs) inline as decisions crystallise. Use when user wants to stress-test a plan against their project's language and documented decisions.

mattpocock/handoff

Compact the current conversation into a handoff document for another agent to pick up.

mattpocock/implement

Implement a piece of work based on a PRD or set of issues.

mattpocock/implement-spec

Implement a specification in code.

mattpocock/improve-codebase-architecture

Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.

mattpocock/loop-me

Grill me about specs for the workflows I want to build, within this workspace.

mattpocock/migrate-to-shoehorn

Migrate test files from `as` type assertions to @total-typescript/shoehorn. Use when user mentions shoehorn, wants to replace `as` in tests, or needs partial test data.

mattpocock/obsidian-vault

Search, create, and manage notes in the Obsidian vault with wikilinks and index notes. Use when user wants to find, create, or organize notes in Obsidian.

mattpocock/prototype

Build a throwaway prototype to flesh out a design — a runnable terminal app for state/business-logic questions, or several radically different UI variations toggleable from one route.

相关技能