@seanyao/roll 3.609.2 → 3.610.2

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.
Files changed (103) hide show
  1. package/CHANGELOG.md +44 -1
  2. package/README.md +5 -6
  3. package/dist/roll.mjs +16146 -16186
  4. package/package.json +3 -2
  5. package/skills/README.md +14 -1
  6. package/skills/docs/skill-authoring.md +66 -0
  7. package/skills/reports/skill-audit-summary.md +53 -0
  8. package/skills/roll-.changelog/SKILL.md +25 -443
  9. package/skills/roll-.changelog/references/full-contract.md +462 -0
  10. package/skills/roll-.clarify/SKILL.md +6 -4
  11. package/skills/roll-.dream/SKILL.md +26 -353
  12. package/skills/roll-.dream/references/full-contract.md +365 -0
  13. package/skills/roll-.echo/SKILL.md +6 -4
  14. package/skills/roll-.qa/SKILL.md +25 -236
  15. package/skills/roll-.qa/references/full-contract.md +256 -0
  16. package/skills/roll-.review/SKILL.md +6 -2
  17. package/skills/roll-brief/SKILL.md +6 -8
  18. package/skills/roll-build/SKILL.md +28 -864
  19. package/skills/roll-build/references/full-contract.md +883 -0
  20. package/skills/roll-debug/SKILL.md +26 -585
  21. package/skills/roll-debug/references/full-contract.md +607 -0
  22. package/skills/roll-design/SKILL.md +28 -903
  23. package/skills/roll-design/references/full-contract.md +923 -0
  24. package/skills/roll-doc/SKILL.md +25 -574
  25. package/skills/roll-doc/references/full-contract.md +594 -0
  26. package/skills/roll-doctor/SKILL.md +21 -2
  27. package/skills/roll-fix/SKILL.md +28 -621
  28. package/skills/roll-fix/references/full-contract.md +640 -0
  29. package/skills/roll-idea/SKILL.md +6 -2
  30. package/skills/roll-loop/SKILL.md +27 -543
  31. package/skills/roll-loop/references/full-contract.md +555 -0
  32. package/skills/roll-notes/SKILL.md +6 -2
  33. package/skills/roll-onboard/SKILL.md +6 -2
  34. package/skills/roll-peer/SKILL.md +27 -316
  35. package/skills/roll-peer/references/full-contract.md +329 -0
  36. package/skills/roll-propose/SKILL.md +6 -8
  37. package/skills/roll-review-pr/SKILL.md +6 -2
  38. package/skills/roll-sentinel/SKILL.md +26 -344
  39. package/skills/roll-sentinel/references/full-contract.md +363 -0
  40. package/skills/roll-spar/SKILL.md +27 -269
  41. package/skills/roll-spar/references/full-contract.md +288 -0
  42. package/skills/route-cases/skills.json +235 -0
  43. package/skills/scripts/audit-skills.mjs +272 -0
  44. package/skills/scripts/test-audit-skills.mjs +39 -0
  45. package/skills/tests/fixtures/skill-audit/block-skill/SKILL.md +12 -0
  46. package/skills/tests/fixtures/skill-audit/minimal-skill/SKILL.md +8 -0
  47. package/skills/tests/fixtures/skill-audit/quoted-skill/SKILL.md +10 -0
  48. package/skills/tests/fixtures/skill-audit/route-cases.json +21 -0
  49. package/skills/tests/fixtures/skill-audit/spoke-skill/SKILL.md +12 -0
  50. package/skills/tests/fixtures/skill-audit/spoke-skill/references/runbook.md +3 -0
  51. package/bin/roll +0 -15361
  52. package/lib/backfill-pi-usage.py +0 -243
  53. package/lib/changelog_audit.py +0 -149
  54. package/lib/changelog_generate.py +0 -470
  55. package/lib/consistency_check.py +0 -409
  56. package/lib/context_feed_budget.sh +0 -194
  57. package/lib/github_sync.py +0 -876
  58. package/lib/i18n/slides.sh +0 -3
  59. package/lib/i18n/slides_build.sh +0 -38
  60. package/lib/i18n/slides_delete.sh +0 -19
  61. package/lib/i18n/slides_list.sh +0 -14
  62. package/lib/i18n/slides_logs.sh +0 -12
  63. package/lib/i18n/slides_new.sh +0 -15
  64. package/lib/i18n/slides_preview.sh +0 -14
  65. package/lib/i18n/slides_templates.sh +0 -7
  66. package/lib/i18n.sh +0 -211
  67. package/lib/loop-exit-summary.py +0 -393
  68. package/lib/loop-fmt.py +0 -589
  69. package/lib/loop_pick_agent.py +0 -316
  70. package/lib/loop_result_eval.py +0 -469
  71. package/lib/loop_unstick.py +0 -180
  72. package/lib/model_prices.py +0 -194
  73. package/lib/prices_fetcher.py +0 -534
  74. package/lib/roll-backlog.py +0 -225
  75. package/lib/roll-brief.py +0 -286
  76. package/lib/roll-help.py +0 -158
  77. package/lib/roll-home.py +0 -556
  78. package/lib/roll-init.py +0 -156
  79. package/lib/roll-loop-status.py +0 -1691
  80. package/lib/roll-loop-story.py +0 -191
  81. package/lib/roll-peer.py +0 -252
  82. package/lib/roll-setup.py +0 -102
  83. package/lib/roll-status.py +0 -367
  84. package/lib/roll_git.py +0 -41
  85. package/lib/roll_render.py +0 -414
  86. package/lib/slides/components/README.md +0 -123
  87. package/lib/slides/components/cards-2.html +0 -9
  88. package/lib/slides/components/cards-3.html +0 -9
  89. package/lib/slides/components/cards-4.html +0 -9
  90. package/lib/slides/components/compare.html +0 -22
  91. package/lib/slides/components/highlight.html +0 -9
  92. package/lib/slides/components/pipeline.html +0 -12
  93. package/lib/slides/components/plain.html +0 -7
  94. package/lib/slides/components/quote.html +0 -4
  95. package/lib/slides/components/timeline.html +0 -9
  96. package/lib/slides/templates/introduction-v3.html +0 -571
  97. package/lib/slides/templates/pitch.html +0 -0
  98. package/lib/slides-render.py +0 -778
  99. package/lib/slides-validate.py +0 -357
  100. package/lib/test_quality_gate.py +0 -143
  101. package/skills/roll-deck/SKILL.md +0 -296
  102. /package/skills/roll-debug/{injectable-bb.js → assets/injectable-bb.js} +0 -0
  103. /package/skills/roll-design/{ENGINEERING_CHECKLIST.md → references/engineering-checklist.md} +0 -0
@@ -2,640 +2,47 @@
2
2
  name: roll-fix
3
3
  license: MIT
4
4
  allowed-tools: "Read, Edit, Write, Glob, Grep, Bash, Skill"
5
- description: Execute bugfix/hotfix from backlog. Reads FIX/BUG from .roll/backlog.md, delivers via TCR workflow. Lighter than roll-build, focused on single-issue fixes.
5
+ description: "Load when the user provides a FIX-XXX or BUG-XXX item, or asks for a focused hotfix/bugfix through Roll lighter TCR repair workflow."
6
6
  ---
7
+ # Roll Fix
7
8
 
8
- # Fix Ship (TCR Edition)
9
+ This hub keeps the routing boundary, hard gates, and execution skeleton in the initial context. Load the heavier runbook only when the task actually needs the detailed contract.
9
10
 
10
- > Follows the Architecture Constraints, Development Discipline, and Engineering Common Sense defined in the project AGENTS.md.
11
+ ## Load
11
12
 
12
- Execute a single `FIX-XXX` / `BUG-XXX`, suitable for small-scope fixes or hotfixes.
13
+ Load when the user provides a FIX-XXX or BUG-XXX item, or asks for a focused hotfix/bugfix through Roll lighter TCR repair workflow.
13
14
 
14
- ## Trigger
15
+ ## When Not to Use
15
16
 
16
- Use when:
17
+ - Broad feature delivery; load roll-build.
18
+ - Discussion-only design work; load roll-design.
17
19
 
18
- - There is a clearly defined `FIX-XXX` or `BUG-XXX`
19
- - It is a single issue, single hotfix, or single small enhancement
20
- - It does not need to be split into multiple Stories / Actions to deliver
20
+ ## Read On Demand
21
21
 
22
- **Workflow:**
23
- 1. Read .roll/backlog.md index Find FIX/BUG row Follow link to `.roll/features/<epic>/<story>/spec.md`
24
- 2. Single Action (no splitting)
25
- 3. Execute via TCR workflow
26
- 4. Write back: update .roll/backlog.md status column + update FIX section in Feature file
22
+ - Read [the full contract](references/full-contract.md) before executing the workflow end to end, recovering from failures, or checking exact output templates.
23
+ - Keep this hub in context for trigger boundaries and hard gates.
27
24
 
28
- Do not use for:
25
+ ## Workflow Skeleton
29
26
 
30
- - Multi-step feature development
31
- - Large changes spanning multiple subsystems
32
- - Requirements that need planning and splitting first
33
- - Roadmap work that should be tracked as Stories
27
+ 1. Read the FIX/BUG row and root-cause context.
28
+ 2. Reproduce or explain why reproduction is impossible.
29
+ 3. Add the failing/regression test first.
30
+ 4. Patch through TCR, run focused and local CI checks.
31
+ 5. Self-review, update backlog/evidence, and open PR.
34
32
 
35
- If the issue expands beyond a single bounded change, switch to `roll-build`.
33
+ ## Hard Gates
36
34
 
37
- ## Project Context Rule
35
+ - Every fix gets a regression signal or documented exception.
36
+ - Blocking review findings are fixed in another TCR cycle.
37
+ - Self-score note is required before exit.
38
38
 
39
- Before creating any file or directory:
39
+ ## Gotchas
40
40
 
41
- 1. **Read existing project structure** check for `package.json`, `go.mod`, `Cargo.toml`, `pyproject.toml`, existing `src/`, `api/`, `cmd/` directories
42
- 2. **Infer conventions from evidence** don't assume a project type; observe what already exists
43
- 3. **Follow what already exists** — introduce new patterns only when the current structure has no precedent
41
+ - Use for narrow FIX/BUG work; broad feature delivery belongs in roll-build.
42
+ - Never patch without a regression signal or explicit reason why the bug cannot be reproduced locally.
44
43
 
45
- > `roll init` no longer asks for project type. Skills are responsible for reading context and acting accordingly.
44
+ ## Maintenance
46
45
 
47
- ---
48
-
49
- ## Hard Rules
50
-
51
- 0. **Worktree-first, PR-at-end (ALWAYS)**
52
- Before editing, work in a dedicated git worktree on its own branch
53
- (`git worktree add ../wt-<id> -b <branch>`), never the shared checkout —
54
- concurrent cycles/sessions must not collide. Finish by pushing the branch
55
- and opening a PR; `main` is PR-protected — NEVER `git push origin main`.
56
- (Under `roll-loop` the runner handles the worktree + PR; this rule is the
57
- manual-path equivalent and holds either way.)
58
-
59
- 1. **No local-only "done"**
60
- Even for a minor change, the work is not complete until it reaches:
61
- - TCR micro-commits (test-guaranteed working states)
62
- - local verification
63
- - Quality review (post-TCR, via code-reviewer skill)
64
- - commit
65
- - push
66
- - CI signal
67
- - deploy
68
- - online verification
69
-
70
- 2. **Keep it to one issue**
71
- This skill is for one user-visible issue, one hotfix, or one tightly related enhancement bundle.
72
-
73
- 3. **Test Design Review first**
74
- - Design the test/verification approach before implementation
75
- - Run `code-reviewer` on test design for coverage validation
76
- - Ensure we're testing the right thing before TCR begins
77
-
78
- 4. **TCR for all changes**
79
- - Follow Test → Green=Commit / Red=Revert for each micro-step
80
- - Even "one-liner" fixes get a TCR cycle
81
- - Each commit is a guaranteed working state
82
-
83
- 5. **Quality Review before final commit** (Post-TCR)
84
- After TCR cycles complete:
85
- - Run `code-reviewer` skill on the diff
86
- - Review focuses on **quality** (naming, patterns, scope)
87
- - Correctness already guaranteed by TCR
88
- - blocking findings (Critical issues) must be fixed via new TCR cycle
89
-
90
- 6. **Do not force backlog churn**
91
- By default, do not update backlog or project status files.
92
- Only write back project tracking if:
93
- - the user asked for it
94
- - the change affects roadmap-visible behavior
95
- - the fix should be tracked for follow-up work
96
-
97
- ## TCR Workflow
98
-
99
- ### 0. Pre-flight self-check (US-AGENT-007)
100
-
101
- Before locking the issue, read the FIX's Agent profile (est_min / chain_depth) from the linked feature md and decide whether this cycle should attempt the fix:
102
-
103
- ```
104
- inputs:
105
- fix.est_min (from **Agent profile:** block on the FIX row's feature md)
106
- fix.chain_depth (0 unless already a downgrade product)
107
-
108
- verdict:
109
- too_big when:
110
- fix.est_min > 20 (lands in the `hard` complexity tier)
111
- ok otherwise
112
- ```
113
-
114
- Routing is a single axis now (US-AGENT-022): `est_min` maps to one of three
115
- complexity tiers — `easy` (≤8), `default` (8<x≤20), `hard` (>20) — and each
116
- tier binds to a locally-installed agent slot in `.roll/agents.yaml` (model =
117
- the agent's own default; a `fallback` slot mechanically covers an unavailable
118
- agent). The retired v1 model (three-dimension type/est/risk_zone matching
119
- against `agent-routes.yaml`, soft history hit-rate preference, per-agent
120
- `max_est_min`/`risk`) no longer applies. The pre-flight verdict here is just
121
- the `hard`-tier boundary: a FIX estimated past it is a sanity signal that the
122
- "single small fix" assumption may be wrong.
123
-
124
- Emit `verdict: ok` or `verdict: too_big` (with `reason:`) as the first cycle output line.
125
-
126
- - `ok` → continue with step 1 below normally
127
- - `too_big` → self-downgrade per US-AGENT-008, **gated by US-AGENT-009 cap check**:
128
-
129
- ```bash
130
- # Cap check first (chain_depth ≥ 2 → refuse third auto-split).
131
- if ! bash -c 'source "$(command -v roll)"; _loop_chain_depth_cap_check FIX-XXX-NNN'; then
132
- bash -c 'source "$(command -v roll)"; _loop_split_cap_hit FIX-XXX-NNN "depth >= 2"'
133
- exit 0
134
- fi
135
- Skill("roll-design", "--from-story FIX-XXX-NNN")
136
- bash -c 'source "$(command -v roll)"; _loop_self_downgrade FIX-XXX-NNN "too_big: <reason>" "FIX-XXX-NNNa,FIX-XXX-NNNb"'
137
- exit 0
138
- ```
139
-
140
- Original FIX goes to 🚫 Hold with `→ split to ...` annotation; sub-stories carry `chain_depth + 1`. Cap-hit path raises ALERT for human triage. Do NOT TCR a half fix.
141
-
142
- Bug fixes are usually small (est_min ≤ 5), so pre-flight is mostly a sanity barrier for FIXes whose underlying issue turns out structural — e.g. a "simple null check" that requires touching 12 files. Catching that upfront is cheaper than burning a cycle.
143
-
144
- ### 1. Lock the issue
145
- - state the user-visible issue or requested enhancement
146
- - define the scope boundary and non-goals
147
-
148
- ### 2. Define verification
149
- - pick the narrowest local check that proves the fix
150
- - define the online verification target
151
- - for hotfixes: include regression test to prevent recurrence
152
- - reference `$roll-.qa` for appropriate test type (unit/integration/E2E)
153
- - **Test-quality self-check (US-QA-011)** — for any new test the fix adds:
154
- 1. The test must call project functions / public command entry points,
155
- not inline `sed`/`awk`/`grep -o`/`find`/`cut` pipelines that
156
- re-implement what `lib/` or `bin/` already does — rubric ❼.
157
- 2. The test must sandbox filesystem state via `BATS_TMPDIR` or an
158
- equivalent helper; never assert on or write to paths outside this
159
- repo (`~/.codex`, `~/.kimi`, `~/.roll/`, system paths) — rubric ❽.
160
- 3. If you can't satisfy (1) or (2), extract a project helper or
161
- redirect the env var to a tmp dir before writing the test.
162
-
163
- ### 3. Test Design Review (TCR Core)
164
-
165
- ```
166
- 🧪 $(msg fix.test_design):
167
-
168
- $(msg fix.verification_approach): {unit test | integration test | manual check}
169
-
170
- $(msg fix.test_scenarios):
171
- ├── $(msg fix.fix_verification): {how to confirm the fix works}
172
- └── $(msg fix.regression_check): {how to ensure we didn't break anything}
173
- ```
174
-
175
- **Reference `$roll-.qa` for test strategy:**
176
- - Even for fixes, follow `$roll-.qa` test pyramid
177
- - Hotfixes may skip visual regression but must have E2E smoke test
178
-
179
- **Run self-review on test design:**
180
- - Is the verification approach appropriate for this fix?
181
- - Are edge cases covered?
182
- - Is the regression check sufficient?
183
-
184
- ### 4. TCR Implementation
185
-
186
- ```
187
- ┌─────────────────────────────────────────────────────────────────────┐
188
- │ $(msg fix.tcr_cycle) │
189
- └─────────────────────────────────────────────────────────────────────┘
190
-
191
- $(msg fix.micro_step 1 "{description of the fix}")
192
-
193
- Step 1: Write/Update Test
194
- └── Run test → Confirm RED (bug reproduced or test fails)
195
-
196
- Step 2: Implement Fix
197
- └── Write minimal code to fix the issue
198
-
199
- Step 3: TCR Decision
200
- └── Run test
201
- ├── ✅ GREEN → git commit -m "tcr: fix {issue description}"
202
- └── ❌ RED → git checkout -- . → Retry
203
-
204
- For simple fixes, this may be a single TCR cycle.
205
- For complex fixes, use multiple micro-steps.
206
- ```
207
-
208
- ### 5. Local integration check (Pre-Push CI Gate)
209
-
210
- Run the repo's full CI check locally to catch issues before push:
211
-
212
- ```bash
213
- # Run local CI (format + lint + build + test)
214
- npm run ci:local 2>/dev/null || (npm run lint && npm run build && npm test -- --run)
215
- ```
216
-
217
- **Reference `$roll-.qa` for coverage requirements:**
218
- - Fixes must not reduce overall coverage
219
- - Hotfixes need at least regression test coverage
220
-
221
- **If failures:**
222
- ```
223
- ❌ Local CI check failed
224
- ├── Run 'npm run ci:fix' to auto-fix formatting issues
225
- ├── Fix lint/build/test errors
226
- └── Re-run checks until passing
227
- ```
228
-
229
- **Setup ci:local script (if not exists):**
230
- Add to `package.json`:
231
- ```json
232
- {
233
- "scripts": {
234
- "ci:local": "npm run format:check && npm run lint && npm run build && npm run test -- --run",
235
- "ci:fix": "npm run format && npm run lint -- --fix"
236
- }
237
- }
238
- ```
239
-
240
- **Setup pre-push hook (optional but recommended):**
241
- ```bash
242
- cat > .git/hooks/pre-push << 'EOF'
243
- #!/bin/bash
244
- echo "🔍 Running local CI checks..."
245
- if ! npm run ci:local 2>/dev/null && ! (npm run lint && npm run build); then
246
- echo "❌ CI check failed, push blocked"
247
- exit 1
248
- fi
249
- echo "✅ CI check passed"
250
- EOF
251
- chmod +x .git/hooks/pre-push
252
- ```
253
-
254
- ### 6. Quality Review (Post-TCR)
255
-
256
- **Run self-code-review on staged changes:**
257
-
258
- ```bash
259
- $roll-.review staged
260
- ```
261
-
262
- **Review Output:**
263
- ```
264
- 🔍 $(msg fix.self_review)
265
- ├── $(msg fix.scope): X files (+Y/-Z lines)
266
- ├── 🔴 $(msg fix.critical): N issues (must fix)
267
- ├── 🟡 $(msg fix.warnings): N issues (should fix)
268
- ├── 🟢 $(msg fix.suggestions): N items (optional)
269
- └── ✅ $(msg fix.passed_dimensions): [...]
270
- ```
271
-
272
- **Review Dimensions** (correctness guaranteed by TCR):
273
- - 🎯 **Code Quality**: Naming clarity, KISS, readability
274
- - 📐 **Design**: Appropriate abstraction, codebase consistency
275
- - ⚠️ **Scope**: Fix is minimal, no opportunistic changes
276
- - 📝 **Hotfix-specific**: Root cause addressed
277
-
278
- **Decision:**
279
- ```
280
- 🔴 Critical > 0 → Fix via new TCR cycle → Re-review
281
- 🟡 Warnings > 0 → Fix if quick or document
282
- 🟢/✅ All clear → Proceed to push
283
- ```
284
-
285
- **Note:** `code-reviewer` placeholder replaced with `$roll-.review` for local execution.
286
-
287
- ### 7. Commit and push (branch + PR — NEVER direct to main)
288
-
289
- `main` is PR-protected. Push the worktree's branch and open a PR — never
290
- `git push origin main`. (Under `roll-loop` the runner already made the
291
- worktree + branch and opens the PR; this is the manual-path equivalent.)
292
-
293
- ```bash
294
- # TCR commits already made on the worktree's branch (see Hard Rule 0).
295
- git push -u origin <branch>
296
- gh pr create --title "{fix|hotfix}: …" --body "…"
297
- # After CI is green: gh pr merge --rebase
298
- ```
299
-
300
- Commit message:
301
- ```
302
- {fix|hotfix|feat}: {description}
303
-
304
- - {what was fixed}
305
- - {root cause if known}
306
- - {test coverage}
307
- ```
308
-
309
- ### 8. Watch CI and resolve
310
-
311
- ```
312
- ⏳ CI Running...
313
- ├── ✅ PASS → Proceed to deploy
314
- └── ❌ FAIL →
315
- ├── Diagnose
316
- ├── TCR cycle to fix
317
- └── Push and retry
318
- ```
319
-
320
- ### 9. Deploy
321
-
322
- Follow the repo's normal deployment path.
323
-
324
- ### 10. Online verification
325
-
326
- Verify the shipped fix on the deployed target:
327
- - confirm the issue is resolved
328
- - confirm the previously working path still works
329
- - for hotfixes: verify in production environment
330
-
331
- ### 10.5. Verification Gate (MANDATORY)
332
-
333
- **Before marking as DONE, the verification gate must be passed.**
334
-
335
- **Fresh evidence** must be provided — claiming completion based on assumptions is not acceptable.
336
-
337
- ```
338
- 🚦 $(msg build.verification_gate)
339
-
340
- $(msg build.evidence_checklist):
341
- ├── [ ] $(msg build.tests_passed)
342
- ├── [ ] $(msg build.build_succeeded)
343
- ├── [ ] $(msg fix.issue_resolved): screenshot / curl output / log excerpt as proof
344
- └── [ ] $(msg build.no_regression)
345
-
346
- $(msg build.gate_decision):
347
- ├── ✅ $(msg build.gate_pass)
348
- └── ❌ $(msg build.gate_fail)
349
- ```
350
-
351
- **Hard Rule**: "I confirm tests passed" does not count as evidence. It must be **freshly run** command output from this session.
352
-
353
- ### 10.6: Acceptance Evidence (after Gate PASS)
354
-
355
- Runs ONLY on a ✅ Gate PASS (a FAIL retry must not mint a misleading report). Non-blocking: any failure here → WARN, continue to Step 11.
356
-
357
- 0. **Before/after pairing (owner ruling 2026-06-06)**: for a FIX, capture the
358
- BROKEN state at reproduction time (screenshot when the surface is visible —
359
- terminal run, panel, page) into `screenshots/before-*.png`; after the fix
360
- passes, capture the SAME surface into `screenshots/after-*.png`. The pair is
361
- the strongest possible fix evidence — reviewers see the delta, not a claim.
362
- Behavior-changing stories: same pattern where a prior state exists.
363
- Brand-new capability with nothing to contrast: skip — never stage a fake
364
- "before".
365
-
366
- 1. **Dump raw evidence** produced in this session to story-level dirs:
367
- `.roll/features/<epic>/{ID}/screenshots/*.png` — the DEFAULT evidence class for
368
- every surface, **CLI included** (US-ATTEST-010): text evidence is the agent's
369
- own report (nothing stops a fabricated `echo "✓ passed" > evidence.txt`); a
370
- screenshot is an OS-level capture of really-rendered pixels — an independent
371
- channel with a categorically higher forgery cost. Combined with the
372
- never-overwritten run dirs (D4) and the render-layer red line, it is the
373
- strongest link in the evidence chain.
374
- `.roll/features/<epic>/{ID}/evidence/*.txt` (resolve `<epic>` via `.roll/index.json`; `roll attest` writes the report there as `{ID}-report.html`) — supplementary (searchable,
375
- copyable); keep raw command outputs here, but do not let a text file be the
376
- ONLY evidence for an AC that has a visible surface.
377
-
378
- **CLI capture recipe**: run the verifying command in a REAL terminal (the
379
- tmux observation window `roll-loop-<slug>` is a natural target — display the
380
- proof there), then `screencapture -x -R <window-rect>` (macOS) into
381
- `screenshots/`. Capture ONLY the relevant work area — a focused window, not
382
- the whole desktop. Unattended cycles: drive the capture from the dispatcher
383
- (deterministic), never hand-craft an image; if the capture channel is
384
- unavailable (no GUI session / no permission), fall back to text evidence and
385
- mark the AC `partial` with a note — never fake a screenshot.
386
- 2. **Write the intent map** `.roll/features/<epic>/{ID}/ac-map.json` — for EVERY AC (ids `{ID}:AC1..n`) pick `pass|readonly|partial|claimed|missing` and reference only evidence that exists (paths relative to the run dir; story-level dirs are reachable as `../evidence/...` / `../screenshots/...`):
387
-
388
- ```json
389
- [{ "ac": "{ID}:AC1", "status": "pass",
390
- "evidence": [
391
- { "kind": "screenshot", "label": "terminal run (real pixels)", "href": "../screenshots/ac1-terminal.png" },
392
- { "kind": "text", "label": "vitest (supplementary)", "textFile": "../evidence/vitest.txt" }
393
- ] }]
394
- ```
395
-
396
- No evidence for an AC → say `claimed` yourself; the renderer enforces that downgrade anyway (red line) and lists it under Discrepancies.
397
- 3. **Run** `roll attest {ID}` (add `--deploy-url <url>` when one exists). The report lands at `.roll/features/<epic>/{ID}/latest/{ID}-report.html` (archive-per-card layout, US-META-001). The report is now layered (US-ATTEST-013): card context + conclusion/business badges + key screenshots up front, technical ANSI/command output folded into collapsed `<details>`, and a closing block (quality gate + evidence index + self-score). A FIX usually carries a before/after pair (`screenshots/before-*.png` + `after-*.png`) — the坏态/好态 contrast is the clearest proof a bug is gone.
398
- 4. **Design QA checklist (US-ATTEST-013) — READABILITY ONLY**. After the report
399
- renders, open it and run the checklist below. This is a presentation review of
400
- the rendered HTML, NOT an evidence review.
401
- **HARD RULE: this checklist NEVER changes any AC's status, evidence, or
402
- `pass|readonly|partial|fail|blocked|claimed|missing` verdict.** Those are
403
- fixed at step 2 (the ac-map) and enforced by the render-layer red line. If a
404
- readability item fails, fix the *presentation* (a missing context field, an
405
- uncropped screenshot, a layout overflow) — never edit a verdict to make the
406
- report look cleaner.
407
- - [ ] **首屏 10s 可懂** — a reviewer grasps what was fixed and whether it passed
408
- within ten seconds, without scrolling into the technical fold.
409
- - [ ] **390 / 320px 无横滚** — no horizontal scroll at mobile widths; before/after
410
- pairs stack rather than overflow.
411
- - [ ] **打印可读** — print preview (or print-to-PDF) is legible; AC cards don't
412
- split awkwardly across pages.
413
- - [ ] **状态不只靠颜色** — every status reads from its icon + bilingual word, not
414
- color alone (colorblind-safe).
415
- - [ ] **截图裁切与清晰度** — screenshots are cropped to the relevant work area and
416
- legible; no full-desktop captures, no blurry/half-rendered frames.
417
- If you cannot open the report (headless cycle), note that the design QA was
418
- deferred and say so in the cycle report — do NOT silently skip it, and do NOT
419
- substitute it for an evidence judgement.
420
-
421
- ### 11. Write Back Status (when tracking is needed)
422
-
423
- Only update when Hard Rule #6 conditions are met (user requested, affects roadmap-visible behavior, or needs follow-up tracking).
424
-
425
- Both locations must be updated — neither can be skipped:
426
-
427
- **① Update .roll/backlog.md index row (Status column):**
428
-
429
- **Location rule (FIX-198)**: edit the MAIN project's backlog by ABSOLUTE path — `${ROLL_MAIN_PROJECT:-$PWD}/.roll/backlog.md`. In ordinary projects the cycle worktree has NO `.roll/` (gitignored, never checked out): a relative `.roll/backlog.md` edit writes into the void and the flip silently vanishes.
430
-
431
-
432
- ```markdown
433
- | [FIX-{ID}](.roll/features/<epic>/FIX-{ID}/spec.md) | {Title} | ✅ Done · [evidence](.roll/features/<epic>/FIX-{ID}/latest/FIX-{ID}-report.html) |
434
- ```
435
-
436
- Change the Status of the corresponding row from `📋 Todo` or `🔨 In Progress` (whichever the row currently shows) to `✅ Done`. When invoked by `roll-loop`, the row will already be `🔨 In Progress` — that is the expected starting state.
437
-
438
- **② Update `.roll/features/<epic>/<story>/spec.md`:**
439
-
440
- ```markdown
441
- ## FIX-{ID} {description} ✅
442
-
443
- **Fixed**: {YYYY-MM-DD}
444
-
445
- **Problem**: {problem description}
446
- **Root Cause**: {root cause}
447
- **Solution**: {solution}
448
-
449
- **Files:**
450
- - `{modified file}`
451
- ```
452
-
453
- - Add ✅ to the title
454
- - Add `**Fixed**` date
455
- - Change AC (if any) from `[ ]` to `[x]`
456
- - Update Files to reflect actual changed files
457
-
458
- ### 12. Update Changelog
459
-
460
- **Mandatory** — the release (GitHub Release body = this version's changelog section) depends on this step. Do not skip.
461
-
462
- ```bash
463
- $roll-.changelog
464
- ```
465
-
466
- ### 13. Report
467
-
468
- Summarize:
469
- - shipped fix/enhancement
470
- - TCR statistics
471
- - quality review outcome
472
- - verification results
473
- - any residual risk
474
- - **.roll/backlog.md updated** ✅
475
- - **CHANGELOG.md updated** ✅
476
-
477
- ## Required Artifacts
478
-
479
- The agent must explicitly output before or during execution:
480
-
481
- - **Current Issue**: one sentence describing the bug, hotfix, or small enhancement
482
- - **Current Fix**: the smallest shippable fix
483
- - **Acceptance criteria**: measurable outcomes
484
- - **Write scope**: expected files or areas
485
- - **Test Design**: verification approach and scenarios
486
- - **Test Design Review**: coverage validation
487
- - **TCR Log**: micro-step(s) and commit(s)
488
- - **Quality Review**: post-TCR review results
489
- - **Deployment target**: where it will be verified
490
-
491
- ## Definition of Done
492
-
493
- A minor change is only "done" when all are true:
494
-
495
- - [ ] Issue clearly defined and scoped
496
- - [ ] Test design reviewed and approved
497
- - [ ] **TCR cycle(s) completed** (fix via Test && Commit)
498
- - [ ] All commits are green states
499
- - [ ] Local integration checks pass
500
- - [ ] Quality review (code-reviewer) passed, blocking issues resolved via TCR
501
- - [ ] Changes pushed
502
- - [ ] CI is green (or explicit, recorded exception exists)
503
- - [ ] Deployment completed
504
- - [ ] Online verification performed
505
- - [ ] **Verification Gate passed** (fresh evidence for tests, build, fix confirmation, no regression)
506
- - [ ] **Self-score note written (US-SKILL-010 / 011)** — before exit, the agent
507
- writes a structured score note via `_skill_write_self_score` so trend
508
- analysis (US-SKILL-014) and skill-self-scoring docs (US-SKILL-015) have
509
- data to read.
510
-
511
- ### Self-score (US-SKILL-011)
512
-
513
- Before exiting the cycle, write one self-score note. The helper validates
514
- inputs and lands the note under `.roll/features/<epic>/<FIX-id>/notes/<date>-roll-fix-<FIX-id>-<epoch>.md` (the card folder is the note home, US-META-008; resolve <epic> via .roll/index.json):
515
-
516
- ```bash
517
- bash -c 'source "$(command -v roll)"; \
518
- _skill_write_self_score roll-fix FIX-XXX-NNN <score 1..10> <good|ok|regression> "<rationale>"'
519
- ```
520
-
521
- Score guidance (integer 1..10):
522
- - **9..10** — clean root-cause fix; regression test added; TCR cycle smooth.
523
- - **6..8** — fix shipped but with caveats (e.g. workaround, partial coverage,
524
- or repeated TCR red iterations); rationale explains the trade-off.
525
- - **1..5** — fix landed but quality is below the bar (test coverage missing,
526
- fix only narrows blast radius, repeated agent re-tries). Verdict should be
527
- `ok` or `regression` if a related test broke.
528
-
529
- Verdict values:
530
- - `good` — fix is the proper root-cause fix; no caveats.
531
- - `ok` — shipped but with documented trade-offs (use rationale to explain).
532
- - `regression` — the fix re-broke something else (rare; consider re-opening).
533
-
534
- ## Rubric
535
-
536
- Quality evaluation for a completed fix. Score each dimension independently.
537
-
538
- | 维度 | ❌ Miss (0) | ⚠️ Partial (1) | ✅ Hit (2) |
539
- |------|------------|----------------|-----------|
540
- | **根因定位** | 只修了表象,未说明根因 | 描述了直接原因 | 追溯根本原因并有代码/日志证据 |
541
- | **最小范围** | 改动超出 fix 边界,含机会主义修改 | 范围合理但有冗余改动 | 最小改动,非 fix 相关代码零触碰 |
542
- | **回归测试** | 无测试,或测试与 bug 无关 | 有测试但未复现原始 bug | 先写复现测试(RED)再修复(GREEN) |
543
- | **验证证据** | 仅声称通过,无实际输出 | 有部分截图/日志但不完整 | 贴出完整命令输出,覆盖 fix + 回归 |
544
- | **无新破坏** | CI 红,或已知回归未处理 | CI 绿但有 warning 未说明 | CI 全绿,覆盖率不降,warning 清零 |
545
-
546
- **评分解读**
547
-
548
- | 总分 | 结论 |
549
- |------|------|
550
- | 9–10 | Exemplary — 可作为参考案例 |
551
- | 7–8 | Acceptable — 可交付,有小瑕疵 |
552
- | 5–6 | Needs Work — 需补充证据或补测试 |
553
- | ≤ 4 | Redo — 根因或验证存在根本缺失 |
554
-
555
- > 用法:fix 完成后由 `$roll-eval`(或人工)对照此表打分,结果写入 `roll-notes`。
556
-
557
- ---
558
-
559
- ## TCR Patterns for Common Fixes
560
-
561
- ### Pattern: Bug Fix with Regression Test
562
-
563
- ```
564
- Issue: "Search returns no results for special characters"
565
-
566
- 🧪 Test Design:
567
- ├── Fix verification: Search with "@#$%" returns results
568
- └── Regression: Normal search still works
569
-
570
- TCR CYCLE 1: Regression test
571
- ├── Write test: Normal search works
572
- ├── Run → ✅ GREEN (expected, feature currently works)
573
- └── Commit: "tcr: add regression test for normal search"
574
-
575
- TCR CYCLE 2: Bug reproduction
576
- ├── Write test: Special character search works
577
- ├── Run → ❌ RED (bug reproduced)
578
- └── No commit (test fails, but we keep it)
579
-
580
- TCR CYCLE 3: Fix implementation
581
- ├── Fix special character handling in search query
582
- ├── Run tests → ✅ GREEN (both tests pass)
583
- └── Commit: "tcr: fix special character handling in search"
584
- ```
585
-
586
- ### Pattern: One-Liner Fix
587
-
588
- ```
589
- Issue: "Button color is wrong"
590
-
591
- 🧪 Test Design:
592
- └── Verification: Visual check + CSS property assertion
593
-
594
- TCR CYCLE:
595
- ├── Test: CSS property assertion
596
- ├── Run → ❌ RED
597
- ├── Fix: Change color value
598
- ├── Run → ✅ GREEN
599
- └── Commit: "tcr: fix button color"
600
- ```
601
-
602
- ### Pattern: Hotfix (Production Issue)
603
-
604
- ```
605
- Issue: "Critical: Payment processing fails"
606
-
607
- 🧪 Test Design:
608
- ├── Fix verification: Payment API returns 200
609
- └── Regression: Invalid payments still rejected
610
-
611
- TCR CYCLE 1: Regression test for invalid payments
612
- └── Commit: "tcr: ensure invalid payments are rejected"
613
-
614
- TCR CYCLE 2: Fix payment processing
615
- └── Commit: "tcr: hotfix payment processing failure"
616
-
617
- 🔍 Quality Review (extra scrutiny for hotfix):
618
- ├── Is this the minimal safe fix?
619
- ├── Is there a safer workaround?
620
- └── Should we roll back instead?
621
- ```
622
-
623
- ## Escalation Rule
624
-
625
- Switch from `minor-ship` to `story-ship` when:
626
-
627
- - the issue turns into multiple shippable Actions
628
- - the change touches multiple domains or risky integrations
629
- - project tracking and backlog state now matter
630
- - the user asks for a full story-driven loop
631
-
632
- ## TCR Recovery
633
-
634
- If TCR repeatedly fails (3+ attempts on same micro-step):
635
-
636
- ```
637
- 1. Revert to clean state
638
- 2. Re-examine: Is this really a "minor" fix?
639
- 3. If not → Escalate to story-ship
640
- 4. If yes → Break into smaller micro-steps
641
- ```
46
+ - Description changes require updates in `route-cases/skills.json`.
47
+ - New observed failures should add a gotcha and the matching positive or negative route case.
48
+ - Heavy examples, templates, recovery paths, and deterministic snippets belong in `references/`, `assets/`, or `scripts/`, not in this hub.