@seanyao/roll 3.620.1 → 3.624.1
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/CHANGELOG.md +46 -0
- package/dist/roll.mjs +4563 -3369
- package/package.json +1 -1
- package/lib/__pycache__/changelog_audit.cpython-314.pyc +0 -0
- package/lib/__pycache__/github_sync.cpython-314.pyc +0 -0
- package/lib/__pycache__/loop-fmt.cpython-314.pyc +0 -0
- package/lib/__pycache__/loop_result_eval.cpython-314.pyc +0 -0
- package/lib/__pycache__/loop_unstick.cpython-314.pyc +0 -0
- package/lib/__pycache__/model_prices.cpython-314.pyc +0 -0
- package/lib/__pycache__/prices_fetcher.cpython-314.pyc +0 -0
- package/lib/__pycache__/roll-home.cpython-314.pyc +0 -0
- package/lib/__pycache__/roll-loop-status.cpython-314.pyc +0 -0
- package/lib/__pycache__/roll_git.cpython-314.pyc +0 -0
- package/lib/__pycache__/roll_render.cpython-314.pyc +0 -0
- package/lib/__pycache__/slides-render.cpython-314.pyc +0 -0
- package/lib/agent_usage/__pycache__/__init__.cpython-314.pyc +0 -0
- package/lib/agent_usage/__pycache__/gemini.cpython-314.pyc +0 -0
- package/lib/agent_usage/__pycache__/kimi.cpython-314.pyc +0 -0
- package/lib/agent_usage/__pycache__/openai.cpython-314.pyc +0 -0
- package/lib/agent_usage/__pycache__/pi.cpython-314.pyc +0 -0
- package/lib/agent_usage/__pycache__/pi_emit.cpython-314.pyc +0 -0
- package/lib/agent_usage/__pycache__/qwen.cpython-314.pyc +0 -0
- package/skills/README.md +0 -64
- package/skills/docs/skill-authoring.md +0 -74
- package/skills/reports/skill-audit-summary.md +0 -53
- package/skills/roll-.changelog/SKILL.md +0 -47
- package/skills/roll-.changelog/references/full-contract.md +0 -462
- package/skills/roll-.clarify/SKILL.md +0 -64
- package/skills/roll-.dream/SKILL.md +0 -47
- package/skills/roll-.dream/references/full-contract.md +0 -365
- package/skills/roll-.echo/SKILL.md +0 -118
- package/skills/roll-.qa/SKILL.md +0 -47
- package/skills/roll-.qa/references/full-contract.md +0 -256
- package/skills/roll-.review/SKILL.md +0 -148
- package/skills/roll-build/SKILL.md +0 -49
- package/skills/roll-build/references/full-contract.md +0 -968
- package/skills/roll-debug/SKILL.md +0 -48
- package/skills/roll-debug/assets/injectable-bb.js +0 -263
- package/skills/roll-debug/references/full-contract.md +0 -607
- package/skills/roll-design/SKILL.md +0 -52
- package/skills/roll-design/references/engineering-checklist.md +0 -298
- package/skills/roll-design/references/full-contract.md +0 -940
- package/skills/roll-doc-audit/SKILL.md +0 -51
- package/skills/roll-doc-audit/references/full-contract.md +0 -796
- package/skills/roll-doctor/SKILL.md +0 -211
- package/skills/roll-fix/SKILL.md +0 -49
- package/skills/roll-fix/references/full-contract.md +0 -672
- package/skills/roll-idea/SKILL.md +0 -62
- package/skills/roll-loop/SKILL.md +0 -50
- package/skills/roll-loop/references/full-contract.md +0 -534
- package/skills/roll-notes/SKILL.md +0 -107
- package/skills/roll-onboard/SKILL.md +0 -238
- package/skills/roll-peer/SKILL.md +0 -47
- package/skills/roll-peer/references/full-contract.md +0 -323
- package/skills/roll-propose/SKILL.md +0 -155
- package/skills/roll-review-pr/SKILL.md +0 -62
- package/skills/roll-spar/SKILL.md +0 -47
- package/skills/roll-spar/references/full-contract.md +0 -288
- package/skills/route-cases/skills.json +0 -216
- package/skills/scripts/audit-skills.mjs +0 -272
- package/skills/scripts/test-audit-skills.mjs +0 -39
- package/skills/tests/fixtures/skill-audit/block-skill/SKILL.md +0 -12
- package/skills/tests/fixtures/skill-audit/minimal-skill/SKILL.md +0 -8
- package/skills/tests/fixtures/skill-audit/quoted-skill/SKILL.md +0 -10
- package/skills/tests/fixtures/skill-audit/route-cases.json +0 -21
- package/skills/tests/fixtures/skill-audit/spoke-skill/SKILL.md +0 -12
- package/skills/tests/fixtures/skill-audit/spoke-skill/references/runbook.md +0 -3
|
@@ -1,940 +0,0 @@
|
|
|
1
|
-
# Full Contract Reference
|
|
2
|
-
|
|
3
|
-
This file preserves the detailed contract extracted from SKILL.md. Read it when the hub points here for exact workflow steps, templates, rubrics, or recovery branches.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Design
|
|
8
|
-
|
|
9
|
-
> Follows the Architecture Constraints, Development Discipline, and Engineering Common Sense defined in the project AGENTS.md.
|
|
10
|
-
|
|
11
|
-
Discuss approaches, design architecture, plan requirements, and write to `.roll/backlog.md`. DDD modeling depth scales automatically with input scope.
|
|
12
|
-
|
|
13
|
-
## When to Use
|
|
14
|
-
|
|
15
|
-
- Requirements or approach are uncertain and multiple options need to be compared
|
|
16
|
-
- Requirements have not yet entered the backlog
|
|
17
|
-
- A solution needs to be designed before splitting into Stories
|
|
18
|
-
- An existing plan needs to be written into `.roll/backlog.md`
|
|
19
|
-
|
|
20
|
-
> **Doc-refresh discipline**: When splitting stories that change user-visible behavior, always append a closing "doc-refresh" story.
|
|
21
|
-
> **文档刷新纪律**:拆出的 story 只要改变了用户可见行为,最后必须追加一张"文档刷新"收尾 story。
|
|
22
|
-
> See [Doc Update Discipline](#doc-update-discipline) at the bottom of this file for the full rule.
|
|
23
|
-
|
|
24
|
-
## Use This Skill For
|
|
25
|
-
|
|
26
|
-
- Approach exploration and comparison (discuss phase)
|
|
27
|
-
- New project domain modeling (Event Storming → Context Map → Tactical Model)
|
|
28
|
-
- New requirement planning with domain context
|
|
29
|
-
- Solution design
|
|
30
|
-
- Splitting into Stories
|
|
31
|
-
- Creating US / FIX entries
|
|
32
|
-
|
|
33
|
-
## When Not to Use
|
|
34
|
-
|
|
35
|
-
- One-liner capture of ideas or bugs (use `$roll-idea`)
|
|
36
|
-
- Executing an already-split US-XXX (use `$roll-build`)
|
|
37
|
-
- Fixing a well-defined FIX-XXX (use `$roll-fix`)
|
|
38
|
-
|
|
39
|
-
## Quick Start
|
|
40
|
-
|
|
41
|
-
```bash
|
|
42
|
-
# New project from scratch → full DDD modeling
|
|
43
|
-
$roll-design "design an e-commerce order system from scratch"
|
|
44
|
-
|
|
45
|
-
# Approach is uncertain → discuss first, then plan
|
|
46
|
-
$roll-design "What approach should we use for search? Postgres FTS or Meilisearch?"
|
|
47
|
-
|
|
48
|
-
# Plan new requirement → domain slice + Stories → write to BACKLOG
|
|
49
|
-
$roll-design "user system design"
|
|
50
|
-
|
|
51
|
-
# Split Stories from an existing Plan
|
|
52
|
-
$roll-design --from-plan .roll/features/auth-plan.md
|
|
53
|
-
|
|
54
|
-
# Directly create a Story (auto-detected as User Story → Slice DDD)
|
|
55
|
-
$roll-design "user login feature"
|
|
56
|
-
|
|
57
|
-
# Non-interactive: read structured input file, skip Clarify/Discuss, write BACKLOG
|
|
58
|
-
$roll-design --from-file docs/requirements/auth-req.md
|
|
59
|
-
|
|
60
|
-
# Promote IDEA to Story: read BACKLOG IDEA-NNN, produce US-XXX, annotate IDEA
|
|
61
|
-
$roll-design --from-idea IDEA-009
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
## DDD Depth Scale
|
|
65
|
-
|
|
66
|
-
DDD modeling depth is determined automatically. It is not a switch — it is a dial.
|
|
67
|
-
|
|
68
|
-
```
|
|
69
|
-
输入范围 DDD 深度 产出物
|
|
70
|
-
─────────────────────────────────────────────────────────────
|
|
71
|
-
新项目 / greenfield Full Event Storming (对话引导)
|
|
72
|
-
Context Map + UL 词汇表
|
|
73
|
-
每个 Context 的 Tactical Model
|
|
74
|
-
→ .roll/domain/
|
|
75
|
-
|
|
76
|
-
User Story / 新特性 Slice 定位所属 Bounded Context
|
|
77
|
-
关键 Aggregate + 触碰的 Entity/VO
|
|
78
|
-
触发的 Domain Event + 跨域影响
|
|
79
|
-
→ 写入 US 的 Domain Model 段
|
|
80
|
-
|
|
81
|
-
Bug Fix Tag Context > Aggregate > Entity 定位
|
|
82
|
-
→ 写入 FIX 描述行
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
**深度自动判断逻辑**(在 Step 2 Analyze 阶段评估):
|
|
86
|
-
|
|
87
|
-
```
|
|
88
|
-
Greenfield 信号(满足任意一条):
|
|
89
|
-
- 无 .roll/backlog.md / .roll/domain/ 目录
|
|
90
|
-
- 输入含 "从零" / "新项目" / "建模" / "设计整个系统" 关键词
|
|
91
|
-
- complexity = large AND 无已有 Bounded Context 文档
|
|
92
|
-
|
|
93
|
-
User Story 信号:
|
|
94
|
-
- 输入是功能需求 / US-XXX 引用
|
|
95
|
-
- complexity = medium or small AND 业务逻辑可见
|
|
96
|
-
|
|
97
|
-
Bug Fix 信号:
|
|
98
|
-
- 输入是 FIX-XXX / 错误描述 / 明确的问题定位
|
|
99
|
-
- 无需建模,只需定位上下文
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
## Workspace Configuration
|
|
103
|
-
|
|
104
|
-
Document structure (story-first layout, US-META-005):
|
|
105
|
-
|
|
106
|
-
```
|
|
107
|
-
.roll/backlog.md # story index (status + one-liner)
|
|
108
|
-
.roll/features/
|
|
109
|
-
<epic>/ # epic folder
|
|
110
|
-
<feature>.md # feature design doc (optional, multi-story overview)
|
|
111
|
-
<feature>-plan.md # design plan (optional)
|
|
112
|
-
<story>/ # individual story folder (one per card)
|
|
113
|
-
spec.md # story definition (AC, depends-on, etc.)
|
|
114
|
-
index.html # auto-generated story portal
|
|
115
|
-
delivery/ # attest evidence (auto-generated on Done)
|
|
116
|
-
.roll/domain/ # DDD domain model
|
|
117
|
-
context-map.md
|
|
118
|
-
ubiquitous-language.md
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
**Important rules:**
|
|
122
|
-
1. **Every story card gets its own folder**: `features/<epic>/<story>/`
|
|
123
|
-
2. **spec.md is the single definition file** — contains full AC, Files, Dependencies
|
|
124
|
-
3. **FIX / IDEA / US all follow the same folder layout** — `features/<epic>/FIX-097/spec.md`
|
|
125
|
-
4. **Feature design docs stay at epic root** — `<feature>.md` and `<feature>-plan.md` are optional, multi-story design overviews
|
|
126
|
-
5. **index.html is auto-generated** by `roll idea` (skeleton) and updated by `roll attest` (delivery section)
|
|
127
|
-
6. **delivery/ is auto-created** by `roll attest` on Done — do not create manually
|
|
128
|
-
7. .roll/backlog.md only contains index rows (one row per story), **do not write** AC / Files there
|
|
129
|
-
8. Domain model files go in `.roll/domain/`
|
|
130
|
-
9. **Do not** write to `~/.kimi/`, `~/.kimi-code/`, or any global config directory
|
|
131
|
-
|
|
132
|
-
**File path resolution:**
|
|
133
|
-
1. Determine epic from story ID prefix (e.g., US-META-* → backlog-lifecycle, FIX-* → query index.json)
|
|
134
|
-
2. Mint the card via the single channel (US-META-009 — never hand-create the folder):
|
|
135
|
-
`roll story new <ID> --title "<one-line title>" --epic <epic>`
|
|
136
|
-
3. Then EDIT the minted spec.md to add the full AC / Files / Dependencies / Agent profile
|
|
137
|
-
4. Backlog row links to: `.roll/features/<epic>/<story>/spec.md`
|
|
138
|
-
5. Design / plan docs (when needed): `.roll/features/<epic>/<feature>.md` + `<feature>-plan.md`
|
|
139
|
-
|
|
140
|
-
## Non-Interactive Mode
|
|
141
|
-
|
|
142
|
-
Activated by explicit flags or auto-detected high-confidence input. Skips Clarify and Discuss, writes stories directly to BACKLOG as `📋 Todo`, no confirm gate.
|
|
143
|
-
|
|
144
|
-
### `--from-file <path>`
|
|
145
|
-
|
|
146
|
-
```
|
|
147
|
-
Input: structured requirement file (plain text or markdown)
|
|
148
|
-
|
|
149
|
-
Expected file contents (minimum viable):
|
|
150
|
-
- Description: what to build (1–3 sentences)
|
|
151
|
-
- Expected AC: measurable outcomes (bullet list)
|
|
152
|
-
- [Optional] Domain hint, priority, dependencies
|
|
153
|
-
|
|
154
|
-
Execution path:
|
|
155
|
-
[Read file] → [Analyze] → [DDD Slice] → [Solution Design] → [Split Stories]
|
|
156
|
-
→ [Write BACKLOG 📋 Todo] → Done (no Clarify, no Discuss, no confirm gate)
|
|
157
|
-
```
|
|
158
|
-
|
|
159
|
-
Input file example (`docs/requirements/auth-req.md`):
|
|
160
|
-
```markdown
|
|
161
|
-
## Requirement: session timeout warning
|
|
162
|
-
|
|
163
|
-
Description: Show a countdown modal 60 seconds before session expires.
|
|
164
|
-
Users can click "Stay logged in" to extend, or let it expire naturally.
|
|
165
|
-
|
|
166
|
-
Expected AC:
|
|
167
|
-
- Modal appears at T-60s with countdown timer
|
|
168
|
-
- "Stay logged in" sends a keepalive and dismisses modal
|
|
169
|
-
- Expiry after countdown logs user out and redirects to /login
|
|
170
|
-
- Works across all authenticated pages
|
|
171
|
-
```
|
|
172
|
-
|
|
173
|
-
### `--from-idea IDEA-NNN`
|
|
174
|
-
|
|
175
|
-
```
|
|
176
|
-
Input: IDEA-NNN identifier from .roll/backlog.md
|
|
177
|
-
|
|
178
|
-
Execution path:
|
|
179
|
-
[Read .roll/backlog.md IDEA-NNN row] → [Analyze] → [DDD Slice] → [Solution Design] → [Split Stories]
|
|
180
|
-
→ [Write BACKLOG 📋 Todo] → [Annotate IDEA row: → US-XXX] → Done
|
|
181
|
-
|
|
182
|
-
IDEA annotation: append `→ US-XXX` to the IDEA row's Description column.
|
|
183
|
-
Example: | IDEA-009 | ... | ✅ Done → US-AUTO-021 |
|
|
184
|
-
```
|
|
185
|
-
|
|
186
|
-
### High-Confidence Auto-Detection
|
|
187
|
-
|
|
188
|
-
When input is not a flag-based mode but already contains all three of: **clear verb**, **explicit scope**, and **verifiable acceptance signal**, skip Clarify automatically. At most retain Discuss (only if approach has genuine divergence).
|
|
189
|
-
|
|
190
|
-
High-confidence signals (all three must be present):
|
|
191
|
-
- Clear verb: add / remove / fix / rename / migrate / split / extract / support ...
|
|
192
|
-
- Explicit scope: named file, command, module, endpoint, or UI element
|
|
193
|
-
- Acceptance signal: "so that X", "when Y then Z", measurable outcome described
|
|
194
|
-
|
|
195
|
-
Examples:
|
|
196
|
-
```bash
|
|
197
|
-
# High confidence — skip Clarify:
|
|
198
|
-
$roll-design "add --dry-run flag to roll loop on that prints plist without installing"
|
|
199
|
-
$roll-design "rename cmd_status() to cmd_overview() in bin/roll and update all callers"
|
|
200
|
-
|
|
201
|
-
# Low confidence — enter Clarify:
|
|
202
|
-
$roll-design "improve the status command"
|
|
203
|
-
$roll-design "make loop better"
|
|
204
|
-
```
|
|
205
|
-
|
|
206
|
-
---
|
|
207
|
-
|
|
208
|
-
## Workflow
|
|
209
|
-
|
|
210
|
-
```
|
|
211
|
-
User Input
|
|
212
|
-
│
|
|
213
|
-
├── --from-file <path> ──→ [Read file] → Step 2 (Analyze) → Steps 3–5 → BACKLOG 📋 → Done
|
|
214
|
-
├── --from-idea IDEA-N ──→ [Read BACKLOG IDEA] → Step 2 → Steps 3–5 → BACKLOG 📋 → Annotate IDEA → Done
|
|
215
|
-
├── high-confidence str ──→ Step 2 (Analyze) directly (skip Clarify, keep Discuss if divergence)
|
|
216
|
-
│
|
|
217
|
-
▼
|
|
218
|
-
┌─────────────────────────────┐
|
|
219
|
-
│ 0. Clarify (when vague) │ ← Automatically triggered when input is under-specified
|
|
220
|
-
│ - Summarize intent │
|
|
221
|
-
│ - Assess complexity │
|
|
222
|
-
│ - Ask 3–5 targeted Qs │
|
|
223
|
-
│ - Wait for user reply │
|
|
224
|
-
└─────────────┬───────────────┘
|
|
225
|
-
│ Intent clear
|
|
226
|
-
▼
|
|
227
|
-
┌─────────────────────────────┐
|
|
228
|
-
│ 1. Discuss (when uncertain) │ ← Automatically triggered when approach is uncertain
|
|
229
|
-
│ - List 2-4 viable options │
|
|
230
|
-
│ - Each: approach + pros/cons │
|
|
231
|
-
│ - Comparison matrix │
|
|
232
|
-
│ - Recommendation + rationale │
|
|
233
|
-
│ - Human makes final decision │
|
|
234
|
-
└─────────────┬───────────────┘
|
|
235
|
-
│ Approach confirmed
|
|
236
|
-
▼
|
|
237
|
-
┌─────────────────────────────┐
|
|
238
|
-
│ [peer] Direction Review │ ← if complexity=medium/large or cross-context; 10s opt-out
|
|
239
|
-
│ Skill("roll-peer", │
|
|
240
|
-
│ tag="architecture") │
|
|
241
|
-
└─────────────┬───────────────┘
|
|
242
|
-
│ AGREE / skipped
|
|
243
|
-
▼
|
|
244
|
-
┌─────────────────────────────┐
|
|
245
|
-
│ 2. Analyze + DDD Depth │ ← Detect scope: Greenfield / Story / Fix
|
|
246
|
-
│ - Requirement analysis │
|
|
247
|
-
│ - Feasibility assessment │
|
|
248
|
-
│ - DDD depth determination │
|
|
249
|
-
└──────┬──────────────────────┘
|
|
250
|
-
│
|
|
251
|
-
├── Greenfield ──→ ┌─────────────────────────────┐
|
|
252
|
-
│ │ 2a. Event Storming (对话引导) │
|
|
253
|
-
│ │ Big Picture: │
|
|
254
|
-
│ │ - 发现 Domain Events │
|
|
255
|
-
│ │ - 识别 Actors / Commands │
|
|
256
|
-
│ │ - 标记 Hot Spots │
|
|
257
|
-
│ │ Process Level: │
|
|
258
|
-
│ │ - Command→Event→Policy 链 │
|
|
259
|
-
│ │ - 识别 Bounded Context 边界│
|
|
260
|
-
│ │ Design Level: │
|
|
261
|
-
│ │ - Aggregate 候选 │
|
|
262
|
-
│ │ - Entity vs Value Object │
|
|
263
|
-
│ └──────────────┬──────────────┘
|
|
264
|
-
│ │
|
|
265
|
-
│ ┌──────────────▼──────────────┐
|
|
266
|
-
│ │ 2b. Strategic Design │
|
|
267
|
-
│ │ - Bounded Contexts 定义 │
|
|
268
|
-
│ │ - Context Map (关系类型) │
|
|
269
|
-
│ │ - Ubiquitous Language 词汇表│
|
|
270
|
-
│ │ → .roll/domain/context-map.md│
|
|
271
|
-
│ │ → .roll/domain/ubiquitous- │
|
|
272
|
-
│ │ language.md │
|
|
273
|
-
│ └──────────────┬──────────────┘
|
|
274
|
-
│ │
|
|
275
|
-
├── User Story ──→ ┌──────────────▼──────────────┐
|
|
276
|
-
│ │ 2c. Domain Slice │
|
|
277
|
-
│ │ - 定位所属 Bounded Context │
|
|
278
|
-
│ │ - 识别关键 Aggregate │
|
|
279
|
-
│ │ - 触碰的 Entity / VO │
|
|
280
|
-
│ │ - 触发的 Domain Events │
|
|
281
|
-
│ │ - 跨域影响(如有) │
|
|
282
|
-
│ └──────────────┬──────────────┘
|
|
283
|
-
│ │
|
|
284
|
-
└── Bug Fix ─────→ ┌──────────────▼──────────────┐
|
|
285
|
-
│ 2d. Domain Tag │
|
|
286
|
-
│ - Context > Aggregate > │
|
|
287
|
-
│ Entity 定位 │
|
|
288
|
-
└──────────────┬──────────────┘
|
|
289
|
-
│
|
|
290
|
-
▼
|
|
291
|
-
┌─────────────────────────────────────────┐
|
|
292
|
-
│ 3. Detailed (Solution) Design ★MANDATORY│
|
|
293
|
-
│ Before ANY decomposition, for │
|
|
294
|
-
│ non-trivial work produce a concrete, │
|
|
295
|
-
│ implementable artifact (depth scales │
|
|
296
|
-
│ with risk/novelty): │
|
|
297
|
-
│ - Architecture / module decomposition │
|
|
298
|
-
│ - Dependency analysis │
|
|
299
|
-
│ Required artifacts (all of): │
|
|
300
|
-
│ (a) data/contract schema │
|
|
301
|
-
│ (b) ≥1 COMPLETE worked sample of │
|
|
302
|
-
│ the intended output/behavior │
|
|
303
|
-
│ (c) key interface signatures │
|
|
304
|
-
│ (d) mapping/normalization rules │
|
|
305
|
-
│ (e) edge cases & failure modes │
|
|
306
|
-
│ Rule: if you cannot show a complete │
|
|
307
|
-
│ worked sample, the design is NOT done.│
|
|
308
|
-
│ [Greenfield] Tactical Model per Context:
|
|
309
|
-
│ - Aggregate Root + Entities + VOs │
|
|
310
|
-
│ - Invariants (业务不变式) │
|
|
311
|
-
│ - Domain Events (触发条件 + 消费方) │
|
|
312
|
-
│ - Repository interfaces │
|
|
313
|
-
│ - Domain Services (跨 Aggregate) │
|
|
314
|
-
│ → .roll/features/<feature>-plan.md │
|
|
315
|
-
│ [Greenfield] → .roll/domain/<ctx>- │
|
|
316
|
-
│ model.md │
|
|
317
|
-
└──────────────────┬──────────────────────┘
|
|
318
|
-
│
|
|
319
|
-
▼
|
|
320
|
-
┌─────────────────────────────────────────┐
|
|
321
|
-
│ [peer] Plan Review │ ← if complexity=medium/large; 10s opt-out
|
|
322
|
-
│ Skill("roll-peer", tag="architecture")│
|
|
323
|
-
└──────────────────┬──────────────────────┘
|
|
324
|
-
│ AGREE / skipped
|
|
325
|
-
▼
|
|
326
|
-
┌─────────────────────────────────────────┐
|
|
327
|
-
│ [gate] Owner Sign-off on Detailed Design │ ← REQUIRED before decomposition
|
|
328
|
-
│ Decomposition slices an AGREED design;│
|
|
329
|
-
│ it does NOT replace designing. Get │
|
|
330
|
-
│ owner sign-off (proportional to risk) │
|
|
331
|
-
│ before splitting into stories. │
|
|
332
|
-
└──────────────────┬──────────────────────┘
|
|
333
|
-
│ Signed off
|
|
334
|
-
▼
|
|
335
|
-
┌─────────────────────────────────────────┐
|
|
336
|
-
│ 4. Split into Stories │
|
|
337
|
-
│ - INVEST principles │
|
|
338
|
-
│ - Bounded Context → US domain prefix │
|
|
339
|
-
│ - Priority ordering │
|
|
340
|
-
│ - **强制检查**: 若本批次任一 US 改了 │
|
|
341
|
-
│ 用户可见行为(CLI 输出 / 命令参数 / │
|
|
342
|
-
│ 状态语义 / 错误提示),必须在末尾追加 │
|
|
343
|
-
│ 一张 doc-refresh 收尾 story │
|
|
344
|
-
│ (详见 Doc Update Discipline 一节)│
|
|
345
|
-
└──────────────────┬──────────────────────┘
|
|
346
|
-
│
|
|
347
|
-
▼
|
|
348
|
-
┌─────────────────────────────────────────┐
|
|
349
|
-
│ 5. Write to .roll/backlog.md │
|
|
350
|
-
│ - Create US-XXX │
|
|
351
|
-
│ - Define AC │
|
|
352
|
-
│ - Link design documents │
|
|
353
|
-
└──────────────────┬──────────────────────┘
|
|
354
|
-
│
|
|
355
|
-
▼
|
|
356
|
-
"Confirm and execute?"
|
|
357
|
-
│
|
|
358
|
-
├── Yes ──→ $roll-build US-XXX
|
|
359
|
-
│
|
|
360
|
-
└── No ──→ Story 已写入 BACKLOG 为 📋 Todo
|
|
361
|
-
loop 下轮将自动执行
|
|
362
|
-
(选 No 仅跳过立即执行)
|
|
363
|
-
```
|
|
364
|
-
|
|
365
|
-
**Gate 语义澄清**:选 `No` 不是放弃,story 已经入 BACKLOG,下轮 loop 会自动 pickup
|
|
366
|
-
(次日 / `roll loop now`)。若想完全搁置,请显式把状态改为 🚫 Hold。
|
|
367
|
-
|
|
368
|
-
---
|
|
369
|
-
|
|
370
|
-
## DDD Output Formats
|
|
371
|
-
|
|
372
|
-
### Event Storming — Big Picture (对话引导)
|
|
373
|
-
|
|
374
|
-
AI 扮演引导人,按顺序提问,不跳步骤:
|
|
375
|
-
|
|
376
|
-
```
|
|
377
|
-
Step 1 - 发现 Domain Events:
|
|
378
|
-
"请描述这个系统里会发生的重要事情,用过去式动词短语
|
|
379
|
-
(例如:订单已创建、支付已完成、库存已扣减)"
|
|
380
|
-
|
|
381
|
-
Step 2 - 识别触发者:
|
|
382
|
-
"每个事件是谁/什么触发的?
|
|
383
|
-
(用户操作 / 系统自动 / 定时任务 / 外部系统)"
|
|
384
|
-
|
|
385
|
-
Step 3 - 标记 Hot Spots:
|
|
386
|
-
"哪些地方你还不确定?有哪些业务规则有争议?
|
|
387
|
-
(标记为 ⚠️ Hot Spot,后续重点讨论)"
|
|
388
|
-
```
|
|
389
|
-
|
|
390
|
-
输出格式(Big Picture 阶段结果):
|
|
391
|
-
|
|
392
|
-
```
|
|
393
|
-
Domain Events discovered:
|
|
394
|
-
[OrderPlaced] ← Customer (user action)
|
|
395
|
-
[PaymentCompleted] ← Payment Gateway (external)
|
|
396
|
-
[InventoryReserved] ← System (automatic, after OrderPlaced)
|
|
397
|
-
[OrderShipped] ← Warehouse Staff (user action)
|
|
398
|
-
|
|
399
|
-
Hot Spots ⚠️:
|
|
400
|
-
- 支付失败后如何回滚库存预留?
|
|
401
|
-
- 同一商品多仓库时库存扣减策略?
|
|
402
|
-
```
|
|
403
|
-
|
|
404
|
-
### Event Storming — Process Level
|
|
405
|
-
|
|
406
|
-
```
|
|
407
|
-
Step 4 - Command→Event 链:
|
|
408
|
-
"把事件串成流程:什么命令触发了它?
|
|
409
|
-
触发后系统自动做什么(Policy)?"
|
|
410
|
-
|
|
411
|
-
Step 5 - 识别 Bounded Context 边界:
|
|
412
|
-
"哪些事件自然聚集在一起?
|
|
413
|
-
哪些事件之间有明显的组织边界或团队边界?"
|
|
414
|
-
```
|
|
415
|
-
|
|
416
|
-
输出格式(Process Level 阶段结果):
|
|
417
|
-
|
|
418
|
-
```
|
|
419
|
-
Flow: Order Lifecycle
|
|
420
|
-
[PlaceOrder] ──→ (Order) ──→ [OrderPlaced]
|
|
421
|
-
│ Policy: reserve inventory
|
|
422
|
-
▼
|
|
423
|
-
(Inventory) ──→ [InventoryReserved]
|
|
424
|
-
│ Policy: request payment
|
|
425
|
-
▼
|
|
426
|
-
(Payment) ──→ [PaymentCompleted]
|
|
427
|
-
|
|
428
|
-
Candidate Bounded Contexts:
|
|
429
|
-
- Order Context (OrderPlaced, OrderShipped, OrderCancelled)
|
|
430
|
-
- Inventory Context (InventoryReserved, InventoryReleased)
|
|
431
|
-
- Payment Context (PaymentCompleted, PaymentFailed)
|
|
432
|
-
```
|
|
433
|
-
|
|
434
|
-
### Strategic Design Output
|
|
435
|
-
|
|
436
|
-
写入 `.roll/domain/context-map.md`:
|
|
437
|
-
|
|
438
|
-
```markdown
|
|
439
|
-
## Bounded Contexts
|
|
440
|
-
|
|
441
|
-
| Context | 职责边界 | 核心概念 |
|
|
442
|
-
|---------|---------|---------|
|
|
443
|
-
| Order | 订单生命周期管理 | Order, OrderItem, Customer |
|
|
444
|
-
| Inventory | 库存预留与释放 | Stock, Reservation, Warehouse |
|
|
445
|
-
| Payment | 支付处理与退款 | Payment, Refund, Transaction |
|
|
446
|
-
|
|
447
|
-
## Context Map
|
|
448
|
-
|
|
449
|
-
Order ═══U/D═══→ Inventory (Customer-Supplier: Order 下游消费库存事件)
|
|
450
|
-
Order ═══U/D═══→ Payment (Customer-Supplier: Order 发起支付请求)
|
|
451
|
-
Payment ──ACL──→ Alipay (Anti-Corruption Layer: 防腐层隔离第三方)
|
|
452
|
-
```
|
|
453
|
-
|
|
454
|
-
写入 `.roll/domain/ubiquitous-language.md`:
|
|
455
|
-
|
|
456
|
-
```markdown
|
|
457
|
-
| 术语 | 定义 | 所属 Context | 注意事项 |
|
|
458
|
-
|-----|------|-------------|---------|
|
|
459
|
-
| Order | 买家提交的购买意向,包含商品列表和配送信息 | Order | 不等于"交易",交易在 Payment Context |
|
|
460
|
-
| Reservation | 为订单锁定的库存数量,有时效 | Inventory | 区别于 Allocation(正式分配) |
|
|
461
|
-
```
|
|
462
|
-
|
|
463
|
-
Context Map 关系类型说明:
|
|
464
|
-
|
|
465
|
-
```
|
|
466
|
-
═══U/D═══→ Customer-Supplier (上下游依赖)
|
|
467
|
-
───ACL───→ Anti-Corruption Layer (防腐层)
|
|
468
|
-
═══PL════ Partnership (平等协作)
|
|
469
|
-
───SK─── Shared Kernel (共享内核)
|
|
470
|
-
───CF───→ Conformist (顺从者)
|
|
471
|
-
───OHS──→ Open Host Service (开放主机)
|
|
472
|
-
```
|
|
473
|
-
|
|
474
|
-
### Tactical Model Output
|
|
475
|
-
|
|
476
|
-
写入 `.roll/domain/<context>-model.md`:
|
|
477
|
-
|
|
478
|
-
```markdown
|
|
479
|
-
## Tactical Model: Order Context
|
|
480
|
-
|
|
481
|
-
### Aggregates
|
|
482
|
-
|
|
483
|
-
**Order** (Aggregate Root)
|
|
484
|
-
Entities: OrderItem
|
|
485
|
-
Value Objects: Address, Money, OrderStatus
|
|
486
|
-
Invariants:
|
|
487
|
-
- 订单金额 = sum(OrderItem.price × quantity)
|
|
488
|
-
- 已支付订单不可修改商品列表
|
|
489
|
-
- OrderItem 数量必须 > 0
|
|
490
|
-
|
|
491
|
-
### Domain Events
|
|
492
|
-
|
|
493
|
-
| Event | 触发条件 | 消费方 | Payload |
|
|
494
|
-
|-------|---------|-------|---------|
|
|
495
|
-
| OrderPlaced | Order.place() 成功 | Inventory Context | orderId, items, customerId |
|
|
496
|
-
| OrderCancelled | Order.cancel() | Inventory Context, Payment Context | orderId, reason |
|
|
497
|
-
|
|
498
|
-
### Repository Interfaces
|
|
499
|
-
|
|
500
|
-
IOrderRepository:
|
|
501
|
-
- findById(orderId): Order
|
|
502
|
-
- save(order): void
|
|
503
|
-
- findByCustomer(customerId, page): Order[]
|
|
504
|
-
|
|
505
|
-
### Domain Services
|
|
506
|
-
|
|
507
|
-
OrderPricingService:
|
|
508
|
-
- 职责: 跨 PriceRule Aggregate 计算最终价格(含优惠券、会员折扣)
|
|
509
|
-
- 原因: 定价逻辑跨越多个 Aggregate,不归属任何单一 Root
|
|
510
|
-
```
|
|
511
|
-
|
|
512
|
-
### Domain Slice Output(User Story 级别)
|
|
513
|
-
|
|
514
|
-
插入 US 的 Domain Model 段(见 Story Format):
|
|
515
|
-
|
|
516
|
-
```markdown
|
|
517
|
-
**Domain Model:**
|
|
518
|
-
- Context: Order
|
|
519
|
-
- Aggregate: Order (Root) owns [OrderItem, Address]
|
|
520
|
-
- Entities touched: OrderItem (新增/修改)
|
|
521
|
-
- Events raised: [OrderItemUpdated] → Inventory Context
|
|
522
|
-
- Cross-context: Inventory Context 需同步更新预留数量
|
|
523
|
-
```
|
|
524
|
-
|
|
525
|
-
### Domain Tag Output(Bug Fix 级别)
|
|
526
|
-
|
|
527
|
-
写入 FIX 描述的第一行:
|
|
528
|
-
|
|
529
|
-
```
|
|
530
|
-
Domain: Order Context > Order Aggregate > OrderItem Entity
|
|
531
|
-
```
|
|
532
|
-
|
|
533
|
-
### AGENTS.md Where to Look — 指针维护
|
|
534
|
-
|
|
535
|
-
After completing any Domain Slice (User Story level), check if the project's `AGENTS.md` has a `## Where to Look` section with a `.roll/domain/` pointer. If missing, append one line:
|
|
536
|
-
|
|
537
|
-
```markdown
|
|
538
|
-
- **Domain model**: `.roll/domain/context-map.md` — Bounded Contexts and relationships
|
|
539
|
-
```
|
|
540
|
-
|
|
541
|
-
Rules:
|
|
542
|
-
- Idempotent: only append if the pointer line is not already present
|
|
543
|
-
- Do not modify any other content in AGENTS.md
|
|
544
|
-
- Skip silently if `.roll/domain/` does not yet exist for this project
|
|
545
|
-
|
|
546
|
-
---
|
|
547
|
-
|
|
548
|
-
## Clarify Phase
|
|
549
|
-
|
|
550
|
-
**Skip conditions** — silently skip Clarify when any of these hold:
|
|
551
|
-
- Input uses `--from-file` or `--from-idea` flag (non-interactive mode)
|
|
552
|
-
- Input is high-confidence (clear verb + explicit scope + acceptance signal — see Non-Interactive Mode)
|
|
553
|
-
|
|
554
|
-
**Trigger conditions** — automatically enters if none of the skip conditions hold AND any of these are met:
|
|
555
|
-
- Input is a single vague sentence without clear scope
|
|
556
|
-
- Missing clear boundaries (what / who / when / where)
|
|
557
|
-
- Contains ambiguous terms like "优化一下", "改一下", "加个东西", "做个设计"
|
|
558
|
-
- Could be interpreted in multiple ways
|
|
559
|
-
|
|
560
|
-
**Pre-Clarify: three-step product localization (always run first, silently)**
|
|
561
|
-
|
|
562
|
-
Before listing questions, internally determine:
|
|
563
|
-
1. **产品端 (product end)**: web / mobile / API / CLI / other — which surface does this touch?
|
|
564
|
-
2. **角色 (role)**: who initiates this action? (end user / admin / system / external)
|
|
565
|
-
3. **业务域 (domain)**: which business domain does this belong to?
|
|
566
|
-
|
|
567
|
-
Already-localized dimensions become context prefix in the output, not open questions.
|
|
568
|
-
|
|
569
|
-
**Output format:**
|
|
570
|
-
|
|
571
|
-
```
|
|
572
|
-
🎯 Clarified Intent: {1-2 sentences}
|
|
573
|
-
🗺 Context: {product end} · {role} · {domain} ← omit if all three are unknown
|
|
574
|
-
|
|
575
|
-
📏 Complexity: {small|medium|large}
|
|
576
|
-
|
|
577
|
-
❓ Open Questions:
|
|
578
|
-
1. {question 1}
|
|
579
|
-
2. {question 2}
|
|
580
|
-
3. {question 3}
|
|
581
|
-
...
|
|
582
|
-
|
|
583
|
-
➡️ Please answer the questions above and I'll proceed to design.
|
|
584
|
-
```
|
|
585
|
-
|
|
586
|
-
**Rules:**
|
|
587
|
-
- Do **not** start designing until the user replies.
|
|
588
|
-
- Never announce "I'm using clarify." Just do it naturally.
|
|
589
|
-
- If the input is already clear enough, skip silently and proceed to Discuss or Analyze.
|
|
590
|
-
|
|
591
|
-
---
|
|
592
|
-
|
|
593
|
-
## Discuss Phase
|
|
594
|
-
|
|
595
|
-
**Trigger conditions** — automatically enters if any of these are met:
|
|
596
|
-
- User is explicitly asking "how to choose" or "what approach to use"
|
|
597
|
-
- More than 2 viable technical paths exist
|
|
598
|
-
- Requirement involves an unfamiliar tech stack or new domain
|
|
599
|
-
|
|
600
|
-
### How to Conduct the Discussion
|
|
601
|
-
|
|
602
|
-
Discuss is **multi-turn by default**. The goal is to reach clarity together, not to produce a complete comparison matrix in one shot.
|
|
603
|
-
|
|
604
|
-
**Step 1 — Understand before proposing**
|
|
605
|
-
|
|
606
|
-
Before listing options, make sure the core problem is clear. If context is thin, ask 1–2 focused questions first:
|
|
607
|
-
|
|
608
|
-
```
|
|
609
|
-
Before I lay out the options — can you tell me [specific constraint / scale / existing system boundary]?
|
|
610
|
-
```
|
|
611
|
-
|
|
612
|
-
Only skip this if the context is already rich enough to reason from.
|
|
613
|
-
|
|
614
|
-
**Step 2 — Offer an opinionated starting point, not a menu**
|
|
615
|
-
|
|
616
|
-
Don't dump 4 options at once. Lead with a concrete recommendation and the key tradeoff:
|
|
617
|
-
|
|
618
|
-
```
|
|
619
|
-
My read: go with X. The main tradeoff is [Y vs Z]. Want me to walk through why, or should I compare against [alternative] first?
|
|
620
|
-
```
|
|
621
|
-
|
|
622
|
-
Then wait. Let the user redirect.
|
|
623
|
-
|
|
624
|
-
**Step 3 — Follow the thread**
|
|
625
|
-
|
|
626
|
-
If the user wants to dig into a specific option or challenge an assumption, stay on that thread. Don't pivot back to the full comparison until the current thread is resolved.
|
|
627
|
-
|
|
628
|
-
**Step 4 — Surface hidden assumptions explicitly**
|
|
629
|
-
|
|
630
|
-
When a direction starts to crystallize, name the assumptions holding it up:
|
|
631
|
-
|
|
632
|
-
```
|
|
633
|
-
This only holds if [assumption]. Is that true for your situation?
|
|
634
|
-
```
|
|
635
|
-
|
|
636
|
-
**Step 5 — Name convergence before triggering the gate**
|
|
637
|
-
|
|
638
|
-
When the discussion reaches a clear conclusion, summarize it explicitly before asking to proceed:
|
|
639
|
-
|
|
640
|
-
```
|
|
641
|
-
Looks like we've landed on: [decision]. The key reasons: [1–2 points].
|
|
642
|
-
```
|
|
643
|
-
|
|
644
|
-
Then trigger the gate.
|
|
645
|
-
|
|
646
|
-
**Gate rule** — after convergence is named, always end with this explicit prompt and **wait for user reply before proceeding**:
|
|
647
|
-
|
|
648
|
-
```
|
|
649
|
-
➡️ Continue to solution design, or keep exploring?
|
|
650
|
-
```
|
|
651
|
-
|
|
652
|
-
Do **not** infer "approach confirmed" from the user's reaction to the comparison. Only proceed to Step 2 (Analyze) when the user explicitly says to continue (e.g., "yes", "proceed", "go ahead", "design it").
|
|
653
|
-
|
|
654
|
-
**Can stop at any time** — if after discussion the user says "let's not do it" or "let me think about it", there's no need to continue to the planning phase.
|
|
655
|
-
|
|
656
|
-
---
|
|
657
|
-
|
|
658
|
-
## Operation Sequence for Creating a New Story
|
|
659
|
-
|
|
660
|
-
```bash
|
|
661
|
-
# 1. Determine Feature ownership (e.g., compiler / ingest / qa)
|
|
662
|
-
FEATURE="compiler"
|
|
663
|
-
|
|
664
|
-
# 2. Write Plan document (if there is a solution design)
|
|
665
|
-
PLAN_FILE=".roll/features/${EPIC}/${FEATURE}-plan.md"
|
|
666
|
-
|
|
667
|
-
# 3. Write story spec: .roll/features/<epic>/<story>/spec.md (full AC)
|
|
668
|
-
# Story specs: .roll/features/<epic>/<story>/spec.md
|
|
669
|
-
|
|
670
|
-
# 4. Append index row under the corresponding Epic > Feature group in .roll/backlog.md
|
|
671
|
-
# | [US-XXX](.roll/features/compiler.md#us-xxx) | One-line description | 📋 Todo |
|
|
672
|
-
|
|
673
|
-
# 5. [Greenfield only] Write domain model files
|
|
674
|
-
DOMAIN_DIR=".roll/domain/"
|
|
675
|
-
# .roll/domain/context-map.md
|
|
676
|
-
# .roll/domain/ubiquitous-language.md
|
|
677
|
-
# .roll/domain/<context>-model.md
|
|
678
|
-
```
|
|
679
|
-
|
|
680
|
-
---
|
|
681
|
-
|
|
682
|
-
## Story Format
|
|
683
|
-
|
|
684
|
-
**.roll/backlog.md index row (only write this one line):**
|
|
685
|
-
|
|
686
|
-
```markdown
|
|
687
|
-
| [US-{DOMAIN}-{N}](.roll/features/<epic>/US-{DOMAIN}-{N}/spec.md) | {one-line description} | 📋 Todo |
|
|
688
|
-
```
|
|
689
|
-
|
|
690
|
-
`{one-line description}` 写法:用户能读懂的一句话,说清楚"能做什么"或"解决了什么麻烦"。不写实现细节、文件路径、函数名。细节和 AC 写在 `.roll/features/` 里。写好了可以直接当 CHANGELOG 条目用。
|
|
691
|
-
|
|
692
|
-
Note: `{DOMAIN}` maps to the Bounded Context name identified in DDD analysis.
|
|
693
|
-
|
|
694
|
-
**US section in .roll/features/\<feature\>.md (full details):**
|
|
695
|
-
|
|
696
|
-
```markdown
|
|
697
|
-
<a id="us-{domain}-{n}"></a>
|
|
698
|
-
## US-{DOMAIN}-{N} {Story Title} 📋
|
|
699
|
-
|
|
700
|
-
**Created**: {YYYY-MM-DD}
|
|
701
|
-
**Plan**: [{feature}-plan.md]({feature}-plan.md) ← if a design document exists
|
|
702
|
-
|
|
703
|
-
- As a {role}
|
|
704
|
-
- I want {action}
|
|
705
|
-
- So that {benefit}
|
|
706
|
-
|
|
707
|
-
**Domain Model:**
|
|
708
|
-
- Context: {Bounded Context name}
|
|
709
|
-
- Aggregate: {Root} owns [{entities}]
|
|
710
|
-
- Events raised: [{EventName}] → {consumer context}
|
|
711
|
-
- Cross-context: {if touches another context, otherwise omit}
|
|
712
|
-
|
|
713
|
-
**Agent profile:**
|
|
714
|
-
- est_min: {1-30 整数;一个 Story ≈ 一个 AI cycle 闭环,目标 5-10 min。这是**唯一的 loop 路由输入**——`lib/loop_pick_agent.py` 把 est_min 映射到复杂度档:≤8 → easy,8<x≤20 → default,>20 → hard;缺失/非法值 → default。est > ~15 是"再拆"信号——除非原子不可分(见 INVEST 的 S/I 校准)}
|
|
715
|
-
- risk_zone: {low / medium / high — 改文档 low,改用户可见行为 medium,改 loop infra 或安全/隔离基建 high。**不参与 loop 路由**(路由只看 est_min);仅供 roll-build / roll-fix 的 pre-flight 自评(US-AGENT-007)做能力匹配参考}
|
|
716
|
-
- chain_depth: 0 {若是自降级产出的子 story 则 +1,累计 ≥2 时第 3 次拒拆}
|
|
717
|
-
|
|
718
|
-
**AC:**
|
|
719
|
-
- [ ] {measurable criteria 1}
|
|
720
|
-
- [ ] {measurable criteria 2}
|
|
721
|
-
- [ ] {measurable criteria 3}
|
|
722
|
-
- [ ] {visual-evidence AC — REQUIRED by default: a captured screenshot of this story's user-visible surface (web/CLI/TUI). For a web/visual card this is "screenshot of <the deliverable page> is captured", paired with the `deliverable_url:` frontmatter below. Omit this AC ONLY when the card is `screenshot_exempt:` (see frontmatter).}
|
|
723
|
-
|
|
724
|
-
**Spec frontmatter (visual-evidence contract — FIX-311):**
|
|
725
|
-
- A web/visual card MUST declare the real product surface it delivers:
|
|
726
|
-
```yaml
|
|
727
|
-
---
|
|
728
|
-
deliverable_url: .roll/features/index.html#casting # alias: screenshot_url. The actual deliverable page, NEVER the card's own dossier/report page.
|
|
729
|
-
---
|
|
730
|
-
```
|
|
731
|
-
- **Pin down the deliverable surface — locate it, don't guess** (`deliverable_url` MUST be the EXACT page + anchor the story lands on):
|
|
732
|
-
- *Existing surface* → cite the real tab/anchor and VERIFY it exists (grep the generated page for the `#anchor`); never a parent or plausible-but-wrong page.
|
|
733
|
-
- *New feature* → DECIDE and NAME where it lands (which page / tab / route it is added to); that landing point IS the `deliverable_url` (it may not exist until this story builds it — that is expected; FIX-309 will require a real capture of it at attest, so a wrong/empty target fails loud).
|
|
734
|
-
- Never the card's dossier; never a generic page when the story changes a specific sub-surface.
|
|
735
|
-
- A card with genuinely NO user-visible surface (pure data-migration, infra, …) instead records:
|
|
736
|
-
```yaml
|
|
737
|
-
---
|
|
738
|
-
screenshot_exempt: pure data-migration — no user-visible surface # a naked `true`/`yes` is NOT valid; the reason is mandatory.
|
|
739
|
-
---
|
|
740
|
-
```
|
|
741
|
-
|
|
742
|
-
**Files:**
|
|
743
|
-
- `{file1}`
|
|
744
|
-
- `{file2}`
|
|
745
|
-
|
|
746
|
-
**Dependencies:**
|
|
747
|
-
- Depends on: {prerequisite US-XXX}
|
|
748
|
-
- Depended on by: {subsequent US-XXX}
|
|
749
|
-
|
|
750
|
-
**Data Flow (if applicable):**
|
|
751
|
-
- Producer: {which module writes data}
|
|
752
|
-
- Consumer: {which module reads data}
|
|
753
|
-
- Integration test: `tests/integration/{flow}.test.ts`
|
|
754
|
-
```
|
|
755
|
-
|
|
756
|
-
> **强制规则 — Agent profile 必须填**:Split into Stories 步骤产出的每个 US 都必须带 `**Agent profile:**` 子段。`est_min` 是 **loop 路由唯一输入**(`lib/loop_pick_agent.py` 的四槽复杂度路由 easy/default/hard/fallback,按 est_min 单轴决档;缺失/非法 → default 档)——务必填准。`risk_zone` 仍要填,但**不参与路由**,只供 roll-build / roll-fix 的 pre-flight 自评(US-AGENT-007)参考;`chain_depth` 默认 0。历史 US 不强制回填。
|
|
757
|
-
>
|
|
758
|
-
> **MUST fill** the `**Agent profile:**` block on every newly split US. `est_min` is the **sole loop-routing input** — `lib/loop_pick_agent.py` maps it onto a four-slot complexity tier (easy/default/hard/fallback) on the est_min axis alone (missing/illegal → default). Fill `risk_zone` too, but note it does NOT feed routing; it only informs the roll-build / roll-fix pre-flight self-eval (US-AGENT-007).
|
|
759
|
-
|
|
760
|
-
### Closing Doc-Refresh Story Template — Phase N.M 收尾文档
|
|
761
|
-
|
|
762
|
-
When any preceding US in the batch changes user-visible behavior, append this template story at the end of the batch. Wire it as `depends-on:` against every preceding user-facing US so it runs last.
|
|
763
|
-
|
|
764
|
-
```markdown
|
|
765
|
-
<a id="us-{domain}-{n}"></a>
|
|
766
|
-
## US-{DOMAIN}-{N} Phase {N.M} 用户文档刷新(中英双轨) 📋
|
|
767
|
-
|
|
768
|
-
**Created**: {YYYY-MM-DD}
|
|
769
|
-
|
|
770
|
-
- As a roll user reading the docs
|
|
771
|
-
- I want the user-facing documentation to match the new behavior shipped in this Phase
|
|
772
|
-
- So that the next person reading the guide / README / `--help` does not hit a stale version
|
|
773
|
-
|
|
774
|
-
**AC:**
|
|
775
|
-
- [ ] Update each affected doc file listed below; **English line and Chinese line on separate lines**, never inline
|
|
776
|
-
- [ ] `roll <cmd> --help` output reflects new flags / commands / status semantics (paste verified output)
|
|
777
|
-
- [ ] README index links to any new guide pages
|
|
778
|
-
- [ ] Error-message changes are mirrored in troubleshooting / FAQ sections
|
|
779
|
-
- [ ] Verified: no doc page still describes the pre-Phase behavior
|
|
780
|
-
|
|
781
|
-
**Files:**
|
|
782
|
-
- `guide/en/{topic}.md`
|
|
783
|
-
- `guide/zh/{topic}.md`
|
|
784
|
-
- `README.md` (index entry)
|
|
785
|
-
- `{any other user-facing doc touched by the Phase}`
|
|
786
|
-
|
|
787
|
-
**Dependencies:**
|
|
788
|
-
- Depends on: {every preceding user-facing US in this batch}
|
|
789
|
-
- Worked example: 参考 `features/authoring/slide-deck-generator.md` 的 US-DECK-015 ——
|
|
790
|
-
roll slides Phase 1.5 把 6 张 user-visible US 末尾合并成一张 doc-refresh story 的范例。
|
|
791
|
-
```
|
|
792
|
-
|
|
793
|
-
---
|
|
794
|
-
|
|
795
|
-
## INVEST Principles
|
|
796
|
-
|
|
797
|
-
> **颗粒度校准(按 AI cycle 量纲)**:Roll 的 Story 不是"几天的活",而是
|
|
798
|
-
> **一个 AI cycle 闭环(目标 5–10 min)**。下面的 S 和 I 按这个量纲重定义,
|
|
799
|
-
> 别套用传统敏捷"一个 sprint 装几个 story"的尺度。
|
|
800
|
-
|
|
801
|
-
Each story must be:
|
|
802
|
-
- **Independent**: 不强求完全独立。有先后依赖就用 `depends-on:` 串成链(配合
|
|
803
|
-
`chain_depth ≤ 2` 防无限套娃)。真正要避免的是"改同一文件的并行冲突",
|
|
804
|
-
而不是"禁止依赖"——为追求独立硬把一个 cycle 的活摊成几个反而更糟。
|
|
805
|
-
- **Negotiable**: Scope is negotiable
|
|
806
|
-
- **Valuable**: Provides value to the user
|
|
807
|
-
- **Estimable**: Effort can be estimated
|
|
808
|
-
- **Small**: **一个 Story ≈ 一个 AI cycle 闭环(目标 5–10 min)**。S 是 cycle 量纲,
|
|
809
|
-
装不进一个 cycle 就拆;`est_min > ~15` 是"再拆"信号——除非原子不可分。
|
|
810
|
-
- **Testable**: Can be tested and verified
|
|
811
|
-
|
|
812
|
-
## Backlog Structure
|
|
813
|
-
|
|
814
|
-
```markdown
|
|
815
|
-
# Project Backlog
|
|
816
|
-
|
|
817
|
-
## Epic Name
|
|
818
|
-
### Feature Name
|
|
819
|
-
| Story | Description | Status |
|
|
820
|
-
|-------|-------------|--------|
|
|
821
|
-
| [US-XXX](.roll/features/<epic>/<story>/spec.md#us-xxx) | One-line description | 📋 Todo |
|
|
822
|
-
| [US-YYY](.roll/features/<epic>/<story>/spec.md#us-yyy) | One-line description | ✅ Done |
|
|
823
|
-
```
|
|
824
|
-
|
|
825
|
-
**Note**: .roll/backlog.md only contains index rows; full AC / Files / Dependencies go in `.roll/features/<epic>/<story>/spec.md`.
|
|
826
|
-
|
|
827
|
-
---
|
|
828
|
-
|
|
829
|
-
## Review Score (FIX-343)
|
|
830
|
-
|
|
831
|
-
The design session is **not** self-scored. The designing agent **does NOT
|
|
832
|
-
self-score**. A design Review Score — when one is produced — comes SOLELY from
|
|
833
|
-
a Reviewer running in a FRESH, separate session (never a sub-agent of the
|
|
834
|
-
designer's session), the same independence rule as build/fix.
|
|
835
|
-
|
|
836
|
-
The design-side peer Review Score path is tracked by **FIX-344** (the runner's
|
|
837
|
-
score stage does not yet cover `roll-design`). Until FIX-344 lands, this skill
|
|
838
|
-
emits no quality score; the agent just delivers the split + specs and stops.
|
|
839
|
-
|
|
840
|
-
---
|
|
841
|
-
|
|
842
|
-
## Integration
|
|
843
|
-
|
|
844
|
-
### With roll-build
|
|
845
|
-
|
|
846
|
-
```
|
|
847
|
-
$roll-design "login feature" → Create US-AUTH-001
|
|
848
|
-
User: "Execute US-AUTH-001"
|
|
849
|
-
↓
|
|
850
|
-
$roll-build US-AUTH-001 → TCR → CI/CD → Deploy
|
|
851
|
-
```
|
|
852
|
-
|
|
853
|
-
### With roll-fix
|
|
854
|
-
|
|
855
|
-
```
|
|
856
|
-
$roll-debug discovers issue → Suggest creating FIX
|
|
857
|
-
$roll-design "fix login API 404" → Create FIX-AUTH-001 ← auto-detected as Bug Fix
|
|
858
|
-
$roll-fix FIX-AUTH-001 → Quick fix
|
|
859
|
-
```
|
|
860
|
-
|
|
861
|
-
### With roll-peer
|
|
862
|
-
|
|
863
|
-
Two checkpoints, both with 10s opt-out:
|
|
864
|
-
|
|
865
|
-
```
|
|
866
|
-
1. After Discuss — Direction Review
|
|
867
|
-
Approach confirmed → [peer, tag=architecture] → challenge the direction before DDD
|
|
868
|
-
Trigger: complexity=medium OR complexity=large OR requirement touches multiple Bounded Contexts
|
|
869
|
-
|
|
870
|
-
2. After Solution Design — Plan Review
|
|
871
|
-
Plan written → [peer, tag=architecture] → full plan review before story split
|
|
872
|
-
Trigger: complexity=medium OR complexity=large (greenfield always qualifies)
|
|
873
|
-
```
|
|
874
|
-
|
|
875
|
-
Rationale (US-SKILL-018): medium-complexity designs also routinely carry
|
|
876
|
-
direction/plan risks worth one independent challenge before story split — the
|
|
877
|
-
cost of one bounded peer pass is small next to reworking a misaimed design after
|
|
878
|
-
it ships. So peer now triggers at medium as well as large; the 10s opt-out
|
|
879
|
-
stays, so you can always skip when you're confident.
|
|
880
|
-
|
|
881
|
-
On AGREE or user skip → continue to the next step normally.
|
|
882
|
-
On REFINE/OBJECT → incorporate feedback, regenerate the relevant output, re-trigger peer.
|
|
883
|
-
On ESCALATE → present both proposals to user for final call.
|
|
884
|
-
|
|
885
|
-
---
|
|
886
|
-
|
|
887
|
-
## Project Context Rule
|
|
888
|
-
|
|
889
|
-
Before creating any file or directory:
|
|
890
|
-
|
|
891
|
-
1. **Read existing project structure** — check for `package.json`, `go.mod`, `Cargo.toml`, `pyproject.toml`, existing `src/`, `api/`, `cmd/` directories
|
|
892
|
-
2. **Check existing domain model** — if `.roll/domain/` exists, read `context-map.md` before adding new Bounded Contexts
|
|
893
|
-
3. **Infer conventions from evidence** — don't assume a project type; observe what already exists
|
|
894
|
-
4. **Follow what already exists** — introduce new patterns only when the current structure has no precedent
|
|
895
|
-
|
|
896
|
-
> `roll init` no longer asks for project type. Skills are responsible for reading context and acting accordingly.
|
|
897
|
-
|
|
898
|
-
---
|
|
899
|
-
|
|
900
|
-
<a id="doc-update-discipline"></a>
|
|
901
|
-
## Doc Update Discipline
|
|
902
|
-
|
|
903
|
-
When `$roll-design` splits a feature into stories, **the closing tasking step is
|
|
904
|
-
always a doc-refresh story whenever any preceding US changes user-visible
|
|
905
|
-
behavior**. This is mandatory, not optional — without it, code ships and the
|
|
906
|
-
docs silently drift to the previous version, and only the next user to read the
|
|
907
|
-
guide notices.
|
|
908
|
-
|
|
909
|
-
**When a separate doc-refresh story IS required (任一为真即触发):**
|
|
910
|
-
- 任一 US 改了 **CLI 输出**(新增/修改输出行、表头、颜色、emoji 语义)
|
|
911
|
-
- 任一 US 改了 **命令参数**(新增/重命名 flag、改变 default、收紧/放宽校验)
|
|
912
|
-
- 任一 US 改了 **状态语义**(backlog 状态、cycle 状态机、退出码含义)
|
|
913
|
-
- 任一 US 改了 **错误提示** / 用户可读日志文案
|
|
914
|
-
- 任一 US 新增/删除/重命名一个用户能直接调用的命令
|
|
915
|
-
|
|
916
|
-
**When it can be skipped (纯内部变更,用户感知不到):**
|
|
917
|
-
- 纯内部重构(内部函数改名、模块边界调整、测试沙箱化)
|
|
918
|
-
- CI / hooks / 工具链修复
|
|
919
|
-
- 安全 / 隔离基础设施(沙箱配置、权限矩阵内部调整)
|
|
920
|
-
- 测试基础设施 / fixture 数据更新
|
|
921
|
-
|
|
922
|
-
**Checklist for the doc-refresh story (中英双语必需):**
|
|
923
|
-
- [ ] `guide/en/<topic>.md` — English guide updated
|
|
924
|
-
- [ ] `guide/zh/<topic>.md` — Chinese guide updated
|
|
925
|
-
- [ ] `README.md` index links to any new doc page
|
|
926
|
-
- [ ] `--help` output snapshot matches new flags / commands / status semantics
|
|
927
|
-
- [ ] Error-message strings reflected in troubleshooting / FAQ
|
|
928
|
-
- [ ] **Bilingual rule**: English and Chinese on **separate lines**, never inline
|
|
929
|
-
(遵循 project CLAUDE.md 中 Bilingual Output Convention)
|
|
930
|
-
|
|
931
|
-
**How to wire the doc-refresh story:**
|
|
932
|
-
1. Place it **last** in the batch
|
|
933
|
-
2. `depends-on:` lists **every** preceding user-facing US in the batch
|
|
934
|
-
3. Title 用 "Phase N.M 用户文档刷新(中英双轨)" 模板(见 [Story Format](#story-format) 中的模板)
|
|
935
|
-
4. Cite a worked example in its Dependencies note — current best reference is
|
|
936
|
-
`features/authoring/slide-deck-generator.md` US-DECK-015 (roll slides Phase 1.5)
|
|
937
|
-
|
|
938
|
-
> Self-validation: this very skill was strengthened via US-SKILL-009; the
|
|
939
|
-
> roll slides Phase 1.5 tasking (US-DECK-015) is the canonical worked example
|
|
940
|
-
> of the discipline in action.
|