跳转到内容

GLOSSARY 格式

# {Context Name}
{用一两句话说明这个上下文是什么,以及它为什么存在。}
## Language
**Order**:
{用一两句话描述这个术语}
_Avoid_: Purchase, transaction
**Invoice**:
针对一笔 **Order** 的付款请求,交付后发送给这笔订单的 **Customer**。
_Avoid_: Bill, payment request
**Customer**:
下 **Order** 的个人或组织。
_Avoid_: Client, buyer, account
  • 明确取舍。 同一概念有多个词时,选出最合适的词,并在 _Avoid_ 下列出其他词。
  • 定义简洁。 最多一两句话。说明它是什么,不要说明它做什么。
  • 定义中提到的术语要加粗。 定义提到其他术语时,将其写成 **Order**,并让所在句子说清两者的关系。
  • 只收录项目上下文特有的术语。 通用编程概念(如超时、错误类型、实用模式)不应收录,即使项目大量使用这些概念也一样。添加术语前,先问:这是这个上下文独有的概念,还是通用编程概念?只有前者才应收录。
  • 术语自然形成类别时,按小标题分组。 如果所有术语都属于同一个紧密关联的领域,使用平铺列表即可。

单上下文(大多数仓库): 在仓库根目录放一个 GLOSSARY.md。

多上下文: 在仓库根目录放一个 GLOSSARY-MAP.md,列出各个上下文、它们的位置,以及彼此之间的关系:

# 术语表映射
## 上下文
- [Ordering](./src/ordering/GLOSSARY.md):接收并跟踪客户订单
- [Billing](./src/billing/GLOSSARY.md):生成发票并处理付款
- [Fulfillment](./src/fulfillment/GLOSSARY.md):管理仓库拣货和发货
## 关系
- **Ordering → Fulfillment**:Ordering 发出 `OrderPlaced` 事件;Fulfillment 接收事件并开始拣货
- **Fulfillment → Billing**:Fulfillment 发出 `ShipmentDispatched` 事件;Billing 接收事件并生成发票
- **Ordering ↔ Billing**:共享 `CustomerId` 和 `Money` 类型

skill 会判断适用哪种结构:

  • 如果存在 GLOSSARY-MAP.md,读取它以查找上下文
  • 如果只有根目录下的 GLOSSARY.md,则为单上下文
  • 如果两者都不存在,在确定第一个术语时再按需创建根目录下的 GLOSSARY.md

存在多个上下文时,根据当前话题推断它对应哪个上下文。如果无法确定,就提问。

英文 GLOSSARY-FORMAT.md
# GLOSSARY.md Format
## Structure
```md
# {Context Name}
{One or two sentence description of what this context is and why it exists.}
## Language
**Order**:
{A one or two sentence description of the term}
_Avoid_: Purchase, transaction
**Invoice**:
A request for payment for an **Order**, sent to its **Customer** after delivery.
_Avoid_: Bill, payment request
**Customer**:
A person or organization that places an **Order**.
_Avoid_: Client, buyer, account
```
## Rules
- **Be opinionated.** When multiple words exist for the same concept, pick the best one and list the others under `_Avoid_`.
- **Keep definitions tight.** One or two sentences max. Define what it IS, not what it does.
- **Bold other glossary terms inside a definition.** When a definition mentions another term, write it as `**Order**`, and let the sentence around it say how the two relate.
- **Only include terms specific to this project's context.** General programming concepts (timeouts, error types, utility patterns) don't belong even if the project uses them extensively. Before adding a term, ask: is this a concept unique to this context, or a general programming concept? Only the former belongs.
- **Group terms under subheadings** when natural clusters emerge. If all terms belong to a single cohesive area, a flat list is fine.
## Single vs multi-context repos
**Single context (most repos):** One `GLOSSARY.md` at the repo root.
**Multiple contexts:** A `GLOSSARY-MAP.md` at the repo root lists the contexts, where they live, and how they relate to each other:
```md
# Glossary Map
## Contexts
- [Ordering](./src/ordering/GLOSSARY.md): receives and tracks customer orders
- [Billing](./src/billing/GLOSSARY.md): generates invoices and processes payments
- [Fulfillment](./src/fulfillment/GLOSSARY.md): manages warehouse picking and shipping
## Relationships
- **Ordering → Fulfillment**: Ordering emits `OrderPlaced` events; Fulfillment consumes them to start picking
- **Fulfillment → Billing**: Fulfillment emits `ShipmentDispatched` events; Billing consumes them to generate invoices
- **Ordering ↔ Billing**: Shared types for `CustomerId` and `Money`
```
The skill infers which structure applies:
- If `GLOSSARY-MAP.md` exists, read it to find contexts
- If only a root `GLOSSARY.md` exists, single context
- If neither exists, create a root `GLOSSARY.md` lazily when the first term is resolved
When multiple contexts exist, infer which one the current topic relates to. If unclear, ask.

非官方学习站,与 Matt Pocock 和 AI Hero 没有隶属关系。本站不提供可安装的中文技能包。

技能原文采用 MIT 许可。Copyright (c) 2026 Matt Pocock

鲁ICP备2025189036号