@seanyao/roll 0.5.0 → 2.602.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.
Files changed (181) hide show
  1. package/CHANGELOG.md +717 -0
  2. package/LICENSE +21 -0
  3. package/README.md +65 -165
  4. package/bin/dream-test-quality-scan +110 -0
  5. package/bin/roll +14897 -815
  6. package/conventions/config.yaml +17 -1
  7. package/conventions/global/AGENTS.md +146 -100
  8. package/conventions/global/CLAUDE.md +1 -21
  9. package/conventions/global/GEMINI.md +8 -22
  10. package/conventions/global/project_rules.md +9 -0
  11. package/conventions/templates/backend-service/AGENTS.md +30 -81
  12. package/conventions/templates/backend-service/GEMINI.md +3 -3
  13. package/conventions/templates/backend-service/project_rules.md +16 -0
  14. package/conventions/templates/cli/AGENTS.md +31 -58
  15. package/conventions/templates/cli/CLAUDE.md +3 -5
  16. package/conventions/templates/cli/GEMINI.md +3 -3
  17. package/conventions/templates/cli/project_rules.md +16 -0
  18. package/conventions/templates/frontend-only/AGENTS.md +29 -64
  19. package/conventions/templates/frontend-only/GEMINI.md +3 -3
  20. package/conventions/templates/frontend-only/project_rules.md +14 -0
  21. package/conventions/templates/fullstack/AGENTS.md +31 -79
  22. package/conventions/templates/fullstack/CLAUDE.md +1 -1
  23. package/conventions/templates/fullstack/GEMINI.md +3 -3
  24. package/conventions/templates/fullstack/project_rules.md +15 -0
  25. package/lib/README.md +42 -0
  26. package/lib/__pycache__/github_sync.cpython-314.pyc +0 -0
  27. package/lib/__pycache__/loop-fmt.cpython-314.pyc +0 -0
  28. package/lib/__pycache__/loop_result_eval.cpython-314.pyc +0 -0
  29. package/lib/__pycache__/loop_unstick.cpython-314.pyc +0 -0
  30. package/lib/__pycache__/model_prices.cpython-314.pyc +0 -0
  31. package/lib/__pycache__/prices_fetcher.cpython-314.pyc +0 -0
  32. package/lib/__pycache__/roll-home.cpython-314.pyc +0 -0
  33. package/lib/__pycache__/roll-loop-status.cpython-314.pyc +0 -0
  34. package/lib/__pycache__/roll_git.cpython-314.pyc +0 -0
  35. package/lib/__pycache__/roll_render.cpython-314.pyc +0 -0
  36. package/lib/__pycache__/slides-render.cpython-314.pyc +0 -0
  37. package/lib/agent_usage/README.md +49 -0
  38. package/lib/agent_usage/__init__.py +108 -0
  39. package/lib/agent_usage/__pycache__/__init__.cpython-314.pyc +0 -0
  40. package/lib/agent_usage/__pycache__/gemini.cpython-314.pyc +0 -0
  41. package/lib/agent_usage/__pycache__/kimi.cpython-314.pyc +0 -0
  42. package/lib/agent_usage/__pycache__/openai.cpython-314.pyc +0 -0
  43. package/lib/agent_usage/__pycache__/pi.cpython-314.pyc +0 -0
  44. package/lib/agent_usage/__pycache__/pi_emit.cpython-314.pyc +0 -0
  45. package/lib/agent_usage/__pycache__/qwen.cpython-314.pyc +0 -0
  46. package/lib/agent_usage/gemini.py +127 -0
  47. package/lib/agent_usage/kimi.py +278 -0
  48. package/lib/agent_usage/kimi_emit.py +123 -0
  49. package/lib/agent_usage/openai.py +126 -0
  50. package/lib/agent_usage/pi.py +200 -0
  51. package/lib/agent_usage/pi_emit.py +135 -0
  52. package/lib/agent_usage/qwen.py +128 -0
  53. package/lib/backfill-pi-usage.py +243 -0
  54. package/lib/changelog_audit.py +155 -0
  55. package/lib/changelog_generate.py +263 -0
  56. package/lib/context_feed_budget.sh +194 -0
  57. package/lib/github_sync.py +876 -0
  58. package/lib/i18n/README.md +54 -0
  59. package/lib/i18n/agent.sh +75 -0
  60. package/lib/i18n/alert.sh +20 -0
  61. package/lib/i18n/backlog.sh +96 -0
  62. package/lib/i18n/brief.sh +5 -0
  63. package/lib/i18n/changelog.sh +5 -0
  64. package/lib/i18n/ci.sh +15 -0
  65. package/lib/i18n/debug.sh +0 -0
  66. package/lib/i18n/doctor.sh +44 -0
  67. package/lib/i18n/dream.sh +0 -0
  68. package/lib/i18n/init.sh +91 -0
  69. package/lib/i18n/lang.sh +10 -0
  70. package/lib/i18n/loop.sh +140 -0
  71. package/lib/i18n/migrate.sh +74 -0
  72. package/lib/i18n/offboard.sh +31 -0
  73. package/lib/i18n/onboard.sh +0 -0
  74. package/lib/i18n/peer.sh +41 -0
  75. package/lib/i18n/peer_help.sh +25 -0
  76. package/lib/i18n/peer_reset.sh +7 -0
  77. package/lib/i18n/peer_status.sh +5 -0
  78. package/lib/i18n/prices.sh +3 -0
  79. package/lib/i18n/prices_refresh.sh +17 -0
  80. package/lib/i18n/prices_show.sh +7 -0
  81. package/lib/i18n/propose.sh +0 -0
  82. package/lib/i18n/release.sh +0 -0
  83. package/lib/i18n/research.sh +0 -0
  84. package/lib/i18n/review_pr.sh +0 -0
  85. package/lib/i18n/sentinel.sh +0 -0
  86. package/lib/i18n/setup.sh +3 -0
  87. package/lib/i18n/shared.sh +157 -0
  88. package/lib/i18n/skills/roll-brief.sh +47 -0
  89. package/lib/i18n/skills/roll-build.sh +97 -0
  90. package/lib/i18n/skills/roll-design.sh +18 -0
  91. package/lib/i18n/skills/roll-fix.sh +53 -0
  92. package/lib/i18n/skills/roll-loop.sh +28 -0
  93. package/lib/i18n/skills/roll-onboard.sh +33 -0
  94. package/lib/i18n/skills_catalog.sh +30 -0
  95. package/lib/i18n/slides.sh +3 -0
  96. package/lib/i18n/slides_build.sh +38 -0
  97. package/lib/i18n/slides_delete.sh +19 -0
  98. package/lib/i18n/slides_list.sh +14 -0
  99. package/lib/i18n/slides_logs.sh +12 -0
  100. package/lib/i18n/slides_new.sh +15 -0
  101. package/lib/i18n/slides_preview.sh +14 -0
  102. package/lib/i18n/slides_templates.sh +7 -0
  103. package/lib/i18n/status.sh +21 -0
  104. package/lib/i18n/update.sh +24 -0
  105. package/lib/i18n.sh +211 -0
  106. package/lib/loop-exit-summary.py +393 -0
  107. package/lib/loop-fmt.py +589 -0
  108. package/lib/loop_pick_agent.py +316 -0
  109. package/lib/loop_result_eval.py +469 -0
  110. package/lib/loop_unstick.py +180 -0
  111. package/lib/model_prices.py +186 -0
  112. package/lib/prices/README.md +35 -0
  113. package/lib/prices/snapshot-2026-05-22.json +22 -0
  114. package/lib/prices/snapshot-2026-05-23-deepseek.json +15 -0
  115. package/lib/prices/snapshot-2026-05-23-kimi.json +14 -0
  116. package/lib/prices_fetcher.py +285 -0
  117. package/lib/roll-backlog.py +225 -0
  118. package/lib/roll-brief.py +286 -0
  119. package/lib/roll-help.py +158 -0
  120. package/lib/roll-home.py +556 -0
  121. package/lib/roll-init.py +156 -0
  122. package/lib/roll-loop-status.py +1683 -0
  123. package/lib/roll-loop-story.py +191 -0
  124. package/lib/roll-onboard-render.py +378 -0
  125. package/lib/roll-peer.py +252 -0
  126. package/lib/roll-plan-validate.py +386 -0
  127. package/lib/roll-setup.py +102 -0
  128. package/lib/roll-status.py +367 -0
  129. package/lib/roll_git.py +41 -0
  130. package/lib/roll_render.py +414 -0
  131. package/lib/slides/components/README.md +123 -0
  132. package/lib/slides/components/cards-2.html +9 -0
  133. package/lib/slides/components/cards-3.html +9 -0
  134. package/lib/slides/components/cards-4.html +9 -0
  135. package/lib/slides/components/compare.html +22 -0
  136. package/lib/slides/components/highlight.html +9 -0
  137. package/lib/slides/components/pipeline.html +12 -0
  138. package/lib/slides/components/plain.html +7 -0
  139. package/lib/slides/components/quote.html +4 -0
  140. package/lib/slides/components/timeline.html +9 -0
  141. package/lib/slides/templates/introduction-v3.html +571 -0
  142. package/lib/slides/templates/pitch.html +0 -0
  143. package/lib/slides-render.py +778 -0
  144. package/lib/slides-validate.py +357 -0
  145. package/lib/test_quality_gate.py +143 -0
  146. package/package.json +8 -7
  147. package/skills/roll-.changelog/SKILL.md +406 -33
  148. package/skills/roll-.clarify/SKILL.md +5 -2
  149. package/skills/roll-.dream/SKILL.md +374 -0
  150. package/skills/roll-.echo/SKILL.md +5 -2
  151. package/skills/roll-.qa/SKILL.md +57 -3
  152. package/skills/roll-.review/SKILL.md +42 -3
  153. package/skills/roll-brief/SKILL.md +209 -0
  154. package/skills/roll-build/SKILL.md +308 -63
  155. package/skills/roll-debug/SKILL.md +341 -162
  156. package/skills/roll-debug/injectable-bb.js +263 -0
  157. package/skills/roll-deck/SKILL.md +296 -0
  158. package/skills/roll-design/ENGINEERING_CHECKLIST.md +1 -1
  159. package/skills/roll-design/SKILL.md +727 -94
  160. package/skills/roll-doc/SKILL.md +595 -0
  161. package/skills/roll-doctor/SKILL.md +192 -0
  162. package/skills/roll-fix/SKILL.md +149 -32
  163. package/skills/{roll-jot → roll-idea}/SKILL.md +18 -10
  164. package/skills/roll-loop/SKILL.md +578 -0
  165. package/skills/roll-notes/SKILL.md +103 -0
  166. package/skills/roll-onboard/SKILL.md +234 -0
  167. package/skills/roll-peer/SKILL.md +336 -0
  168. package/skills/roll-propose/SKILL.md +157 -0
  169. package/skills/roll-review-pr/SKILL.md +58 -0
  170. package/skills/roll-sentinel/SKILL.md +11 -2
  171. package/skills/roll-spar/SKILL.md +8 -6
  172. package/template/.github/workflows/ci.yml +5 -2
  173. package/template/AGENTS.md +20 -74
  174. package/skills/roll-research/SKILL.md +0 -307
  175. package/skills/roll-research/references/schema.json +0 -162
  176. package/skills/roll-research/scripts/md_to_pdf.py +0 -289
  177. package/tools/roll-fetch/SKILL.md +0 -182
  178. package/tools/roll-fetch/package.json +0 -15
  179. package/tools/roll-fetch/smart-web-fetch.js +0 -558
  180. package/tools/roll-probe/SKILL.md +0 -84
  181. /package/template/{BACKLOG.md → .roll/backlog.md} +0 -0
@@ -0,0 +1,192 @@
1
+ ---
2
+ name: roll-doctor
3
+ license: MIT
4
+ allowed-tools: "Read, Bash, Edit"
5
+ description: "Diagnose Roll toolchain health. Checks skill files, YAML frontmatter, symlinks, conventions sync, template integrity, and config validity."
6
+ ---
7
+
8
+ # Roll Doctor
9
+
10
+ 诊断 Roll 工具链健康状态。快速定位 skill 不工作、convention 不同步、symlink 断裂等问题。
11
+
12
+ ## When to Use
13
+
14
+ - "roll 怎么不工作了"
15
+ - "skill 找不到了"
16
+ - "convention 没有同步"
17
+ - "$roll-debug 不响应"
18
+ - 任何 Roll 相关功能异常
19
+
20
+ ## Checks
21
+
22
+ ### 1. Roll Installation
23
+
24
+ ```bash
25
+ # Verify ROLL_HOME structure
26
+ ls -la ~/.roll/
27
+ ls -la ~/.roll/skills/
28
+ ls -la ~/.roll/conventions/
29
+ ```
30
+
31
+ Expected:
32
+ - `~/.roll/` exists
33
+ - `~/.roll/skills/` has roll-* directories
34
+ - `~/.roll/conventions/global/` has AGENTS.md, CLAUDE.md, etc.
35
+ - `~/.roll/conventions/templates/` has backend-service, cli, frontend-only, fullstack
36
+
37
+ ### 2. Skill Health
38
+
39
+ ```bash
40
+ # List all skills and check YAML frontmatter
41
+ for f in ~/.roll/skills/*/SKILL.md; do
42
+ echo "=== $(basename $(dirname $f)) ==="
43
+ head -5 "$f"
44
+ done
45
+ ```
46
+
47
+ Check:
48
+ - Each skill directory has `SKILL.md`
49
+ - YAML frontmatter has `name:` and `description:`
50
+ - No duplicate `name` values across skills
51
+ - File is readable markdown
52
+
53
+ ### 3. Symlinks
54
+
55
+ ```bash
56
+ # Claude Code
57
+ ls -la ~/.claude/skills/roll-*
58
+
59
+ # Antigravity (agy — reuses ~/.gemini/, if exists)
60
+ ls -la ~/.gemini/skills/roll-* 2>/dev/null
61
+
62
+ # Trae (if exists)
63
+ ls -la ~/.trae/skills/roll-* 2>/dev/null
64
+ ```
65
+
66
+ Check:
67
+ - Each symlink exists
68
+ - Each symlink points to valid target in `~/.roll/skills/`
69
+ - No broken symlinks (red in ls output)
70
+
71
+ ### 4. Conventions Sync
72
+
73
+ ```bash
74
+ # Check roll.md sync
75
+ diff ~/.roll/conventions/global/CLAUDE.md ~/.claude/roll.md
76
+
77
+ # Check CLAUDE.md includes @roll.md
78
+ grep "@roll.md" ~/.claude/CLAUDE.md
79
+ ```
80
+
81
+ Check:
82
+ - `~/.claude/roll.md` exists and matches `~/.roll/conventions/global/CLAUDE.md`
83
+ - `~/.claude/CLAUDE.md` contains `@roll.md` reference
84
+ - `~/.claude/CLAUDE.md` is not missing or stale
85
+
86
+ ### 5. Template Integrity
87
+
88
+ ```bash
89
+ # Global conventions
90
+ ls ~/.roll/conventions/global/
91
+
92
+ # Project type templates
93
+ for t in backend-service cli frontend-only fullstack; do
94
+ ls ~/.roll/conventions/templates/$t/
95
+ done
96
+
97
+ # New project template
98
+ ls ~/.roll/template/
99
+ ```
100
+
101
+ Check:
102
+ - All expected files present in each directory
103
+ - No missing AGENTS.md, CLAUDE.md, or GEMINI.md
104
+
105
+ ### 6. Config
106
+
107
+ ```bash
108
+ cat ~/.roll/config.yaml
109
+ ```
110
+
111
+ Check:
112
+ - File exists and is valid YAML
113
+ - Has required `ai_tool_name` or `ai_claude` entries
114
+
115
+ ### 7. Peer Review
116
+
117
+ ```bash
118
+ # Peer state directory
119
+ ls -la ~/.roll/.peer-state/ 2>/dev/null || echo "missing"
120
+
121
+ # Peer config in config.yaml
122
+ grep "peer_" ~/.roll/config.yaml 2>/dev/null || echo "no peer config"
123
+
124
+ # Available peer CLIs
125
+ for tool in claude kimi pi codex; do
126
+ command -v "$tool" &>/dev/null && echo "✓ $tool" || echo "✗ $tool"
127
+ done
128
+
129
+ # roll-peer skill
130
+ ls ~/.roll/skills/roll-peer/SKILL.md 2>/dev/null || echo "missing"
131
+ ```
132
+
133
+ Check:
134
+ - `~/.roll/.peer-state/` exists and is writable
135
+ - `~/.roll/config.yaml` contains `peer_call_timeout` (default: 180)
136
+ - At least one peer CLI (claude / kimi / pi) is installed
137
+ - `roll-peer` skill exists
138
+
139
+ ## Report Format
140
+
141
+ ```
142
+ 🔬 Roll Doctor Report
143
+
144
+ [✓/✗] Roll installation
145
+ [✓/✗] Skills (N skills checked)
146
+ [✓/✗] Symlinks (N tools checked)
147
+ [✓/✗] Conventions sync
148
+ [✓/✗] Templates integrity
149
+ [✓/✗] Config
150
+ [✓/✗] Peer Review
151
+
152
+ ---
153
+ Issues found: N
154
+
155
+ 1. [severity] description → fix command
156
+ 2. [severity] description → fix command
157
+
158
+ Recommendation: ...
159
+ ```
160
+
161
+ ## Severity Levels
162
+
163
+ | Level | Meaning | Example |
164
+ |-------|---------|---------|
165
+ | 🔴 Critical | Skill completely broken | Broken symlink, missing SKILL.md |
166
+ | 🟡 Warning | Partial functionality | Stale convention, outdated roll.md |
167
+ | 🟢 Info | Recommendations | Missing optional tool symlink |
168
+
169
+ ## Auto-Fix
170
+
171
+ If user confirms, automatically fix safe issues:
172
+
173
+ - **Broken/missing symlinks** → `roll setup` (recreates all)
174
+ - **Stale conventions** → `roll sync conventions`
175
+ - **Missing template files** → warn user to re-install
176
+
177
+ Never auto-fix without user confirmation for:
178
+ - Overwriting `~/.claude/CLAUDE.md` (may have user customizations)
179
+ - Deleting files
180
+
181
+ ## Quick Fix Commands
182
+
183
+ ```bash
184
+ # Recreate all symlinks and sync conventions
185
+ roll setup
186
+
187
+ # Sync only conventions
188
+ roll sync conventions
189
+
190
+ # Reinstall (nuclear option)
191
+ curl -fsSL https://raw.githubusercontent.com/seanyao/roll/main/install.sh | bash
192
+ ```
@@ -1,6 +1,8 @@
1
1
  ---
2
2
  name: roll-fix
3
- description: Execute bugfix/hotfix from backlog. Reads FIX/BUG from BACKLOG.md, delivers via TCR workflow. Lighter than story-build, focused on single-issue fixes.
3
+ license: MIT
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.
4
6
  ---
5
7
 
6
8
  # Fix Ship (TCR Edition)
@@ -18,10 +20,10 @@ Use when:
18
20
  - It does not need to be split into multiple Stories / Actions to deliver
19
21
 
20
22
  **Workflow:**
21
- 1. Read BACKLOG.md index → Find FIX/BUG row → Follow link to `docs/features/<feature>.md`
23
+ 1. Read .roll/backlog.md index → Find FIX/BUG row → Follow link to `.roll/features/<feature>.md`
22
24
  2. Single Action (no splitting)
23
25
  3. Execute via TCR workflow
24
- 4. Write back: update BACKLOG.md status column + update FIX section in Feature file
26
+ 4. Write back: update .roll/backlog.md status column + update FIX section in Feature file
25
27
 
26
28
  Do not use for:
27
29
 
@@ -30,7 +32,7 @@ Do not use for:
30
32
  - Requirements that need planning and splitting first
31
33
  - Roadmap work that should be tracked as Stories
32
34
 
33
- If the issue expands beyond a single bounded change, switch to `roll-story`.
35
+ If the issue expands beyond a single bounded change, switch to `roll-build`.
34
36
 
35
37
  ## Project Context Rule
36
38
 
@@ -86,6 +88,51 @@ Before creating any file or directory:
86
88
 
87
89
  ## TCR Workflow
88
90
 
91
+ ### 0. Pre-flight self-check (US-AGENT-007)
92
+
93
+ 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:
94
+
95
+ ```
96
+ inputs:
97
+ fix.est_min (from **Agent profile:** block on the FIX row's feature md)
98
+ fix.chain_depth (0 unless already a downgrade product)
99
+
100
+ verdict:
101
+ too_big when:
102
+ fix.est_min > 20 (lands in the `hard` complexity tier)
103
+ ok otherwise
104
+ ```
105
+
106
+ Routing is a single axis now (US-AGENT-022): `est_min` maps to one of three
107
+ complexity tiers — `easy` (≤8), `default` (8<x≤20), `hard` (>20) — and each
108
+ tier binds to a locally-installed agent slot in `.roll/agents.yaml` (model =
109
+ the agent's own default; a `fallback` slot mechanically covers an unavailable
110
+ agent). The retired v1 model (three-dimension type/est/risk_zone matching
111
+ against `agent-routes.yaml`, soft history hit-rate preference, per-agent
112
+ `max_est_min`/`risk`) no longer applies. The pre-flight verdict here is just
113
+ the `hard`-tier boundary: a FIX estimated past it is a sanity signal that the
114
+ "single small fix" assumption may be wrong.
115
+
116
+ Emit `verdict: ok` or `verdict: too_big` (with `reason:`) as the first cycle output line.
117
+
118
+ - `ok` → continue with step 1 below normally
119
+ - `too_big` → self-downgrade per US-AGENT-008, **gated by US-AGENT-009 cap check**:
120
+
121
+ ```bash
122
+ # Cap check first (chain_depth ≥ 2 → refuse third auto-split).
123
+ if ! bash -c 'source "$(command -v roll)"; _loop_chain_depth_cap_check FIX-XXX-NNN'; then
124
+ bash -c 'source "$(command -v roll)"; _loop_split_cap_hit FIX-XXX-NNN "depth >= 2"'
125
+ exit 0
126
+ fi
127
+ Skill("roll-design", "--from-story FIX-XXX-NNN")
128
+ bash -c 'source "$(command -v roll)"; _loop_self_downgrade FIX-XXX-NNN "too_big: <reason>" "FIX-XXX-NNNa,FIX-XXX-NNNb"'
129
+ exit 0
130
+ ```
131
+
132
+ 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.
133
+
134
+ 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.
135
+
89
136
  ### 1. Lock the issue
90
137
  - state the user-visible issue or requested enhancement
91
138
  - define the scope boundary and non-goals
@@ -95,17 +142,26 @@ Before creating any file or directory:
95
142
  - define the online verification target
96
143
  - for hotfixes: include regression test to prevent recurrence
97
144
  - reference `$roll-.qa` for appropriate test type (unit/integration/E2E)
145
+ - **Test-quality self-check (US-QA-011)** — for any new test the fix adds:
146
+ 1. The test must call project functions / public command entry points,
147
+ not inline `sed`/`awk`/`grep -o`/`find`/`cut` pipelines that
148
+ re-implement what `lib/` or `bin/` already does — rubric ❼.
149
+ 2. The test must sandbox filesystem state via `BATS_TMPDIR` or an
150
+ equivalent helper; never assert on or write to paths outside this
151
+ repo (`~/.codex`, `~/.kimi`, `~/.roll/`, system paths) — rubric ❽.
152
+ 3. If you can't satisfy (1) or (2), extract a project helper or
153
+ redirect the env var to a tmp dir before writing the test.
98
154
 
99
155
  ### 3. Test Design Review (TCR Core)
100
156
 
101
157
  ```
102
- 🧪 Test Design for Fix:
158
+ 🧪 $(msg fix.test_design):
103
159
 
104
- Verification Approach: {unit test | integration test | manual check}
160
+ $(msg fix.verification_approach): {unit test | integration test | manual check}
105
161
 
106
- Test Scenarios:
107
- ├── Fix verification: {how to confirm the fix works}
108
- └── Regression check: {how to ensure we didn't break anything}
162
+ $(msg fix.test_scenarios):
163
+ ├── $(msg fix.fix_verification): {how to confirm the fix works}
164
+ └── $(msg fix.regression_check): {how to ensure we didn't break anything}
109
165
  ```
110
166
 
111
167
  **Reference `$roll-.qa` for test strategy:**
@@ -121,10 +177,10 @@ Before creating any file or directory:
121
177
 
122
178
  ```
123
179
  ┌─────────────────────────────────────────────────────────────────────┐
124
- TCR CYCLE FOR FIX
180
+ $(msg fix.tcr_cycle)
125
181
  └─────────────────────────────────────────────────────────────────────┘
126
182
 
127
- MICRO-STEP 1: {description of the fix}
183
+ $(msg fix.micro_step 1 "{description of the fix}")
128
184
 
129
185
  Step 1: Write/Update Test
130
186
  └── Run test → Confirm RED (bug reproduced or test fails)
@@ -197,12 +253,12 @@ $roll-.review staged
197
253
 
198
254
  **Review Output:**
199
255
  ```
200
- 🔍 Self Review Report
201
- ├── Scope: X files (+Y/-Z lines)
202
- ├── 🔴 Critical: N issues (must fix)
203
- ├── 🟡 Warnings: N issues (should fix)
204
- ├── 🟢 Suggestions: N items (optional)
205
- └── ✅ Passed dimensions: [...]
256
+ 🔍 $(msg fix.self_review)
257
+ ├── $(msg fix.scope): X files (+Y/-Z lines)
258
+ ├── 🔴 $(msg fix.critical): N issues (must fix)
259
+ ├── 🟡 $(msg fix.warnings): N issues (should fix)
260
+ ├── 🟢 $(msg fix.suggestions): N items (optional)
261
+ └── ✅ $(msg fix.passed_dimensions): [...]
206
262
  ```
207
263
 
208
264
  **Review Dimensions** (correctness guaranteed by TCR):
@@ -268,17 +324,17 @@ Verify the shipped fix on the deployed target:
268
324
  **Fresh evidence** must be provided — claiming completion based on assumptions is not acceptable.
269
325
 
270
326
  ```
271
- 🚦 Verification Gate
327
+ 🚦 $(msg build.verification_gate)
272
328
 
273
- Evidence checklist (each item must have actual output):
274
- ├── [ ] Tests pass: paste actual test run output
275
- ├── [ ] Build succeeds: paste build output
276
- ├── [ ] Issue resolved: screenshot / curl output / log excerpt as proof
277
- └── [ ] No regression: verify at least one existing feature still works
329
+ $(msg build.evidence_checklist):
330
+ ├── [ ] $(msg build.tests_passed)
331
+ ├── [ ] $(msg build.build_succeeded)
332
+ ├── [ ] $(msg fix.issue_resolved): screenshot / curl output / log excerpt as proof
333
+ └── [ ] $(msg build.no_regression)
278
334
 
279
- Gate Decision:
280
- ├── ✅ All items have evidence → Can mark as DONE
281
- └── ❌ Any item lacks evidence → Provide evidence before passing the gate
335
+ $(msg build.gate_decision):
336
+ ├── ✅ $(msg build.gate_pass)
337
+ └── ❌ $(msg build.gate_fail)
282
338
  ```
283
339
 
284
340
  **Hard Rule**: "I confirm tests passed" does not count as evidence. It must be **freshly run** command output from this session.
@@ -289,15 +345,15 @@ Only update when Hard Rule #6 conditions are met (user requested, affects roadma
289
345
 
290
346
  Both locations must be updated — neither can be skipped:
291
347
 
292
- **① Update BACKLOG.md index row (Status column):**
348
+ **① Update .roll/backlog.md index row (Status column):**
293
349
 
294
350
  ```markdown
295
- | [FIX-{ID}](docs/features/<feature>.md#fix-{id}) | {Title} | ✅ Done |
351
+ | [FIX-{ID}](.roll/features/<feature>.md#fix-{id}) | {Title} | ✅ Done |
296
352
  ```
297
353
 
298
- Change the Status of the corresponding row from `📋 Todo` to `✅ Done`.
354
+ 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.
299
355
 
300
- **② Update `docs/features/<feature>.md` FIX section:**
356
+ **② Update `.roll/features/<feature>.md` FIX section:**
301
357
 
302
358
  ```markdown
303
359
  ## FIX-{ID} {description} ✅
@@ -317,7 +373,15 @@ Change the Status of the corresponding row from `📋 Todo` to `✅ Done`.
317
373
  - Change AC (if any) from `[ ]` to `[x]`
318
374
  - Update Files to reflect actual changed files
319
375
 
320
- ### 12. Report
376
+ ### 12. Update Changelog
377
+
378
+ **Mandatory** — the release (GitHub Release body = this version's changelog section) depends on this step. Do not skip.
379
+
380
+ ```bash
381
+ $roll-.changelog
382
+ ```
383
+
384
+ ### 13. Report
321
385
 
322
386
  Summarize:
323
387
  - shipped fix/enhancement
@@ -325,7 +389,8 @@ Summarize:
325
389
  - quality review outcome
326
390
  - verification results
327
391
  - any residual risk
328
- - **BACKLOG.md updated** ✅
392
+ - **.roll/backlog.md updated** ✅
393
+ - **CHANGELOG.md updated** ✅
329
394
 
330
395
  ## Required Artifacts
331
396
 
@@ -356,6 +421,58 @@ A minor change is only "done" when all are true:
356
421
  - [ ] Deployment completed
357
422
  - [ ] Online verification performed
358
423
  - [ ] **Verification Gate passed** (fresh evidence for tests, build, fix confirmation, no regression)
424
+ - [ ] **Self-score note written (US-SKILL-010 / 011)** — before exit, the agent
425
+ writes a structured score note via `_skill_write_self_score` so trend
426
+ analysis (US-SKILL-014) and skill-self-scoring docs (US-SKILL-015) have
427
+ data to read.
428
+
429
+ ### Self-score (US-SKILL-011)
430
+
431
+ Before exiting the cycle, write one self-score note. The helper validates
432
+ inputs and lands the note under `.roll/notes/<date>-roll-fix-<FIX-id>-<epoch>.md`:
433
+
434
+ ```bash
435
+ bash -c 'source "$(command -v roll)"; \
436
+ _skill_write_self_score roll-fix FIX-XXX-NNN <score 1..10> <good|ok|regression> "<rationale>"'
437
+ ```
438
+
439
+ Score guidance (integer 1..10):
440
+ - **9..10** — clean root-cause fix; regression test added; TCR cycle smooth.
441
+ - **6..8** — fix shipped but with caveats (e.g. workaround, partial coverage,
442
+ or repeated TCR red iterations); rationale explains the trade-off.
443
+ - **1..5** — fix landed but quality is below the bar (test coverage missing,
444
+ fix only narrows blast radius, repeated agent re-tries). Verdict should be
445
+ `ok` or `regression` if a related test broke.
446
+
447
+ Verdict values:
448
+ - `good` — fix is the proper root-cause fix; no caveats.
449
+ - `ok` — shipped but with documented trade-offs (use rationale to explain).
450
+ - `regression` — the fix re-broke something else (rare; consider re-opening).
451
+
452
+ ## Rubric
453
+
454
+ Quality evaluation for a completed fix. Score each dimension independently.
455
+
456
+ | 维度 | ❌ Miss (0) | ⚠️ Partial (1) | ✅ Hit (2) |
457
+ |------|------------|----------------|-----------|
458
+ | **根因定位** | 只修了表象,未说明根因 | 描述了直接原因 | 追溯根本原因并有代码/日志证据 |
459
+ | **最小范围** | 改动超出 fix 边界,含机会主义修改 | 范围合理但有冗余改动 | 最小改动,非 fix 相关代码零触碰 |
460
+ | **回归测试** | 无测试,或测试与 bug 无关 | 有测试但未复现原始 bug | 先写复现测试(RED)再修复(GREEN) |
461
+ | **验证证据** | 仅声称通过,无实际输出 | 有部分截图/日志但不完整 | 贴出完整命令输出,覆盖 fix + 回归 |
462
+ | **无新破坏** | CI 红,或已知回归未处理 | CI 绿但有 warning 未说明 | CI 全绿,覆盖率不降,warning 清零 |
463
+
464
+ **评分解读**
465
+
466
+ | 总分 | 结论 |
467
+ |------|------|
468
+ | 9–10 | Exemplary — 可作为参考案例 |
469
+ | 7–8 | Acceptable — 可交付,有小瑕疵 |
470
+ | 5–6 | Needs Work — 需补充证据或补测试 |
471
+ | ≤ 4 | Redo — 根因或验证存在根本缺失 |
472
+
473
+ > 用法:fix 完成后由 `$roll-eval`(或人工)对照此表打分,结果写入 `roll-notes`。
474
+
475
+ ---
359
476
 
360
477
  ## TCR Patterns for Common Fixes
361
478
 
@@ -1,32 +1,40 @@
1
1
  ---
2
- name: roll-jot
3
- description: "Fast backlog capture. Analyzes a short description, classifies it as bug or idea, and appends it to BACKLOG.md with an auto-incremented ID."
2
+ name: roll-idea
3
+ license: MIT
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."
4
6
  ---
5
7
 
6
- # roll-jot
8
+ # roll-idea
7
9
 
8
10
  > One-liner in, backlog entry out. No questions asked.
9
11
 
10
12
  ## Trigger
11
13
 
12
- User explicitly invokes `roll-jot` with a free-text description.
14
+ User explicitly invokes `roll-idea` with a free-text description.
13
15
 
14
16
  ```
15
- $roll-jot 评价页面的星星也要纳入到 draft 的 scope 里
16
- $roll-jot 手机端星星指标一行一个从上往下排
17
- $roll-jot 给 HOD 加一个批量导出 PDF 的功能
17
+ $roll-idea 评价页面的星星也要纳入到 draft 的 scope 里
18
+ $roll-idea 手机端星星指标一行一个从上往下排
19
+ $roll-idea 给 HOD 加一个批量导出 PDF 的功能
18
20
  ```
19
21
 
22
+ ## When Not to Use
23
+
24
+ - Requirement needs discussion or splitting into Stories (use `$roll-design`)
25
+ - A US-XXX / FIX-XXX is ready to execute (use `$roll-build` / `$roll-fix`)
26
+ - Recording a development moment or feeling (use `$roll-notes`)
27
+
20
28
  ## Behavior
21
29
 
22
- 1. **Read** `BACKLOG.md` from the project root.
30
+ 1. **Read** `.roll/backlog.md` from the project root.
23
31
  2. **Classify** the input:
24
32
  - If it describes a defect, regression, broken behavior, or "也要/没/不/bug" → **bug**
25
33
  - Otherwise → **idea**
26
34
  3. **Assign ID**:
27
35
  - Bug → next `FIX-NNN`
28
36
  - Idea → next `IDEA-NNN`
29
- 4. **Append** a new row to the appropriate table in `BACKLOG.md`:
37
+ 4. **Append** a new row to the appropriate table in `.roll/backlog.md`:
30
38
  - Bug → `## 🐛 Bug Fixes` table
31
39
  - Idea → `## 💡 Ideas` table (create the section if it doesn't exist)
32
40
  5. **Update stats** line if present (e.g. `Bug Fixes: N`, `Ideas: N`).
@@ -47,4 +55,4 @@ Text: {description}
47
55
  - Do **not** ask the user for clarification.
48
56
  - If the description is vague, record it verbatim and append `(细节待确认)`.
49
57
  - Never modify existing entries — only append new rows.
50
- - If `BACKLOG.md` does not exist, report an error and stop.
58
+ - If `.roll/backlog.md` does not exist, report an error and stop.