dsh-gate-agent 0.1.3 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-gate-agent",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "type": "module",
5
5
  "description": "Phase/node workflow gate with built-in commands, tools, and skills.",
6
6
  "exports": {
@@ -5,7 +5,7 @@ argument-hint: "What will the next session be used for?"
5
5
  disable-model-invocation: true
6
6
  ---
7
7
 
8
- Write a handoff document summarising the current conversation so a fresh agent can continue the work. Save to the temporary directory of the user's OS - not the current workspace.
8
+ Write a handoff document summarising the current conversation so a fresh agent can continue the work. Save under `.scratch/handoff/` in the workspace. Use `gate_artifact_write({ kind: 'handoff', path: '.scratch/handoff/<name>.md', content })`; do not use generic `write`.
9
9
 
10
10
  Include a "suggested skills" section in the document, which suggests skills that the agent should invoke.
11
11
 
@@ -56,11 +56,10 @@ user-invocable: false
56
56
  - 产品范围、行为与验收问题报告给工作项;
57
57
  - 本次规划的技术设计问题报告给 Agent Note;引用输入的问题按项目配置反馈其属主;
58
58
  - 状态、评审与批准证据报告给工作项;
59
- - 领域术语问题报告给 技能`gate-domain-modeling` 的属主,技术决定报告给相关 Agent Note。
60
59
 
61
60
  由 planning worker 决定并执行修正;本 worker 不更新工作项、Note 或就绪状态。
62
61
 
63
- 仅当提议为架构决定单独建档时,使用 技能`adr` 的准入条件检查反悔成本与真实权衡。其他 Agent Note 按项目部署后的 README 判断是否有长期设计价值。纯行为规则归产品合同;普通实现细节不因“重要”就自动生成 Note。
62
+ 纯行为规则归产品合同;普通实现细节不因“重要”就自动生成 Note。
64
63
 
65
64
  设计仍依赖临时产品假设时保持非权威。修订产品合同后,检查所有承接同一产品合同的设计,不只修改最先暴露问题的那一份。
66
65
 
@@ -64,8 +64,6 @@ user-invocable: false
64
64
 
65
65
  设计定稿遵循 技术设计规则([rfc.md](./rfc.md) ) 的合同稳定性与评审条件。Note 的 proposed/implemented 表示交付生命周期,不代替评审和批准证据。
66
66
 
67
- 使用项目既有领域语言和适用架构约束。领域术语与模型变化使用 `gate-domain-modeling`;需要为架构决定单独建档时,使用 `adr` 的准入条件判断,在相关 Agent Note 中记录决定。
68
-
69
67
  ### 决定权限
70
68
 
71
69
  在已同意的产品合同、既有架构和项目约束内,自主解决普通技术选择。
@@ -54,8 +54,6 @@
54
54
 
55
55
  需要产品、业务、兼容性、成本、风险、持久架构方向或其他价值判断时,交给相应决定权限,不把问题伪装成纯技术选择。
56
56
 
57
- 接受的决定形成或改变领域语言时,使用 `gate-domain-modeling` SKILL 维护领域资料。需要为架构决定单独建档时,使用 `adr` SKILL 的准入条件判断;决定属于本设计时在同一 Note 中维护,可独立判断的新决定按项目 Note 规则记录。
58
-
59
57
  ## 定稿与评审条件
60
58
 
61
59
  技术设计可以进入 Plan Review,需要满足:
@@ -6,6 +6,10 @@ argument-hint: "项目路径,或要覆盖的功能 / bug"
6
6
 
7
7
  # Playwright E2E 配置
8
8
 
9
+ 在 gate 中:模型启用本技能时走 implement;用户在 discuss 调用时只讨论方案,写 config/spec/AGENTS 与安装依赖在 implement 进行。
10
+
11
+
12
+
9
13
  分工是固定的:**Agent 写 spec,Playwright runner 跑 spec。** 提需求的这一轮里,Agent 不打开浏览器一格格点页面——那是它最贵、最慢、最不可回归的用法;它只写 Node.js + Playwright 脚本,然后跑命令。脚本一旦落盘,「这个功能对不对」就从一轮轮截图变成一条几秒钟、几乎不花 token、随时可重跑的断言。
10
14
 
11
15
  这个 skill 一次跑完,产出三样**落盘**的东西:可跑的 `playwright.config.ts`、项目里长期生效的测试规则、覆盖目标行为的 spec。之后日常由项目里的规则接管,换项目、换技术栈、或规则要改的时候再调它。
@@ -10,7 +10,7 @@ disable-model-invocation: true
10
10
 
11
11
  ## 位置与复用
12
12
 
13
- 遵循项目文档分层和既有 PRD 格式。优先更新同一产品主题已有的 PRD;没有已配置的存放位置时,先在对话中起草并请用户决定位置,不自行发布到外部系统。
13
+ 遵循项目文档分层和既有 PRD 格式。写入使用 `gate_artifact_write({ kind: 'prd', path, content })`,不要使用通用 `write`。优先更新同一产品主题已有的 PRD;没有已配置的存放位置时,先在对话中起草并请用户决定位置,不自行发布到外部系统。
14
14
 
15
15
  ## 内容
16
16
 
@@ -4,14 +4,11 @@ description: Investigate a question against high-trust primary sources and captu
4
4
  user-invocable: false
5
5
  ---
6
6
 
7
- Spin up a **background agent** to do the research, so you keep working while it reads.
7
+ 调用 `gate_research_dispatch({ question, purpose })` 派 research worker,并等待结果。
8
8
 
9
- Its job:
9
+ worker 的职责:
10
10
 
11
11
  1. Investigate the question against **primary sources** — official docs, source code, specs, first-party APIs — not a secondary write-up of them. Follow every claim back to the source that owns it.
12
12
  2. Write the findings to a single Markdown file, citing each claim's source.
13
- 3. Save it where the repo already keeps such notes; match the existing convention, and if there is none, put it somewhere sensible and say where.
14
-
15
-
16
-
13
+ 3. Save it with `gate_artifact_write({ kind: 'research', path, content })`;优先项目文档位置,否则 `.scratch/research/`。不要使用通用 `write`。
17
14
 
@@ -3,6 +3,8 @@ name: gate-writing-for-agents
3
3
  description: Writing documents for agents. Use when creating or editing skills, or modifying AGENTS.md or CLAUDE.md.
4
4
  ---
5
5
 
6
+ 在 gate 中:修改 skill、AGENTS.md 或 agent 文档属于 implement 工作;discuss/plan 只讨论写法,不落盘。
7
+
6
8
  Reference for writing any document an agent consumes — a skill, an `AGENTS.md`, a doc reached by a pointer. The packaging differs; the writing does not: the same levers make each one predictable — the agent taking the same _process_ every run, not producing the same output.
7
9
 
8
10
  When the document you're writing is a skill, read [`SKILL-MECHANICS.md`](SKILL-MECHANICS.md) for frontmatter, invocation choice, and router skills.
@@ -1,64 +0,0 @@
1
- # CONTEXT.md Format
2
-
3
- ## Structure
4
-
5
- ```md
6
- # {Context Name}
7
-
8
- {One or two sentence description of what this context is and why it exists.}
9
-
10
- ## Language
11
-
12
- **Order**:
13
- {A one or two sentence description of the term}
14
- _Avoid_: Purchase, transaction
15
-
16
- **Invoice**:
17
- A request for payment sent to a customer after delivery.
18
- _Avoid_: Bill, payment request
19
-
20
- **Customer**:
21
- A person or organization that places orders.
22
- _Avoid_: Client, buyer, account
23
- ```
24
-
25
- ## Rules
26
-
27
- - **Be opinionated.** When multiple words exist for the same concept, pick the best one and list the others under `_Avoid_`.
28
- - **Keep definitions tight.** One or two sentences max. Define what it IS, not what it does.
29
- - **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.
30
- - **Group terms under subheadings** when natural clusters emerge. If all terms belong to a single cohesive area, a flat list is fine.
31
-
32
- ## Single vs multi-context repos
33
-
34
- **Single context (most repos):** One `CONTEXT.md` at the repo root.
35
-
36
- **Multiple contexts:** A `CONTEXT-MAP.md` at the repo root lists the contexts, where they live, and how they relate to each other:
37
-
38
- ```md
39
- # Context Map
40
-
41
- ## Contexts
42
-
43
- - [Ordering](./src/ordering/CONTEXT.md): receives and tracks customer orders
44
- - [Billing](./src/billing/CONTEXT.md): generates invoices and processes payments
45
- - [Fulfillment](./src/fulfillment/CONTEXT.md): manages warehouse picking and shipping
46
-
47
- ## Relationships
48
-
49
- - **Ordering → Fulfillment**: Ordering emits `OrderPlaced` events; Fulfillment consumes them to start picking
50
- - **Fulfillment → Billing**: Fulfillment emits `ShipmentDispatched` events; Billing consumes them to generate invoices
51
- - **Ordering ↔ Billing**: Shared types for `CustomerId` and `Money`
52
- ```
53
-
54
- The skill infers which structure applies:
55
-
56
- Resolve the root from project instructions before these checks; the current working directory may be a subproject. Use the project documentation hierarchy for ownership; the context map does not create separate record categories. Paths shown in the map are Markdown links relative to the map file.
57
-
58
- - If `CONTEXT-MAP.md` exists, read it to find contexts
59
- - If only a root `CONTEXT.md` exists, single context
60
- - If neither exists, create a root `CONTEXT.md` lazily when the first term is resolved
61
-
62
- When multiple contexts exist, infer which one the current topic relates to. If unclear, ask.
63
-
64
-
@@ -1,64 +0,0 @@
1
- # GLOSSARY.md Format
2
-
3
- ## Structure
4
-
5
- ```md
6
- # {Context Name}
7
-
8
- {One or two sentence description of what this context is and why it exists.}
9
-
10
- ## Language
11
-
12
- **Order**:
13
- {A one or two sentence description of the term}
14
- _Avoid_: Purchase, transaction
15
-
16
- **Invoice**:
17
- A request for payment sent to a customer after delivery.
18
- _Avoid_: Bill, payment request
19
-
20
- **Customer**:
21
- A person or organization that places orders.
22
- _Avoid_: Client, buyer, account
23
- ```
24
-
25
- ## Rules
26
-
27
- - **Be opinionated.** When multiple words exist for the same concept, pick the best one and list the others under `_Avoid_`.
28
- - **Keep definitions tight.** One or two sentences max. Define what it IS, not what it does.
29
- - **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.
30
- - **Group terms under subheadings** when natural clusters emerge. If all terms belong to a single cohesive area, a flat list is fine.
31
-
32
- ## Single vs multi-context repos
33
-
34
- **Single context (most repos):** One `GLOSSARY.md` at the repo root.
35
-
36
- **Multiple contexts:** A `GLOSSARY-MAP.md` at the repo root lists the contexts, where they live, and how they relate to each other:
37
-
38
- ```md
39
- # Glossary Map
40
-
41
- ## Contexts
42
-
43
- - [Ordering](./src/ordering/GLOSSARY.md): receives and tracks customer orders
44
- - [Billing](./src/billing/GLOSSARY.md): generates invoices and processes payments
45
- - [Fulfillment](./src/fulfillment/GLOSSARY.md): manages warehouse picking and shipping
46
-
47
- ## Relationships
48
-
49
- - **Ordering → Fulfillment**: Ordering emits `OrderPlaced` events; Fulfillment consumes them to start picking
50
- - **Fulfillment → Billing**: Fulfillment emits `ShipmentDispatched` events; Billing consumes them to generate invoices
51
- - **Ordering ↔ Billing**: Shared types for `CustomerId` and `Money`
52
- ```
53
-
54
- The skill infers which structure applies:
55
-
56
- Resolve the root from project instructions before these checks; the current working directory may be a subproject. Use the project documentation hierarchy for ownership; the context map does not create separate record categories. Paths shown in the map are Markdown links relative to the map file.
57
-
58
- - If `GLOSSARY-MAP.md` exists, read it to find contexts
59
- - If only a root `GLOSSARY.md` exists, single context
60
- - If neither exists, create a root `GLOSSARY.md` lazily when the first term is resolved
61
-
62
- When multiple contexts exist, infer which one the current topic relates to. If unclear, ask.
63
-
64
-
@@ -1,47 +0,0 @@
1
- ---
2
- name: gate-domain-modeling
3
- description: Build and sharpen a project's domain model. Use when discussing codebase terminology, writing or editing a GLOSSARY.md, or recording a durable decision in its selected owner.
4
- user-invocable: false
5
- ---
6
-
7
- # Domain Modeling
8
-
9
- Actively build and sharpen the project's domain model as you design. This is the *active* discipline: challenging terms, inventing edge-case scenarios, and writing the glossary and decisions down the moment they crystallise. (Merely *reading* `GLOSSARY.md` for vocabulary is not this skill: that's a one-line habit any skill can do. This skill is for when you're changing the model, not just consuming it.)
10
-
11
- ## File structure
12
-
13
- Follow the document ownership entry referenced by project instructions for glossary paths and decisions applicable to the model being discussed. If a required input's owner or scope is unclear, report the configuration gap.
14
-
15
- Resolve the repository management root from project instructions, using the Git top-level only as a fallback. Working inside a subproject does not change it. A root `GLOSSARY-MAP.md` selects domain documents when the repository has multiple contexts. Do not create a separate record system per context or derive record categories automatically from contexts.
16
-
17
- A single-context project may use a root `GLOSSARY.md`. A root `GLOSSARY-MAP.md`, when present, points to the selected contexts' glossaries; context paths need not be under `src/`. Resolve decision paths separately from the document ownership entry and, for Agent Notes, its configured record roots. Create a glossary or decision record only when there is content for its selected owner. Use the `adr` skill when a separate architecture decision record is warranted.
18
-
19
- ## During the session
20
-
21
- ### Challenge against the glossary
22
-
23
- When the user uses a term that conflicts with the existing language in `GLOSSARY.md`, call it out immediately. "Your glossary defines 'cancellation' as X, but you seem to mean Y. Which is it?"
24
-
25
- ### Sharpen fuzzy language
26
-
27
- 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."
28
-
29
- ### Discuss concrete scenarios
30
-
31
- 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.
32
-
33
- ### Cross-reference with code
34
-
35
- 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?"
36
-
37
- ### Update GLOSSARY.md inline
38
-
39
- When a term is resolved, update `GLOSSARY.md` right there. Don't batch these up: capture them as they happen. Use the format in [GLOSSARY-FORMAT.md](./GLOSSARY-FORMAT.md).
40
-
41
- `GLOSSARY.md` should be totally devoid of implementation details. Do not treat `GLOSSARY.md` as a spec, a scratch pad, or a repository for implementation decisions. It is a glossary and nothing else.
42
-
43
-
44
-
45
-
46
-
47
-