@seanyao/roll 3.620.1 → 3.624.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.
- package/CHANGELOG.md +46 -0
- package/dist/roll.mjs +4563 -3369
- package/package.json +1 -1
- package/lib/__pycache__/changelog_audit.cpython-314.pyc +0 -0
- package/lib/__pycache__/github_sync.cpython-314.pyc +0 -0
- package/lib/__pycache__/loop-fmt.cpython-314.pyc +0 -0
- package/lib/__pycache__/loop_result_eval.cpython-314.pyc +0 -0
- package/lib/__pycache__/loop_unstick.cpython-314.pyc +0 -0
- package/lib/__pycache__/model_prices.cpython-314.pyc +0 -0
- package/lib/__pycache__/prices_fetcher.cpython-314.pyc +0 -0
- package/lib/__pycache__/roll-home.cpython-314.pyc +0 -0
- package/lib/__pycache__/roll-loop-status.cpython-314.pyc +0 -0
- package/lib/__pycache__/roll_git.cpython-314.pyc +0 -0
- package/lib/__pycache__/roll_render.cpython-314.pyc +0 -0
- package/lib/__pycache__/slides-render.cpython-314.pyc +0 -0
- package/lib/agent_usage/__pycache__/__init__.cpython-314.pyc +0 -0
- package/lib/agent_usage/__pycache__/gemini.cpython-314.pyc +0 -0
- package/lib/agent_usage/__pycache__/kimi.cpython-314.pyc +0 -0
- package/lib/agent_usage/__pycache__/openai.cpython-314.pyc +0 -0
- package/lib/agent_usage/__pycache__/pi.cpython-314.pyc +0 -0
- package/lib/agent_usage/__pycache__/pi_emit.cpython-314.pyc +0 -0
- package/lib/agent_usage/__pycache__/qwen.cpython-314.pyc +0 -0
- package/skills/README.md +0 -64
- package/skills/docs/skill-authoring.md +0 -74
- package/skills/reports/skill-audit-summary.md +0 -53
- package/skills/roll-.changelog/SKILL.md +0 -47
- package/skills/roll-.changelog/references/full-contract.md +0 -462
- package/skills/roll-.clarify/SKILL.md +0 -64
- package/skills/roll-.dream/SKILL.md +0 -47
- package/skills/roll-.dream/references/full-contract.md +0 -365
- package/skills/roll-.echo/SKILL.md +0 -118
- package/skills/roll-.qa/SKILL.md +0 -47
- package/skills/roll-.qa/references/full-contract.md +0 -256
- package/skills/roll-.review/SKILL.md +0 -148
- package/skills/roll-build/SKILL.md +0 -49
- package/skills/roll-build/references/full-contract.md +0 -968
- package/skills/roll-debug/SKILL.md +0 -48
- package/skills/roll-debug/assets/injectable-bb.js +0 -263
- package/skills/roll-debug/references/full-contract.md +0 -607
- package/skills/roll-design/SKILL.md +0 -52
- package/skills/roll-design/references/engineering-checklist.md +0 -298
- package/skills/roll-design/references/full-contract.md +0 -940
- package/skills/roll-doc-audit/SKILL.md +0 -51
- package/skills/roll-doc-audit/references/full-contract.md +0 -796
- package/skills/roll-doctor/SKILL.md +0 -211
- package/skills/roll-fix/SKILL.md +0 -49
- package/skills/roll-fix/references/full-contract.md +0 -672
- package/skills/roll-idea/SKILL.md +0 -62
- package/skills/roll-loop/SKILL.md +0 -50
- package/skills/roll-loop/references/full-contract.md +0 -534
- package/skills/roll-notes/SKILL.md +0 -107
- package/skills/roll-onboard/SKILL.md +0 -238
- package/skills/roll-peer/SKILL.md +0 -47
- package/skills/roll-peer/references/full-contract.md +0 -323
- package/skills/roll-propose/SKILL.md +0 -155
- package/skills/roll-review-pr/SKILL.md +0 -62
- package/skills/roll-spar/SKILL.md +0 -47
- package/skills/roll-spar/references/full-contract.md +0 -288
- package/skills/route-cases/skills.json +0 -216
- package/skills/scripts/audit-skills.mjs +0 -272
- package/skills/scripts/test-audit-skills.mjs +0 -39
- package/skills/tests/fixtures/skill-audit/block-skill/SKILL.md +0 -12
- package/skills/tests/fixtures/skill-audit/minimal-skill/SKILL.md +0 -8
- package/skills/tests/fixtures/skill-audit/quoted-skill/SKILL.md +0 -10
- package/skills/tests/fixtures/skill-audit/route-cases.json +0 -21
- package/skills/tests/fixtures/skill-audit/spoke-skill/SKILL.md +0 -12
- package/skills/tests/fixtures/skill-audit/spoke-skill/references/runbook.md +0 -3
|
@@ -1,365 +0,0 @@
|
|
|
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
|
-
# Roll Dream (Nightly Code Health Scan)
|
|
8
|
-
|
|
9
|
-
> Follows the Architecture Constraints, Development Discipline, and Engineering
|
|
10
|
-
> Common Sense defined in the project AGENTS.md.
|
|
11
|
-
|
|
12
|
-
**Passively triggered — do not invoke manually.** Runs nightly via scheduler.
|
|
13
|
-
Consolidates structural signals accumulated during the day, surfaces technical
|
|
14
|
-
debt, and writes REFACTOR entries to BACKLOG. The human reviews the dream log
|
|
15
|
-
in the morning brief.
|
|
16
|
-
|
|
17
|
-
## Distinction from roll-sentinel
|
|
18
|
-
|
|
19
|
-
| | roll-sentinel | roll-.dream |
|
|
20
|
-
|--|--------------|------------|
|
|
21
|
-
| **Trigger** | Post-deploy, scheduled patrol | Nightly, fixed schedule |
|
|
22
|
-
| **Target** | Runtime behavior (production) | Code structure (codebase) |
|
|
23
|
-
| **Output** | FIX entries | REFACTOR entries + dream log |
|
|
24
|
-
| **Question** | "Is the product working?" | "Is the code healthy?" |
|
|
25
|
-
|
|
26
|
-
## Scan Logic
|
|
27
|
-
|
|
28
|
-
Run all scans every night. Each scan is independent.
|
|
29
|
-
|
|
30
|
-
### Scan 1 — Dead Code
|
|
31
|
-
|
|
32
|
-
Find code that is defined but never referenced:
|
|
33
|
-
|
|
34
|
-
```bash
|
|
35
|
-
# Unused exports (TypeScript/JS)
|
|
36
|
-
grep -r "^export " src/ --include="*.ts" -l | while read f; do
|
|
37
|
-
symbol=$(grep -o "export \(function\|const\|class\|type\|interface\) [A-Za-z]*" "$f" | awk '{print $NF}')
|
|
38
|
-
# check if symbol appears anywhere else in the codebase
|
|
39
|
-
done
|
|
40
|
-
|
|
41
|
-
# Unused files (no imports pointing to them)
|
|
42
|
-
# Git: files not touched in 90+ days and not imported anywhere
|
|
43
|
-
git log --since="90 days ago" --name-only --format="" | sort -u > /tmp/recently_touched
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
Flag: files or exports with zero references outside their own file.
|
|
47
|
-
|
|
48
|
-
### Scan 2 — Architectural Drift
|
|
49
|
-
|
|
50
|
-
Compare current code structure against the domain model in `.roll/domain/`:
|
|
51
|
-
|
|
52
|
-
```bash
|
|
53
|
-
# Read context-map.md and ubiquitous-language.md if they exist
|
|
54
|
-
# Check: do module/directory names match Bounded Context names?
|
|
55
|
-
# Check: do cross-module imports respect Context boundaries?
|
|
56
|
-
# Check: do any modules import directly across Context lines without ACL?
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
Flag: modules that import directly from a different Bounded Context without
|
|
60
|
-
an Anti-Corruption Layer, or module names that have diverged from the
|
|
61
|
-
Ubiquitous Language.
|
|
62
|
-
|
|
63
|
-
**Distinction from Scan 6C**: Scan 2 flags *import boundary violations* (cross-context coupling). Scan 6C flags *missing documentation entries* (module exists but has no entry in `.roll/domain/*.md`). Never double-flag — Scan 2 and Scan 6C are orthogonal checks.
|
|
64
|
-
|
|
65
|
-
### Scan 3 — Pruning Candidates
|
|
66
|
-
|
|
67
|
-
Find over-engineering that can be simplified:
|
|
68
|
-
|
|
69
|
-
```bash
|
|
70
|
-
# Abstractions with only one implementation
|
|
71
|
-
grep -r "interface \|abstract class " src/ --include="*.ts" -l
|
|
72
|
-
|
|
73
|
-
# Wrapper functions that do nothing but delegate
|
|
74
|
-
# Config flags that are never toggled (always true or always false)
|
|
75
|
-
# Error handling for paths that cannot occur
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
Flag: interfaces with exactly one implementor, feature flags frozen to one
|
|
79
|
-
value, wrapper layers with no logic.
|
|
80
|
-
|
|
81
|
-
### Scan 4 — Emerging Patterns
|
|
82
|
-
|
|
83
|
-
Find repeated structures that warrant extraction:
|
|
84
|
-
|
|
85
|
-
```bash
|
|
86
|
-
# Duplicated code blocks (>10 lines, similar structure)
|
|
87
|
-
# Similar file structures across multiple modules
|
|
88
|
-
# Repeated try/catch patterns with identical handling
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
Flag: any pattern appearing 3+ times that could be extracted into a shared
|
|
92
|
-
utility or convention.
|
|
93
|
-
|
|
94
|
-
### Scan 5 — Doc Coverage Check
|
|
95
|
-
|
|
96
|
-
Check documentation structure against the conventions in `AGENTS.md § Documentation Conventions`.
|
|
97
|
-
|
|
98
|
-
**Check A — BACKLOG Done stories missing guide/en/ docs:**
|
|
99
|
-
|
|
100
|
-
Scan .roll/backlog.md for features with multiple ✅ Done stories. For each feature epic, check whether a corresponding `guide/en/<topic>.md` exists. If a feature has ≥3 Done stories and no guide doc, flag it.
|
|
101
|
-
|
|
102
|
-
**Check B — guide/en/ files missing guide/zh/ translations:**
|
|
103
|
-
|
|
104
|
-
```bash
|
|
105
|
-
for f in guide/en/*.md; do
|
|
106
|
-
base=$(basename "$f")
|
|
107
|
-
[ ! -f "guide/zh/$base" ] && echo "missing ZH: $base"
|
|
108
|
-
done
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
Flag any `guide/en/<topic>.md` that has no matching `guide/zh/<topic>.md`, provided the EN file has existed since before the most recent git tag (i.e., at least one release cycle old).
|
|
112
|
-
|
|
113
|
-
**Check C — stray files in docs/ root (根目录散落文件):**
|
|
114
|
-
|
|
115
|
-
```bash
|
|
116
|
-
find docs/ -maxdepth 1 -name '*.md' 2>/dev/null
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
Flag any `.md` file directly in `docs/` root (allowed subdirs: `guide/`, `domain/`, `features/`, `practices/`, `briefs/`, `dream/`).
|
|
120
|
-
|
|
121
|
-
**Check D — features.md Feature Coverage (US-DOC-009):**
|
|
122
|
-
|
|
123
|
-
Dependency gate: skip when `.roll/features.md` does not exist.
|
|
124
|
-
|
|
125
|
-
Parse .roll/backlog.md for all `### Feature: <name>` groups that contain ≥1 ✅ Done story. Parse `.roll/features.md` for Feature names. If any Feature group with Done stories is absent from `.roll/features.md`, the catalog is stale — flag as REFACTOR:
|
|
126
|
-
|
|
127
|
-
```markdown
|
|
128
|
-
| REFACTOR-XXX | features.md 功能目录落后于 BACKLOG,N 个已完成功能区未收录,用户无法通过产品目录发现这些功能 — flagged by dream YYYY-MM-DD | 📋 Todo |
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
The catalog is auto-updated by the release script (maintainer-private at `roll-meta/ops/release.sh`) at release time (Section 8 of roll-.changelog). Between releases, this check surfaces the coverage gap so it isn't silently skipped.
|
|
132
|
-
|
|
133
|
-
**REFACTOR entry format for doc findings:**
|
|
134
|
-
|
|
135
|
-
```markdown
|
|
136
|
-
| REFACTOR-XXX | docs: {具体缺口描述} — flagged by dream {YYYY-MM-DD} | 📋 Todo |
|
|
137
|
-
```
|
|
138
|
-
|
|
139
|
-
**Dream log section** — add after existing sections:
|
|
140
|
-
|
|
141
|
-
```markdown
|
|
142
|
-
## 文档覆盖度
|
|
143
|
-
- features.md 功能区覆盖:{N}/{M} 个已完成功能区已收录(缺失:{列表 或 "无"})
|
|
144
|
-
{其他发现内容 或 "文档结构符合规范,无缺口。"}
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
### Scan 6 — 文档新鲜度 (Doc Freshness)
|
|
148
|
-
|
|
149
|
-
**Dependency gate**: Skip Scan 6 entirely when `$roll-doc-audit` (US-SKILL-008) is not yet deployed.
|
|
150
|
-
Check: `[ -f "$ROLL_HOME/skills/roll-doc-audit/SKILL.md" ]`. If absent, log "Scan 6 skipped — roll-doc-audit not deployed" in the dream log and stop. No fallback.
|
|
151
|
-
|
|
152
|
-
When deployed, each finding produces a REFACTOR entry with `$roll-doc-audit` as execution hint:
|
|
153
|
-
```markdown
|
|
154
|
-
| REFACTOR-XXX | docs: <description> — flagged by dream <date> (hint: $roll-doc-audit) | 📋 Todo |
|
|
155
|
-
```
|
|
156
|
-
|
|
157
|
-
#### Check A — Stale Docs
|
|
158
|
-
|
|
159
|
-
Flag source files whose owning doc is >30 days stale:
|
|
160
|
-
|
|
161
|
-
```bash
|
|
162
|
-
# For each file listed in .roll/features/*.md or README.md "## Files:" sections:
|
|
163
|
-
# owner_doc_commit = git log -1 --format="%ci" -- <doc_file>
|
|
164
|
-
# source_commit = git log -1 --format="%ci" -- <source_file>
|
|
165
|
-
# lag_days = (source_commit - owner_doc_commit) in days
|
|
166
|
-
# if lag_days > 30 AND doc contains at least one specific file path reference → flag
|
|
167
|
-
```
|
|
168
|
-
|
|
169
|
-
The "owner doc" for a source file is the nearest `README.md` or `.roll/features/*.md` that lists the file path in a `## Files:` section. Skip docs that contain only conceptual descriptions (no specific file path references) — they cannot be objectively stale.
|
|
170
|
-
|
|
171
|
-
#### Check B — Undocumented ENV Vars
|
|
172
|
-
|
|
173
|
-
Flag environment variables that appear frequently in source but have no documentation:
|
|
174
|
-
|
|
175
|
-
```bash
|
|
176
|
-
# Detect ENV var patterns in non-test source files:
|
|
177
|
-
patterns=(
|
|
178
|
-
'process\.env\.[A-Z_]+' # Node.js
|
|
179
|
-
'os\.getenv\("[A-Z_]+"\)' # Python
|
|
180
|
-
'ENV\["[A-Z_]+"\]' # Ruby
|
|
181
|
-
)
|
|
182
|
-
# For each matched variable name:
|
|
183
|
-
# count occurrences across all source files
|
|
184
|
-
# if count >= 5 AND zero mentions in any .md file → flag
|
|
185
|
-
```
|
|
186
|
-
|
|
187
|
-
Flag variables appearing ≥5× in source with zero mentions in any `.md`.
|
|
188
|
-
"Other convention signals" (comment clusters, module structure templates) are explicitly deferred — too vague for deterministic detection.
|
|
189
|
-
|
|
190
|
-
#### Check C — Existence Drift
|
|
191
|
-
|
|
192
|
-
Find module directories that exist in code but are absent from architecture docs.
|
|
193
|
-
This is distinct from Scan 2 (which checks *import violations*) — Scan 6C checks *documentation existence*:
|
|
194
|
-
|
|
195
|
-
```bash
|
|
196
|
-
# Walk all non-excluded directories
|
|
197
|
-
# For each dir with >= 3 non-hidden, non-.md source files:
|
|
198
|
-
# check if any .roll/domain/*.md contains the directory name
|
|
199
|
-
# if not found → flag as "existence drift"
|
|
200
|
-
```
|
|
201
|
-
|
|
202
|
-
Exclusions: `node_modules/`, `.git/`, `dist/`, `build/`, `.shared/`, `docs/`, `tests/`.
|
|
203
|
-
|
|
204
|
-
Flag directories with ≥3 source files and zero name-match in `.roll/domain/*.md`.
|
|
205
|
-
|
|
206
|
-
#### Dream Log Section
|
|
207
|
-
|
|
208
|
-
Add after `## 文档覆盖度` section:
|
|
209
|
-
|
|
210
|
-
```markdown
|
|
211
|
-
## 文档新鲜度
|
|
212
|
-
- 滞后文档:{N} 个(超过 30 天未更新但绑定了代码文件)
|
|
213
|
-
- 未记录 ENV 变量:{N} 个(出现 ≥5 次但无文档)
|
|
214
|
-
- 架构文档缺失模块:{N} 个(≥3 个源文件的目录未出现在 .roll/domain/)
|
|
215
|
-
{发现内容列表 或 "文档新鲜度良好,无滞后或缺失项。"}
|
|
216
|
-
```
|
|
217
|
-
|
|
218
|
-
### Scan 7 — Test Quality (rubric-driven)
|
|
219
|
-
|
|
220
|
-
Apply the test-quality rubric at [guide/en/testing/quality-rubric.md](../../guide/en/testing/quality-rubric.md)
|
|
221
|
-
(Chinese: [quality-rubric.zh.md](../../guide/zh/testing/quality-rubric.md)) against every file under
|
|
222
|
-
`tests/`. The rubric publishes six anti-pattern categories (❶..❻); each has a
|
|
223
|
-
**Signals** subsection that lists the matching heuristics. Scan 7 is purely a
|
|
224
|
-
mechanical apply-the-rubric step — no new logic.
|
|
225
|
-
|
|
226
|
-
**Per-category signals** — read from the rubric, summarized here:
|
|
227
|
-
|
|
228
|
-
| Marker | Anti-pattern | Cheapest signal |
|
|
229
|
-
|--------|--------------|-----------------|
|
|
230
|
-
| ❶ | Hardcoded business data | Bare numeric / version / pricing literal inside `[[ "$output" == *"..."*` that matches a value also defined in `lib/` |
|
|
231
|
-
| ❷ | Over-mocking real boundaries | `function git() {` / `function gh() {` overrides at the top of a unit test |
|
|
232
|
-
| ❸ | Asserting implementation details | `grep '_internal_helper'` against output; assertions on `.roll/internal/*` paths |
|
|
233
|
-
| ❹ | Fixture order coupling | `setup_file` writes shared mutable state without per-test reset |
|
|
234
|
-
| ❺ | Testing private functions | Test sources a `lib/` file and calls a `_underscore_prefixed` helper directly |
|
|
235
|
-
| ❻ | Asserting framework behavior | References to `$BATS_TEST_NUMBER`, `$BATS_SUITE_NAME` in assertions |
|
|
236
|
-
|
|
237
|
-
**Rate cap — 每轮 ≤ 5 条 test-quality REFACTOR entries**. Same dream cycle may
|
|
238
|
-
emit more than 5 findings; the dream scan must rank by severity (❶ > ❷ > ❸ > ❹ > ❺ > ❻
|
|
239
|
-
and within a class, by occurrence count) and only persist the top 5 to BACKLOG.
|
|
240
|
-
Remaining findings go into the dream log under `## 测试质量` but are not made
|
|
241
|
-
into REFACTOR rows — this prevents the backlog from being drowned in test-debt
|
|
242
|
-
on the first scan after rubric publication.
|
|
243
|
-
|
|
244
|
-
**REFACTOR entry format** — same as other scans, but tagged with category:
|
|
245
|
-
|
|
246
|
-
```markdown
|
|
247
|
-
| REFACTOR-XXX | docs: <one-line description> [test-quality:❶] — flagged by dream YYYY-MM-DD | 📋 Todo |
|
|
248
|
-
```
|
|
249
|
-
|
|
250
|
-
The `[test-quality:❶]` (through `❻`) tag is **required** so downstream filtering
|
|
251
|
-
(e.g. "show me all ❶ items still open") is mechanical. The marker character must
|
|
252
|
-
match the rubric exactly.
|
|
253
|
-
|
|
254
|
-
**Optional helper** — `bin/dream-test-quality-scan` is a thin shell script
|
|
255
|
-
maintainers can invoke ad-hoc to dry-run the ❶ detector against a single file
|
|
256
|
-
or directory (see `bin/dream-test-quality-scan --help`). The dream skill itself
|
|
257
|
-
does **not** depend on the helper — Scan 7 is the AI agent applying the rubric.
|
|
258
|
-
The helper just exists so a maintainer (or this skill's smoke test) can confirm
|
|
259
|
-
the ❶ heuristic still finds known instances.
|
|
260
|
-
|
|
261
|
-
#### Dream Log Section (Scan 7)
|
|
262
|
-
|
|
263
|
-
Add after `## 文档新鲜度` section:
|
|
264
|
-
|
|
265
|
-
```markdown
|
|
266
|
-
## 测试质量
|
|
267
|
-
- 本轮发现 {N} 项(写入 BACKLOG 的前 5 项见下;剩余 {M} 项仅记录于本日志)
|
|
268
|
-
- ❶ 硬编码业务数据:{count}
|
|
269
|
-
- ❷ 过度 mock:{count}
|
|
270
|
-
- ❸ 断言实现细节:{count}
|
|
271
|
-
- ❹ Fixture 顺序耦合:{count}
|
|
272
|
-
- ❺ 测私有函数:{count}
|
|
273
|
-
- ❻ 断言框架行为:{count}
|
|
274
|
-
{命中文件列表 或 "未发现可治理的测试反模式。"}
|
|
275
|
-
```
|
|
276
|
-
|
|
277
|
-
## Output
|
|
278
|
-
|
|
279
|
-
### REFACTOR Entry (.roll/backlog.md)
|
|
280
|
-
|
|
281
|
-
For each finding that warrants action, append one row to the `## ♻️ Refactor`
|
|
282
|
-
section of .roll/backlog.md:
|
|
283
|
-
|
|
284
|
-
```markdown
|
|
285
|
-
| REFACTOR-XXX | {one-line description} — flagged by dream {YYYY-MM-DD} | 📋 Todo |
|
|
286
|
-
```
|
|
287
|
-
|
|
288
|
-
`{one-line description}` 写法:一句人话说清楚"什么地方需要改"以及"不改会怎样"。不写函数名、文件路径、技术方案。例:`loop 状态读取逻辑分散在多处,修一处容易遗漏另一处`。
|
|
289
|
-
|
|
290
|
-
**Threshold**: only flag items where the fix would meaningfully reduce
|
|
291
|
-
complexity or prevent future bugs. Ignore cosmetic issues.
|
|
292
|
-
|
|
293
|
-
### Dream Log (.roll/dream/YYYY-MM-DD.md)
|
|
294
|
-
|
|
295
|
-
Always write a log, even when no REFACTOR entries are created. Output uses
|
|
296
|
-
Chinese to align with roll-brief style — easier for the morning reader to scan
|
|
297
|
-
without context switching:
|
|
298
|
-
|
|
299
|
-
```markdown
|
|
300
|
-
# Dream Log {YYYY-MM-DD}
|
|
301
|
-
|
|
302
|
-
## 概要
|
|
303
|
-
- 扫描项:死代码 / 架构漂移 / 裁剪候选 / 新兴模式 / 文档覆盖度 / 文档新鲜度
|
|
304
|
-
- 发现:{N} 项标记,{M} 个 REFACTOR 条目已创建
|
|
305
|
-
|
|
306
|
-
## 死代码
|
|
307
|
-
{发现内容 或 "未发现死代码。"}
|
|
308
|
-
|
|
309
|
-
## 架构漂移
|
|
310
|
-
{发现内容 或 "未发现架构漂移。"}
|
|
311
|
-
|
|
312
|
-
## 裁剪候选
|
|
313
|
-
{发现内容 或 "未发现可裁剪项。"}
|
|
314
|
-
|
|
315
|
-
## 新兴模式
|
|
316
|
-
{发现内容 或 "未发现可提取的重复模式。"}
|
|
317
|
-
|
|
318
|
-
## 文档覆盖度
|
|
319
|
-
{发现内容 或 "文档结构符合规范,无缺口。"}
|
|
320
|
-
|
|
321
|
-
## 文档新鲜度
|
|
322
|
-
- 滞后文档:{N} 个
|
|
323
|
-
- 未记录 ENV 变量:{N} 个
|
|
324
|
-
- 架构文档缺失模块:{N} 个
|
|
325
|
-
{发现内容 或 "文档新鲜度良好,无滞后或缺失项。"}
|
|
326
|
-
|
|
327
|
-
## 创建的 REFACTOR 条目
|
|
328
|
-
{列表 或 "无。"}
|
|
329
|
-
```
|
|
330
|
-
|
|
331
|
-
### Commit
|
|
332
|
-
|
|
333
|
-
扫描完成后立即提交,把 dream 发现纳入 git 历史,便于晨报追溯:
|
|
334
|
-
|
|
335
|
-
```bash
|
|
336
|
-
git add .roll/backlog.md .roll/dream/YYYY-MM-DD.md
|
|
337
|
-
# 有 REFACTOR 条目时:
|
|
338
|
-
git commit -m "chore: dream scan YYYY-MM-DD — {N} REFACTOR entries"
|
|
339
|
-
# 无发现时:
|
|
340
|
-
git commit -m "chore: dream scan YYYY-MM-DD — no findings"
|
|
341
|
-
git push origin main
|
|
342
|
-
```
|
|
343
|
-
|
|
344
|
-
- .roll/backlog.md 和 dream 日志必须在**同一个 commit** 里入库,避免出现"REFACTOR 已加但日志找不到"或反过来的撕裂状态
|
|
345
|
-
- 写文件失败时不要执行 commit;保持工作区干净,由调度器负责重试
|
|
346
|
-
- 仅 `.roll/backlog.md` 和 `.roll/dream/YYYY-MM-DD.md` 入 commit,不要顺带带入其他无关变更
|
|
347
|
-
|
|
348
|
-
## Scheduler Configuration
|
|
349
|
-
|
|
350
|
-
roll-.dream runs **locally** — it reads the local codebase directly.
|
|
351
|
-
|
|
352
|
-
### Local cron (default)
|
|
353
|
-
|
|
354
|
-
Installed automatically via `roll loop on` alongside roll-loop and roll-brief.
|
|
355
|
-
The cron entry is generated using the configured agent — no manual cron editing needed.
|
|
356
|
-
|
|
357
|
-
## Failure Handling
|
|
358
|
-
|
|
359
|
-
If the scan fails partway through:
|
|
360
|
-
|
|
361
|
-
1. Write partial results to `.roll/dream/YYYY-MM-DD.md` with a `## 状态:部分完成` header
|
|
362
|
-
2. Do not write incomplete REFACTOR entries to BACKLOG
|
|
363
|
-
3. Log the error to `~/.shared/roll/dream/error.log`
|
|
364
|
-
|
|
365
|
-
The scheduler (not this skill) is responsible for retry and human notification.
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
hidden: true
|
|
3
|
-
name: roll-.echo
|
|
4
|
-
license: MIT
|
|
5
|
-
description: "Load when user intent is vague, contradictory, rambling, or unclear and should be restated for confirmation before action."
|
|
6
|
-
---
|
|
7
|
-
# Echo
|
|
8
|
-
|
|
9
|
-
## Gotchas
|
|
10
|
-
|
|
11
|
-
- Echo confirms unclear intent; it must not add scope, design decisions, or backlog artifacts on its own.
|
|
12
|
-
- Do not load for clear actionable requests, even if the task is large.
|
|
13
|
-
|
|
14
|
-
> Passive intent clarification — restate messy thoughts as clear intent, confirm, then act.
|
|
15
|
-
|
|
16
|
-
## When to Activate
|
|
17
|
-
|
|
18
|
-
This skill fires **automatically** when the AI detects unclear intent. It should feel natural — not like a skill invocation, but like a thoughtful colleague saying "let me make sure I got that right."
|
|
19
|
-
|
|
20
|
-
**Activation signals** (any of these):
|
|
21
|
-
- Input is long and rambling (>3 sentences without a clear ask)
|
|
22
|
-
- Multiple ideas tangled together with no clear priority
|
|
23
|
-
- Contradictory statements ("I want X but also not-X")
|
|
24
|
-
- Hedging language: "maybe", "sort of", "I think", "not sure but", "something like"
|
|
25
|
-
- Vague scope: "make it better", "fix this area", "do something about"
|
|
26
|
-
- The intent could reasonably be interpreted in 2+ very different ways
|
|
27
|
-
|
|
28
|
-
## When Not to Use
|
|
29
|
-
|
|
30
|
-
- Intent is already clear and actionable ("add a login button to the header")
|
|
31
|
-
- User gives a specific command with a skill trigger ("$roll-build US-001")
|
|
32
|
-
- User is answering a question you asked (they're clarifying, not initiating)
|
|
33
|
-
- The task is simple enough that misinterpretation risk is negligible
|
|
34
|
-
- User needs targeted Q&A to fill specific gaps (use `$roll-.clarify`)
|
|
35
|
-
|
|
36
|
-
**When in doubt**: If you're 80%+ confident you understand correctly, just execute. Echo is for the 50/50 situations where getting it wrong would waste real effort.
|
|
37
|
-
|
|
38
|
-
## How to Echo
|
|
39
|
-
|
|
40
|
-
### Step 1: Listen completely
|
|
41
|
-
|
|
42
|
-
Let the user finish. Don't interrupt a stream of consciousness — the clearest signal often comes at the end.
|
|
43
|
-
|
|
44
|
-
### Step 2: Distill
|
|
45
|
-
|
|
46
|
-
Extract the core intent from the noise. Structure it as:
|
|
47
|
-
|
|
48
|
-
```
|
|
49
|
-
What I'm hearing:
|
|
50
|
-
- **Goal**: {what they want to achieve — one sentence}
|
|
51
|
-
- **Scope**: {what's in / what's out}
|
|
52
|
-
- **Priority**: {if multiple things mentioned, which comes first}
|
|
53
|
-
- **Constraints**: {any specific requirements or limitations mentioned}
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
Only include fields that are relevant. A simple clarification might just be:
|
|
57
|
-
|
|
58
|
-
```
|
|
59
|
-
So you want: {one clear sentence restating the intent}
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
### Step 3: Surface ambiguity (if any)
|
|
63
|
-
|
|
64
|
-
If there are genuine decision points the user needs to resolve:
|
|
65
|
-
|
|
66
|
-
```
|
|
67
|
-
One thing I want to confirm: {the specific ambiguity, with 2-3 concrete options}
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
Don't manufacture ambiguity. If you understood fine, skip this.
|
|
71
|
-
|
|
72
|
-
### Step 4: Confirm and proceed
|
|
73
|
-
|
|
74
|
-
End with a natural confirmation prompt, then act on the response:
|
|
75
|
-
- If confirmed → route to the appropriate skill or start working
|
|
76
|
-
- If corrected → update understanding, optionally echo again if the correction introduces new ambiguity
|
|
77
|
-
|
|
78
|
-
## Style
|
|
79
|
-
|
|
80
|
-
- **Be brief.** The echo should be shorter than the original input, not longer.
|
|
81
|
-
- **Be concrete.** Replace vague language with specific interpretations. "Make it better" → "Improve the search response time" or "Redesign the search UI."
|
|
82
|
-
- **Be natural.** This is a conversation, not a form. Don't use the template rigidly.
|
|
83
|
-
- **No jargon.** Mirror the user's vocabulary, not technical framework terms.
|
|
84
|
-
- **No patronizing.** Don't echo things that are already obvious. The user will feel like you're not listening.
|
|
85
|
-
|
|
86
|
-
## Anti-Patterns
|
|
87
|
-
|
|
88
|
-
- Echoing when intent is already clear (wastes the user's time)
|
|
89
|
-
- Echoing every single message (becomes annoying fast)
|
|
90
|
-
- Adding your own ideas to the echo (scope creep — echo is for understanding, not suggesting)
|
|
91
|
-
- Using the echo as a stall tactic when you should just do the work
|
|
92
|
-
- Turning a simple ask into a complex questionnaire
|
|
93
|
-
|
|
94
|
-
## Examples
|
|
95
|
-
|
|
96
|
-
### Good Echo (vague input)
|
|
97
|
-
|
|
98
|
-
**User**: "I've been thinking about the search, it's kind of slow and the results aren't great, maybe we need elasticsearch or something, and also the UI is weird on mobile, the filters don't work right, I don't know, just... it needs work"
|
|
99
|
-
|
|
100
|
-
**Echo**: "Got it — sounds like two separate issues: (1) search quality and performance (results aren't relevant + slow), and (2) mobile UI broken filters. Want me to tackle them as two separate stories, or is one more urgent?"
|
|
101
|
-
|
|
102
|
-
### Good Echo (contradictory input)
|
|
103
|
-
|
|
104
|
-
**User**: "Make the dashboard simpler, but also add the analytics charts we discussed, and the export feature, oh and notifications"
|
|
105
|
-
|
|
106
|
-
**Echo**: "Those pull in opposite directions — simpler dashboard vs. adding 3 new features. Which do you mean: strip the current dashboard down and then selectively add these features? Or keep what's there and add the new stuff on top?"
|
|
107
|
-
|
|
108
|
-
### No Echo Needed (clear input)
|
|
109
|
-
|
|
110
|
-
**User**: "Add a dark mode toggle to the settings page"
|
|
111
|
-
|
|
112
|
-
*→ Just do it. No echo needed.*
|
|
113
|
-
|
|
114
|
-
### No Echo Needed (skill trigger)
|
|
115
|
-
|
|
116
|
-
**User**: "$roll-design search improvements"
|
|
117
|
-
|
|
118
|
-
*→ Route to roll-design. No echo needed.*
|
package/skills/roll-.qa/SKILL.md
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
hidden: true
|
|
3
|
-
name: roll-.qa
|
|
4
|
-
license: MIT
|
|
5
|
-
allowed-tools: "Read"
|
|
6
|
-
description: "Load when a build, fix, review, or story needs Roll QA coverage standards: test pyramid, evidence expectations, visual/E2E boundaries, or CI gates."
|
|
7
|
-
---
|
|
8
|
-
# Roll QA
|
|
9
|
-
|
|
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.
|
|
11
|
-
|
|
12
|
-
## Load
|
|
13
|
-
|
|
14
|
-
Load when a build, fix, review, or story needs Roll QA coverage standards: test pyramid, evidence expectations, visual/E2E boundaries, or CI gates.
|
|
15
|
-
|
|
16
|
-
## When Not to Use
|
|
17
|
-
|
|
18
|
-
- Post-TCR code review; load roll-.review.
|
|
19
|
-
- PR review verdicts; load roll-review-pr.
|
|
20
|
-
|
|
21
|
-
## Read On Demand
|
|
22
|
-
|
|
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.
|
|
25
|
-
|
|
26
|
-
## Workflow Skeleton
|
|
27
|
-
|
|
28
|
-
1. Map risk to unit, integration, E2E, visual, and smoke layers.
|
|
29
|
-
2. Define acceptance evidence per story.
|
|
30
|
-
3. Use the lightest layer that proves the risk.
|
|
31
|
-
4. Escalate coverage when behavior crosses boundaries.
|
|
32
|
-
|
|
33
|
-
## Hard Gates
|
|
34
|
-
|
|
35
|
-
- Tests must exercise product code or public entry points.
|
|
36
|
-
- Visual checks require rendered evidence when UI is touched.
|
|
37
|
-
|
|
38
|
-
## Gotchas
|
|
39
|
-
|
|
40
|
-
- QA chooses evidence depth; it does not replace story-specific acceptance criteria or TCR test design.
|
|
41
|
-
- Do not use visual/E2E layers as a substitute for focused unit coverage when the risk is pure logic.
|
|
42
|
-
|
|
43
|
-
## Maintenance
|
|
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.
|