@seanyao/roll 3.610.1 → 3.611.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 (73) hide show
  1. package/CHANGELOG.md +69 -0
  2. package/README.md +30 -19
  3. package/dist/roll.mjs +10485 -11206
  4. package/package.json +3 -1
  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 +29 -542
  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/lib/i18n/slides.sh +0 -3
  52. package/lib/i18n/slides_build.sh +0 -38
  53. package/lib/i18n/slides_delete.sh +0 -19
  54. package/lib/i18n/slides_list.sh +0 -14
  55. package/lib/i18n/slides_logs.sh +0 -12
  56. package/lib/i18n/slides_new.sh +0 -15
  57. package/lib/i18n/slides_preview.sh +0 -14
  58. package/lib/i18n/slides_templates.sh +0 -7
  59. package/lib/slides/components/README.md +0 -123
  60. package/lib/slides/components/cards-2.html +0 -9
  61. package/lib/slides/components/cards-3.html +0 -9
  62. package/lib/slides/components/cards-4.html +0 -9
  63. package/lib/slides/components/compare.html +0 -22
  64. package/lib/slides/components/highlight.html +0 -9
  65. package/lib/slides/components/pipeline.html +0 -12
  66. package/lib/slides/components/plain.html +0 -7
  67. package/lib/slides/components/quote.html +0 -4
  68. package/lib/slides/components/timeline.html +0 -9
  69. package/lib/slides/templates/introduction-v3.html +0 -571
  70. package/lib/slides/templates/pitch.html +0 -0
  71. package/skills/roll-deck/SKILL.md +0 -296
  72. /package/skills/roll-debug/{injectable-bb.js → assets/injectable-bb.js} +0 -0
  73. /package/skills/roll-design/{ENGINEERING_CHECKLIST.md → references/engineering-checklist.md} +0 -0
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "@seanyao/roll",
3
- "version": "3.610.1",
3
+ "version": "3.611.2",
4
4
  "description": "Roll — Roll out features with AI agents",
5
5
  "packageManager": "pnpm@11.1.3",
6
6
  "scripts": {
7
7
  "test": "bash scripts/test-ts.sh",
8
+ "test:cov": "pnpm -r exec vitest run --coverage.enabled --coverage.provider=v8 --coverage.include='src/**' --coverage.reporter=text-summary --coverage.reporter=text",
8
9
  "bundle": "node scripts/bundle.mjs",
9
10
  "prepack": "pnpm -r build && pnpm bundle"
10
11
  },
@@ -39,6 +40,7 @@
39
40
  },
40
41
  "devDependencies": {
41
42
  "@types/node": "^25.9.1",
43
+ "@vitest/coverage-v8": "4.1.8",
42
44
  "esbuild": "^0.28.0",
43
45
  "typescript": "^6.0.3",
44
46
  "vitest": "^4.1.8"
package/skills/README.md CHANGED
@@ -35,7 +35,6 @@ roll 的**技能契约**仓——AI agent 在 roll 项目里工作时加载并
35
35
  - `roll-onboard` — 存量项目交互式接入
36
36
  - `roll-propose` — 产品视角提案生成(只进 proposals,不直写 backlog)
37
37
  - `roll-.changelog` — Done 卡 → 用户 changelog(含验收证据 marker 约定)
38
- - `roll-deck` — 双语 18 页 deck 生成
39
38
  - `roll-debug` — 网页黑盒诊断探针
40
39
  - `roll-.clarify` / `roll-.echo` — 模糊输入的被动澄清
41
40
 
@@ -49,3 +48,17 @@ Skills are prose contracts — edit the markdown, PR to `main`, then bump the
49
48
  `skills/` submodule pointer in the main repo. Conventions (bilingual output,
50
49
  backlog write-back rules, evidence chain) are defined by the main repo's
51
50
  AGENTS.md and enforced there.
51
+
52
+ ## Health & Authoring · 健康检查与编写纪律
53
+
54
+ Skill descriptions are model-facing routing triggers, not human summaries. New
55
+ or edited skills must keep a compact `Load when...` description, positive and
56
+ negative route cases, Roll-specific gotchas, and progressive disclosure through
57
+ `references/`, `assets/`, or `scripts/` when the hub grows.
58
+
59
+ ```bash
60
+ node scripts/audit-skills.mjs --strict
61
+ node scripts/test-audit-skills.mjs
62
+ ```
63
+
64
+ See [docs/skill-authoring.md](docs/skill-authoring.md) for the full rules.
@@ -0,0 +1,66 @@
1
+ # Skill Authoring Guide
2
+
3
+ Roll skills are context that an agent must carry. Keep every skill small,
4
+ routable, and backed by evidence.
5
+
6
+ ## Required Shape
7
+
8
+ - `SKILL.md` is the hub. Keep trigger boundaries, hard gates, and the shortest
9
+ execution skeleton in the hub.
10
+ - `description` is a model-facing routing trigger. Start with `Load when...`,
11
+ keep it at 50 words or fewer, and describe user intent rather than workflow
12
+ internals.
13
+ - Put heavy examples, long templates, recovery branches, rubrics, and optional
14
+ runbooks in `references/`.
15
+ - Put reusable generated files, snippets, images, or browser probes in
16
+ `assets/`.
17
+ - Put deterministic repeated logic in `scripts/` so the agent does not
18
+ reconstruct boilerplate in context.
19
+ - If a hub must stay over 250 lines, add a reviewed waiver in the hub and
20
+ explain why splitting would be riskier.
21
+
22
+ ## Route Evidence
23
+
24
+ Every skill must have route cases in `route-cases/skills.json`:
25
+
26
+ - At least two positive user intents that should load the skill.
27
+ - At least two negative or forbidden-load intents that should not load the
28
+ skill.
29
+ - Adjacent skills need explicit negative coverage. Examples:
30
+ `roll-build` vs `roll-design` vs `roll-fix`,
31
+ `roll-loop` vs `roll-.dream` vs `roll-sentinel`,
32
+ `roll-.review` vs `roll-review-pr` vs `roll-peer` vs `roll-spar`.
33
+
34
+ Changing a description requires updating the route cases in the same change.
35
+
36
+ ## Gotchas
37
+
38
+ Every hub must include `## Gotchas` or `## Known Failure Modes`.
39
+
40
+ - Add Roll-specific mistakes, invariants, trigger boundaries, or failure modes.
41
+ - Do not repeat generic coding advice.
42
+ - If a gotcha comes from a missed load, add a positive route case.
43
+ - If a gotcha comes from an off-target load, add a negative route case.
44
+ - Treat the section as append-mostly unless an entry is proven obsolete.
45
+
46
+ ## Maintenance Workflow
47
+
48
+ - Description change -> update route cases.
49
+ - Observed skill failure -> add gotcha and route evidence.
50
+ - Heavy new section -> move it to `references/` or `assets/`.
51
+ - Repeatable deterministic command sequence -> move it to `scripts/`.
52
+ - New auxiliary file -> link it from `SKILL.md`; unreferenced spokes fail audit.
53
+
54
+ ## Audit Commands
55
+
56
+ Run these from the roll-skills repository root:
57
+
58
+ ```bash
59
+ node scripts/audit-skills.mjs
60
+ node scripts/audit-skills.mjs --json
61
+ node scripts/audit-skills.mjs --strict
62
+ node scripts/test-audit-skills.mjs
63
+ ```
64
+
65
+ `--strict` is the gate for description style, route coverage, gotcha coverage,
66
+ hub size, missing spoke references, and unreferenced spoke files.
@@ -0,0 +1,53 @@
1
+ # Skill Ecosystem Audit Summary
2
+
3
+ Generated for US-SKILL-023 through US-SKILL-028.
4
+
5
+ ## Strict Audit Result
6
+
7
+ Command:
8
+
9
+ ```bash
10
+ node scripts/audit-skills.mjs --strict
11
+ ```
12
+
13
+ Result:
14
+
15
+ - Skills scanned: 23
16
+ - Load-trigger descriptions: 23/23
17
+ - Gotchas coverage: 23/23
18
+ - Skills over 250 lines: 0
19
+ - Skills with auxiliary files: 13
20
+ - Route fixture coverage: 2 positive and 2 negative cases for every skill
21
+ - Violations: 0
22
+
23
+ ## Hub Size Reduction
24
+
25
+ The initial `SKILL.md` line baseline was 7,929 lines. Current hub-only
26
+ `SKILL.md` total is 1,985 lines. Detailed contracts were moved into
27
+ `references/full-contract.md` for the refactored skills.
28
+
29
+ | Skill | Baseline hub lines | Current hub lines | Moved content |
30
+ |---|---:|---:|---|
31
+ | roll-design | 924 | 49 | `references/full-contract.md`, `references/engineering-checklist.md` |
32
+ | roll-build | 884 | 48 | `references/full-contract.md` |
33
+ | roll-fix | 641 | 48 | `references/full-contract.md` |
34
+ | roll-debug | 607 | 48 | `references/full-contract.md`, `assets/injectable-bb.js` |
35
+ | roll-doc | 595 | 46 | `references/full-contract.md` |
36
+ | roll-loop | 563 | 47 | `references/full-contract.md` |
37
+ | roll-.changelog | 465 | 47 | `references/full-contract.md` |
38
+ | roll-.dream | 374 | 47 | `references/full-contract.md` |
39
+ | roll-sentinel | 364 | 46 | `references/full-contract.md` |
40
+ | roll-peer | 336 | 47 | `references/full-contract.md` |
41
+ | roll-deck | 296 | 46 | `references/full-contract.md` |
42
+ | roll-spar | 289 | 47 | `references/full-contract.md` |
43
+ | roll-.qa | 258 | 47 | `references/full-contract.md` |
44
+
45
+ ## Maintenance Rules Added
46
+
47
+ - Descriptions start with `Load when...` and route on user intent.
48
+ - `route-cases/skills.json` carries positive and negative route examples.
49
+ - Every hub has `Gotchas` with Roll-specific failure modes.
50
+ - Long contracts load progressively through `references/`, `assets/`, or
51
+ `scripts/`.
52
+ - `scripts/audit-skills.mjs --strict` gates description style, route coverage,
53
+ gotcha coverage, hub size, and spoke integrity.
@@ -3,463 +3,45 @@ hidden: true
3
3
  name: roll-.changelog
4
4
  license: MIT
5
5
  allowed-tools: "Read, Edit, Write, Bash(git:*)"
6
- description: After build completion, extracts completed Stories from .roll/backlog.md to generate CHANGELOG.md. Auto-triggered after successful deploy, keeping the external changelog in sync with the internal backlog.
6
+ description: "Load when a completed Roll build or deploy needs CHANGELOG.md generated or updated from Done stories, acceptance evidence, and release notes."
7
7
  ---
8
+ # Roll Changelog
8
9
 
9
- # WK Generate Changelog
10
+ 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.
10
11
 
11
- After successful Build & Deploy, extracts completed Stories from .roll/backlog.md to generate a user-friendly `CHANGELOG.md`.
12
+ ## Load
12
13
 
13
- ## Evidence marker(US-ATTEST-008 约定)
14
-
15
- 写入 CHANGELOG 的每个条目,若对应 story 存在验收报告
16
- (`.roll/features/<epic>/<id>/latest/<id>-report.html`),在该 bullet 行的下一行追加
17
- 不可见注释 marker(GitHub Release body 不渲染,grep 可追溯):
18
-
19
- ```markdown
20
- - 修复导出报表时间区间偏移(FIX-200)
21
- <!-- evidence: .roll/features/<epic>/FIX-200/latest/FIX-200-report.html -->
22
- ```
23
-
24
- 报告不存在则不加(deletion-not-placeholder,与报告渲染同一契约)。
25
-
26
- ## When Triggered
27
-
28
- - **Auto-triggered**: After successful deploy of `$roll-build` or `$roll-fix`
29
- - **Manual trigger**: When user requests "update changelog" / "更新 changelog"
14
+ Load when a completed Roll build or deploy needs CHANGELOG.md generated or updated from Done stories, acceptance evidence, and release notes.
30
15
 
31
16
  ## When Not to Use
32
17
 
33
- - Generating commit messages or PR descriptions — this skill only runs post-deploy
34
- - Recording dev diary / moments (use `$roll-notes`)
35
- - Bumping package version (use the project's release script — Roll's lives in `roll-meta/ops/release.sh`)
36
-
37
- ## Workflow
38
-
39
- ### 1. Check CHANGELOG.md
40
-
41
- ```
42
- CHANGELOG.md exists?
43
- ├── Yes → Append mode (add current deploy's changes)
44
- └── No → Create mode (backfill all historical completed Stories)
45
- ```
46
-
47
- ### 2. Read .roll/backlog.md
48
-
49
- ```
50
- Append mode:
51
- Extract only the Story/Fix just deployed in this session.
52
-
53
- Create mode:
54
- Extract ALL Stories and Fixes with status ✅ Done.
55
- Read each Story's .roll/features/<feature>.md for Completed date.
56
- Group entries by completion date, reverse chronological order.
57
- ```
58
-
59
- ### 3. Filter for External Content
60
-
61
- CHANGELOG 是给**使用者**看的,不是给维护者看的。一句话讲清"用户能做什么 / 不再被什么坑",能不写就不写。
62
-
63
- **BACKLOG 描述写好了,CHANGELOG 就是复制 + 过滤,不是重写。**
64
- 如果 BACKLOG 描述已经是人话、一句话、说用户价值,直接用它(去掉 `depends-on:` 等功能性标签)。
65
- 只有 BACKLOG 描述包含实现细节或技术黑话时,才需要改写。
66
-
67
- **FIX 条目的 filter 规则**:BACKLOG 的 FIX 描述通常是 `<用户症状> — <修复手段>` 结构。
68
- CHANGELOG 只取破折号前的用户症状,丢弃破折号后的修复手段。
69
- 例:`roll update 后 loop 状态误报 off — reload 改用 bootout+bootstrap` → CHANGELOG 只写 `roll update 后 loop 状态不再误报 off`。
70
-
71
- **完全跳过(不写入 CHANGELOG):**
72
- - 测试基建(teardown 清理、test isolation、bats helper、CI 时序)
73
- - prompt / SKILL.md 内部契约(schema 锁定、enum 强制、contract test)
74
- - 内部重构(提取函数、变量改名、目录调整)
75
- - 只有开发者会遇到的 bug(发版脚本自身逻辑、TCR 节奏调整)
76
- - 任何"用户体验不变"的改动
77
-
78
- 判断准则:**如果用户读了这条记录,他不会改变使用方式,就别写。**
79
-
80
- **保留:**
81
- - 用户能直接调用的新功能 / 新命令
82
- - 用户实际遇到过的 bug 修复
83
- - 看得见的体验变化(布局、文案、速度、可见性)
84
- - 影响安装、升级、配置的改动
85
-
86
- **写法约束(BACKLOG 描述不符合时才介入改写):**
87
-
88
- 1. **一行**。超了就是太啰嗦。
89
- 2. **不写实现细节**:禁止文件路径、函数名、字段列表、命令参数、配置键名。
90
- 3. **不写数字细节**:"3 个服务"、"60+ ghost" 这种内部状态不写。
91
- 4. **说人话**:避免 "幂等"、"trap"、"epoch" 等技术黑话;说"做两次效果一样"、"异常退出也会清理"、"启动时间"。
92
- 5. **句式**:`功能名 — 用户能做什么 / 解决了什么麻烦`。
93
-
94
- **语言:中文。**
95
-
96
- 具体对比(都是真实的 roll 改动):
97
-
98
- ❌ 全是实现细节:
99
- ```
100
- - **Added**: `roll loop runs` 每次 loop 运行的快速可见性 — 单次 loop 结束追加一行 JSON 到 `~/.shared/roll/loop/runs.jsonl`(含 ts/project/run_id/status/built/skipped/alerts/tcr_count/duration_sec),新命令 `roll loop runs [N] [--all]` 倒序显示最近 N 次(默认 10)。
101
- ```
102
-
103
- ✅ 讲价值:
104
- ```
105
- - **Added**: `roll loop runs` — 随时查看 loop 最近几次都跑了什么
106
- ```
107
-
108
- ❌ 内部信息扎堆:
109
- ```
110
- - **Fixed**: 集成测试 launchd ghost 泄漏 — `integration_teardown` 在删除 TEST_TMP 之前,先 `launchctl bootout` 该沙箱里被 `roll loop on` 注册到 user gui domain 的所有 `com.roll.*` 服务。
111
- ```
112
-
113
- ✅ **直接跳过**:测试基建修复,用户感知不到。
114
-
115
- ❌ 参数列表+黑话:
116
- ```
117
- - **Added**: Loop 并发安全 — runner script 启动时写入 per-project LOCK 文件并检测重入;活跃 PID 已存在则跳过本次,残留死 LOCK 自动清理;正常/异常退出均通过 trap 清掉 LOCK。
118
- ```
119
-
120
- ✅ 用户视角:
121
- ```
122
- - **Fixed**: 多个 loop 实例不会再互相打架(重复触发自动跳过)
123
- ```
124
-
125
- ❌ 说机制不说现象(Fix 类最常犯):
126
- ```
127
- - **Fixed**: `roll loop runs` 过滤条件从完整路径改为 slug,历史记录不再因路径不匹配而消失
128
- - **Fixed**: `roll-loop` skill 写入 `runs.jsonl` 时 project slug 计算方式明确,避免写成 bare basename
129
- ```
130
-
131
- ✅ 直接说用户看到了什么:
132
- ```
133
- - **Fixed**: `roll loop runs` 不再报"当前项目尚无运行记录",历史记录正常显示
134
- ```
135
-
136
- Fix 类句式参考:`<命令/功能> 不再 <之前的坏现象>`,或 `<命令/功能> 现在 <正常表现>`。内部有几个 bug 导致这一个现象,合并成一条。
137
-
138
- **归因标签**:每条 bullet 末尾加来源标签——`[loop]`(对应 `US-AUTO-*` / `FIX-*` / `US-CL-*` 等由 Loop 自动执行的故事)、`[dream]`(对应 `REFACTOR-*`,Dream 夜间扫描推入 Backlog)、无标签(人工提交或来源不明)。同一来源的多条不必重复标。
139
-
140
- ### 4. Section Header — Always `## Unreleased`
141
-
142
- **⚠️ do NOT guess version numbers.** Only the release script (maintainer-private
143
- in `roll-meta/ops/release.sh`) assigns concrete versions, and it only does so at
144
- the moment of a real release. Until then, every new bullet goes under
145
- `## Unreleased` at the top of CHANGELOG.md.
146
-
147
- ```
148
- ## Unreleased
149
-
150
- ### 新功能
151
- - ...new entries here...
152
-
153
- ### 稳定性
154
- - ...
155
- ```
156
-
157
- 新条目按**感知分组**(`### 标题`)归类,不写 `**Added**` / `**Fixed**` 前缀——
158
- 分组规则见 **Section 7**(版本段落 = GitHub Release 正文,分组结构是 changelog 自己的格式)。
159
-
160
- When the release script runs, it renames `## Unreleased` to `## v{N}` (where N
161
- is computed from git tags) — that's the single moment a version label gets
162
- assigned.
163
-
164
- Do NOT read `package.json` version, do NOT call `git describe`, do NOT invent
165
- version numbers like `v2026.511.8`. Just write to `## Unreleased`.
166
-
167
- ### 5.3 Style Anchors — In-Context Few-Shot
168
-
169
- Before drafting bullets, pull the most recent 3 published versions' bullets as
170
- in-context examples so the agent doesn't write from a blank slate (the blank
171
- slate is where the technical-jargon habit comes from — the agent is fresh
172
- from writing function names and just copies them over).
173
-
174
- ```bash
175
- _changelog_style_anchors CHANGELOG.md
176
- ```
177
-
178
- Output is the concatenated bullet lines from the last 3 `## v...` sections,
179
- capped at 1500 characters. Use them as a style reference when drafting — pay
180
- attention to length, voice ("不再被…坑" / "现在 …"), and absence of internal
181
- names.
182
-
183
- ### 5.4 Mechanical Lint — Hard Gate
184
-
185
- After drafting bullets, run each through the mechanical linter. Any non-empty
186
- output means the bullet violates at least one blacklist rule and must be
187
- rewritten.
188
-
189
- ```bash
190
- for bullet in "${draft_bullets[@]}"; do
191
- violations=$(_changelog_lint_bullet "$bullet")
192
- [ -n "$violations" ] && needs_rewrite+=("$bullet :: $violations")
193
- done
194
- ```
195
-
196
- Violation tags emitted by `_changelog_lint_bullet`:
197
-
198
- | Tag | Trigger | Why it's noise to users |
199
- |---|---|---|
200
- | `backtick-identifier` | `…` contains `_` or `()` | Internal symbol names mean nothing to users |
201
- | `file-suffix` | `.md/.sh/.yml/.ts/.bats` outside backticks | File paths are maintainer concern |
202
- | `internal-word` | Phase N / Step N / Helper / Schema / Fixture / Refactor | Workflow/design vocabulary, not user-facing |
203
- | `over-length` | > 50 visible chars | Too long = probably explaining implementation |
204
- | `path-fragment` | `docs/` / `bin/` / `tests/` / `scripts/` outside backticks | Source-tree layout is maintainer concern |
205
-
206
- **Rewrite loop (max 2 rounds)**:
207
- 1. Show the agent the violation list + original bullet → request rewrite
208
- 2. Re-lint the rewrite
209
- 3. If still violating after 2 rewrites → **keep the bullet but prefix `⚠️ `** so
210
- the human reviewer can spot it, AND append a line to
211
- `~/.shared/roll/loop/ALERT.md` describing what couldn't be fixed.
212
- Never block the whole release on style — let the human take the wheel.
213
-
214
- ### 5.5 Self-Audit — Stage Gate
215
-
216
- The mechanical linter in Step 5.4 catches **blacklist** patterns; the audit
217
- gate in this step is a **whitelist** of 5 boolean checks that the bullet must
218
- satisfy before it can be staged. Stricter (30-char cap vs 50) and shape-aware
219
- (requires the user-facing `—` or `不再`/`现在` sentence pattern).
220
-
221
- ```bash
222
- accepted=$(_changelog_audit_gate "$draft1" "$rewrite1" "$rewrite2")
223
- # Exit 0: stdout = first clean candidate
224
- # Exit 1: stdout = ⚠️-prefixed last candidate; ALERT was written
225
- ```
226
-
227
- 5 boolean checks evaluated by `_changelog_audit_bullet`:
228
-
229
- | Tag | Trigger |
230
- |---|---|
231
- | `over-length-30` | visible chars > 30 (bypassed if bullet has a backticked user command) |
232
- | `internal-id` | backtick content contains `_` or `()` |
233
- | `path-or-suffix` | `.md/.sh/.yml/.ts/.bats` or `docs/bin/tests/scripts/` outside backticks |
234
- | `phase-step` | `Phase N` or `Step N` |
235
- | `bad-shape` | none of `—`, `不再`, `现在` present |
236
-
237
- **3-round retry envelope**:
238
- 1. Round 1 = original draft; if pass → stage immediately
239
- 2. Round 2 = rewrite based on violations from round 1
240
- 3. Round 3 = second rewrite if round 2 also failed
241
- 4. All 3 failed → keep last candidate prefixed with `⚠️ `, append ALERT to
242
- `~/.shared/roll/loop/ALERT.md`. **Never block the stage** — let the human
243
- reviewer take the wheel. The loop must keep moving.
244
-
245
- **Audit log**: every round (pass or fail) appends one JSONL line to
246
- `~/.shared/roll/loop/changelog-audit.jsonl`:
247
-
248
- ```json
249
- {"ts":"2026-05-13T13:50:00Z","verdict":"fail","round":1,"bullet":"...","reasons":["over-length-30","bad-shape"]}
250
- ```
251
-
252
- Useful when reviewing whether the agent actually iterated or just rubber-stamped
253
- its own first draft. Set `ROLL_CHANGELOG_AUDIT_LOG` to redirect (tests only).
18
+ - Planning new backlog stories.
19
+ - Owner internal briefing; load roll-brief.
254
20
 
255
- ### 5. Generate CHANGELOG.md
21
+ ## Read On Demand
256
22
 
257
- 条目结构按 **Section 7** 的感知分组(`### 新功能` / `### 自动化流水线` / …),不用 `Added`/`Fixed`。
23
+ - Read [the full contract](references/full-contract.md) before executing the workflow end to end, recovering from failures, or checking exact output templates.
24
+ - Keep this hub in context for trigger boundaries and hard gates.
258
25
 
259
- **Create mode** (first time, no CHANGELOG.md yet):
260
- ```markdown
261
- # Changelog
26
+ ## Workflow Skeleton
262
27
 
263
- ## Unreleased
264
-
265
- ### 新功能
266
- - ...current deploy's entries...
267
-
268
- ## 2026.05.10
269
- - ...historical entries from completed Stories before today...
270
- ```
271
-
272
- **Append mode** (most common — CHANGELOG.md exists):
273
-
274
- 1. Find `## Unreleased` heading at the top of CHANGELOG.md.
275
- 2. If it exists → append each new bullet under the **right `### 感知分组`**(已有该组就追加,没有就按 Section 7 的分组顺序插入),do NOT create a new `##` section.
276
- 3. If it doesn't exist → insert a fresh `## Unreleased` at the very top (right after the `# Changelog` title) with the grouped bullets.
277
-
278
- ```markdown
279
- # Changelog
280
-
281
- ## Unreleased
282
-
283
- ### 自动化流水线
284
- - ...just-deployed entry appended here... `[loop]`
285
-
286
- ### 稳定性
287
- - ...another just-deployed entry...
288
-
289
- ## v2026.05.07 ← previous releases left untouched
290
- - ...
291
- ```
292
-
293
- **Ordering**: Unreleased always at top. Below it, released versions in reverse chronological order.
294
-
295
- ### 6. Stage Update
296
-
297
- **Normal path (called from `$roll-build` or `$roll-fix`)**: stage only — the
298
- caller's completion commit will pick up CHANGELOG.md.
299
-
300
- ```bash
301
- git add CHANGELOG.md
302
- ```
303
-
304
- **Standalone / manual path** (called outside a roll-build session): stage and commit.
305
-
306
- ```bash
307
- git add CHANGELOG.md
308
- git commit -m "chore: sync changelog"
309
- git push
310
- ```
311
-
312
- ## Integration
313
-
314
- After successful deploy in `$roll-build` / `$roll-fix`:
315
-
316
- ```markdown
317
- **Post-Deploy:**
318
- - `$roll-.changelog` - Sync external changelog
319
- ```
320
-
321
- ---
322
-
323
- ## 7. 版本段落 = GitHub Release 正文(分组 + 措辞)
324
-
325
- Roll 里**没有独立的 "release notes"**:release notes 就是 changelog——同一份内容、
326
- 同一个文件(`CHANGELOG.md`)。凡是有人说 "release notes",在 Roll 里就是指 changelog。
327
- 发版脚本(maintainer-private,`roll-meta/ops/release.sh`)把 `## Unreleased` 改名成
328
- `## v{N}`,把该版段落**逐字提取**作为 GitHub Release 正文——不另写格式、不另存文件
329
- (没有 `RELEASE_NOTES.md`)、不在发版关键路径上现场生成。
330
-
331
- 所以**版本段落本身就要长成 Release 正文该有的样子**。下面的分组 / 合并 / 措辞 / hard
332
- rules 不是"另一种格式",就是 changelog 段落的写法——把它写好 = 同时写好了 changelog
333
- 和"发布说明"。
334
-
335
- ### 7.1 分组(取代 Added/Fixed)
336
-
337
- 每条 bullet 按**用户感知**归入下列分组,分组用 `###` 标题,每组最多 5 条,超出的合并:
338
-
339
- | 分组(`### 标题`) | 归入条件 |
340
- |---|---|
341
- | 新功能 | 全新命令或用户可感知的新能力 |
342
- | 自动化流水线 | PR 自动化、Auto-merge、CI 触发、分支管理 |
343
- | 可见性 | Dashboard、弹窗、实时输出、状态显示 |
344
- | 稳定性 | 崩溃修复、并发问题、状态误报 |
345
- | 工程和测试 | CI 速度、测试并行、文档工作流 |
346
-
347
- 分组顺序:**影响日常使用的放前面**,纯工程改进放后面。某组少于 2 条可并入相邻组,不强留空组。
348
- **不写 `**Added**` / `**Fixed**` 前缀**——分组标题已经承担语义分类。
349
-
350
- ### 7.2 合并相似条目(dedup)
351
-
352
- 同一功能点的多个 bullet(如"开 PR"和"Auto-merge"都在描述同一条流水线)合并成一条,
353
- 一句话说清整体效果。判断标准:**用户感知到的是同一件事,就合并。**
354
-
355
- ### 7.3 措辞:第二人称 + 有温度
356
-
357
- - 用**第二人称**("你不用再盯着"、"你可以随时查看")
358
- - **主语是用户的感受**,不是系统行为("不再误报" > "修复了误报逻辑")
359
- - **故意模糊实现细节**:不写函数名、文件名、Phase 编号(Section 3 的过滤规则同样适用)
360
- - **有温度**:可以用"真的很急"、"不再越来越乱"这种口语表达
361
- - 每条一行,简洁优先
362
-
363
- ### 7.4 Hard rules
364
-
365
- - **不杜撰**:每条都能追溯到一个真实的已完成 Story / FIX / 合并 PR;CHANGELOG 里没有的改动不写。
366
- - **不猜版本号**:只写 `## Unreleased`(见 Section 4),版本号由发版脚本赋。
367
- - **不 bump / tag / 发布**:那是人执行的发版步骤,本 skill 只写 changelog。
368
- - **可审阅**:CHANGELOG 是提交进仓库的文件,owner 随时(尤其发版前)可直接审阅 / 编辑——
369
- 无需为审阅单独生成什么。
370
-
371
- ### 7.5 示例
372
-
373
- ```markdown
374
- ## Unreleased
375
-
376
- ### 自动化流水线
377
- - 你不用再盯着 PR,开完自动合并 `[loop]`
378
-
379
- ### 稳定性
380
- - 多个 loop 不再互相打架 `[loop]`
381
-
382
- ### 新功能
383
- - `roll loop runs` 随时回看最近几次跑了啥 `[loop]`
384
- ```
385
-
386
- ## 8. features.md 重写模式(产品 SOT)
387
-
388
- US-DOC-008 — 发版脚本(maintainer-private,位于 `roll-meta/ops/release.sh`)
389
- 在 changelog 写盘后会再调一次本 skill,请求"整体重写
390
- `.roll/features.md`"。这次调用的语义和上面完全不同:**不是基于本版
391
- Story 增量**,而是基于**项目整体当前状态**。
392
-
393
- ### 8.1 何时触发
394
-
395
- 发版脚本完成 changelog 写盘后,喂一段以
396
- `## 当前任务:重写 .roll/features.md(Section 8)` 开头的 prompt。
397
-
398
- ### 8.2 输入
399
-
400
- prompt 会包含:
401
- - 当前 `.roll/features.md`(可能为空,可能上一版本的)
402
- - 当前 `.roll/backlog.md` 全文(Epic / Feature 分组结构)
403
- - 当前 `.roll/features/` 目录清单
404
- - 当前版本号
405
-
406
- ### 8.3 输出契约
407
-
408
- 把整个 `.roll/features.md` 写出来。结构固定为三段:
409
-
410
- ```
411
- # Roll — Features
412
-
413
- > 说明段(保留原文)
414
-
415
- ---
416
-
417
- ## ✨ Core Highlights
418
-
419
- - **<Feature 名>** — 1 句话产品级描述
420
- - **<Feature 名>** — 1 句话产品级描述
421
- - ...(3-5 条)
422
-
423
- ---
424
-
425
- ## Features by Epic
426
-
427
- ### <Epic 名>
428
- - [<Feature 名>](.roll/features/<file>.md) — 1 句话描述
429
- - <Feature 名> — 1 句话描述(缺 deep doc 时不加链接)
430
-
431
- ### <Epic 名>
432
- - ...
433
-
434
- ---
28
+ 1. Read Done stories and acceptance evidence.
29
+ 2. Generate or update CHANGELOG.md.
30
+ 3. Keep user-facing language external and concise.
31
+ 4. Stage only the changelog artifact when required.
435
32
 
436
- ## 维护说明(保留原文)
437
- ```
33
+ ## Hard Gates
438
34
 
439
- ### 8.4 规则
35
+ - No changelog entries from unaccepted work.
36
+ - No private backlog/process detail in public notes.
440
37
 
441
- - **Catalog 必须列出 BACKLOG 中所有 `### Feature:` 出现的 Feature 名**
442
- (即使没有 deep doc 也要列)
443
- - Feature 名跟 `.roll/features/<file>.md` 文件名一致时,加链接到该 md
444
- - 没有对应 deep doc 的 Feature,**只写 plain text 不加链接**
445
- - **Planning distinction(US-DOC-011)**:
446
- - 该 Feature 下**所有** Story 均为 `📋 Todo` → 在描述末尾追加 `*(规划中)*`
447
- - 只要有 **≥1 个** `✅ Done` Story → 正常展示,**不加**任何标记
448
- - 一眼可见:规划中的 Feature 在每个 Epic 分组的末尾列出
449
- - **FIX-051 兜底**:发版脚本在 AI 重写后会跑机械校验
450
- `_enforce_planning_markers`,即使本规则被 AI 漏掉也会自动补 `*(规划中)*`;
451
- 规则的权威实现是发版脚本里的纯 shell 函数,prompt 这条只是软提示
452
- - 描述写 1 句话 **产品视角**:用户能用它做什么,避免实现细节
453
- - **语言:单一中文**。Feature 名(如 `roll-loop` / `Cross-Agent Peer Review`)和命令、环境变量等术语保留英文原样;描述句一律中文。**不要**在条目下追加英文翻译行(早期 v517.x 双语混排版式已废弃,理由:扫读困难、维护翻倍、与 `guide/en|zh/` 平行目录约定不一致;英文受众走 site 端 i18n)
454
- - 分组用 BACKLOG 的 Epic 名,原序,不重排
455
- - Core Highlights 从所有 Features 里挑 3-5 个最能代表产品定位的,
456
- 描述用 bold 标 Feature 名后接说明;不照搬 catalog 文案
457
- - **不**写 "Recent Activity" 类区块——features.md 是 SOT,全量当下状态
458
- - **不**写版本号、不引用 changelog 条目
459
- - 说明段(顶部 quote)和维护说明(尾部)原文保留,不要重新生成措辞
38
+ ## Gotchas
460
39
 
461
- ### 8.5 失败安全
40
+ - Only run after completion/deploy evidence exists; do not invent changelog bullets from Todo or In Progress backlog rows.
41
+ - Keep internal backlog detail out of user-facing CHANGELOG.md unless it is part of accepted release evidence.
462
42
 
463
- 如果 prompt 信息不足(BACKLOG 解析失败等),**不要部分写入** —— 输出原
464
- 文件内容即可。发版脚本会捕获 stdout 后比较:内容未变就不 stage。
43
+ ## Maintenance
465
44
 
45
+ - Description changes require updates in `route-cases/skills.json`.
46
+ - New observed failures should add a gotcha and the matching positive or negative route case.
47
+ - Heavy examples, templates, recovery paths, and deterministic snippets belong in `references/`, `assets/`, or `scripts/`, not in this hub.