@seanyao/roll 0.5.0 → 2.602.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 (181) hide show
  1. package/CHANGELOG.md +736 -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 +15030 -814
  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 +194 -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 +15 -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 +733 -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 +579 -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,209 @@
1
+ ---
2
+ name: roll-brief
3
+ license: MIT
4
+ allowed-tools: "Read, Glob, Grep, Write, Bash(git:*)"
5
+ description: |
6
+ Owner-facing briefing generator. Summarizes what the agent has done since
7
+ the last brief: completed US/FIX/REFACTOR, in-progress items, BACKLOG queue
8
+ status, escalations requiring human attention, and a release-readiness verdict.
9
+ Three trigger modes: auto on Feature completion, daily morning schedule,
10
+ or manual $roll-brief invocation. Distinct from roll-.changelog (user-facing
11
+ changelog) — this is an internal digest for the product owner.
12
+ ---
13
+
14
+ # Roll Brief
15
+
16
+ > Follows the Architecture Constraints, Development Discipline, and Engineering
17
+ > Common Sense defined in the project AGENTS.md.
18
+
19
+ Owner-facing digest of autonomous agent activity. Gives the human everything
20
+ needed to decide whether to cut a new release — without having to read every
21
+ commit or diff.
22
+
23
+ ## Distinct from roll-.changelog
24
+
25
+ | | roll-brief | roll-.changelog |
26
+ |--|-----------|----------------|
27
+ | **Audience** | Product owner (internal) | End users (public) |
28
+ | **Content** | All activity including REFACTOR, escalations, health signals | Only user-visible feature changes |
29
+ | **Trigger** | Feature completion / daily / on-demand | Post-deploy |
30
+ | **Tone** | Operational, candid | Product-facing, polished |
31
+
32
+ ## Trigger Modes
33
+
34
+ ### 1. Feature Completion (auto)
35
+
36
+ Triggered by `roll-loop` when a set of related Stories under one Feature are
37
+ all marked ✅ Done. The loop passes the Feature name as context.
38
+
39
+ ### 2. Daily Morning (scheduled)
40
+
41
+ Runs at a fixed time each morning (configurable in `~/.roll/config.yaml`).
42
+ Covers all activity since the previous brief.
43
+
44
+ ```yaml
45
+ # ~/.roll/config.yaml
46
+ brief:
47
+ daily_time: "08:00" # local time
48
+ timezone: "Asia/Shanghai"
49
+ ```
50
+
51
+ ### 3. On-Demand
52
+
53
+ ```bash
54
+ $roll-brief # since last brief
55
+ $roll-brief --since 2026-05-09 # since specific date
56
+ $roll-brief --feature auth # scoped to one feature
57
+ ```
58
+
59
+ ## Workflow
60
+
61
+ ### Step 1 — Determine Scope
62
+
63
+ ```bash
64
+ # Find timestamp of last brief
65
+ ls .roll/briefs/ | sort | tail -1
66
+
67
+ # Read .roll/backlog.md — collect all status changes since last brief
68
+ # Read git log — commits since last brief timestamp
69
+ git log --since="{last_brief_timestamp}" --oneline
70
+ ```
71
+
72
+ ### Step 2 — Collect Activity
73
+
74
+ From .roll/backlog.md and git log, classify all items since last brief:
75
+
76
+ - **Completed**: US-XXX ✅, FIX-XXX ✅, REFACTOR-XXX ✅
77
+ - **In progress**: items currently 🔨
78
+ - **Queue**: items still 📋 Todo (ordered by priority)
79
+ - **Dream findings**: any REFACTOR entries added by roll-.dream since last brief
80
+ - **Escalations**: any ALERT files in `~/.shared/roll/loop/` or `~/.shared/roll/dream/`
81
+ - **Doc coverage**: compute from `guide/en/` and `guide/zh/`:
82
+ - EN coverage = number of files in `guide/en/`
83
+ - ZH translation rate = files in `guide/zh/` ÷ files in `guide/en/` × 100%
84
+
85
+ ### Step 3 — Assess Release Readiness
86
+
87
+ A simple heuristic — not a gate, just a signal for the human:
88
+
89
+ ```
90
+ ✅ Release candidate if:
91
+ - No 🔨 in-progress US items
92
+ - No open ESCALATE alerts
93
+ - CI is green (check latest workflow run)
94
+ - No critical REFACTOR entries flagged in last 48h
95
+
96
+ ⚠️ Hold if any of the above is false
97
+ ```
98
+
99
+ ### Step 4 — Write Brief
100
+
101
+ 文件命名:`.roll/briefs/YYYY-MM-DD-{NN}.md`,NN 为当日序号(01 起,零填充两位)。
102
+ 计算方式:`ls .roll/briefs/YYYY-MM-DD-*.md 2>/dev/null | wc -l`,+1 即为本次序号。
103
+
104
+ 全部用中文输出。**省略空 section**(无内容时连标题一起不输出):
105
+
106
+ ```markdown
107
+ # 简报 {YYYY-MM-DD HH:mm}
108
+
109
+ > 触发:{触发原因} | 覆盖:{起止时间范围}
110
+
111
+ ## 已完成({N} 项)
112
+ | 编号 | 描述 | 类型 |
113
+ |----|-------------|------|
114
+ | US-XXX | {标题} | 用户故事 |
115
+ | FIX-XXX | {标题} | 缺陷修复 |
116
+ | REFACTOR-XXX | {标题} | 重构 |
117
+
118
+ <!-- 仅当有 🔨 条目时输出 -->
119
+ ## 进行中
120
+ | 编号 | 描述 |
121
+ |----|-------------|
122
+ | US-XXX | {标题} — 开始于 {date} |
123
+
124
+ <!-- 仅当有 📋 条目时输出 -->
125
+ ## 待处理队列({N} 项)
126
+ | 编号 | 描述 | 优先级 |
127
+ |----|-------------|----------|
128
+ | US-XXX | {标题} | 高 |
129
+
130
+ <!-- US-AGENT-010: per-agent hit-rate summary (one line). Read the last
131
+ window_cycles records of runs.jsonl, group by `agent`, format as
132
+ `agents: pi 8/22 (36%) · deepseek 5/8 (63%)`. Sample < 5 → `(n/a)`.
133
+ Omit when no records have an agent field (legacy data). -->
134
+ ## Agent 路由命中率
135
+ {agents: <name> built/total (pct%) · …} ← from `runs.jsonl` last 50 cycles
136
+
137
+ <!-- 仅当 roll-.dream 有新发现时输出 -->
138
+ ## 悟见
139
+ {来自 .roll/dream/ 的摘要}
140
+
141
+ <!-- 仅当有 ESCALATE 告警时输出 -->
142
+ ## 需人工介入
143
+ {告警内容}
144
+
145
+ <!-- 始终输出 doc coverage 数字;若无缺口写"覆盖完整" -->
146
+ ## 文档覆盖度
147
+ - guide/en: {N} 个文档
148
+ - ZH 翻译率:{M}/{N}({%})
149
+ - {缺口列表 或 "覆盖完整,无缺口。"}
150
+
151
+ ## 发版就绪
152
+ {✅ 可发版 / ⚠️ 暂缓 — 原因}
153
+
154
+ **下一版本:** `v{YYYY}.{MMDD}.{序号}`
155
+
156
+ - {本轮新增 1}
157
+ - {本轮新增 2}
158
+
159
+ ---
160
+ *状态:进行中 {N} · 待处理 {N} · 告警 {N} | 下次简报:{datetime}*
161
+ ```
162
+
163
+ **首份简报或传入 `--full-history`**:在"已完成"表格后追加历史汇总区块:
164
+
165
+ ```markdown
166
+ ### 历史汇总
167
+ **Epic: {Name}** — {done}/{total} ✅
168
+ ```
169
+
170
+ ### Step 4.5 — Commit Brief
171
+
172
+ 写完文件后立即提交,让简报进入 git 历史,便于后续追溯与跨会话审计:
173
+
174
+ ```bash
175
+ git add .roll/briefs/YYYY-MM-DD-NN.md
176
+ git commit -m "docs: roll-brief YYYY-MM-DD-NN — {触发原因}"
177
+ git push origin main
178
+ ```
179
+
180
+ - 触发原因来自调用上下文(Feature 完成 / 每日 / 手动 / `--feature` / `--since`),用一句话填入
181
+ - 写文件失败时不要执行 commit;保持工作区干净,由调用方处理重试
182
+ - 仅 `.roll/briefs/` 下新文件入 commit,不要顺带带入其他无关变更
183
+
184
+ ### Step 5 — Notify
185
+
186
+ 写完文件后在终端或 CI 日志中打印简报路径:
187
+
188
+ ```
189
+ 📋 $(msg brief.generated ".roll/briefs/YYYY-MM-DD-NN.md")
190
+ $(msg brief.release_readiness): ✅ $(msg brief.release_ready_status)
191
+ ```
192
+
193
+ 有升级事项时须显著打印,不得遗漏。
194
+
195
+ ## Scheduler Configuration
196
+
197
+ roll-brief runs **locally**, triggered either by roll-loop (on Feature
198
+ completion) or by local cron (daily morning). The agent reads local
199
+ BACKLOG state and git history directly.
200
+
201
+ ### Local cron (daily morning)
202
+
203
+ Installed automatically via `roll loop on` alongside roll-loop and roll-.dream.
204
+ The cron entry is generated using the configured agent — no manual cron editing needed.
205
+
206
+ ### Triggered by roll-loop
207
+
208
+ When roll-loop detects a Feature is fully complete, it invokes roll-brief
209
+ automatically — no separate cron entry needed for that trigger.