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