grill-with-docs
- 信任分
- 88/100
- 兼容 Agent
- 1
- 领域
- 工程开发
- 兼容 Agent
- Claude Code
- 信任分
- 88 / 100 · 社区维护
- 作者 / 版本 / 许可
- @mattpocock · 未声明 license
- 安装命令数
- 1 条
需要注意: 未限定 allowed-tools,默认拥有全部工具权限。
想读作者英文原文? ↓ 滚到正文区切换 · 在 GitHub 查看 ↗
设计思路
grill-with-docs 是 grill-me 的「领域知识增强版」——拷问的同时维护两份语料文件:CONTEXT.md(领域术语表)和 docs/adr/(架构决策记录)。每当用户用一个术语和已有定义冲突、或用一个模糊词、或对一段代码的描述与代码本身矛盾,skill 会立刻挑出来;术语一旦敲定,当场写进 CONTEXT.md,不批处理。
仓库布局
单一 context 项目:
/
├── docs/adr/ ← system-wide decisions
├── CONTEXT.md
├── src/
多 context 项目根有 CONTEXT-MAP.md 指引各 context 在哪:
/
├── CONTEXT-MAP.md
├── docs/adr/ ← system-wide decisions
├── src/
│ ├── ordering/
│ │ ├── CONTEXT.md
│ │ └── docs/adr/ ← context-specific decisions
│ └── billing/
│ ├── CONTEXT.md
│ └── docs/adr/
lazy 创建——没有 CONTEXT.md / docs/adr/ 就先不建,第一个术语 / ADR 出现时再建。
Session 中的核心动作
- Challenge against the glossary:术语和已有定义冲突就立刻提:「你的 glossary 把『cancellation』定义为 X,但你这里似乎指 Y——到底是哪个?」
- Sharpen fuzzy language:模糊或重载的词出现时提议精确替换:「你说的『account』指 Customer 还是 User?这两件事不一样。」
- Discuss concrete scenarios:讨论领域关系时用具体场景压力测——构造边界 case 强迫对方精确化。
- Cross-reference with code:用户讲的工作机制和代码不一致时立刻挑:「你的代码取消整个 Order,但你刚才说支持部分取消——哪个是对的?」
- Update CONTEXT.md inline:术语敲定就当场写入,不批处理。
CONTEXT.md 的纪律
- 是 glossary,不是 spec / 草稿 / 实现决策的归宿——纯粹术语表,绝不混实现细节。
- 用
CONTEXT-FORMAT.md的格式。
ADR 的纪律
只有同时满足以下三条才提议建 ADR:
- 难以回退:以后改主意代价不小
- 没有上下文会让未来读者疑惑:"为什么这样做?"
- 真权衡的结果:有真备选项,因具体理由选了这个
三条缺一就跳过 ADR,用 ADR-FORMAT.md 的格式。
适合谁
- 在做 DDD(领域驱动设计)的项目
- 团队术语长期混乱、需要建 ubiquitous language 的产品
- 写 ADR 但不知道何时该写、何时该跳过的工程负责人
何时不该用
- 简单 CRUD / 工具脚本——没有领域复杂度
- 临时实验——ADR 写出来很快就过时
配套
grill-me(无语料的拷问母法)、ubiquitous-language(专门维护通用语言)、brainstorming(前期发散设计)。
Interview me relentlessly about every aspect of this plan until we reach a shared understanding. Walk down each branch of the design tree, resolving dependencies between decisions one-by-one. For each question, provide your recommended answer.
Ask the questions one at a time, waiting for feedback on each question before continuing.
If a question can be answered by exploring the codebase, explore the codebase instead.
Domain awareness
During codebase exploration, also look for existing documentation:
File structure
Most repos have a single context:
/
├── CONTEXT.md
├── docs/
│ └── adr/
│ ├── 0001-event-sourced-orders.md
│ └── 0002-postgres-for-write-model.md
└── src/
If a CONTEXT-MAP.md exists at the root, the repo has multiple contexts. The map points to where each one lives:
/
├── CONTEXT-MAP.md
├── docs/
│ └── adr/ ← system-wide decisions
├── src/
│ ├── ordering/
│ │ ├── CONTEXT.md
│ │ └── docs/adr/ ← context-specific decisions
│ └── billing/
│ ├── CONTEXT.md
│ └── docs/adr/
Create files lazily — only when you have something to write. If no CONTEXT.md exists, create one when the first term is resolved. If no docs/adr/ exists, create it when the first ADR is needed.
During the session
Challenge against the glossary
When the user uses a term that conflicts with the existing language in CONTEXT.md, call it out immediately. "Your glossary defines 'cancellation' as X, but you seem to mean Y — which is it?"
Sharpen fuzzy language
When the user uses vague or overloaded terms, propose a precise canonical term. "You're saying 'account' — do you mean the Customer or the User? Those are different things."
Discuss concrete scenarios
When domain relationships are being discussed, stress-test them with specific scenarios. Invent scenarios that probe edge cases and force the user to be precise about the boundaries between concepts.
Cross-reference with code
When the user states how something works, check whether the code agrees. If you find a contradiction, surface it: "Your code cancels entire Orders, but you just said partial cancellation is possible — which is right?"
Update CONTEXT.md inline
When a term is resolved, update CONTEXT.md right there. Don't batch these up — capture them as they happen. Use the format in CONTEXT-FORMAT.md.
CONTEXT.md should be totally devoid of implementation details. Do not treat CONTEXT.md as a spec, a scratch pad, or a repository for implementation decisions. It is a glossary and nothing else.
Offer ADRs sparingly
Only offer to create an ADR when all three are true:
- Hard to reverse — the cost of changing your mind later is meaningful
- Surprising without context — a future reader will wonder "why did they do it this way?"
- The result of a real trade-off — there were genuine alternatives and you picked one for specific reasons
If any of the three is missing, skip the ADR. Use the format in ADR-FORMAT.md.