@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.
Files changed (67) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/dist/roll.mjs +4563 -3369
  3. package/package.json +1 -1
  4. package/lib/__pycache__/changelog_audit.cpython-314.pyc +0 -0
  5. package/lib/__pycache__/github_sync.cpython-314.pyc +0 -0
  6. package/lib/__pycache__/loop-fmt.cpython-314.pyc +0 -0
  7. package/lib/__pycache__/loop_result_eval.cpython-314.pyc +0 -0
  8. package/lib/__pycache__/loop_unstick.cpython-314.pyc +0 -0
  9. package/lib/__pycache__/model_prices.cpython-314.pyc +0 -0
  10. package/lib/__pycache__/prices_fetcher.cpython-314.pyc +0 -0
  11. package/lib/__pycache__/roll-home.cpython-314.pyc +0 -0
  12. package/lib/__pycache__/roll-loop-status.cpython-314.pyc +0 -0
  13. package/lib/__pycache__/roll_git.cpython-314.pyc +0 -0
  14. package/lib/__pycache__/roll_render.cpython-314.pyc +0 -0
  15. package/lib/__pycache__/slides-render.cpython-314.pyc +0 -0
  16. package/lib/agent_usage/__pycache__/__init__.cpython-314.pyc +0 -0
  17. package/lib/agent_usage/__pycache__/gemini.cpython-314.pyc +0 -0
  18. package/lib/agent_usage/__pycache__/kimi.cpython-314.pyc +0 -0
  19. package/lib/agent_usage/__pycache__/openai.cpython-314.pyc +0 -0
  20. package/lib/agent_usage/__pycache__/pi.cpython-314.pyc +0 -0
  21. package/lib/agent_usage/__pycache__/pi_emit.cpython-314.pyc +0 -0
  22. package/lib/agent_usage/__pycache__/qwen.cpython-314.pyc +0 -0
  23. package/skills/README.md +0 -64
  24. package/skills/docs/skill-authoring.md +0 -74
  25. package/skills/reports/skill-audit-summary.md +0 -53
  26. package/skills/roll-.changelog/SKILL.md +0 -47
  27. package/skills/roll-.changelog/references/full-contract.md +0 -462
  28. package/skills/roll-.clarify/SKILL.md +0 -64
  29. package/skills/roll-.dream/SKILL.md +0 -47
  30. package/skills/roll-.dream/references/full-contract.md +0 -365
  31. package/skills/roll-.echo/SKILL.md +0 -118
  32. package/skills/roll-.qa/SKILL.md +0 -47
  33. package/skills/roll-.qa/references/full-contract.md +0 -256
  34. package/skills/roll-.review/SKILL.md +0 -148
  35. package/skills/roll-build/SKILL.md +0 -49
  36. package/skills/roll-build/references/full-contract.md +0 -968
  37. package/skills/roll-debug/SKILL.md +0 -48
  38. package/skills/roll-debug/assets/injectable-bb.js +0 -263
  39. package/skills/roll-debug/references/full-contract.md +0 -607
  40. package/skills/roll-design/SKILL.md +0 -52
  41. package/skills/roll-design/references/engineering-checklist.md +0 -298
  42. package/skills/roll-design/references/full-contract.md +0 -940
  43. package/skills/roll-doc-audit/SKILL.md +0 -51
  44. package/skills/roll-doc-audit/references/full-contract.md +0 -796
  45. package/skills/roll-doctor/SKILL.md +0 -211
  46. package/skills/roll-fix/SKILL.md +0 -49
  47. package/skills/roll-fix/references/full-contract.md +0 -672
  48. package/skills/roll-idea/SKILL.md +0 -62
  49. package/skills/roll-loop/SKILL.md +0 -50
  50. package/skills/roll-loop/references/full-contract.md +0 -534
  51. package/skills/roll-notes/SKILL.md +0 -107
  52. package/skills/roll-onboard/SKILL.md +0 -238
  53. package/skills/roll-peer/SKILL.md +0 -47
  54. package/skills/roll-peer/references/full-contract.md +0 -323
  55. package/skills/roll-propose/SKILL.md +0 -155
  56. package/skills/roll-review-pr/SKILL.md +0 -62
  57. package/skills/roll-spar/SKILL.md +0 -47
  58. package/skills/roll-spar/references/full-contract.md +0 -288
  59. package/skills/route-cases/skills.json +0 -216
  60. package/skills/scripts/audit-skills.mjs +0 -272
  61. package/skills/scripts/test-audit-skills.mjs +0 -39
  62. package/skills/tests/fixtures/skill-audit/block-skill/SKILL.md +0 -12
  63. package/skills/tests/fixtures/skill-audit/minimal-skill/SKILL.md +0 -8
  64. package/skills/tests/fixtures/skill-audit/quoted-skill/SKILL.md +0 -10
  65. package/skills/tests/fixtures/skill-audit/route-cases.json +0 -21
  66. package/skills/tests/fixtures/skill-audit/spoke-skill/SKILL.md +0 -12
  67. package/skills/tests/fixtures/skill-audit/spoke-skill/references/runbook.md +0 -3
@@ -1,256 +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
- # QA Cover
8
-
9
- This is a **reference skill** used by `roll-build` and `roll-fix` for quality assurance and test coverage.
10
-
11
- ## When to Apply
12
-
13
- Any product with a user interface (Web, Desktop, Mobile) must follow these testing standards.
14
-
15
- ## When Not to Use
16
-
17
- - Non-UI backends (APIs, CLI tools, data pipelines) — use project-specific test frameworks
18
- - Spike code or throwaway prototypes that won't ship
19
- - Per-commit self-review of diffs (use `$roll-.review`)
20
-
21
- ## Required Testing Levels
22
-
23
- ### 1. Unit Tests (Logic)
24
- - **Tool**: Vitest / Jest
25
- - **Coverage**: Business logic, utilities, hooks
26
- - **Run**: `npm run test`
27
-
28
- ### 2. E2E Tests (User Flows)
29
- - **Tool**: **Playwright** (default)
30
- - **Coverage**: Critical user paths, interactions
31
- - **Run**: `npm run test:e2e`
32
-
33
- ### 3. Visual Regression (UI Stability)
34
- - **Tool**: Playwright screenshot testing
35
- - **Coverage**: Key UI states
36
- - **Run**: Part of E2E tests
37
- - **Baseline**: Stored in `e2e/__snapshots__/`
38
-
39
- ### 4. Smoke Tests (Post-deploy)
40
- - **Tool**: Playwright
41
- - **Coverage**: Core functionality on production
42
- - **Run**: `npm run test:e2e:smoke`
43
-
44
- ## Playwright Setup
45
-
46
- ### Installation
47
- ```bash
48
- npm install -D @playwright/test
49
- npx playwright install chromium
50
- ```
51
-
52
- ### Configuration (playwright.config.ts)
53
- ```typescript
54
- import { defineConfig, devices } from '@playwright/test';
55
-
56
- export default defineConfig({
57
- testDir: './e2e',
58
- fullyParallel: true,
59
- retries: process.env.CI ? 2 : 0,
60
- reporter: 'html',
61
- use: {
62
- baseURL: process.env.PLAYWRIGHT_BASE_URL || 'http://localhost:5173',
63
- trace: 'on-first-retry',
64
- screenshot: 'only-on-failure',
65
- },
66
- projects: [
67
- { name: 'chromium', use: { ...devices['Desktop Chrome'] } },
68
- ],
69
- });
70
- ```
71
-
72
- ### Required Test Files
73
-
74
- **e2e/smoke.spec.ts** (Deployment verification)
75
- ```typescript
76
- import { test, expect } from '@playwright/test';
77
-
78
- test('app loads', async ({ page }) => {
79
- await page.goto('/');
80
- await expect(page.locator('#app')).toBeVisible();
81
- });
82
- ```
83
-
84
- **e2e/interaction.spec.ts** (User flows)
85
- ```typescript
86
- test('user can complete core flow', async ({ page }) => {
87
- await page.goto('/');
88
- // Test critical user journey
89
- });
90
- ```
91
-
92
- **e2e/visual.spec.ts** (Visual regression)
93
- ```typescript
94
- test('homepage visual', async ({ page }) => {
95
- await page.goto('/');
96
- await expect(page).toHaveScreenshot('homepage.png');
97
- });
98
- ```
99
-
100
- ### Package.json Scripts
101
- ```json
102
- {
103
- "scripts": {
104
- "test:e2e": "playwright test",
105
- "test:e2e:ui": "playwright test --ui",
106
- "test:e2e:smoke": "playwright test smoke.spec.ts",
107
- "test:all": "npm run test && npm run test:e2e"
108
- }
109
- }
110
- ```
111
-
112
- ## Visual Regression Workflow
113
-
114
- ### 1. Create Baseline (First Time)
115
- ```bash
116
- npx playwright test --update-snapshots
117
- ```
118
-
119
- ### 2. Commit Baseline
120
- ```bash
121
- git add e2e/__snapshots__/
122
- git commit -m "chore: add visual regression baselines"
123
- ```
124
-
125
- ### 3. Subsequent Runs (Compare)
126
- ```bash
127
- npm run test:e2e
128
- # Fails if screenshots differ beyond threshold
129
- ```
130
-
131
- ### 4. Update Baseline (Intentional UI Change)
132
- ```bash
133
- npx playwright test --update-snapshots
134
- git add e2e/__snapshots__/
135
- git commit -m "chore: update visual baseline for new design"
136
- ```
137
-
138
- ## CI/CD Integration
139
-
140
- ### Local Pre-push Checklist
141
- - [ ] `npm run test` passes
142
- - [ ] `npm run test:e2e` passes
143
- - [ ] No unexpected visual regressions
144
-
145
- ### Post-deploy Smoke Test
146
- ```bash
147
- # Against production URL
148
- PLAYWRIGHT_BASE_URL=https://your-app.com npm run test:e2e:smoke
149
- ```
150
-
151
- ## Common Patterns
152
-
153
- ### Testing Canvas/Game Rendering
154
- ```typescript
155
- test('game renders', async ({ page }) => {
156
- await page.goto('/');
157
- const canvas = page.locator('#gameCanvas');
158
- await expect(canvas).toBeVisible();
159
-
160
- // Visual regression for canvas
161
- await expect(page).toHaveScreenshot('game-initial.png', {
162
- maxDiffPixels: 100,
163
- });
164
- });
165
- ```
166
-
167
- ### Testing Responsive Layouts
168
- ```typescript
169
- test('responsive design', async ({ page }) => {
170
- await page.setViewportSize({ width: 375, height: 667 });
171
- await page.goto('/');
172
- await expect(page.locator('.mobile-menu')).toBeVisible();
173
- });
174
- ```
175
-
176
- ### Testing Voice/Audio Features
177
- ```typescript
178
- test('voice button toggles', async ({ page }) => {
179
- await page.goto('/');
180
- const btn = page.locator('#voiceBtn');
181
- await btn.click();
182
- await expect(btn).toHaveClass(/active/);
183
- });
184
- ```
185
-
186
- ## Failure Handling
187
-
188
- ### Flaky Tests
189
- - Add `test.fixme()` to skip temporarily
190
- - Increase `timeout` for slow operations
191
- - Use `retries` in config for network-dependent tests
192
-
193
- ### Visual Regression Failures
194
- 1. Check if change is intentional
195
- 2. If yes: `npx playwright test --update-snapshots`
196
- 3. If no: fix the code
197
-
198
- ### Missing Test Infrastructure
199
- If project lacks Playwright setup:
200
- 1. Install dependencies
201
- 2. Create config
202
- 3. Add basic smoke test
203
- 4. Run to create baseline
204
- 5. Commit as separate "test infrastructure" change
205
-
206
- ## CI Failure Triage
207
-
208
- When CI goes red, triage the failure into an actionable item instead of ignoring it.
209
-
210
- ### Step 1: Read the CI Log
211
-
212
- ```
213
- CI failure
214
-
215
- ├── Which step failed? (lint / build / test / e2e)
216
- ├── What is the error message?
217
- ├── Is it reproducible locally?
218
- └── Is it flaky (passes on retry)?
219
- ```
220
-
221
- ### Step 2: Classify Severity
222
-
223
- | Severity | Signal | Action |
224
- |----------|--------|--------|
225
- | Critical | Build or core tests fail, blocks all merges | Fix immediately via `$roll-fix` |
226
- | High | E2E test fails on a key user flow | Create FIX-XXX, fix within current sprint |
227
- | Medium | Visual regression, non-critical test failure | Create FIX-XXX, prioritize in backlog |
228
- | Low | Lint warning, flaky test (passes on retry) | Create FIX-XXX or IDEA-XXX, fix when convenient |
229
-
230
- ### Step 3: Create Backlog Entry
231
-
232
- ```bash
233
- # For fixable bugs — create FIX entry
234
- $roll-idea fix "CI: {step} fails — {root cause summary}"
235
-
236
- # For flaky/environmental issues — create IDEA entry
237
- $roll-idea idea "CI: investigate flaky {test name}"
238
- ```
239
-
240
- ### Step 4: Execute Fix
241
-
242
- ```
243
- FIX-XXX created
244
-
245
- ├── Critical / High → $roll-fix FIX-XXX (immediate)
246
- ├── Medium → schedule in backlog, $roll-fix when ready
247
- └── Low → backlog, fix opportunistically
248
- ```
249
-
250
- All fixes go through `$roll-fix` TCR workflow — test, fix, review, commit, push, CI green.
251
-
252
- ## References
253
-
254
- - [Playwright Docs](https://playwright.dev/)
255
- - [Visual Regression Guide](https://playwright.dev/docs/test-snapshots)
256
- - Example implementation: `<owner>/<repo>/e2e/`
@@ -1,148 +0,0 @@
1
- ---
2
- hidden: true
3
- name: roll-.review
4
- license: MIT
5
- allowed-tools: "Read, Bash(git:*)"
6
- description: "Load when a TCR micro-step needs self code review before commit, focused on bugs, regressions, security, and design issues."
7
- ---
8
- # WK Self Code Review
9
-
10
- ## Gotchas
11
-
12
- - Review findings lead with bugs and regressions, not style preferences or summaries.
13
- - This is local self-review; use roll-review-pr for PR diffs and roll-peer for cross-agent negotiation.
14
-
15
- **Quality gate for the TCR loop** - Self-review after each micro-step is completed and before commit.
16
-
17
- ## Position in WK Workflow
18
-
19
- ```
20
- TCR Loop:
21
- Write Test → Run Test → ✅ Green → Self Review → Commit
22
-
23
- Critical?
24
- Yes → Fix → Redo
25
- No → Proceed
26
- ```
27
-
28
- ## When Triggered
29
-
30
- - **Auto-triggered**: After each TCR micro-step in `$roll-build` / `$roll-fix`
31
- - **Manual trigger**: When the user wants to review current changes
32
-
33
- ## When Not to Use
34
-
35
- - Docs-only changes (README, CHANGELOG) with no code diff
36
- - Test pyramid / coverage standards check (use `$roll-.qa`)
37
- - Post-deploy production sampling (use `$roll-sentinel`)
38
-
39
- ## Review Scope
40
-
41
- ```bash
42
- # Default: review staged changes (recommended for TCR)
43
- $roll-.review staged
44
-
45
- # Review all uncommitted changes
46
- $roll-.review unstaged
47
-
48
- # Review specific files
49
- $roll-.review files src/utils.ts
50
- ```
51
-
52
- ## Review Dimensions (7 Core Dimensions)
53
-
54
- Original 6 dimensions plus Reuse (added in REFACTOR-022, simplify three-axis integration):
55
-
56
- ```
57
- ┌─────────────────────────────────────────────────────────┐
58
- │ WK Quality Checklist │
59
- ├─────────────────────────────────────────────────────────┤
60
- │ ✅ Correctness - Logic is correct, no bugs │
61
- │ ✅ Security - No vulnerabilities, input valid. │
62
- │ ✅ Maintainability - Clear naming, sound structure │
63
- │ Quality anti-patterns (check each): │
64
- │ □ Redundant state / cached values that could be │
65
- │ derived directly │
66
- │ □ Parameter sprawl — new param vs. restructure │
67
- │ □ Copy-paste with slight variation (near-dup) │
68
- │ □ Leaky abstraction — exposes internal details │
69
- │ □ Stringly-typed — raw string where constant │
70
- │ / enum exists │
71
- │ □ Unnecessary JSX nesting (no layout value) │
72
- │ □ Nested conditionals ≥3 deep (ternary chains, │
73
- │ nested if/else) — flatten with early return │
74
- │ □ Unnecessary comments explaining WHAT │
75
- │ ✅ Performance - No performance pitfalls │
76
- │ Efficiency anti-patterns (check each): │
77
- │ □ Redundant computation / repeated file read / │
78
- │ duplicate API call / N+1 pattern │
79
- │ □ Missed concurrency — independent ops sequential │
80
- │ □ Hot-path bloat — blocking work in startup or │
81
- │ per-request path │
82
- │ □ Loop no-op updates — missing change-detection │
83
- │ guard │
84
- │ □ TOCTOU existence pre-check — operate directly + │
85
- │ handle error instead │
86
- │ □ Memory — unbounded structures / missing cleanup │
87
- │ □ Overly broad op — reading full file for a slice │
88
- │ ✅ Testability - Easy to test, edge cases covered │
89
- │ ✅ Scope - Focused on current task, no │
90
- │ unrelated changes │
91
- │ ✅ Reuse - No new code duplicating existing │
92
- │ □ New function duplicates existing utility/helper │
93
- │ □ Inline logic replaceable by existing tool │
94
- └─────────────────────────────────────────────────────────┘
95
- ```
96
-
97
- **Usage in TCR**: Each micro-step review is a lightweight self-check against this checklist — no sub-agents, zero extra token cost. The three-axis deep review with parallel agents runs once per Story in `$roll-build` Phase 7.
98
-
99
- ## Severity Levels and Decisions
100
-
101
- | Level | Definition | Decision |
102
- |-------|-----------|----------|
103
- | 🔴 **Critical** | Bug, security vulnerability | **Must fix**, redo TCR |
104
- | 🟡 **Warning** | Maintainability issue | **Recommend fix** or document |
105
- | 🟢 **Suggestion** | Minor optimization | Optional, proceed with commit |
106
- | ✅ **Pass** | No issues | Proceed with commit |
107
-
108
- ## Output Format
109
-
110
- ```markdown
111
- ## Self Review Report
112
- **Scope**: staged (2 files, +45/-12 lines)
113
-
114
- ### 🔴 Critical (Must Fix)
115
- | File | Line | Issue | Action |
116
- |------|------|-------|--------|
117
- | auth.ts | 23 | SQL injection | Use parameterized query |
118
-
119
- ### 🟡 Warnings
120
- - utils.ts:45 - Magic number, consider: `const MAX_RETRY = 3`
121
-
122
- ### ✅ Passed
123
- - Naming conventions
124
- - Error handling
125
- ```
126
-
127
- ## TCR Integration
128
-
129
- In each micro-step of `$roll-build`:
130
-
131
- ```markdown
132
- **Micro-Step X: [Description]**
133
-
134
- 1. Write/Update Test
135
- 2. Run Test → ✅ Green
136
- 3. **$roll-.review staged**
137
- - 🔴 Critical? → Fix → Redo step
138
- - 🟡 Warning? → Quick fix or document
139
- - ✅ Pass? → Proceed
140
- 4. git commit -m "tcr: description"
141
- ```
142
-
143
- ## WK Principle Alignment
144
-
145
- - **Agent-First**: Structured review checklist, executable by AI
146
- - **Check Phase**: Local quality control
147
- - **Micro-steps**: Small fast steps, each review < 100 lines
148
- - **TCR**: Can only commit after passing self-check, ensuring repo quality
@@ -1,49 +0,0 @@
1
- ---
2
- name: roll-build
3
- license: MIT
4
- allowed-tools: "Read, Edit, Write, Glob, Grep, Bash, Skill, Agent"
5
- description: "Load when a user gives a US-XXX story or asks to ship a feature through Roll TCR delivery, from clarification through verification and backlog write-back."
6
- ---
7
- # Roll Build
8
-
9
- 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
- ## Load
12
-
13
- Load when a user gives a US-XXX story or asks to ship a feature through Roll TCR delivery, from clarification through verification and backlog write-back.
14
-
15
- ## When Not to Use
16
-
17
- - Pure design or backlog splitting without code; load roll-design.
18
- - Narrow FIX/BUG repair; load roll-fix.
19
-
20
- ## Read On Demand
21
-
22
- - Read [the full contract](references/full-contract.md) before executing the workflow end to end, recovering from failures, or checking exact output templates.
23
- - Keep this hub in context for trigger boundaries and hard gates.
24
-
25
- ## Workflow Skeleton
26
-
27
- 1. Classify input as Story mode or Fly mode.
28
- 2. Read backlog/spec and decide if the story fits one cycle.
29
- 3. Split into small TCR actions and define verification.
30
- 4. Run test-first implementation, self-review, evidence, and write-back.
31
- 5. Commit on green, open PR, and leave remote evidence.
32
-
33
- ## Hard Gates
34
-
35
- - TCR for every micro-step.
36
- - No WIP commits or bypassed verification.
37
- - Self-review, attest, and E2E evidence remain required. The Review Score is produced by the runner's fresh-session peer Reviewer — the agent does NOT self-score.
38
- - Docs/code/product alignment is a DoD gate: user-visible behavior, command, output-copy, site, or delivery-view changes update the touched README/docs/guide/site/help in the same delivery.
39
-
40
- ## Gotchas
41
-
42
- - Do not use for pure design/backlog splitting; route that to roll-design until implementation starts.
43
- - TCR and evidence gates remain mandatory even when the code change looks small.
44
-
45
- ## Maintenance
46
-
47
- - Description changes require updates in `route-cases/skills.json`.
48
- - New observed failures should add a gotcha and the matching positive or negative route case.
49
- - Heavy examples, templates, recovery paths, and deterministic snippets belong in `references/`, `assets/`, or `scripts/`, not in this hub.