aped-method 1.0.0 → 1.6.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.
@@ -1,21 +1,21 @@
1
1
  export function skills(c) {
2
2
  const a = c.apedDir; // .aped (engine: skills, config, templates)
3
- const o = c.outputDir; // docs/aped (output: generated artifacts)
3
+ const o = c.outputDir; // docs/aped (output: generated artifacts + state)
4
4
  return [
5
5
  // ── aped-a ──────────────────────────────────────────────
6
6
  {
7
7
  path: `${a}/aped-a/SKILL.md`,
8
8
  content: `---
9
9
  name: aped-a
10
- description: 'Analyze project idea through parallel market, domain, and technical research. Use when user says "analyze project", "research idea", "aped analyze", or invokes /aped-a.'
10
+ description: 'Analyzes a new project idea through parallel market, domain, and technical research. Use when user says "research idea", "aped analyze", or invokes /aped-a. Not for existing codebases — use aped-ctx for brownfield projects.'
11
11
  ---
12
12
 
13
13
  # APED Analyze — Parallel Research to Product Brief
14
14
 
15
15
  ## Setup
16
16
 
17
- 1. Read \`${a}/config.yaml\` — extract \`user_name\`, \`communication_language\`
18
- 2. Read \`${a}/state.yaml\` — check \`pipeline.phases.analyze\`
17
+ 1. Read \`${a}/config.yaml\` — extract \`user_name\`, \`communication_language\`, \`ticket_system\`, \`git_provider\`
18
+ 2. Read \`${o}/state.yaml\` — check \`pipeline.phases.analyze\`
19
19
  - If status is \`done\`: ask user — redo analysis or skip to next phase?
20
20
  - If user skips: invoke Skill tool with \`skill: "aped-p"\` and stop
21
21
 
@@ -29,13 +29,23 @@ Ask the user these questions (adapt to \`communication_language\`):
29
29
 
30
30
  Wait for answers before proceeding.
31
31
 
32
+ ## Task Tracking
33
+
34
+ Create tasks to track this phase:
35
+ \`\`\`
36
+ TaskCreate: "Parallel research — Market, Domain, Technical"
37
+ TaskCreate: "Synthesize research into product brief"
38
+ TaskCreate: "Validate brief"
39
+ \`\`\`
40
+
32
41
  ## Parallel Research
33
42
 
34
43
  Read \`${a}/aped-a/references/research-prompts.md\` for detailed agent prompts.
35
44
 
36
- Launch **3 Agent tool calls in parallel** with \`run_in_background: true\`:
45
+ Launch **3 Agent tool calls in a single message** (parallel execution) with \`run_in_background: true\`:
37
46
 
38
47
  ### Agent 1: Market Research
48
+ - \`subagent_type: "Explore"\`
39
49
  - Customer behavior and pain points in the target segment
40
50
  - Competitive landscape: direct and indirect competitors
41
51
  - Market size and growth trajectory
@@ -43,6 +53,7 @@ Launch **3 Agent tool calls in parallel** with \`run_in_background: true\`:
43
53
  - Use WebSearch for current data
44
54
 
45
55
  ### Agent 2: Domain Research
56
+ - \`subagent_type: "Explore"\`
46
57
  - Industry analysis and key trends
47
58
  - Regulatory requirements and compliance needs
48
59
  - Technical trends shaping the domain
@@ -50,12 +61,15 @@ Launch **3 Agent tool calls in parallel** with \`run_in_background: true\`:
50
61
  - Use WebSearch for current data
51
62
 
52
63
  ### Agent 3: Technical Research
64
+ - \`subagent_type: "Explore"\`
53
65
  - Technology stack overview and options
54
66
  - Integration patterns and APIs available
55
67
  - Architecture patterns for similar products
56
68
  - Open-source tools and frameworks relevant
57
69
  - Use WebSearch for current data
58
70
 
71
+ Once all 3 agents return, update task: \`TaskUpdate: "Parallel research" → completed\`
72
+
59
73
  ## Synthesis
60
74
 
61
75
  Ensure output directory exists:
@@ -78,9 +92,15 @@ bash ${a}/aped-a/scripts/validate-brief.sh ${o}/product-brief.md
78
92
 
79
93
  If validation fails: fix missing sections and re-validate.
80
94
 
95
+ Update tasks:
96
+ \`\`\`
97
+ TaskUpdate: "Synthesize research" → completed
98
+ TaskUpdate: "Validate brief" → completed
99
+ \`\`\`
100
+
81
101
  ## State Update
82
102
 
83
- Update \`${a}/state.yaml\`:
103
+ Update \`${o}/state.yaml\`:
84
104
  \`\`\`yaml
85
105
  pipeline:
86
106
  current_phase: "analyze"
@@ -100,7 +120,7 @@ Invoke Skill tool with \`skill: "aped-p"\` to proceed to PRD phase.
100
120
  path: `${a}/aped-p/SKILL.md`,
101
121
  content: `---
102
122
  name: aped-p
103
- description: 'Generate PRD autonomously from product brief. Use when user says "create PRD", "generate PRD", "aped prd", or invokes /aped-p.'
123
+ description: 'Generates PRD autonomously from product brief. Use when user says "create PRD", "generate PRD", "aped prd", or invokes /aped-p.'
104
124
  ---
105
125
 
106
126
  # APED PRD — Autonomous PRD Generation
@@ -108,7 +128,7 @@ description: 'Generate PRD autonomously from product brief. Use when user says "
108
128
  ## Setup
109
129
 
110
130
  1. Read \`${a}/config.yaml\` — extract \`user_name\`, \`communication_language\`, \`document_output_language\`
111
- 2. Read \`${a}/state.yaml\` — check pipeline state
131
+ 2. Read \`${o}/state.yaml\` — check pipeline state
112
132
  - If \`pipeline.phases.prd.status\` is \`done\`: ask user — redo PRD or skip?
113
133
  - If user skips: invoke Skill tool with \`skill: "aped-e"\` and stop
114
134
 
@@ -127,6 +147,19 @@ description: 'Generate PRD autonomously from product brief. Use when user says "
127
147
  - Match against \`detection_signals\`
128
148
  - Note \`required_sections\`, \`skip_sections\`, \`key_questions\`
129
149
 
150
+ ## Task Tracking
151
+
152
+ Create tasks for each generation phase:
153
+ \`\`\`
154
+ TaskCreate: "P1: Foundation — Executive Summary & Vision"
155
+ TaskCreate: "P2: Scope & Journeys"
156
+ TaskCreate: "P3: Domain Requirements (conditional)"
157
+ TaskCreate: "P4: Functional & Non-Functional Requirements"
158
+ TaskCreate: "Validate PRD"
159
+ \`\`\`
160
+
161
+ Update each task to \`completed\` as you finish each phase.
162
+
130
163
  ## PRD Generation (4 compressed phases)
131
164
 
132
165
  Generate the PRD autonomously using \`${a}/templates/prd.md\` as structure.
@@ -162,7 +195,7 @@ bash ${a}/aped-p/scripts/validate-prd.sh ${o}/prd.md
162
195
  ## Output & State
163
196
 
164
197
  1. Write PRD to \`${o}/prd.md\`
165
- 2. Update \`${a}/state.yaml\`:
198
+ 2. Update \`${o}/state.yaml\`:
166
199
  \`\`\`yaml
167
200
  pipeline:
168
201
  current_phase: "prd"
@@ -174,7 +207,9 @@ pipeline:
174
207
 
175
208
  ## Chain
176
209
 
177
- Invoke Skill tool with \`skill: "aped-e"\` to proceed to Epics phase.
210
+ Ask the user: "Do you want to design the UX before creating epics?"
211
+ - If yes: invoke Skill tool with \`skill: "aped-ux"\`
212
+ - If no: invoke Skill tool with \`skill: "aped-e"\` to skip directly to Epics
178
213
  `,
179
214
  },
180
215
  // ── aped-e ──────────────────────────────────────────────
@@ -182,15 +217,15 @@ Invoke Skill tool with \`skill: "aped-e"\` to proceed to Epics phase.
182
217
  path: `${a}/aped-e/SKILL.md`,
183
218
  content: `---
184
219
  name: aped-e
185
- description: 'Create epics and stories from PRD with full FR coverage. Use when user says "create epics", "break into stories", "aped epics", or invokes /aped-e.'
220
+ description: 'Creates epics and stories from PRD with full FR coverage. Use when user says "create epics", "break into stories", "aped epics", or invokes /aped-e.'
186
221
  ---
187
222
 
188
223
  # APED Epics & Stories — Requirements Decomposition
189
224
 
190
225
  ## Setup
191
226
 
192
- 1. Read \`${a}/config.yaml\` — extract config
193
- 2. Read \`${a}/state.yaml\` — check pipeline state
227
+ 1. Read \`${a}/config.yaml\` — extract config including \`ticket_system\`
228
+ 2. Read \`${o}/state.yaml\` — check pipeline state
194
229
  - If \`pipeline.phases.epics.status\` is \`done\`: ask user — redo or skip?
195
230
  - If user skips: invoke Skill tool with \`skill: "aped-d"\` and stop
196
231
 
@@ -200,6 +235,18 @@ description: 'Create epics and stories from PRD with full FR coverage. Use when
200
235
  - If no prd phase in state: ask user for PRD path
201
236
  - Extract ALL FRs and NFRs by number
202
237
 
238
+ ## Task Tracking
239
+
240
+ \`\`\`
241
+ TaskCreate: "Extract FRs and NFRs from PRD"
242
+ TaskCreate: "Design epics (user-value grouping)"
243
+ TaskCreate: "Create stories with ACs and tasks"
244
+ TaskCreate: "FR coverage validation"
245
+ TaskCreate: "Write story files"
246
+ \`\`\`
247
+
248
+ Update each to \`completed\` as you progress.
249
+
203
250
  ## Epic Design
204
251
 
205
252
  Read \`${a}/aped-e/references/epic-rules.md\` for design principles.
@@ -225,6 +272,16 @@ Story files: \`${o}/stories/{story-key}.md\`
225
272
  - ACs in **Given/When/Then** format
226
273
  - Tasks as checkboxes: \`- [ ] task [AC: AC#]\`
227
274
 
275
+ ## Ticket System Integration
276
+
277
+ Read \`ticket_system\` from config. If not \`none\`:
278
+ - Add ticket reference in each story header: \`**Ticket:** {{ticket_id}}\`
279
+ - If \`jira\`: format as \`PROJ-###\` placeholder
280
+ - If \`linear\`: format as \`TEAM-###\` placeholder
281
+ - If \`github-issues\`: format as \`#issue_number\` placeholder
282
+ - If \`gitlab-issues\`: format as \`#issue_number\` placeholder
283
+ - Note: actual ticket creation is manual — these are reference placeholders
284
+
228
285
  ## FR Coverage Map
229
286
 
230
287
  Every FR from PRD mapped to exactly one epic. No orphans, no phantoms.
@@ -243,7 +300,7 @@ mkdir -p ${o}/stories
243
300
 
244
301
  1. Write epics to \`${o}/epics.md\`
245
302
  2. Create story files in \`${o}/stories/\` using \`${a}/templates/story.md\`
246
- 3. Update \`${a}/state.yaml\` with sprint section and pipeline phase
303
+ 3. Update \`${o}/state.yaml\` with sprint section and pipeline phase
247
304
 
248
305
  ## Chain
249
306
 
@@ -255,15 +312,16 @@ Invoke Skill tool with \`skill: "aped-d"\` to proceed to Dev Sprint.
255
312
  path: `${a}/aped-d/SKILL.md`,
256
313
  content: `---
257
314
  name: aped-d
258
- description: 'Dev sprint - implement next story with TDD red-green-refactor. Use when user says "start dev", "implement story", "aped dev", or invokes /aped-d.'
315
+ description: 'Implements next story with TDD red-green-refactor cycle. Use when user says "start dev", "implement story", "aped dev", or invokes /aped-d.'
316
+ disable-model-invocation: true
259
317
  ---
260
318
 
261
319
  # APED Dev Sprint — TDD Story Implementation
262
320
 
263
321
  ## Setup
264
322
 
265
- 1. Read \`${a}/config.yaml\` — extract config
266
- 2. Read \`${a}/state.yaml\` — find next story
323
+ 1. Read \`${a}/config.yaml\` — extract config including \`ticket_system\`, \`git_provider\`
324
+ 2. Read \`${o}/state.yaml\` — find next story
267
325
 
268
326
  ## Story Selection
269
327
 
@@ -278,19 +336,37 @@ If story has \`[AI-Review]\` items: address them BEFORE regular tasks.
278
336
 
279
337
  ## State Update (start)
280
338
 
281
- Update \`${a}/state.yaml\`: story — \`in-progress\`, epic — \`in-progress\` if first story.
339
+ Update \`${o}/state.yaml\`: story — \`in-progress\`, epic — \`in-progress\` if first story.
340
+
341
+ ## Task Tracking
342
+
343
+ Create a task for each story task checkbox:
344
+ \`\`\`
345
+ For each "- [ ] task description [AC: AC#]" in story:
346
+ TaskCreate: "task description" (status: todo)
347
+ \`\`\`
348
+ Update each to \`in_progress\` when starting RED, \`completed\` when GATE passes.
282
349
 
283
350
  ## Context Gathering
284
351
 
352
+ Launch **2 Agent tool calls in parallel** for context:
353
+
354
+ ### Agent 1: Code Context
355
+ - \`subagent_type: "Explore"\`
285
356
  - Read story Dev Notes for architecture, file paths, dependencies
286
- - Use MCP context7 for library docs mentioned in Dev Notes
287
357
  - Read existing code files mentioned in story
358
+ - Map the current state of files to modify
359
+
360
+ ### Agent 2: Library Docs (if dependencies listed)
361
+ - \`subagent_type: "general-purpose"\`
362
+ - Use MCP context7 (\`resolve-library-id\` then \`query-docs\`) for libraries in Dev Notes
363
+ - Extract relevant API patterns and usage examples
288
364
 
289
365
  ## TDD Implementation
290
366
 
291
367
  Read \`${a}/aped-d/references/tdd-engine.md\` for detailed rules.
292
368
 
293
- For each task:
369
+ For each task (update TaskUpdate to \`in_progress\` when starting):
294
370
 
295
371
  ### RED
296
372
  Write failing tests first. Run: \`bash ${a}/aped-d/scripts/run-tests.sh\`
@@ -308,11 +384,17 @@ Mark \`[x]\` ONLY when: tests exist, pass 100%, implementation matches, ACs sati
308
384
 
309
385
  **STOP and ask user if:** new dependency, 3 consecutive failures, missing config, ambiguity.
310
386
 
387
+ ## Git Commit Convention
388
+
389
+ Read \`git_provider\` and \`ticket_system\` from config:
390
+ - Commit message format: \`type(scope): description\`
391
+ - If ticket system configured, append ticket ref: \`type(scope): description [TICKET-ID]\`
392
+
311
393
  ## Completion
312
394
 
313
395
  1. Update story: mark tasks \`[x]\`, fill Dev Agent Record
314
- 2. Update \`${a}/state.yaml\`: story — \`review\`
315
- 3. Chain to \`/aped-r\`
396
+ 2. Update \`${o}/state.yaml\`: story — \`review\`
397
+ 3. Invoke Skill tool with \`skill: "aped-r"\` to proceed to Review phase
316
398
  `,
317
399
  },
318
400
  // ── aped-r ──────────────────────────────────────────────
@@ -320,15 +402,16 @@ Mark \`[x]\` ONLY when: tests exist, pass 100%, implementation matches, ACs sati
320
402
  path: `${a}/aped-r/SKILL.md`,
321
403
  content: `---
322
404
  name: aped-r
323
- description: 'Adversarial code review for completed stories. Use when user says "review code", "run review", "aped review", or invokes /aped-r.'
405
+ description: 'Reviews completed stories adversarially with minimum 3 findings. Use when user says "review code", "run review", "aped review", or invokes /aped-r.'
406
+ disable-model-invocation: true
324
407
  ---
325
408
 
326
409
  # APED Review — Adversarial Code Review
327
410
 
328
411
  ## Setup
329
412
 
330
- 1. Read \`${a}/config.yaml\` — extract config
331
- 2. Read \`${a}/state.yaml\` — find first story with status \`review\`
413
+ 1. Read \`${a}/config.yaml\` — extract config including \`git_provider\`
414
+ 2. Read \`${o}/state.yaml\` — find first story with status \`review\`
332
415
  - If none: report "No stories pending review" and stop
333
416
 
334
417
  ## Load Story
@@ -341,20 +424,33 @@ Read story from \`${o}/stories/{story-key}.md\`
341
424
  bash ${a}/aped-r/scripts/git-audit.sh ${o}/stories/{story-key}.md
342
425
  \`\`\`
343
426
 
427
+ ## Task Tracking
428
+
429
+ \`\`\`
430
+ TaskCreate: "Git audit"
431
+ TaskCreate: "AC validation"
432
+ TaskCreate: "Task audit"
433
+ TaskCreate: "Code quality review"
434
+ TaskCreate: "Generate review report"
435
+ \`\`\`
436
+
344
437
  ## Adversarial Review
345
438
 
346
439
  Read \`${a}/aped-r/references/review-criteria.md\` for detailed criteria.
347
440
 
348
- ### 1. AC Validation
349
- For each AC: search code for evidence (file:line). Rate: IMPLEMENTED / PARTIAL / MISSING.
441
+ Launch **2 Agent tool calls in parallel** for the review:
442
+
443
+ ### Agent 1: AC & Task Validation (\`subagent_type: "feature-dev:code-explorer"\`)
444
+ - For each AC: search code for evidence (file:line). Rate: IMPLEMENTED / PARTIAL / MISSING
445
+ - For each \`[x]\` task: find proof in code. No evidence = **CRITICAL**
350
446
 
351
- ### 2. Task Audit
352
- For each \`[x]\` task: find proof in code. No evidence = **CRITICAL**.
447
+ ### Agent 2: Code Quality (\`subagent_type: "feature-dev:code-reviewer"\`)
448
+ - Security, Performance, Reliability, Test Quality
449
+ - Focus on files listed in the story's File List section
353
450
 
354
- ### 3. Code Quality
355
- Security, Performance, Reliability, Test Quality.
451
+ Once both agents return, merge findings. Update tasks to \`completed\`.
356
452
 
357
- ### 4. Minimum 3 findings enforced.
453
+ ### Minimum 3 findings enforced.
358
454
 
359
455
  ## Report
360
456
 
@@ -367,7 +463,616 @@ Severity: CRITICAL > HIGH > MEDIUM > LOW. Format: \`[Severity] Description [file
367
463
 
368
464
  ## State Update
369
465
 
370
- Update \`${a}/state.yaml\`. If more stories chain to \`/aped-d\`. If all done report completion.
466
+ Update \`${o}/state.yaml\`. If more stories remain: invoke Skill tool with \`skill: "aped-d"\`. If all stories done: report pipeline completion.
467
+ `,
468
+ },
469
+ // ── aped-ux ─────────────────────────────────────────────
470
+ {
471
+ path: `${a}/aped-ux/SKILL.md`,
472
+ content: `---
473
+ name: aped-ux
474
+ description: 'Designs UX specifications from PRD — screen flows, wireframes, component inventory. Use when user says "design UX", "create wireframes", "UX spec", "aped ux", or invokes /aped-ux. Runs between PRD and Epics phases.'
475
+ ---
476
+
477
+ # APED UX — Spec-First UX Design
478
+
479
+ Generates UX specifications from the PRD before epics creation. Produces screen flows, wireframes (ASCII), component inventories, and interaction specs that \`/aped-e\` consumes to enrich stories with visual context.
480
+
481
+ ## Setup
482
+
483
+ 1. Read \`${a}/config.yaml\` — extract config
484
+ 2. Read \`${o}/state.yaml\` — check pipeline state
485
+ - If \`pipeline.phases.ux.status\` is \`done\`: ask user — redo or skip?
486
+ - If user skips: invoke Skill tool with \`skill: "aped-e"\` and stop
487
+ 3. Read \`${a}/aped-ux/references/ux-patterns.md\` for design patterns catalog
488
+
489
+ ## Task Tracking
490
+
491
+ \`\`\`
492
+ TaskCreate: "Analyze PRD user journeys"
493
+ TaskCreate: "Define screen inventory"
494
+ TaskCreate: "Design screen flows"
495
+ TaskCreate: "Create wireframes"
496
+ TaskCreate: "Build component inventory"
497
+ TaskCreate: "Write interaction specs"
498
+ TaskCreate: "Validate UX spec"
499
+ \`\`\`
500
+
501
+ ## Load PRD
502
+
503
+ - Read PRD from \`pipeline.phases.prd.output\`
504
+ - Extract: user journeys, FRs grouped by capability, actors, key workflows
505
+
506
+ ## Phase 1: Screen Inventory
507
+
508
+ For each user journey in the PRD:
509
+
510
+ 1. **Map the journey** to concrete screens (1 journey = 1+ screens)
511
+ 2. **Name each screen** with a slug: \`{area}-{action}\` (e.g., \`auth-login\`, \`dashboard-overview\`, \`settings-profile\`)
512
+ 3. **Classify screen type**: form, list, detail, dashboard, wizard, modal, empty-state, error
513
+ 4. **Map FR coverage**: which FRs are satisfied by which screen
514
+
515
+ Output: screen inventory table.
516
+
517
+ ## Phase 2: Screen Flows
518
+
519
+ For each major workflow:
520
+
521
+ 1. **Draw flow diagram** in text format:
522
+ \`\`\`
523
+ [Landing] → [Login] → [Dashboard]
524
+ ↓ ↓
525
+ [Register] [Settings]
526
+
527
+ [Verify Email] → [Dashboard]
528
+ \`\`\`
529
+
530
+ 2. **Document transitions**: what triggers navigation (button click, form submit, auto-redirect)
531
+ 3. **Identify shared patterns**: navigation, auth guards, error states, loading states
532
+
533
+ ## Phase 3: Wireframes (ASCII)
534
+
535
+ For each screen, produce an ASCII wireframe:
536
+
537
+ \`\`\`
538
+ ┌─────────────────────────────────┐
539
+ │ [Logo] [Nav] [Avatar] │
540
+ ├─────────────────────────────────┤
541
+ │ │
542
+ │ ┌──────────┐ ┌──────────────┐ │
543
+ │ │ Sidebar │ │ Content │ │
544
+ │ │ │ │ │ │
545
+ │ │ • Item 1 │ │ ┌────────┐ │ │
546
+ │ │ • Item 2 │ │ │ Card 1 │ │ │
547
+ │ │ • Item 3 │ │ └────────┘ │ │
548
+ │ │ │ │ ┌────────┐ │ │
549
+ │ │ │ │ │ Card 2 │ │ │
550
+ │ └──────────┘ │ └────────┘ │ │
551
+ │ └──────────────┘ │
552
+ ├─────────────────────────────────┤
553
+ │ [Footer] │
554
+ └─────────────────────────────────┘
555
+ \`\`\`
556
+
557
+ Rules:
558
+ - Use box drawing characters (┌ ─ ┐ │ └ ┘ ├ ┤)
559
+ - Label every zone with its purpose
560
+ - Show content hierarchy (headings, lists, cards, forms)
561
+ - Annotate interactive elements: \`[Button]\`, \`(Input)\`, \`{Dropdown}\`
562
+ - Include responsive notes: "sidebar collapses to hamburger on mobile"
563
+
564
+ ## Phase 4: Component Inventory
565
+
566
+ Analyze all wireframes and extract:
567
+
568
+ ### Component Tree
569
+ \`\`\`
570
+ App
571
+ ├── Layout
572
+ │ ├── Header (logo, nav, avatar)
573
+ │ ├── Sidebar (nav items, collapsible)
574
+ │ └── Footer
575
+ ├── Shared
576
+ │ ├── Button (primary, secondary, ghost, danger)
577
+ │ ├── Input (text, email, password, search)
578
+ │ ├── Card (title, body, actions)
579
+ │ ├── Modal (header, body, footer)
580
+ │ └── Toast (success, error, warning, info)
581
+ └── Feature-specific
582
+ ├── UserAvatar (image, initials fallback)
583
+ ├── DataTable (sortable, filterable, paginated)
584
+ └── StatsCard (value, label, trend)
585
+ \`\`\`
586
+
587
+ ### Component Spec (for each)
588
+ - **Props**: name, type, required, default
589
+ - **States**: default, hover, active, disabled, loading, error
590
+ - **Variants**: size (sm/md/lg), color (primary/secondary/danger)
591
+ - **Accessibility**: ARIA role, keyboard navigation, focus management
592
+
593
+ ## Phase 5: Interaction Specs
594
+
595
+ For each screen, document:
596
+
597
+ 1. **Loading states**: skeleton, spinner, progressive
598
+ 2. **Empty states**: first-use, no-results, error
599
+ 3. **Error handling**: inline validation, toast, error page
600
+ 4. **Animations**: page transitions, micro-interactions (optional)
601
+ 5. **Responsive behavior**: breakpoints, layout changes, touch targets
602
+
603
+ ## Validation
604
+
605
+ Check completeness:
606
+ - [ ] Every FR from PRD maps to at least one screen
607
+ - [ ] Every screen has a wireframe
608
+ - [ ] Every interactive element has states defined
609
+ - [ ] Flows cover happy path + error paths
610
+ - [ ] Component inventory covers all wireframe elements
611
+ - [ ] No orphan screens (unreachable from any flow)
612
+
613
+ ## Output
614
+
615
+ \`\`\`bash
616
+ mkdir -p ${o}/ux
617
+ \`\`\`
618
+
619
+ Write to \`${o}/ux/\`:
620
+ 1. \`screen-inventory.md\` — table of all screens with FR mapping
621
+ 2. \`flows.md\` — all screen flow diagrams
622
+ 3. \`wireframes.md\` — ASCII wireframes for every screen
623
+ 4. \`components.md\` — component tree + specs
624
+ 5. \`interactions.md\` — states, errors, responsive, animations
625
+
626
+ ## State Update
627
+
628
+ Update \`${o}/state.yaml\`:
629
+ \`\`\`yaml
630
+ pipeline:
631
+ current_phase: "ux"
632
+ phases:
633
+ ux:
634
+ status: "done"
635
+ output: "${o}/ux/"
636
+ \`\`\`
637
+
638
+ ## Chain
639
+
640
+ Invoke Skill tool with \`skill: "aped-e"\` to proceed to Epics phase.
641
+ \`/aped-e\` will read UX specs to enrich stories with wireframe refs, component specs, and interaction requirements in Dev Notes.
642
+ `,
643
+ },
644
+ // ── aped-s ──────────────────────────────────────────────
645
+ {
646
+ path: `${a}/aped-s/SKILL.md`,
647
+ content: `---
648
+ name: aped-s
649
+ description: 'Shows sprint status dashboard with progress, blockers, and next actions. Use when user says "sprint status", "show progress", "aped status", or invokes /aped-s.'
650
+ allowed-tools: Read, Grep, Glob, Bash
651
+ ---
652
+
653
+ # APED Status — Sprint Dashboard
654
+
655
+ ## Setup
656
+
657
+ 1. Read \`${a}/config.yaml\` — extract \`communication_language\`, \`ticket_system\`
658
+ 2. Read \`${o}/state.yaml\` — load full pipeline and sprint state
659
+
660
+ ## Pipeline Overview
661
+
662
+ Display current pipeline phase and completion status:
663
+
664
+ \`\`\`
665
+ Pipeline: A[✓] → P[✓] → E[✓] → D[▶] → R[ ]
666
+ \`\`\`
667
+
668
+ For each completed phase, show the output artifact path.
669
+
670
+ ## Sprint Progress
671
+
672
+ For each epic in \`sprint.stories\`:
673
+
674
+ 1. Count stories by status: \`done\`, \`in-progress\`, \`review\`, \`ready-for-dev\`, \`backlog\`
675
+ 2. Calculate completion percentage
676
+ 3. Display as progress bar:
677
+
678
+ \`\`\`
679
+ Epic 1: User Authentication [████████░░] 80% (4/5 stories)
680
+ ✓ 1-1-project-setup done
681
+ ✓ 1-2-user-registration done
682
+ ✓ 1-3-login-flow done
683
+ ✓ 1-4-password-reset done
684
+ ▶ 1-5-session-management in-progress
685
+ \`\`\`
686
+
687
+ ## Blockers Detection
688
+
689
+ Scan for:
690
+ - Stories with \`[AI-Review]\` items → **Review blockers**
691
+ - Stories \`in-progress\` for more than 1 session → **Stuck stories**
692
+ - Missing dependencies between stories → **Dependency blockers**
693
+ - HALT conditions logged in Dev Agent Record → **Dev halts**
694
+
695
+ ## Next Actions
696
+
697
+ Based on current state, suggest the next logical command:
698
+ - If stories \`ready-for-dev\`: suggest \`/aped-d\`
699
+ - If stories in \`review\`: suggest \`/aped-r\`
700
+ - If all stories \`done\`: suggest pipeline complete
701
+ - If blockers found: describe resolution path
702
+
703
+ ## Ticket System Integration
704
+
705
+ If \`ticket_system\` is not \`none\`:
706
+ - Show ticket references alongside story statuses
707
+ - Note any stories without ticket references
708
+
709
+ ## Output
710
+
711
+ Display only — no file writes, no state changes. Pure read-only dashboard.
712
+ `,
713
+ },
714
+ // ── aped-c ──────────────────────────────────────────────
715
+ {
716
+ path: `${a}/aped-c/SKILL.md`,
717
+ content: `---
718
+ name: aped-c
719
+ description: 'Manages scope changes and pivots during development with impact analysis. Use when user says "correct course", "change scope", "pivot", "aped correct", or invokes /aped-c.'
720
+ disable-model-invocation: true
721
+ ---
722
+
723
+ # APED Correct Course — Managed Pivot
724
+
725
+ Use when requirements change, priorities shift, or the current approach needs rethinking mid-pipeline.
726
+
727
+ ## Setup
728
+
729
+ 1. Read \`${a}/config.yaml\` — extract config
730
+ 2. Read \`${o}/state.yaml\` — understand current pipeline state
731
+ 3. Read existing artifacts: brief, PRD, epics, stories
732
+
733
+ ## Impact Assessment
734
+
735
+ Ask the user:
736
+ 1. **What changed?** — New requirement, removed feature, architectural pivot, priority shift
737
+ 2. **Why?** — User feedback, market shift, technical limitation, stakeholder decision
738
+
739
+ Then analyze impact:
740
+
741
+ ### Scope Change Matrix
742
+
743
+ | What changed | Artifacts affected | Action required |
744
+ |---|---|---|
745
+ | New feature added | PRD, Epics | Add FRs → create new stories |
746
+ | Feature removed | PRD, Epics | Remove FRs → archive stories |
747
+ | Architecture change | PRD NFRs, All stories | Update NFRs → review all Dev Notes |
748
+ | Priority reorder | Epics, Sprint | Reorder stories → update sprint |
749
+ | Complete pivot | Everything | Reset to /aped-a |
750
+
751
+ ## Change Execution
752
+
753
+ ### Minor change (new/removed feature)
754
+ 1. Update PRD: add/remove FRs, update scope
755
+ 2. Re-run validation: \`bash ${a}/aped-p/scripts/validate-prd.sh ${o}/prd.md\`
756
+ 3. Update epics: add/archive affected stories
757
+ 4. Re-run coverage: \`bash ${a}/aped-e/scripts/validate-coverage.sh ${o}/epics.md ${o}/prd.md\`
758
+ 5. Update \`${o}/state.yaml\`: mark affected stories as \`backlog\`
759
+
760
+ ### Major change (architecture/pivot)
761
+ 1. Confirm with user: "This invalidates in-progress work. Proceed?"
762
+ 2. Archive current artifacts to \`${o}/archive/{date}/\`
763
+ 3. Update PRD or restart from \`/aped-a\`
764
+ 4. Regenerate affected downstream artifacts
765
+
766
+ ## Story Impact Report
767
+
768
+ For each in-progress or completed story:
769
+ - **Safe**: story not affected by change
770
+ - **Needs update**: story Dev Notes or ACs need modification
771
+ - **Invalidated**: story no longer relevant — archive it
772
+
773
+ ## State Update
774
+
775
+ Update \`${o}/state.yaml\`:
776
+ - Reset affected stories to \`backlog\` or \`ready-for-dev\`
777
+ - If major change: reset \`current_phase\` to appropriate earlier phase
778
+ - Log the correction in pipeline phases:
779
+ \`\`\`yaml
780
+ corrections:
781
+ - date: "{date}"
782
+ type: "{minor|major}"
783
+ reason: "{user's reason}"
784
+ affected_stories: [...]
785
+ \`\`\`
786
+
787
+ ## Guard Against Scope Creep
788
+
789
+ After applying changes, verify:
790
+ - Total FR count still within 10-80 range
791
+ - No epic became too large (>8 stories)
792
+ - No story became too large (>8 tasks)
793
+ - Changed stories still fit single-session size
794
+ `,
795
+ },
796
+ // ── aped-ctx ────────────────────────────────────────────
797
+ {
798
+ path: `${a}/aped-ctx/SKILL.md`,
799
+ content: `---
800
+ name: aped-ctx
801
+ description: 'Analyzes existing codebase to generate project context for brownfield development. Use when user says "document codebase", "project context", "existing project", "aped context", or invokes /aped-ctx. Not for new project ideation — use aped-a for greenfield.'
802
+ allowed-tools: Read, Grep, Glob, Bash
803
+ ---
804
+
805
+ # APED Context — Brownfield Project Analysis
806
+
807
+ Use on existing codebases to generate project context before running the APED pipeline. Essential for brownfield projects where you're adding features to existing code.
808
+
809
+ ## Setup
810
+
811
+ 1. Read \`${a}/config.yaml\` — extract config
812
+ 2. Verify this is a brownfield project (existing code, not greenfield)
813
+
814
+ ## Codebase Analysis
815
+
816
+ ### Phase 1: Structure Discovery
817
+
818
+ Scan the project root:
819
+ - Detect language/framework from config files (package.json, Cargo.toml, go.mod, pyproject.toml, etc.)
820
+ - Map directory structure (max 3 levels deep)
821
+ - Identify entry points, main modules, config files
822
+ - Count: files, LOC, languages used
823
+
824
+ ### Phase 2: Architecture Mapping
825
+
826
+ - Identify architectural pattern (MVC, hexagonal, microservices, monolith, etc.)
827
+ - Map data flow: entry point → processing → storage → response
828
+ - List external dependencies and integrations (APIs, databases, queues, caches)
829
+ - Identify test framework and coverage approach
830
+
831
+ ### Phase 3: Convention Extraction
832
+
833
+ - Naming conventions (files, functions, variables, classes)
834
+ - Code organization patterns (feature-based, layer-based, domain-based)
835
+ - Error handling patterns
836
+ - Logging approach
837
+ - Config management (env vars, config files, secrets)
838
+
839
+ ### Phase 4: Dependency Audit
840
+
841
+ - List production dependencies with versions
842
+ - Flag outdated or deprecated packages
843
+ - Identify security advisories (if available)
844
+ - Note lock file type (package-lock, yarn.lock, pnpm-lock, etc.)
845
+
846
+ ## Output
847
+
848
+ Write project context to \`${o}/project-context.md\`:
849
+
850
+ \`\`\`markdown
851
+ # Project Context: {project_name}
852
+
853
+ ## Tech Stack
854
+ - Language: {lang} {version}
855
+ - Framework: {framework} {version}
856
+ - Database: {db}
857
+ - Test Framework: {test_framework}
858
+
859
+ ## Architecture
860
+ - Pattern: {pattern}
861
+ - Entry Point: {entry}
862
+ - Key Modules: {modules}
863
+
864
+ ## Conventions
865
+ - File naming: {convention}
866
+ - Code style: {style}
867
+ - Error handling: {pattern}
868
+
869
+ ## Dependencies
870
+ | Package | Version | Purpose |
871
+ |---------|---------|---------|
872
+
873
+ ## Integration Points
874
+ - {service}: {purpose}
875
+
876
+ ## Notes for Development
877
+ - {important context for new feature development}
878
+ \`\`\`
879
+
880
+ ## State Update
881
+
882
+ Update \`${o}/state.yaml\`:
883
+ \`\`\`yaml
884
+ project_context:
885
+ generated: true
886
+ path: "${o}/project-context.md"
887
+ type: "brownfield"
888
+ \`\`\`
889
+
890
+ ## Next Steps
891
+
892
+ Suggest:
893
+ - If no brief exists: run \`/aped-a\` with project context loaded
894
+ - If brief exists: context will inform \`/aped-p\` and \`/aped-d\` decisions
895
+ `,
896
+ },
897
+ // ── aped-qa ─────────────────────────────────────────────
898
+ {
899
+ path: `${a}/aped-qa/SKILL.md`,
900
+ content: `---
901
+ name: aped-qa
902
+ description: 'Generates E2E and integration tests from acceptance criteria for completed features. Use when user says "generate tests", "E2E tests", "integration tests", "aped qa", or invokes /aped-qa.'
903
+ ---
904
+
905
+ # APED QA — E2E & Integration Test Generation
906
+
907
+ Generate comprehensive end-to-end and integration tests for completed stories or epics. Complements the unit tests written during /aped-d TDD.
908
+
909
+ ## Setup
910
+
911
+ 1. Read \`${a}/config.yaml\` — extract config
912
+ 2. Read \`${o}/state.yaml\` — find completed stories/epics
913
+
914
+ ## Scope Selection
915
+
916
+ Ask the user:
917
+ 1. **What to test?** — specific story, full epic, or all completed work
918
+ 2. **Test type?** — E2E (user journeys), Integration (API/service), or Both
919
+
920
+ ## Story/Epic Analysis
921
+
922
+ For the selected scope:
923
+ 1. Read story files from \`${o}/stories/\`
924
+ 2. Extract all Acceptance Criteria (Given/When/Then)
925
+ 3. Map user journeys across stories (multi-step flows)
926
+ 4. Identify integration points (APIs, databases, external services)
927
+
928
+ ## Task Tracking
929
+
930
+ \`\`\`
931
+ TaskCreate: "Analyze stories and extract ACs"
932
+ TaskCreate: "Generate E2E tests"
933
+ TaskCreate: "Generate integration tests"
934
+ TaskCreate: "Run and verify all tests"
935
+ TaskCreate: "Write QA report"
936
+ \`\`\`
937
+
938
+ ## Test Generation
939
+
940
+ Launch **2 Agent tool calls in parallel**:
941
+
942
+ ### Agent 1: E2E Tests (\`subagent_type: "general-purpose"\`)
943
+
944
+ For each user journey that spans one or more stories:
945
+
946
+ 1. Map the full flow: entry → steps → expected outcome
947
+ 2. Generate test using the project's test framework
948
+ 3. Each AC's Given/When/Then becomes a test step
949
+ 4. Include:
950
+ - Happy path (main flow)
951
+ - Error paths (invalid input, unauthorized, not found)
952
+ - Edge cases (empty data, concurrent access, timeouts)
953
+
954
+ ### Agent 2: Integration Tests (\`subagent_type: "general-purpose"\`)
955
+
956
+ For each integration point:
957
+
958
+ 1. Test request/response contracts
959
+ 2. Test error handling (service down, timeout, malformed response)
960
+ 3. Test data consistency (DB state before/after)
961
+ 4. Test authentication/authorization boundaries
962
+
963
+ Once both agents return, update tasks to \`completed\`.
964
+
965
+ ### Test Naming Convention
966
+
967
+ \`\`\`
968
+ {test-type}/{epic-slug}/{story-slug}.test.{ext}
969
+ \`\`\`
970
+
971
+ ## Framework Detection
972
+
973
+ Read project config to auto-detect:
974
+ - **Node.js**: Playwright, Cypress, or Puppeteer for E2E; Supertest for API
975
+ - **Python**: Pytest + httpx for API; Playwright for E2E
976
+ - **Go**: Go test + httptest for API
977
+ - **Rust**: reqwest for API tests
978
+
979
+ Use \`bash ${a}/aped-d/scripts/run-tests.sh\` to verify tests pass.
980
+
981
+ ## Test Coverage Report
982
+
983
+ After generation:
984
+ - List ACs covered vs uncovered
985
+ - List user journeys tested
986
+ - List integration points tested
987
+ - Flag any untestable ACs (and why)
988
+
989
+ ## Output
990
+
991
+ 1. Write tests to project test directory (detect convention)
992
+ 2. Write QA report to \`${o}/qa-report.md\`:
993
+ - Stories tested
994
+ - Tests generated (count by type)
995
+ - Coverage gaps
996
+ - Manual test suggestions (for things that can't be automated)
997
+
998
+ ## No State Change
999
+
1000
+ QA doesn't affect pipeline state — it's an additive quality layer.
1001
+
1002
+ ## Next Steps
1003
+
1004
+ Suggest running \`/aped-s\` to view updated sprint status with QA coverage noted.
1005
+ `,
1006
+ },
1007
+ // ── aped-quick ────────────────────────────────────────────
1008
+ {
1009
+ path: `${a}/aped-quick/SKILL.md`,
1010
+ content: `---
1011
+ name: aped-quick
1012
+ description: 'Implements quick fixes and small features bypassing the full pipeline. Use when user says "quick fix", "quick feature", "hotfix", "aped quick", or invokes /aped-quick.'
1013
+ ---
1014
+
1015
+ # APED Quick — Fast Track for Small Changes
1016
+
1017
+ Use this for isolated fixes, small features, or refactors that don't warrant the full A→P→E→D→R pipeline.
1018
+
1019
+ ## Setup
1020
+
1021
+ 1. Read \`${a}/config.yaml\` — extract config
1022
+ 2. Read \`${o}/state.yaml\` — note current phase for context
1023
+
1024
+ ## Scope Check
1025
+
1026
+ This mode is for changes that:
1027
+ - Touch **5 files or fewer**
1028
+ - Can be completed in **1 session**
1029
+ - Don't introduce **new architectural patterns**
1030
+ - Don't require **new dependencies**
1031
+
1032
+ If any of these are violated, recommend the full pipeline instead.
1033
+
1034
+ ## Quick Spec (2 minutes)
1035
+
1036
+ Ask the user:
1037
+ 1. **What?** — What needs to change (1-2 sentences)
1038
+ 2. **Why?** — Why now, what breaks without it
1039
+ 3. **Type?** — fix | feature | refactor
1040
+
1041
+ Generate a quick spec using \`${a}/templates/quick-spec.md\`:
1042
+ - Fill: title, type, what, why, acceptance criteria, files to change, test plan
1043
+ - Write to \`${o}/quick-specs/{date}-{slug}.md\`
1044
+
1045
+ ## Implementation (TDD)
1046
+
1047
+ Same TDD cycle as aped-d but compressed:
1048
+
1049
+ 1. **RED** — Write test for the expected behavior
1050
+ 2. **GREEN** — Minimal implementation to pass
1051
+ 3. **REFACTOR** — Clean up while green
1052
+
1053
+ Run tests: \`bash ${a}/aped-d/scripts/run-tests.sh\`
1054
+
1055
+ ## Self-Review (30 seconds)
1056
+
1057
+ Quick checklist — no full adversarial review:
1058
+ - [ ] Tests pass
1059
+ - [ ] No security issues introduced
1060
+ - [ ] No regressions in existing tests
1061
+ - [ ] AC from quick spec satisfied
1062
+
1063
+ ## Git Commit
1064
+
1065
+ Read \`ticket_system\` and \`git_provider\` from config.
1066
+ - Format: \`type(scope): description\`
1067
+ - Append ticket ref if configured
1068
+ - If \`git_provider\` is \`github\`: suggest PR creation with \`gh pr create\`
1069
+ - If \`git_provider\` is \`gitlab\`: suggest MR creation with \`glab mr create\`
1070
+
1071
+ ## Output
1072
+
1073
+ 1. Write quick spec to \`${o}/quick-specs/\` (create dir if needed)
1074
+ 2. No state.yaml update — quick specs don't affect pipeline phase
1075
+ 3. Report: files changed, tests added, quick spec path
371
1076
  `,
372
1077
  },
373
1078
  // ── aped-all ─────────────────────────────────────────────
@@ -375,14 +1080,15 @@ Update \`${a}/state.yaml\`. If more stories — chain to \`/aped-d\`. If all don
375
1080
  path: `${a}/aped-all/SKILL.md`,
376
1081
  content: `---
377
1082
  name: aped-all
378
- description: 'Run full APED pipeline from Analyze through Review. Use when user says "run full pipeline", "aped all", "start from scratch", or invokes /aped-all.'
1083
+ description: 'Runs the full APED pipeline from Analyze through Review with auto-resume. Use when user says "run full pipeline", "aped all", or invokes /aped-all.'
1084
+ disable-model-invocation: true
379
1085
  ---
380
1086
 
381
1087
  # APED Pipeline — Full Orchestrator
382
1088
 
383
1089
  ## Resume Logic
384
1090
 
385
- 1. Read \`${a}/state.yaml\`
1091
+ 1. Read \`${o}/state.yaml\`
386
1092
  2. Determine resume point:
387
1093
 
388
1094
  | State | Action |
@@ -390,18 +1096,33 @@ description: 'Run full APED pipeline from Analyze through Review. Use when user
390
1096
  | No state / \`current_phase: "none"\` | Start from \`/aped-a\` |
391
1097
  | Any phase \`in-progress\` | Re-invoke that phase (ask user: resume or restart?) |
392
1098
  | analyze \`done\`, prd missing | Invoke \`/aped-p\` |
393
- | prd \`done\`, epics missing | Invoke \`/aped-e\` |
1099
+ | prd \`done\`, ux missing | Invoke \`/aped-ux\` (optional — ask user: design UX or skip to epics?) |
1100
+ | ux \`done\` or skipped, epics missing | Invoke \`/aped-e\` |
394
1101
  | epics \`done\` | Loop: \`/aped-d\` — \`/aped-r\` until all stories \`done\` |
395
1102
  | All stories \`done\` | Report pipeline complete |
396
1103
 
1104
+ ## Task Tracking
1105
+
1106
+ Create a task per pipeline phase:
1107
+ \`\`\`
1108
+ TaskCreate: "Phase A — Analyze"
1109
+ TaskCreate: "Phase P — PRD"
1110
+ TaskCreate: "Phase UX — UX Design (optional)"
1111
+ TaskCreate: "Phase E — Epics"
1112
+ TaskCreate: "Phase D — Dev Sprint"
1113
+ TaskCreate: "Phase R — Review"
1114
+ \`\`\`
1115
+
1116
+ Update each to \`in_progress\` when invoking, \`completed\` when phase returns done.
1117
+
397
1118
  ## Execution
398
1119
 
399
- Use the Skill tool to invoke each phase: aped-a, aped-p, aped-e, aped-d, aped-r.
400
- Each phase updates \`${a}/state.yaml\` and chains automatically.
1120
+ Use the Skill tool to invoke each phase: aped-a, aped-p, aped-ux (optional), aped-e, aped-d, aped-r.
1121
+ Each phase updates \`${o}/state.yaml\` and chains automatically.
401
1122
 
402
1123
  ## Interruption Handling
403
1124
 
404
- State persists in \`${a}/state.yaml\`. Next \`/aped-all\` resumes from last incomplete phase.
1125
+ State persists in \`${o}/state.yaml\`. Next \`/aped-all\` resumes from last incomplete phase.
405
1126
 
406
1127
  ## Completion Report
407
1128