prizmkit 1.0.131 → 1.0.133
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/bundled/VERSION.json +3 -3
- package/bundled/dev-pipeline/templates/bootstrap-tier1.md +6 -41
- package/bundled/dev-pipeline/templates/bootstrap-tier2.md +6 -41
- package/bundled/dev-pipeline/templates/bootstrap-tier3.md +6 -41
- package/bundled/skills/_metadata.json +1 -1
- package/bundled/skills/app-planner/SKILL.md +46 -259
- package/bundled/skills/dev-pipeline-launcher/SKILL.md +6 -29
- package/package.json +1 -1
- package/src/scaffold.js +6 -5
- package/bundled/dev-pipeline/assets/playwright-cli-reference.md +0 -113
package/bundled/VERSION.json
CHANGED
|
@@ -166,47 +166,12 @@ Key decisions: [list]
|
|
|
166
166
|
|
|
167
167
|
Verify UI behavior using `playwright-cli` before committing. This phase is best-effort — failures are logged but do NOT block the commit.
|
|
168
168
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
playwright-cli --help
|
|
172
|
-
```
|
|
173
|
-
For detailed help on a specific command:
|
|
174
|
-
```bash
|
|
175
|
-
playwright-cli --help <command> # e.g. playwright-cli --help snapshot
|
|
176
|
-
```
|
|
177
|
-
Also read `dev-pipeline/assets/playwright-cli-reference.md` for snapshot format and workflow patterns.
|
|
178
|
-
|
|
179
|
-
1. **Start dev server** (if `setup_command` is specified):
|
|
180
|
-
```bash
|
|
181
|
-
{{BROWSER_SETUP_COMMAND}} &
|
|
182
|
-
DEV_SERVER_PID=$!
|
|
183
|
-
sleep 5 # wait for server to start
|
|
184
|
-
```
|
|
185
|
-
|
|
186
|
-
2. **Open browser and navigate**:
|
|
187
|
-
```bash
|
|
188
|
-
playwright-cli open {{BROWSER_URL}}
|
|
189
|
-
```
|
|
190
|
-
|
|
191
|
-
3. **Take snapshot and execute verify steps**:
|
|
192
|
-
```bash
|
|
193
|
-
playwright-cli snapshot
|
|
194
|
-
```
|
|
195
|
-
Read the snapshot file to identify element refs. Then execute each verify step by mapping the descriptive step to actual refs from the snapshot.
|
|
169
|
+
1. Start dev server if needed: `{{BROWSER_SETUP_COMMAND}}`
|
|
170
|
+
2. Use `playwright-cli` to open `{{BROWSER_URL}}`, then verify:
|
|
196
171
|
{{BROWSER_VERIFY_STEPS}}
|
|
197
|
-
|
|
198
|
-
4.
|
|
199
|
-
|
|
200
|
-
playwright-cli screenshot
|
|
201
|
-
```
|
|
202
|
-
|
|
203
|
-
5. **Close browser and cleanup**:
|
|
204
|
-
```bash
|
|
205
|
-
playwright-cli close
|
|
206
|
-
kill $DEV_SERVER_PID 2>/dev/null || true
|
|
207
|
-
```
|
|
208
|
-
|
|
209
|
-
6. **Log results** — append to `context-snapshot.md`:
|
|
172
|
+
3. Take a final screenshot for evidence.
|
|
173
|
+
4. Close browser and stop dev server.
|
|
174
|
+
5. Append results to `context-snapshot.md`:
|
|
210
175
|
```
|
|
211
176
|
## Browser Verification
|
|
212
177
|
URL: {{BROWSER_URL}}
|
|
@@ -215,7 +180,7 @@ Also read `dev-pipeline/assets/playwright-cli-reference.md` for snapshot format
|
|
|
215
180
|
Result: PASS / FAIL (reason)
|
|
216
181
|
```
|
|
217
182
|
|
|
218
|
-
If any step fails, log the failure and continue
|
|
183
|
+
If any step fails, log the failure and continue. Do NOT retry browser verification.
|
|
219
184
|
{{END_IF_BROWSER_INTERACTION}}
|
|
220
185
|
|
|
221
186
|
### Phase 4: Architecture Sync & Commit (SINGLE COMMIT)
|
|
@@ -280,47 +280,12 @@ If GATE:MISSING — send message to Reviewer (re-spawn if needed): "Write the '#
|
|
|
280
280
|
|
|
281
281
|
Verify UI behavior using `playwright-cli` before committing. This phase is best-effort — failures are logged but do NOT block the commit.
|
|
282
282
|
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
playwright-cli --help
|
|
286
|
-
```
|
|
287
|
-
For detailed help on a specific command:
|
|
288
|
-
```bash
|
|
289
|
-
playwright-cli --help <command> # e.g. playwright-cli --help snapshot
|
|
290
|
-
```
|
|
291
|
-
Also read `dev-pipeline/assets/playwright-cli-reference.md` for snapshot format and workflow patterns.
|
|
292
|
-
|
|
293
|
-
1. **Start dev server** (if `setup_command` is specified):
|
|
294
|
-
```bash
|
|
295
|
-
{{BROWSER_SETUP_COMMAND}} &
|
|
296
|
-
DEV_SERVER_PID=$!
|
|
297
|
-
sleep 5 # wait for server to start
|
|
298
|
-
```
|
|
299
|
-
|
|
300
|
-
2. **Open browser and navigate**:
|
|
301
|
-
```bash
|
|
302
|
-
playwright-cli open {{BROWSER_URL}}
|
|
303
|
-
```
|
|
304
|
-
|
|
305
|
-
3. **Take snapshot and execute verify steps**:
|
|
306
|
-
```bash
|
|
307
|
-
playwright-cli snapshot
|
|
308
|
-
```
|
|
309
|
-
Read the snapshot file to identify element refs. Then execute each verify step by mapping the descriptive step to actual refs from the snapshot.
|
|
283
|
+
1. Start dev server if needed: `{{BROWSER_SETUP_COMMAND}}`
|
|
284
|
+
2. Use `playwright-cli` to open `{{BROWSER_URL}}`, then verify:
|
|
310
285
|
{{BROWSER_VERIFY_STEPS}}
|
|
311
|
-
|
|
312
|
-
4.
|
|
313
|
-
|
|
314
|
-
playwright-cli screenshot
|
|
315
|
-
```
|
|
316
|
-
|
|
317
|
-
5. **Close browser and cleanup**:
|
|
318
|
-
```bash
|
|
319
|
-
playwright-cli close
|
|
320
|
-
kill $DEV_SERVER_PID 2>/dev/null || true
|
|
321
|
-
```
|
|
322
|
-
|
|
323
|
-
6. **Log results** — append to `context-snapshot.md`:
|
|
286
|
+
3. Take a final screenshot for evidence.
|
|
287
|
+
4. Close browser and stop dev server.
|
|
288
|
+
5. Append results to `context-snapshot.md`:
|
|
324
289
|
```
|
|
325
290
|
## Browser Verification
|
|
326
291
|
URL: {{BROWSER_URL}}
|
|
@@ -329,7 +294,7 @@ Also read `dev-pipeline/assets/playwright-cli-reference.md` for snapshot format
|
|
|
329
294
|
Result: PASS / FAIL (reason)
|
|
330
295
|
```
|
|
331
296
|
|
|
332
|
-
If any step fails, log the failure and continue
|
|
297
|
+
If any step fails, log the failure and continue. Do NOT retry browser verification.
|
|
333
298
|
{{END_IF_BROWSER_INTERACTION}}
|
|
334
299
|
|
|
335
300
|
### Phase 6: Architecture Sync & Commit (SINGLE COMMIT)
|
|
@@ -380,47 +380,12 @@ If GATE:MISSING — send message to Reviewer (re-spawn if needed): "Write the '#
|
|
|
380
380
|
|
|
381
381
|
Verify UI behavior using `playwright-cli` before committing. This phase is best-effort — failures are logged but do NOT block the commit.
|
|
382
382
|
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
playwright-cli --help
|
|
386
|
-
```
|
|
387
|
-
For detailed help on a specific command:
|
|
388
|
-
```bash
|
|
389
|
-
playwright-cli --help <command> # e.g. playwright-cli --help snapshot
|
|
390
|
-
```
|
|
391
|
-
Also read `dev-pipeline/assets/playwright-cli-reference.md` for snapshot format and workflow patterns.
|
|
392
|
-
|
|
393
|
-
1. **Start dev server** (if `setup_command` is specified):
|
|
394
|
-
```bash
|
|
395
|
-
{{BROWSER_SETUP_COMMAND}} &
|
|
396
|
-
DEV_SERVER_PID=$!
|
|
397
|
-
sleep 5 # wait for server to start
|
|
398
|
-
```
|
|
399
|
-
|
|
400
|
-
2. **Open browser and navigate**:
|
|
401
|
-
```bash
|
|
402
|
-
playwright-cli open {{BROWSER_URL}}
|
|
403
|
-
```
|
|
404
|
-
|
|
405
|
-
3. **Take snapshot and execute verify steps**:
|
|
406
|
-
```bash
|
|
407
|
-
playwright-cli snapshot
|
|
408
|
-
```
|
|
409
|
-
Read the snapshot file to identify element refs. Then execute each verify step by mapping the descriptive step to actual refs from the snapshot.
|
|
383
|
+
1. Start dev server if needed: `{{BROWSER_SETUP_COMMAND}}`
|
|
384
|
+
2. Use `playwright-cli` to open `{{BROWSER_URL}}`, then verify:
|
|
410
385
|
{{BROWSER_VERIFY_STEPS}}
|
|
411
|
-
|
|
412
|
-
4.
|
|
413
|
-
|
|
414
|
-
playwright-cli screenshot
|
|
415
|
-
```
|
|
416
|
-
|
|
417
|
-
5. **Close browser and cleanup**:
|
|
418
|
-
```bash
|
|
419
|
-
playwright-cli close
|
|
420
|
-
kill $DEV_SERVER_PID 2>/dev/null || true
|
|
421
|
-
```
|
|
422
|
-
|
|
423
|
-
6. **Log results** — append to `context-snapshot.md`:
|
|
386
|
+
3. Take a final screenshot for evidence.
|
|
387
|
+
4. Close browser and stop dev server.
|
|
388
|
+
5. Append results to `context-snapshot.md`:
|
|
424
389
|
```
|
|
425
390
|
## Browser Verification
|
|
426
391
|
URL: {{BROWSER_URL}}
|
|
@@ -429,7 +394,7 @@ Also read `dev-pipeline/assets/playwright-cli-reference.md` for snapshot format
|
|
|
429
394
|
Result: PASS / FAIL (reason)
|
|
430
395
|
```
|
|
431
396
|
|
|
432
|
-
If any step fails, log the failure and continue
|
|
397
|
+
If any step fails, log the failure and continue. Do NOT retry browser verification.
|
|
433
398
|
{{END_IF_BROWSER_INTERACTION}}
|
|
434
399
|
|
|
435
400
|
|
|
@@ -11,6 +11,20 @@ Plan deliverable features for dev-pipeline in two modes:
|
|
|
11
11
|
|
|
12
12
|
Always produce a validated `feature-list.json` that conforms to `dev-pipeline-feature-list`.
|
|
13
13
|
|
|
14
|
+
## Invocation Commitment (Hard Rule)
|
|
15
|
+
|
|
16
|
+
**When the user invokes `/app-planner`, you MUST execute the app-planner workflow.** You must NEVER:
|
|
17
|
+
- Decide on the user's behalf that the task "doesn't need app-planner"
|
|
18
|
+
- Skip app-planner to jump directly to spec/plan/implement or any other skill
|
|
19
|
+
- Bypass the interactive phases because you judge the task to be "simple" or "obvious"
|
|
20
|
+
|
|
21
|
+
If you believe the task is better suited for a different workflow (e.g., fast path via `/prizmkit-plan`), you MUST:
|
|
22
|
+
1. **Explain why** you think a different path is more appropriate
|
|
23
|
+
2. **Ask the user explicitly** whether they want to switch or continue with app-planner
|
|
24
|
+
3. **Only switch if the user confirms** — otherwise proceed with app-planner as invoked
|
|
25
|
+
|
|
26
|
+
The user chose this skill intentionally. Respect that choice.
|
|
27
|
+
|
|
14
28
|
## Scope Boundary (Hard Rule)
|
|
15
29
|
|
|
16
30
|
**This skill is PLANNING ONLY.** You must NEVER:
|
|
@@ -39,10 +53,7 @@ Trigger this skill for requests like:
|
|
|
39
53
|
- "Prepare feature-list.json", "Prepare dev-pipeline input"
|
|
40
54
|
- "Reprioritize features", "Split features"
|
|
41
55
|
|
|
42
|
-
Do NOT use this skill when
|
|
43
|
-
- user only wants to run pipeline now (invoke `dev-pipeline-launcher`)
|
|
44
|
-
- user is debugging/refactoring unrelated to feature planning
|
|
45
|
-
- user wants to write or modify source code directly
|
|
56
|
+
Do NOT use this skill when the user only wants to run the pipeline (`dev-pipeline-launcher`), is debugging/refactoring, or wants to write source code directly.
|
|
46
57
|
|
|
47
58
|
## Resource Loading Rules (Mandatory)
|
|
48
59
|
|
|
@@ -55,13 +66,18 @@ Do NOT use this skill when:
|
|
|
55
66
|
2. **Use shared quality examples as needed**:
|
|
56
67
|
- read `assets/planning-guide.md` for decomposition and acceptance criteria patterns
|
|
57
68
|
|
|
58
|
-
3. **
|
|
69
|
+
3. **Load on-demand references when triggered**:
|
|
70
|
+
- Validation errors or interrupted session → read `references/error-recovery.md`
|
|
71
|
+
- Architecture decisions emerged → read `references/architecture-decisions.md`
|
|
72
|
+
- Browser interaction fields needed → read `references/browser-interaction.md`
|
|
73
|
+
|
|
74
|
+
4. **Always validate output via script**:
|
|
59
75
|
- run:
|
|
60
76
|
```bash
|
|
61
77
|
python3 ${SKILL_DIR}/scripts/validate-and-generate.py validate --input <output-path> --mode <new|incremental>
|
|
62
78
|
```
|
|
63
79
|
|
|
64
|
-
|
|
80
|
+
5. **Use script output as source of truth**:
|
|
65
81
|
- if validation fails, fix and re-run until pass
|
|
66
82
|
|
|
67
83
|
## Prerequisites
|
|
@@ -157,56 +173,11 @@ Checkpoints catch cascading errors early — skipping one means the next phase b
|
|
|
157
173
|
| **CP-AP-4** | `feature-list.json` Generated | Schema validates, all required keys present | 6-7 |
|
|
158
174
|
| **CP-AP-5** | Final Validation Pass | Python script returns `"valid": true` with zero errors | 8 |
|
|
159
175
|
|
|
160
|
-
**Resume Detection**:
|
|
176
|
+
**Resume Detection**: If existing artifacts are found, read `references/error-recovery.md` §Resume Support for checkpoint-based resumption.
|
|
161
177
|
|
|
162
178
|
## Architecture Decision Capture
|
|
163
179
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
### What Qualifies (ALL must apply)
|
|
167
|
-
|
|
168
|
-
Only capture decisions that are **framework-shaping** — NOT individual feature details. Qualifying categories:
|
|
169
|
-
|
|
170
|
-
| Category | Examples |
|
|
171
|
-
|----------|----------|
|
|
172
|
-
| Tech stack choices | PostgreSQL over MongoDB, React over Vue, Node.js runtime |
|
|
173
|
-
| Communication patterns | REST vs GraphQL, WebSocket vs SSE vs polling |
|
|
174
|
-
| Architectural patterns | Monorepo, microservices, monolith, event-driven |
|
|
175
|
-
| Data model strategies | Relational vs document, event sourcing, CQRS |
|
|
176
|
-
| Security architecture | JWT vs session, OAuth provider, RBAC model |
|
|
177
|
-
|
|
178
|
-
**Do NOT capture**: individual feature implementation details, UI component choices, specific API endpoint designs, or anything scoped to a single feature.
|
|
179
|
-
|
|
180
|
-
**This is conditional** — most planning sessions will NOT produce architecture decisions. Only capture when genuinely impactful decisions are made during the discussion.
|
|
181
|
-
|
|
182
|
-
### When to Capture
|
|
183
|
-
|
|
184
|
-
After Phase 5 (DAG verification), before Phase 6 (JSON generation). At this point decisions are settled.
|
|
185
|
-
|
|
186
|
-
### How to Capture
|
|
187
|
-
|
|
188
|
-
1. **Detect platform** — determine which project instruction file to update:
|
|
189
|
-
- `.claude/` directory exists → append to `CLAUDE.md`
|
|
190
|
-
- `.codebuddy/` directory exists → append to `CODEBUDDY.md`
|
|
191
|
-
- Both exist → append to both
|
|
192
|
-
- Neither exists → skip (no project instruction file)
|
|
193
|
-
|
|
194
|
-
2. **Check for existing section** — read the target file and look for `### Architecture Decisions` heading:
|
|
195
|
-
- If heading exists → append new entries below it (avoid duplicates with existing entries)
|
|
196
|
-
- If heading does not exist → create it at the end of the file
|
|
197
|
-
|
|
198
|
-
3. **Format** — one line per decision, no feature IDs:
|
|
199
|
-
```markdown
|
|
200
|
-
### Architecture Decisions
|
|
201
|
-
- WebSocket for real-time: sub-second latency required for collaboration features
|
|
202
|
-
- PostgreSQL: relational data model with complex queries, ACID compliance needed
|
|
203
|
-
- Monorepo structure: shared types between frontend and backend
|
|
204
|
-
```
|
|
205
|
-
|
|
206
|
-
4. **User confirmation** — before writing, show the collected decisions and ask:
|
|
207
|
-
> "These architecture decisions were identified during planning. Record them to [CLAUDE.md / CODEBUDDY.md]? (Y/n)"
|
|
208
|
-
|
|
209
|
-
If user declines, skip without further prompting.
|
|
180
|
+
After Phase 5, if framework-shaping architecture decisions emerged during planning (tech stack, communication patterns, data model strategies — not individual feature details), read `references/architecture-decisions.md` and follow the capture flow. Most sessions will NOT produce architecture decisions — only capture when genuinely impactful.
|
|
210
181
|
|
|
211
182
|
## Fast Path — Incremental Shortcuts
|
|
212
183
|
|
|
@@ -222,11 +193,12 @@ For simple incremental planning, skip detailed Phase 2-3 analysis to accelerate
|
|
|
222
193
|
|
|
223
194
|
### Fast Path Workflow
|
|
224
195
|
1. Read existing `feature-list.json` and confirm scope
|
|
225
|
-
2.
|
|
226
|
-
3.
|
|
227
|
-
4.
|
|
228
|
-
5.
|
|
229
|
-
6. If
|
|
196
|
+
2. **User confirmation (mandatory)** — Tell the user: "This qualifies for fast-path (simple incremental addition). Skip detailed Phase 2-3 analysis and draft directly? Or use full workflow?" Only proceed with fast path if user confirms.
|
|
197
|
+
3. Generate next sequential feature IDs
|
|
198
|
+
4. Draft features (title + description + acceptance_criteria + dependencies)
|
|
199
|
+
5. Run validation script immediately
|
|
200
|
+
6. If valid → summarize and recommend next step
|
|
201
|
+
7. If invalid → apply fixes, re-validate (max 2 attempts, then escalate to full workflow)
|
|
230
202
|
|
|
231
203
|
### When NOT to Use Fast Path
|
|
232
204
|
- New app planning (always use full workflow)
|
|
@@ -238,59 +210,25 @@ For simple incremental planning, skip detailed Phase 2-3 analysis to accelerate
|
|
|
238
210
|
### Example Fast Path Session
|
|
239
211
|
```
|
|
240
212
|
User: "Add email verification to existing user module."
|
|
241
|
-
AI: [Detects incremental mode]
|
|
213
|
+
AI: [Detects incremental mode]
|
|
242
214
|
AI: [Checks existing plan: found 8 features, user module exists]
|
|
243
215
|
AI: [Qualifies for fast path: 1 feature, low complexity, ≤2 deps]
|
|
244
|
-
AI: "
|
|
216
|
+
AI: "This qualifies for fast-path. Skip detailed analysis and draft directly? Or use full workflow?"
|
|
217
|
+
User: "Fast path is fine."
|
|
218
|
+
AI: "Drafting F-009..."
|
|
245
219
|
AI: [Validates immediately]
|
|
246
220
|
AI: "Ready to proceed to dev-pipeline."
|
|
247
221
|
```
|
|
248
222
|
|
|
249
223
|
## Browser Interaction Planning
|
|
250
224
|
|
|
251
|
-
For
|
|
252
|
-
|
|
253
|
-
### When to Suggest
|
|
225
|
+
For features with user-visible UI (pages, forms, modals), optionally add `browser_interaction` for automated playwright-cli verification in the pipeline.
|
|
254
226
|
|
|
255
|
-
Suggest
|
|
256
|
-
|
|
257
|
-
- The feature produces user-visible UI (pages, forms, modals, navigation flows)
|
|
258
|
-
- The acceptance criteria reference visual/interactive behavior (e.g., "user sees...", "clicking X shows Y")
|
|
227
|
+
**Suggest when**: web frontend + user-visible UI + acceptance criteria reference visual/interactive behavior.
|
|
228
|
+
**Do NOT suggest for**: backend-only, config/setup, or non-UI features.
|
|
259
229
|
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
- Config/setup/scaffolding features
|
|
263
|
-
- Features where UI is not the primary deliverable
|
|
264
|
-
|
|
265
|
-
### How to Capture
|
|
266
|
-
|
|
267
|
-
During Phase 4 (refine descriptions and acceptance criteria), for qualifying features ask:
|
|
268
|
-
|
|
269
|
-
> "This feature has UI behavior. Want to add browser verification so the pipeline can auto-check it after implementation? (Y/n)"
|
|
270
|
-
|
|
271
|
-
If yes, generate the `browser_interaction` object:
|
|
272
|
-
|
|
273
|
-
```json
|
|
274
|
-
{
|
|
275
|
-
"browser_interaction": {
|
|
276
|
-
"url": "http://localhost:3000/login",
|
|
277
|
-
"setup_command": "npm run dev",
|
|
278
|
-
"verify_steps": [
|
|
279
|
-
"snapshot",
|
|
280
|
-
"click <ref> — click login button",
|
|
281
|
-
"fill <ref> 'test@example.com' — enter email",
|
|
282
|
-
"screenshot"
|
|
283
|
-
],
|
|
284
|
-
"screenshot": true
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
```
|
|
288
|
-
|
|
289
|
-
**Rules:**
|
|
290
|
-
- `url` is required — the page URL to verify
|
|
291
|
-
- `setup_command` is optional — command to start dev server (omit if already running)
|
|
292
|
-
- `verify_steps` are descriptive placeholders — the actual `ref` IDs are resolved at runtime by `playwright-cli snapshot`. Use natural language descriptions (e.g., "click login button") that the pipeline agent will map to real refs.
|
|
293
|
-
- `screenshot` defaults to `true` — capture final state for human review
|
|
230
|
+
During Phase 4, ask qualifying features: "Want to add browser verification? (Y/n)"
|
|
231
|
+
If yes → read `references/browser-interaction.md` for the `browser_interaction` object format and field rules.
|
|
294
232
|
|
|
295
233
|
## Output Rules
|
|
296
234
|
|
|
@@ -325,166 +263,15 @@ Recommend these three options in this strict order:
|
|
|
325
263
|
|
|
326
264
|
When launcher is available, do not prioritize raw scripts.
|
|
327
265
|
|
|
328
|
-
## Error Recovery
|
|
329
|
-
|
|
330
|
-
Structured error handling for interrupted sessions and validation failures.
|
|
331
|
-
|
|
332
|
-
### Validation Failures
|
|
333
|
-
|
|
334
|
-
When `python3 scripts/validate-and-generate.py validate --input <file> --mode <mode>` returns errors:
|
|
335
|
-
|
|
336
|
-
#### Parse validation output
|
|
337
|
-
Script returns JSON with `"valid": false`, `"errors": [...]`, `"warnings": [...]`
|
|
338
|
-
|
|
339
|
-
#### Decision Tree
|
|
340
|
-
|
|
341
|
-
**if `error_count == 0` (warnings only):**
|
|
342
|
-
- Proceed with user approval
|
|
343
|
-
- Show warnings and ask: "Continue? (Y/n)"
|
|
344
|
-
|
|
345
|
-
**elif `error_count > 0` (critical errors):**
|
|
346
|
-
|
|
347
|
-
Group errors by type and apply targeted fixes:
|
|
348
|
-
|
|
349
|
-
| Error Type | Symptom | Fix Offered | Auto-Fix? |
|
|
350
|
-
|-----------|---------|------------|-----------|
|
|
351
|
-
| **Schema mismatch** | `$schema` invalid, missing `app_name`, wrong `features` type | "Set `$schema` to `dev-pipeline-feature-list-v1`, `app_name` to string" | Yes |
|
|
352
|
-
| **Feature ID issues** | Invalid format (not `F-NNN`), duplicate IDs, undefined refs | "Suggest corrected IDs, show duplicates" | Yes |
|
|
353
|
-
| **Dependency errors** | Circular dependency, undefined target features | "Show cycle chain (e.g., `F-003 → F-005 → F-003`), suggest break point" | No |
|
|
354
|
-
| **Missing fields** | Feature missing required keys (title, description, AC) | "List each feature + missing keys, guide patch" | Partial |
|
|
355
|
-
| **Insufficient AC** | Feature has <2 acceptance criteria | "Show feature, suggest AC examples" | No |
|
|
356
|
-
| **Invalid values** | complexity not in [low/medium/high], status not pending | "Show field, valid values" | Yes |
|
|
357
|
-
|
|
358
|
-
#### Execution
|
|
359
|
-
|
|
360
|
-
```
|
|
361
|
-
For auto-fixable errors:
|
|
362
|
-
1. Show summary: "Found N schema/ID/format issues"
|
|
363
|
-
2. Offer: auto-fix? (Y/n)
|
|
364
|
-
3. Apply fix → regenerate file
|
|
365
|
-
4. Re-run validation
|
|
366
|
-
5. If new errors → loop (max 2 more attempts)
|
|
367
|
-
|
|
368
|
-
For manual fixes (dependencies, AC content):
|
|
369
|
-
1. Show concise prompt: "Edit line X-Y in feature-list.json"
|
|
370
|
-
2. Wait for user action
|
|
371
|
-
3. Retry validation (max 2 more attempts)
|
|
372
|
-
|
|
373
|
-
if all_retries_exceeded:
|
|
374
|
-
→ Escalate: "After 3 attempts, validation still fails.
|
|
375
|
-
(a) Review file manually, OR
|
|
376
|
-
(b) Restart planning from Phase 1"
|
|
377
|
-
```
|
|
378
|
-
|
|
379
|
-
### Interrupted Planning Resume
|
|
380
|
-
|
|
381
|
-
| Scenario | Detection | Action |
|
|
382
|
-
|----------|-----------|--------|
|
|
383
|
-
| Partial `feature-list.json` exists | File found in working dir | Read file, show summary, ask: "Resume from checkpoint or restart?" |
|
|
384
|
-
| Checkpoint CP-AP-4 passed | File generates valid schema | Offer: "Jump to Phase 7 (final validation)" |
|
|
385
|
-
| Checkpoint CP-AP-5 passed | Full validation passes | Offer: "Feature plan complete, proceed to dev-pipeline" |
|
|
386
|
-
| User restarts mid-session | User says "restart" | Return to Phase 1 Vision, or load previous checkpoint if requested |
|
|
387
|
-
| Max validation retries exceeded | 3 failed validation loops | Offer: (a) manual review, (b) restart from Phase 1 |
|
|
388
|
-
|
|
389
|
-
### Incremental Mode Abort
|
|
390
|
-
|
|
391
|
-
If in Incremental mode but existing `feature-list.json` not found:
|
|
392
|
-
- Ask: "Start new plan or provide existing file?"
|
|
393
|
-
- If new plan chosen → switch to Route A (New App Planning)
|
|
394
|
-
- If existing file uploaded → continue Route B
|
|
395
|
-
|
|
396
|
-
## Incremental Feature Planning — Style Matching
|
|
397
|
-
|
|
398
|
-
When appending features to an existing plan, preserve style and detail level automatically.
|
|
399
|
-
|
|
400
|
-
### Style Detection (Automatic)
|
|
401
|
-
|
|
402
|
-
Before drafting new features, analyze existing plan:
|
|
403
|
-
|
|
404
|
-
1. **Language Detection**
|
|
405
|
-
- Scan `title` and `description` fields
|
|
406
|
-
- If >70% English titles → default to English
|
|
407
|
-
- If >70% Chinese titles → suggest Chinese (or allow bilingual)
|
|
408
|
-
|
|
409
|
-
2. **Description Density**
|
|
410
|
-
- Calculate avg word count per description
|
|
411
|
-
- If avg <30 words → draft concise descriptions
|
|
412
|
-
- If avg 30-80 words → draft standard detail
|
|
413
|
-
- If avg >80 words → draft detailed descriptions
|
|
414
|
-
|
|
415
|
-
3. **Acceptance Criteria Patterns**
|
|
416
|
-
- Count avg AC per feature
|
|
417
|
-
- Identify dominant format (Given/When/Then Gherkin, BDD, or loose)
|
|
418
|
-
- Draft new AC in same format
|
|
419
|
-
|
|
420
|
-
4. **Complexity Distribution**
|
|
421
|
-
- Count low/medium/high distribution in existing features
|
|
422
|
-
- Alert if new features deviate significantly (>20 percentile points)
|
|
423
|
-
- Suggest rebalancing if needed
|
|
424
|
-
|
|
425
|
-
### Style Consistency Prompt
|
|
426
|
-
|
|
427
|
-
If new features deviate significantly from detected style:
|
|
428
|
-
|
|
429
|
-
```
|
|
430
|
-
"Your new features use avg X words/description, but existing features use Y.
|
|
431
|
-
Current ratio: low:M%, medium:N%, high:O%.
|
|
432
|
-
Adjust new features to match? (Y/n)"
|
|
433
|
-
```
|
|
434
|
-
|
|
435
|
-
Accept user choice, then adjust draft accordingly before Phase 6 (JSON generation).
|
|
436
|
-
|
|
437
|
-
## Resume Support
|
|
438
|
-
|
|
439
|
-
App-planner sessions can be resumed from the last completed checkpoint without losing context.
|
|
440
|
-
|
|
441
|
-
### Detection Logic
|
|
442
|
-
|
|
443
|
-
Check for artifact files in working directory:
|
|
444
|
-
|
|
445
|
-
| Artifacts Found | Last Completed Checkpoint | Next Phase | Resume Action |
|
|
446
|
-
|-----------------|--------------------------|-----------|----------------|
|
|
447
|
-
| None | (new session) | Phase 1: Vision | Start fresh planning |
|
|
448
|
-
| `feature-list.json` exists | CP-AP-4 (file generated) | Phase 7: Final validation | Offer to validate or extend |
|
|
449
|
-
| `feature-list.json` + validation passed | CP-AP-5 (validation pass) | Handoff: dev-pipeline | Offer: execute pipeline now |
|
|
450
|
-
| Partial state (incomplete file) | CP-AP-2 or CP-AP-3 | Next phase after last checkpoint | Resume interactive planning |
|
|
451
|
-
|
|
452
|
-
### Resume Command (Project Structure)
|
|
453
|
-
|
|
454
|
-
For projects using `.prizmkit/` structure:
|
|
455
|
-
|
|
456
|
-
```bash
|
|
457
|
-
# Explicit resume (if file is not in current directory):
|
|
458
|
-
app-planner --resume-from <path-to-existing-feature-list.json>
|
|
459
|
-
```
|
|
460
|
-
|
|
461
|
-
AI detects existing file → suggests:
|
|
462
|
-
```
|
|
463
|
-
"Existing plan found with N features, M newly added.
|
|
464
|
-
Resume incremental planning? (Y/n)"
|
|
465
|
-
```
|
|
466
|
-
|
|
467
|
-
### Artifact Path Convention
|
|
468
|
-
|
|
469
|
-
**CRITICAL PATH RULE**: `feature-list.json` MUST be written to the project root directory
|
|
470
|
-
(same level as `package.json` / `.git`).
|
|
471
|
-
|
|
472
|
-
Before writing, verify: `ls package.json .git 2>/dev/null` — if these exist in the current
|
|
473
|
-
directory, you are at the project root. NEVER write to `dev-pipeline/` or any subdirectory.
|
|
474
|
-
|
|
475
|
-
After writing, verify: `ls -la feature-list.json` from project root.
|
|
476
|
-
|
|
477
|
-
```
|
|
478
|
-
<project-root>/
|
|
479
|
-
├── feature-list.json # Primary output (always here, at project root)
|
|
480
|
-
└── .prizmkit/planning/ # Optional organization for backups
|
|
481
|
-
├── feature-list.validated.json # Checkpoint backup after CP-AP-5
|
|
482
|
-
└── <ISO-timestamp>.backup.json # Optional incremental backups
|
|
483
|
-
```
|
|
266
|
+
## Error Recovery & Resume
|
|
484
267
|
|
|
485
|
-
|
|
268
|
+
If validation fails or a session is interrupted → read `references/error-recovery.md` for the full error type table, decision tree, retry logic, and checkpoint-based resume support.
|
|
486
269
|
|
|
487
|
-
|
|
270
|
+
Key behaviors:
|
|
271
|
+
- Warnings only → proceed with user approval
|
|
272
|
+
- Critical errors → group by type, auto-fix where possible, max 3 total attempts
|
|
273
|
+
- Interrupted session → detect checkpoint from existing artifacts, offer resume or restart
|
|
274
|
+
- `feature-list.json` MUST be written to project root (same level as `package.json` / `.git`)
|
|
488
275
|
|
|
489
276
|
## Session Exit Gate
|
|
490
277
|
|
|
@@ -324,39 +324,16 @@ After pipeline completion, if features have `browser_interaction` fields and `pl
|
|
|
324
324
|
|
|
325
325
|
2. **Ask user**: "N features have browser verification configured. Run playwright-cli verification now? (Y/n)"
|
|
326
326
|
|
|
327
|
-
3. **If yes**,
|
|
328
|
-
|
|
329
|
-
playwright-cli
|
|
330
|
-
|
|
331
|
-
Then read `dev-pipeline/assets/playwright-cli-reference.md` for snapshot format and workflow patterns. For each qualifying feature:
|
|
332
|
-
```bash
|
|
333
|
-
# Start dev server if setup_command is specified
|
|
334
|
-
# (run in background, wait for port to be ready)
|
|
335
|
-
|
|
336
|
-
# Open browser and navigate
|
|
337
|
-
playwright-cli open <url>
|
|
338
|
-
|
|
339
|
-
# Take initial snapshot
|
|
340
|
-
playwright-cli snapshot
|
|
341
|
-
|
|
342
|
-
# Execute verify_steps (if specified) — these are descriptive;
|
|
343
|
-
# map them to actual refs from the snapshot
|
|
344
|
-
# e.g., "click login button" → find button ref in snapshot → playwright-cli click <ref>
|
|
345
|
-
|
|
346
|
-
# Take final screenshot
|
|
347
|
-
playwright-cli screenshot
|
|
348
|
-
|
|
349
|
-
# Close browser
|
|
350
|
-
playwright-cli close
|
|
351
|
-
```
|
|
327
|
+
3. **If yes**, for each qualifying feature:
|
|
328
|
+
- Start dev server if `setup_command` is specified
|
|
329
|
+
- Use `playwright-cli` to open the URL, execute `verify_steps`, and take a screenshot
|
|
330
|
+
- Close browser and stop dev server
|
|
352
331
|
|
|
353
332
|
4. **Report results**:
|
|
354
333
|
- For each feature: URL opened, steps executed, screenshot path
|
|
355
|
-
- If any step fails
|
|
334
|
+
- If any step fails: flag as verification failure
|
|
356
335
|
- Screenshots are saved to `.playwright-cli/` for user review
|
|
357
336
|
|
|
358
|
-
5. **Cleanup**: Stop any dev servers started by `setup_command`
|
|
359
|
-
|
|
360
337
|
**Important**: Browser verification is best-effort — failures here do NOT change the feature's pipeline status. They serve as visual confirmation aids for the user.
|
|
361
338
|
|
|
362
339
|
---
|
|
@@ -373,7 +350,7 @@ After pipeline completion, if features have `browser_interaction` fields and `pl
|
|
|
373
350
|
| Launch failed (process died immediately) | Show last 20 lines of log: `tail -20 dev-pipeline/state/pipeline-daemon.log` |
|
|
374
351
|
| Feature stuck/blocked | Use `retry-feature.sh <F-XXX>` to retry; use `reset-feature.sh <F-XXX> --clean --run` for fresh start |
|
|
375
352
|
| All features blocked/failed | Show status, suggest daemon-safe recovery: `dev-pipeline/reset-feature.sh <F-XXX> --clean --run feature-list.json` |
|
|
376
|
-
| `playwright-cli` not installed | Browser verification skipped (non-blocking). Suggest: `npm install -g @playwright/cli@latest` |
|
|
353
|
+
| `playwright-cli` not installed | Browser verification skipped (non-blocking). Suggest: `npm install -g @playwright/cli@latest && playwright-cli install --skills` |
|
|
377
354
|
| Permission denied on script | Run `chmod +x dev-pipeline/launch-daemon.sh dev-pipeline/run.sh` |
|
|
378
355
|
|
|
379
356
|
### Integration Notes
|
package/package.json
CHANGED
package/src/scaffold.js
CHANGED
|
@@ -697,7 +697,7 @@ export async function installGitignore(projectRoot, options, dryRun) {
|
|
|
697
697
|
// ============================================================
|
|
698
698
|
|
|
699
699
|
/**
|
|
700
|
-
* 安装 playwright-cli(全局 npm 包 +
|
|
700
|
+
* 安装 playwright-cli(全局 npm 包 + AI agent skills)
|
|
701
701
|
* 用于浏览器交互验证(browser_interaction 功能)
|
|
702
702
|
*/
|
|
703
703
|
export async function installPlaywrightCli(projectRoot, dryRun) {
|
|
@@ -723,12 +723,13 @@ export async function installPlaywrightCli(projectRoot, dryRun) {
|
|
|
723
723
|
}
|
|
724
724
|
}
|
|
725
725
|
|
|
726
|
-
//
|
|
726
|
+
// Install AI agent skills (official SKILL.md + references, auto-detects system browser)
|
|
727
727
|
try {
|
|
728
|
-
execSync('playwright-cli install', { cwd: projectRoot, stdio: 'pipe', timeout: 60000 });
|
|
729
|
-
console.log(chalk.green(' ✓ playwright-cli
|
|
728
|
+
execSync('playwright-cli install --skills', { cwd: projectRoot, stdio: 'pipe', timeout: 60000 });
|
|
729
|
+
console.log(chalk.green(' ✓ playwright-cli skills installed'));
|
|
730
730
|
} catch (e) {
|
|
731
|
-
console.log(chalk.yellow(` ⚠
|
|
731
|
+
console.log(chalk.yellow(` ⚠ Skills install skipped: ${e.message}`));
|
|
732
|
+
console.log(chalk.yellow(' ⚠ Run manually: playwright-cli install --skills'));
|
|
732
733
|
}
|
|
733
734
|
}
|
|
734
735
|
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
# playwright-cli Quick Reference (for AI Agents)
|
|
2
|
-
|
|
3
|
-
Token-efficient browser automation tool. State is saved to `.playwright-cli/` on disk — only file paths are returned, not page content.
|
|
4
|
-
|
|
5
|
-
## Core Workflow
|
|
6
|
-
|
|
7
|
-
```
|
|
8
|
-
playwright-cli open <url> # open browser + navigate (returns snapshot path)
|
|
9
|
-
playwright-cli snapshot # capture page state → .yml file with element refs (e.g. ref=e15)
|
|
10
|
-
playwright-cli click <ref> # click element by ref from snapshot
|
|
11
|
-
playwright-cli fill <ref> <text> # fill text into input/textarea by ref
|
|
12
|
-
playwright-cli type <text> # type text into active element
|
|
13
|
-
playwright-cli press <key> # press key: Enter, Tab, Escape, ArrowDown, etc.
|
|
14
|
-
playwright-cli screenshot # capture viewport → .png file
|
|
15
|
-
playwright-cli close # close browser
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
## Reading Snapshots
|
|
19
|
-
|
|
20
|
-
After `open` or `snapshot`, read the `.yml` file. Each element has a `ref=eXX`:
|
|
21
|
-
|
|
22
|
-
```yaml
|
|
23
|
-
- navigation "Main" [ref=e4]:
|
|
24
|
-
- link "Docs" [ref=e11] [cursor=pointer]:
|
|
25
|
-
- /url: /docs/intro
|
|
26
|
-
- button "Login" [ref=e14] [cursor=pointer]
|
|
27
|
-
- searchbox "Search" [ref=e20]
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
Use refs in subsequent commands: `playwright-cli click e14`, `playwright-cli fill e20 "query"`.
|
|
31
|
-
|
|
32
|
-
**Important**: Refs change after navigation — always `snapshot` after clicking a link.
|
|
33
|
-
|
|
34
|
-
## Additional Commands
|
|
35
|
-
|
|
36
|
-
```
|
|
37
|
-
# Navigation
|
|
38
|
-
goto <url> # navigate without reopening browser
|
|
39
|
-
go-back / go-forward # browser history
|
|
40
|
-
reload # reload page
|
|
41
|
-
|
|
42
|
-
# Form interaction
|
|
43
|
-
select <ref> <value> # select dropdown option
|
|
44
|
-
check <ref> / uncheck <ref> # checkbox/radio
|
|
45
|
-
upload <file> # file upload
|
|
46
|
-
dblclick <ref> # double click
|
|
47
|
-
hover <ref> # hover over element
|
|
48
|
-
drag <startRef> <endRef> # drag and drop
|
|
49
|
-
|
|
50
|
-
# Tabs
|
|
51
|
-
tab-list # list all open tabs
|
|
52
|
-
tab-new [url] # open new tab
|
|
53
|
-
tab-select <index> # switch to tab by index
|
|
54
|
-
tab-close [index] # close tab
|
|
55
|
-
|
|
56
|
-
# JavaScript
|
|
57
|
-
eval <expression> # evaluate JS on page (e.g. eval "document.title")
|
|
58
|
-
eval <expression> <ref> # evaluate JS on specific element
|
|
59
|
-
|
|
60
|
-
# Session management
|
|
61
|
-
list # list browser sessions
|
|
62
|
-
close-all # close all browsers
|
|
63
|
-
-s=<name> <command> # target specific session (for multiple browsers)
|
|
64
|
-
|
|
65
|
-
# DevTools
|
|
66
|
-
console # list console messages
|
|
67
|
-
network # list network requests
|
|
68
|
-
screenshot [ref] # screenshot specific element (not just viewport)
|
|
69
|
-
|
|
70
|
-
# Storage / Auth
|
|
71
|
-
state-save [file] # save cookies + localStorage (for auth reuse)
|
|
72
|
-
state-load <file> # restore saved state
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
## Typical Verification Flow
|
|
76
|
-
|
|
77
|
-
```bash
|
|
78
|
-
# 1. Start dev server (if needed)
|
|
79
|
-
npm run dev &
|
|
80
|
-
sleep 5
|
|
81
|
-
|
|
82
|
-
# 2. Open and get initial snapshot
|
|
83
|
-
playwright-cli open http://localhost:3000
|
|
84
|
-
# → reads .playwright-cli/page-*.yml for element refs
|
|
85
|
-
|
|
86
|
-
# 3. Interact — map acceptance criteria to actions
|
|
87
|
-
playwright-cli snapshot
|
|
88
|
-
# read the .yml, find the target element ref
|
|
89
|
-
playwright-cli click e14 # e.g. click "Login" button
|
|
90
|
-
playwright-cli fill e20 "admin" # e.g. fill username
|
|
91
|
-
playwright-cli fill e22 "pass" # e.g. fill password
|
|
92
|
-
playwright-cli click e25 # e.g. click "Submit"
|
|
93
|
-
|
|
94
|
-
# 4. Verify result
|
|
95
|
-
playwright-cli snapshot
|
|
96
|
-
# read the new .yml — check if expected elements exist
|
|
97
|
-
# e.g. look for "Welcome" heading, dashboard nav, etc.
|
|
98
|
-
|
|
99
|
-
# 5. Screenshot for human review
|
|
100
|
-
playwright-cli screenshot
|
|
101
|
-
|
|
102
|
-
# 6. Cleanup
|
|
103
|
-
playwright-cli close
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
## Tips for AI Agents
|
|
107
|
-
|
|
108
|
-
- **Always snapshot before interacting** — you need refs, and they change after navigation
|
|
109
|
-
- **Read the .yml file** to find the right ref — don't guess ref numbers
|
|
110
|
-
- **One command at a time** — each command returns immediately, check result before next
|
|
111
|
-
- **Failures are non-blocking** — if an element isn't found, log it and continue
|
|
112
|
-
- **Screenshots are evidence** — take one after each major verification step
|
|
113
|
-
- `.playwright-cli/` artifacts are gitignored — they're ephemeral
|