agileflow 2.77.0 → 2.79.0
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/README.md +6 -6
- package/package.json +6 -1
- package/scripts/agileflow-configure.js +174 -2
- package/scripts/agileflow-statusline.sh +171 -78
- package/scripts/agileflow-welcome.js +88 -64
- package/scripts/auto-self-improve.js +23 -45
- package/scripts/check-update.js +35 -42
- package/scripts/damage-control/bash-tool-damage-control.js +257 -0
- package/scripts/damage-control/edit-tool-damage-control.js +279 -0
- package/scripts/damage-control/patterns.yaml +227 -0
- package/scripts/damage-control/write-tool-damage-control.js +274 -0
- package/scripts/damage-control-bash.js +232 -0
- package/scripts/damage-control-edit.js +243 -0
- package/scripts/damage-control-write.js +243 -0
- package/scripts/obtain-context.js +22 -3
- package/scripts/ralph-loop.js +191 -63
- package/scripts/screenshot-verifier.js +213 -0
- package/scripts/session-manager.js +12 -33
- package/src/core/agents/accessibility.md +124 -53
- package/src/core/agents/adr-writer.md +192 -52
- package/src/core/agents/analytics.md +139 -60
- package/src/core/agents/api.md +173 -63
- package/src/core/agents/ci.md +139 -57
- package/src/core/agents/compliance.md +159 -68
- package/src/core/agents/configuration/damage-control.md +356 -0
- package/src/core/agents/configuration-damage-control.md +248 -0
- package/src/core/agents/database.md +162 -61
- package/src/core/agents/datamigration.md +179 -66
- package/src/core/agents/design.md +179 -57
- package/src/core/agents/devops.md +160 -3
- package/src/core/agents/documentation.md +204 -60
- package/src/core/agents/epic-planner.md +147 -55
- package/src/core/agents/integrations.md +197 -69
- package/src/core/agents/mentor.md +158 -57
- package/src/core/agents/mobile.md +159 -67
- package/src/core/agents/monitoring.md +154 -65
- package/src/core/agents/multi-expert.md +115 -43
- package/src/core/agents/orchestrator.md +77 -24
- package/src/core/agents/performance.md +130 -75
- package/src/core/agents/product.md +151 -55
- package/src/core/agents/qa.md +162 -74
- package/src/core/agents/readme-updater.md +178 -76
- package/src/core/agents/refactor.md +148 -95
- package/src/core/agents/research.md +143 -72
- package/src/core/agents/security.md +154 -65
- package/src/core/agents/testing.md +176 -97
- package/src/core/agents/ui.md +170 -79
- package/src/core/commands/adr/list.md +171 -0
- package/src/core/commands/adr/update.md +235 -0
- package/src/core/commands/adr/view.md +252 -0
- package/src/core/commands/adr.md +207 -50
- package/src/core/commands/agent.md +16 -0
- package/src/core/commands/assign.md +148 -44
- package/src/core/commands/auto.md +18 -1
- package/src/core/commands/babysit.md +391 -38
- package/src/core/commands/baseline.md +14 -0
- package/src/core/commands/blockers.md +170 -51
- package/src/core/commands/board.md +144 -66
- package/src/core/commands/changelog.md +15 -0
- package/src/core/commands/ci.md +179 -69
- package/src/core/commands/compress.md +18 -0
- package/src/core/commands/configure.md +16 -0
- package/src/core/commands/context/export.md +193 -4
- package/src/core/commands/context/full.md +191 -18
- package/src/core/commands/context/note.md +248 -4
- package/src/core/commands/debt.md +17 -0
- package/src/core/commands/deploy.md +208 -65
- package/src/core/commands/deps.md +15 -0
- package/src/core/commands/diagnose.md +16 -0
- package/src/core/commands/docs.md +196 -64
- package/src/core/commands/epic/list.md +170 -0
- package/src/core/commands/epic/view.md +242 -0
- package/src/core/commands/epic.md +192 -69
- package/src/core/commands/feedback.md +191 -71
- package/src/core/commands/handoff.md +162 -48
- package/src/core/commands/help.md +9 -0
- package/src/core/commands/ideate.md +446 -0
- package/src/core/commands/impact.md +16 -0
- package/src/core/commands/metrics.md +141 -37
- package/src/core/commands/multi-expert.md +77 -0
- package/src/core/commands/packages.md +16 -0
- package/src/core/commands/pr.md +161 -67
- package/src/core/commands/readme-sync.md +16 -0
- package/src/core/commands/research/analyze.md +568 -0
- package/src/core/commands/research/ask.md +345 -20
- package/src/core/commands/research/import.md +562 -19
- package/src/core/commands/research/list.md +173 -5
- package/src/core/commands/research/view.md +181 -8
- package/src/core/commands/retro.md +135 -48
- package/src/core/commands/review.md +219 -47
- package/src/core/commands/session/end.md +209 -0
- package/src/core/commands/session/history.md +210 -0
- package/src/core/commands/session/init.md +116 -0
- package/src/core/commands/session/new.md +296 -0
- package/src/core/commands/session/resume.md +166 -0
- package/src/core/commands/session/status.md +166 -0
- package/src/core/commands/setup/visual-e2e.md +462 -0
- package/src/core/commands/skill/create.md +115 -17
- package/src/core/commands/skill/delete.md +117 -0
- package/src/core/commands/skill/edit.md +104 -0
- package/src/core/commands/skill/list.md +128 -0
- package/src/core/commands/skill/test.md +135 -0
- package/src/core/commands/skill/upgrade.md +542 -0
- package/src/core/commands/sprint.md +17 -1
- package/src/core/commands/status.md +133 -21
- package/src/core/commands/story/list.md +176 -0
- package/src/core/commands/story/view.md +265 -0
- package/src/core/commands/story-validate.md +101 -1
- package/src/core/commands/story.md +204 -51
- package/src/core/commands/template.md +16 -1
- package/src/core/commands/tests.md +226 -64
- package/src/core/commands/update.md +17 -1
- package/src/core/commands/validate-expertise.md +16 -0
- package/src/core/commands/velocity.md +140 -36
- package/src/core/commands/verify.md +14 -0
- package/src/core/commands/whats-new.md +30 -0
- package/src/core/skills/_learnings/README.md +91 -0
- package/src/core/skills/_learnings/_template.yaml +106 -0
- package/src/core/skills/_learnings/code-review.yaml +118 -0
- package/src/core/skills/_learnings/commit.yaml +69 -0
- package/src/core/skills/_learnings/story-writer.yaml +71 -0
- package/src/core/templates/damage-control-patterns.yaml +234 -0
- package/src/core/templates/skill-template.md +53 -11
- package/tools/cli/commands/start.js +180 -0
- package/tools/cli/installers/ide/claude-code.js +127 -0
- package/tools/cli/tui/Dashboard.js +66 -0
- package/tools/cli/tui/StoryList.js +69 -0
- package/tools/cli/tui/index.js +16 -0
|
@@ -0,0 +1,462 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Set up Visual E2E testing infrastructure with Playwright and screenshot verification
|
|
3
|
+
argument-hint: (no arguments)
|
|
4
|
+
compact_context:
|
|
5
|
+
priority: high
|
|
6
|
+
preserve_rules:
|
|
7
|
+
- "Install Playwright with npx playwright install --with-deps chromium"
|
|
8
|
+
- "Create playwright.config.ts with webServer config for auto-starting dev server"
|
|
9
|
+
- "Create tests/e2e/ directory with example test that takes screenshots"
|
|
10
|
+
- "Create screenshots/ directory for visual verification workflow"
|
|
11
|
+
- "Add test:e2e script to package.json"
|
|
12
|
+
- "All screenshots must be visually reviewed and renamed with 'verified-' prefix"
|
|
13
|
+
- "Use TodoWrite to track all 8 setup steps"
|
|
14
|
+
- "Run example test after setup to verify it works"
|
|
15
|
+
state_fields:
|
|
16
|
+
- playwright_installed
|
|
17
|
+
- config_created
|
|
18
|
+
- example_test_created
|
|
19
|
+
- screenshots_dir_created
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
# setup-visual-e2e
|
|
23
|
+
|
|
24
|
+
Set up Visual E2E testing infrastructure with Playwright and screenshot verification workflow for reliable UI development.
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## STEP 0: Gather Context
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
node .agileflow/scripts/obtain-context.js visual-e2e
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
<!-- COMPACT_SUMMARY_START -->
|
|
37
|
+
|
|
38
|
+
## COMPACT SUMMARY - /agileflow:setup:visual-e2e IS ACTIVE
|
|
39
|
+
|
|
40
|
+
**CRITICAL**: You are setting up Visual E2E infrastructure. All 8 steps must complete for working setup.
|
|
41
|
+
|
|
42
|
+
**ROLE**: Visual E2E Infrastructure Bootstrapper - Install Playwright, create config, create example tests with screenshots
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
### RULE #1: ALWAYS USE TodoWrite FOR 8 STEPS
|
|
47
|
+
|
|
48
|
+
Track all steps explicitly:
|
|
49
|
+
```
|
|
50
|
+
1. Check project has package.json
|
|
51
|
+
2. Install Playwright and dependencies
|
|
52
|
+
3. Create playwright.config.ts with webServer
|
|
53
|
+
4. Create tests/e2e/ directory structure
|
|
54
|
+
5. Create screenshots/ directory
|
|
55
|
+
6. Create example e2e test with screenshot capture
|
|
56
|
+
7. Add test:e2e script to package.json
|
|
57
|
+
8. Run example test to verify setup
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Mark each step complete. This ensures comprehensive setup.
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
### RULE #2: SCREENSHOT VERIFICATION WORKFLOW
|
|
65
|
+
|
|
66
|
+
**The key insight**: Tests passing doesn't mean UI looks correct.
|
|
67
|
+
|
|
68
|
+
The Visual Mode workflow:
|
|
69
|
+
1. E2E tests capture screenshots during test runs
|
|
70
|
+
2. Claude reviews each screenshot visually
|
|
71
|
+
3. Claude renames verified screenshots with `verified-` prefix
|
|
72
|
+
4. `screenshot-verifier.js` confirms all screenshots are verified
|
|
73
|
+
5. Ralph Loop requires 2+ iterations in Visual Mode
|
|
74
|
+
|
|
75
|
+
**NEVER** declare UI work complete without visually reviewing screenshots.
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
### RULE #3: PLAYWRIGHT CONFIG WITH WEBSERVER
|
|
80
|
+
|
|
81
|
+
Always configure webServer to auto-start dev server:
|
|
82
|
+
|
|
83
|
+
```typescript
|
|
84
|
+
// playwright.config.ts
|
|
85
|
+
export default defineConfig({
|
|
86
|
+
webServer: {
|
|
87
|
+
command: 'npm run dev',
|
|
88
|
+
url: 'http://localhost:3000',
|
|
89
|
+
reuseExistingServer: !process.env.CI,
|
|
90
|
+
timeout: 120000,
|
|
91
|
+
},
|
|
92
|
+
use: {
|
|
93
|
+
baseURL: 'http://localhost:3000',
|
|
94
|
+
screenshot: 'on', // Capture on every test
|
|
95
|
+
},
|
|
96
|
+
});
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
### RULE #4: EXAMPLE TEST WITH SCREENSHOTS
|
|
102
|
+
|
|
103
|
+
Create working example that captures screenshots:
|
|
104
|
+
|
|
105
|
+
```typescript
|
|
106
|
+
// tests/e2e/visual-example.spec.ts
|
|
107
|
+
import { test, expect } from '@playwright/test';
|
|
108
|
+
|
|
109
|
+
test('homepage visual check', async ({ page }) => {
|
|
110
|
+
await page.goto('/');
|
|
111
|
+
|
|
112
|
+
// Capture screenshot for visual verification
|
|
113
|
+
await page.screenshot({
|
|
114
|
+
path: 'screenshots/homepage.png',
|
|
115
|
+
fullPage: true
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
// Basic assertions
|
|
119
|
+
await expect(page).toHaveTitle(/./);
|
|
120
|
+
});
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
### ANTI-PATTERNS (DON'T DO THESE)
|
|
126
|
+
|
|
127
|
+
- Create config without example test
|
|
128
|
+
- Skip screenshots directory creation
|
|
129
|
+
- Forget webServer config (user has to manually start dev server)
|
|
130
|
+
- Skip running tests after setup
|
|
131
|
+
- Declare UI work done without reviewing screenshots
|
|
132
|
+
|
|
133
|
+
### DO THESE INSTEAD
|
|
134
|
+
|
|
135
|
+
- Create config AND working example test with screenshots
|
|
136
|
+
- Create screenshots/ directory in project root
|
|
137
|
+
- Configure webServer to auto-start dev server
|
|
138
|
+
- Run test after setup to verify and generate initial screenshot
|
|
139
|
+
- Review all screenshots visually before completing UI work
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
### WORKFLOW PHASES
|
|
144
|
+
|
|
145
|
+
**Phase 1: Detection (Step 1)**
|
|
146
|
+
- Check package.json exists
|
|
147
|
+
- Detect dev server command (npm run dev, yarn dev, etc.)
|
|
148
|
+
- Check if Playwright already installed
|
|
149
|
+
|
|
150
|
+
**Phase 2: Installation (Step 2)**
|
|
151
|
+
- Install @playwright/test
|
|
152
|
+
- Install browser with npx playwright install --with-deps chromium
|
|
153
|
+
|
|
154
|
+
**Phase 3: Configuration (Steps 3-5)**
|
|
155
|
+
- Create playwright.config.ts
|
|
156
|
+
- Create tests/e2e/ directory
|
|
157
|
+
- Create screenshots/ directory
|
|
158
|
+
- Add screenshots/ to .gitignore (optional - depends on workflow)
|
|
159
|
+
|
|
160
|
+
**Phase 4: Examples (Step 6)**
|
|
161
|
+
- Create example e2e test with screenshot capture
|
|
162
|
+
- Test should pass immediately
|
|
163
|
+
|
|
164
|
+
**Phase 5: Scripts (Step 7)**
|
|
165
|
+
- Add test:e2e script to package.json
|
|
166
|
+
|
|
167
|
+
**Phase 6: Verification (Step 8)**
|
|
168
|
+
- Run example test
|
|
169
|
+
- Show generated screenshot path
|
|
170
|
+
- Remind about verification workflow
|
|
171
|
+
|
|
172
|
+
---
|
|
173
|
+
|
|
174
|
+
### KEY FILES TO REMEMBER
|
|
175
|
+
|
|
176
|
+
| File | Purpose |
|
|
177
|
+
|------|---------|
|
|
178
|
+
| `playwright.config.ts` | Playwright configuration with webServer |
|
|
179
|
+
| `tests/e2e/visual-example.spec.ts` | Example test with screenshots |
|
|
180
|
+
| `screenshots/` | Directory for test screenshots |
|
|
181
|
+
| `scripts/screenshot-verifier.js` | Verify all screenshots have verified- prefix |
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
### REMEMBER AFTER COMPACTION
|
|
186
|
+
|
|
187
|
+
- `/agileflow:setup:visual-e2e` IS ACTIVE - bootstrap Visual E2E infrastructure
|
|
188
|
+
- Install Playwright with browser dependencies
|
|
189
|
+
- Configure webServer to auto-start dev server
|
|
190
|
+
- Create example test that captures screenshots
|
|
191
|
+
- Create screenshots/ directory
|
|
192
|
+
- Run test after setup to verify
|
|
193
|
+
- Use TodoWrite to track 8 steps
|
|
194
|
+
- Visual Mode = review screenshots + verified- prefix
|
|
195
|
+
|
|
196
|
+
<!-- COMPACT_SUMMARY_END -->
|
|
197
|
+
|
|
198
|
+
## Prompt
|
|
199
|
+
|
|
200
|
+
ROLE: Visual E2E Infrastructure Bootstrapper
|
|
201
|
+
|
|
202
|
+
INPUTS
|
|
203
|
+
DEV_CMD=<command> Dev server command (default: npm run dev)
|
|
204
|
+
PORT=<number> Dev server port (default: 3000)
|
|
205
|
+
BROWSER=chromium Browser to install (default: chromium)
|
|
206
|
+
|
|
207
|
+
ACTIONS
|
|
208
|
+
1) Check project has package.json
|
|
209
|
+
2) Install Playwright and browser dependencies
|
|
210
|
+
3) Create playwright.config.ts with webServer
|
|
211
|
+
4) Create tests/e2e/ directory structure
|
|
212
|
+
5) Create screenshots/ directory
|
|
213
|
+
6) Create example e2e test with screenshot capture
|
|
214
|
+
7) Add test:e2e script to package.json
|
|
215
|
+
8) Run example test to verify setup
|
|
216
|
+
|
|
217
|
+
TODO LIST TRACKING
|
|
218
|
+
**CRITICAL**: Immediately create a todo list using TodoWrite tool to track Visual E2E setup:
|
|
219
|
+
```
|
|
220
|
+
1. Check project has package.json
|
|
221
|
+
2. Install Playwright and browser dependencies
|
|
222
|
+
3. Create playwright.config.ts with webServer
|
|
223
|
+
4. Create tests/e2e/ directory structure
|
|
224
|
+
5. Create screenshots/ directory
|
|
225
|
+
6. Create example e2e test with screenshot capture
|
|
226
|
+
7. Add test:e2e script to package.json
|
|
227
|
+
8. Run example test to verify setup
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
Mark each step complete as you finish it.
|
|
231
|
+
|
|
232
|
+
OBJECTIVE
|
|
233
|
+
Set up Visual E2E testing infrastructure with Playwright and screenshot verification workflow.
|
|
234
|
+
|
|
235
|
+
WHY VISUAL E2E?
|
|
236
|
+
|
|
237
|
+
The problem: **Tests pass but UI is broken.**
|
|
238
|
+
|
|
239
|
+
Functional tests verify behavior but not visual appearance. A button can "work" but be:
|
|
240
|
+
- Wrong color
|
|
241
|
+
- Wrong position
|
|
242
|
+
- Overlapping other elements
|
|
243
|
+
- Missing entirely (replaced by error state)
|
|
244
|
+
|
|
245
|
+
Visual E2E with screenshot verification catches these issues.
|
|
246
|
+
|
|
247
|
+
PLAYWRIGHT CONFIG
|
|
248
|
+
|
|
249
|
+
Create playwright.config.ts:
|
|
250
|
+
```typescript
|
|
251
|
+
import { defineConfig, devices } from '@playwright/test';
|
|
252
|
+
|
|
253
|
+
export default defineConfig({
|
|
254
|
+
testDir: './tests/e2e',
|
|
255
|
+
|
|
256
|
+
// Run tests in parallel
|
|
257
|
+
fullyParallel: true,
|
|
258
|
+
|
|
259
|
+
// Fail the build on CI if you accidentally left test.only
|
|
260
|
+
forbidOnly: !!process.env.CI,
|
|
261
|
+
|
|
262
|
+
// Retry on CI only
|
|
263
|
+
retries: process.env.CI ? 2 : 0,
|
|
264
|
+
|
|
265
|
+
// Opt out of parallel tests on CI
|
|
266
|
+
workers: process.env.CI ? 1 : undefined,
|
|
267
|
+
|
|
268
|
+
// Reporter
|
|
269
|
+
reporter: 'html',
|
|
270
|
+
|
|
271
|
+
use: {
|
|
272
|
+
// Base URL for navigation
|
|
273
|
+
baseURL: 'http://localhost:3000',
|
|
274
|
+
|
|
275
|
+
// Capture screenshot on every test
|
|
276
|
+
screenshot: 'on',
|
|
277
|
+
|
|
278
|
+
// Collect trace on failure
|
|
279
|
+
trace: 'on-first-retry',
|
|
280
|
+
},
|
|
281
|
+
|
|
282
|
+
// Configure webServer to auto-start dev server
|
|
283
|
+
webServer: {
|
|
284
|
+
command: 'npm run dev',
|
|
285
|
+
url: 'http://localhost:3000',
|
|
286
|
+
reuseExistingServer: !process.env.CI,
|
|
287
|
+
timeout: 120000,
|
|
288
|
+
},
|
|
289
|
+
|
|
290
|
+
projects: [
|
|
291
|
+
{
|
|
292
|
+
name: 'chromium',
|
|
293
|
+
use: { ...devices['Desktop Chrome'] },
|
|
294
|
+
},
|
|
295
|
+
],
|
|
296
|
+
});
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
EXAMPLE E2E TEST
|
|
300
|
+
|
|
301
|
+
Create tests/e2e/visual-example.spec.ts:
|
|
302
|
+
```typescript
|
|
303
|
+
import { test, expect } from '@playwright/test';
|
|
304
|
+
|
|
305
|
+
test.describe('Visual Verification Examples', () => {
|
|
306
|
+
test('homepage loads correctly', async ({ page }) => {
|
|
307
|
+
await page.goto('/');
|
|
308
|
+
|
|
309
|
+
// Capture full-page screenshot for visual verification
|
|
310
|
+
await page.screenshot({
|
|
311
|
+
path: 'screenshots/homepage-full.png',
|
|
312
|
+
fullPage: true,
|
|
313
|
+
});
|
|
314
|
+
|
|
315
|
+
// Basic assertions
|
|
316
|
+
await expect(page).toHaveTitle(/./);
|
|
317
|
+
});
|
|
318
|
+
|
|
319
|
+
test('component renders correctly', async ({ page }) => {
|
|
320
|
+
await page.goto('/');
|
|
321
|
+
|
|
322
|
+
// Capture specific element screenshot
|
|
323
|
+
const header = page.locator('header').first();
|
|
324
|
+
if (await header.isVisible()) {
|
|
325
|
+
await header.screenshot({
|
|
326
|
+
path: 'screenshots/header-component.png',
|
|
327
|
+
});
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
// Verify element is visible
|
|
331
|
+
await expect(header).toBeVisible();
|
|
332
|
+
});
|
|
333
|
+
});
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
DIRECTORY STRUCTURE
|
|
337
|
+
|
|
338
|
+
Create:
|
|
339
|
+
```
|
|
340
|
+
tests/
|
|
341
|
+
└── e2e/
|
|
342
|
+
├── visual-example.spec.ts # Example test with screenshots
|
|
343
|
+
└── fixtures/ # Test data if needed
|
|
344
|
+
|
|
345
|
+
screenshots/ # Screenshot output directory
|
|
346
|
+
├── homepage-full.png # After test runs
|
|
347
|
+
└── verified-homepage-full.png # After Claude reviews
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
NPM SCRIPTS
|
|
351
|
+
|
|
352
|
+
Add to package.json:
|
|
353
|
+
```json
|
|
354
|
+
{
|
|
355
|
+
"scripts": {
|
|
356
|
+
"test:e2e": "playwright test",
|
|
357
|
+
"test:e2e:ui": "playwright test --ui",
|
|
358
|
+
"test:e2e:headed": "playwright test --headed"
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
```
|
|
362
|
+
|
|
363
|
+
INSTALLATION
|
|
364
|
+
|
|
365
|
+
```bash
|
|
366
|
+
# Install Playwright
|
|
367
|
+
npm install --save-dev @playwright/test
|
|
368
|
+
|
|
369
|
+
# Install browser (chromium is smallest)
|
|
370
|
+
npx playwright install --with-deps chromium
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
VISUAL VERIFICATION WORKFLOW
|
|
374
|
+
|
|
375
|
+
After running tests:
|
|
376
|
+
|
|
377
|
+
1. **Review screenshots**: Claude reads each screenshot in screenshots/
|
|
378
|
+
2. **Verify visually**: Check that UI looks correct
|
|
379
|
+
3. **Rename verified**: `mv screenshots/homepage.png screenshots/verified-homepage.png`
|
|
380
|
+
4. **Run verifier**: `node scripts/screenshot-verifier.js --path ./screenshots`
|
|
381
|
+
|
|
382
|
+
This ensures Claude actually looked at each screenshot before declaring completion.
|
|
383
|
+
|
|
384
|
+
INTEGRATION WITH RALPH LOOP
|
|
385
|
+
|
|
386
|
+
When using Visual Mode in Ralph Loop:
|
|
387
|
+
```bash
|
|
388
|
+
# Initialize loop with Visual Mode
|
|
389
|
+
node scripts/ralph-loop.js --init --epic=EP-XXXX --visual
|
|
390
|
+
|
|
391
|
+
# Loop checks:
|
|
392
|
+
# 1. npm test passes
|
|
393
|
+
# 2. All screenshots have verified- prefix
|
|
394
|
+
# 3. Minimum 2 iterations completed
|
|
395
|
+
```
|
|
396
|
+
|
|
397
|
+
Visual Mode prevents premature completion promises for UI work.
|
|
398
|
+
|
|
399
|
+
WORKFLOW
|
|
400
|
+
|
|
401
|
+
1. Check for package.json
|
|
402
|
+
2. Show proposed setup plan:
|
|
403
|
+
```
|
|
404
|
+
Will install:
|
|
405
|
+
- @playwright/test
|
|
406
|
+
- chromium browser (~300MB)
|
|
407
|
+
|
|
408
|
+
Will create:
|
|
409
|
+
- playwright.config.ts (with webServer config)
|
|
410
|
+
- tests/e2e/visual-example.spec.ts
|
|
411
|
+
- screenshots/ directory
|
|
412
|
+
|
|
413
|
+
Will update:
|
|
414
|
+
- package.json (add test:e2e scripts)
|
|
415
|
+
```
|
|
416
|
+
|
|
417
|
+
3. Ask: "Proceed with Visual E2E setup? (YES/NO)"
|
|
418
|
+
|
|
419
|
+
4. If YES:
|
|
420
|
+
- Run installations
|
|
421
|
+
- Create config files
|
|
422
|
+
- Create example test
|
|
423
|
+
- Run test to verify setup
|
|
424
|
+
|
|
425
|
+
5. Show results:
|
|
426
|
+
```
|
|
427
|
+
Visual E2E Setup Complete
|
|
428
|
+
|
|
429
|
+
Installed:
|
|
430
|
+
- @playwright/test
|
|
431
|
+
- chromium browser
|
|
432
|
+
|
|
433
|
+
Created:
|
|
434
|
+
- playwright.config.ts
|
|
435
|
+
- tests/e2e/visual-example.spec.ts
|
|
436
|
+
- screenshots/
|
|
437
|
+
|
|
438
|
+
Try running:
|
|
439
|
+
- npm run test:e2e # Run tests
|
|
440
|
+
- npm run test:e2e:headed # Watch tests run
|
|
441
|
+
|
|
442
|
+
Visual Mode workflow:
|
|
443
|
+
1. Run tests: npm run test:e2e
|
|
444
|
+
2. Review screenshots in screenshots/
|
|
445
|
+
3. Rename verified: mv file.png verified-file.png
|
|
446
|
+
4. Verify all: node scripts/screenshot-verifier.js
|
|
447
|
+
```
|
|
448
|
+
|
|
449
|
+
RULES
|
|
450
|
+
- Preview all changes (diff-first, YES/NO)
|
|
451
|
+
- Run test after setup to verify and generate screenshots
|
|
452
|
+
- Configure webServer to auto-start dev server
|
|
453
|
+
- Create working example test with screenshot capture
|
|
454
|
+
- Use chromium only (smallest browser, ~300MB)
|
|
455
|
+
- Remind about verification workflow after setup
|
|
456
|
+
|
|
457
|
+
OUTPUT
|
|
458
|
+
- Setup summary
|
|
459
|
+
- Playwright configuration with webServer
|
|
460
|
+
- Example E2E test with screenshot capture
|
|
461
|
+
- Screenshots directory
|
|
462
|
+
- Instructions for Visual Mode workflow
|
|
@@ -1,6 +1,21 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: Generate a custom skill with web research, cookbook pattern, and MCP integration
|
|
3
3
|
argument-hint: [SKILL_NAME] (optional)
|
|
4
|
+
compact_context:
|
|
5
|
+
priority: high
|
|
6
|
+
preserve_rules:
|
|
7
|
+
- "ACTIVE COMMAND: /agileflow:skill:create - Generates custom research-backed skills"
|
|
8
|
+
- "MUST enter Plan Mode FIRST to research THREE sources: web docs, local docs, codebase patterns"
|
|
9
|
+
- "MUST output to .claude/skills/<skill-name>/ (directly usable by Claude Code)"
|
|
10
|
+
- "MUST include references.md linking web docs, local docs, and codebase patterns"
|
|
11
|
+
- "MUST use cookbook pattern for complex skills (2+ use cases)"
|
|
12
|
+
- "NEVER copy entire docs - reference URLs instead"
|
|
13
|
+
- "CRITICAL: Ask for approval of plan before generating skill files"
|
|
14
|
+
state_fields:
|
|
15
|
+
- skill_name
|
|
16
|
+
- research_sources
|
|
17
|
+
- use_cases_count
|
|
18
|
+
- mcp_server_found
|
|
4
19
|
---
|
|
5
20
|
|
|
6
21
|
# /agileflow:skill:create
|
|
@@ -11,27 +26,67 @@ Generate dynamic, research-backed skills that combine web documentation, user's
|
|
|
11
26
|
|
|
12
27
|
<!-- COMPACT_SUMMARY_START -->
|
|
13
28
|
|
|
14
|
-
##
|
|
29
|
+
## 🚨 COMPACT SUMMARY - /agileflow:skill:create IS ACTIVE
|
|
15
30
|
|
|
16
|
-
**
|
|
31
|
+
**CRITICAL**: This command creates custom skills by researching THREE sources and building research-backed workflows.
|
|
17
32
|
|
|
18
|
-
###
|
|
19
|
-
|
|
20
|
-
2. **Research THREE sources**: Web docs, user's local docs, user's codebase
|
|
21
|
-
3. **Link to external docs** - Reference URLs, don't copy entire docs
|
|
22
|
-
4. **Reference local patterns** - Point to user's existing practices and code
|
|
23
|
-
5. **Use cookbook pattern** for multi-use-case skills
|
|
24
|
-
6. **Output to `.claude/skills/<skill-name>/`** - directly usable by Claude Code
|
|
25
|
-
|
|
26
|
-
### Generated Skill Structure
|
|
33
|
+
### 🚨 RULE #1: Enter Plan Mode First
|
|
34
|
+
ALWAYS start with Plan Mode to explore before generating ANY skill files.
|
|
27
35
|
```
|
|
28
|
-
|
|
29
|
-
├── SKILL.md # Pivot file with references to all sources
|
|
30
|
-
├── cookbook/ # Per-use-case workflows
|
|
31
|
-
├── references.md # Links to web docs + local docs + code patterns
|
|
32
|
-
├── tools/ # Executable scripts (optional)
|
|
33
|
-
└── .mcp.json # MCP server config (if applicable)
|
|
36
|
+
EnterPlanMode
|
|
34
37
|
```
|
|
38
|
+
This prevents wasted generations and gets user approval on research findings.
|
|
39
|
+
|
|
40
|
+
### 🚨 RULE #2: Research Three Sources
|
|
41
|
+
In Plan Mode, research and collect (DON'T generate):
|
|
42
|
+
1. **Web docs**: Official documentation URLs, API reference URLs, best practices links
|
|
43
|
+
2. **Local docs**: Files in `docs/02-practices/`, `docs/04-architecture/`, `docs/03-decisions/`
|
|
44
|
+
3. **Codebase patterns**: Existing code using Glob/Grep to find patterns
|
|
45
|
+
|
|
46
|
+
### 🚨 RULE #3: Link, Never Copy
|
|
47
|
+
- Link to external docs with URLs (don't copy entire docs)
|
|
48
|
+
- Point to local files that exist (don't reference user's docs/02-practices/ directly)
|
|
49
|
+
- Show codebase patterns with file locations and code snippets
|
|
50
|
+
|
|
51
|
+
### 🚨 RULE #4: Output Structure
|
|
52
|
+
Output ALWAYS goes to `.claude/skills/<skill-name>/` with:
|
|
53
|
+
- `SKILL.md` (main file with activation triggers and cookbook references)
|
|
54
|
+
- `references.md` (all documentation links)
|
|
55
|
+
- `cookbook/` directory (one .md per use case)
|
|
56
|
+
- `.mcp.json` (if MCP server found)
|
|
57
|
+
|
|
58
|
+
### 🚨 RULE #5: Cookbook Pattern
|
|
59
|
+
- **Simple skill** (1 use case): SKILL.md only
|
|
60
|
+
- **Complex skill** (2+ use cases): SKILL.md + cookbook/ directory with per-use-case files
|
|
61
|
+
|
|
62
|
+
### 🚨 RULE #6: Get Approval Before Writing
|
|
63
|
+
After research and plan creation:
|
|
64
|
+
1. Show plan findings to user
|
|
65
|
+
2. Ask for approval
|
|
66
|
+
3. Exit Plan Mode with approval
|
|
67
|
+
4. THEN write the skill files
|
|
68
|
+
|
|
69
|
+
### Critical Files Generated
|
|
70
|
+
| File | Purpose | Required? |
|
|
71
|
+
|------|---------|-----------|
|
|
72
|
+
| SKILL.md | Main skill file with activation triggers | Yes |
|
|
73
|
+
| references.md | Links to all web/local/codebase docs | Yes |
|
|
74
|
+
| cookbook/<use-case>.md | Per-use-case workflow | If 2+ cases |
|
|
75
|
+
| .mcp.json | MCP server configuration | If found |
|
|
76
|
+
|
|
77
|
+
### Anti-Patterns
|
|
78
|
+
- ❌ DON'T write skill files without Plan Mode approval
|
|
79
|
+
- ❌ DON'T copy entire external documentation
|
|
80
|
+
- ❌ DON'T reference docs/02-practices/ that user hasn't created
|
|
81
|
+
- ❌ DON'T skip cookbook pattern for complex skills
|
|
82
|
+
- ❌ DON'T forget references.md (critical for user context)
|
|
83
|
+
|
|
84
|
+
### REMEMBER AFTER COMPACTION
|
|
85
|
+
- Skill creation is 5 phases: Requirements → Plan Mode Research → Get Approval → Generate → Write Files
|
|
86
|
+
- Plan Mode research finds URLs and local patterns (don't generate from plan)
|
|
87
|
+
- User must approve plan before ANY files are written
|
|
88
|
+
- Complex skills need cookbook/ for each use case
|
|
89
|
+
- references.md is the pivot file linking all sources
|
|
35
90
|
|
|
36
91
|
<!-- COMPACT_SUMMARY_END -->
|
|
37
92
|
|
|
@@ -564,3 +619,46 @@ If validation fails:
|
|
|
564
619
|
# With skill name hint
|
|
565
620
|
/agileflow:skill:create supabase-swift
|
|
566
621
|
```
|
|
622
|
+
|
|
623
|
+
---
|
|
624
|
+
|
|
625
|
+
## POST-CREATION ACTIONS
|
|
626
|
+
|
|
627
|
+
After successfully creating a skill, offer next steps:
|
|
628
|
+
|
|
629
|
+
```xml
|
|
630
|
+
<invoke name="AskUserQuestion">
|
|
631
|
+
<parameter name="questions">[{
|
|
632
|
+
"question": "Skill '<skill-name>' created! What would you like to do next?",
|
|
633
|
+
"header": "Next Steps",
|
|
634
|
+
"multiSelect": false,
|
|
635
|
+
"options": [
|
|
636
|
+
{"label": "Test the skill (Recommended)", "description": "Verify the skill works correctly"},
|
|
637
|
+
{"label": "View all skills", "description": "See full skill inventory with /agileflow:skill:list"},
|
|
638
|
+
{"label": "Create another skill", "description": "Build another custom skill"},
|
|
639
|
+
{"label": "Done", "description": "Exit"}
|
|
640
|
+
]
|
|
641
|
+
}]</parameter>
|
|
642
|
+
</invoke>
|
|
643
|
+
```
|
|
644
|
+
|
|
645
|
+
**If "Test the skill"**:
|
|
646
|
+
- Run `/agileflow:skill:test SKILL=<skill-name>`
|
|
647
|
+
- Provide sample input scenarios
|
|
648
|
+
- Verify output matches expectations
|
|
649
|
+
|
|
650
|
+
**If "View all skills"**:
|
|
651
|
+
- Run `/agileflow:skill:list`
|
|
652
|
+
|
|
653
|
+
**If "Create another skill"**:
|
|
654
|
+
- Re-run `/agileflow:skill:create`
|
|
655
|
+
|
|
656
|
+
---
|
|
657
|
+
|
|
658
|
+
## Related Commands
|
|
659
|
+
|
|
660
|
+
- `/agileflow:skill:list` - View all installed skills
|
|
661
|
+
- `/agileflow:skill:test` - Test a skill with sample inputs
|
|
662
|
+
- `/agileflow:skill:edit` - Modify an existing skill
|
|
663
|
+
- `/agileflow:skill:delete` - Remove a skill
|
|
664
|
+
- `/agileflow:skill:upgrade` - Update skill with new patterns
|