Community程式設計與開發github.com

mattpocock/領域建模

建立並精煉專案的領域模型。當使用者需要定義領域術語或通用語言、記錄架構決策,或當其他技能需要維護領域模型時使用。

領域建模 是什麼?

這個技能專注於主動建立和精煉專案的領域模型,而不僅僅是被動閱讀術語。它幫助開發者和 AI 助手在使用者設計過程中,挑戰模糊語言、發明邊界案例、即時更新術語表,並在必要時記錄架構決策記錄(ADR)。支援的檔案結構包括單一上下文(CONTEXT.md)和多重上下文(需有 CONTEXT-MAP.md 指向各子上下文),以及每個上下文下的 ADR 目錄。技能強調術語表應完全避免實作細節,只作為純粹的術語字典;ADR 則僅在決策難以逆轉、對未來讀者驚奇且經過真實權衡時才建立。這個技能適合在 Cursor、Claude Code 等具備檔案系統存取能力的平台上使用,透過語意理解、即時校對與互動討論,幫助團隊維持一致且精確的領域語言。

相容平台~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.

相關技能