@torka/claude-workflows 0.12.0 → 0.13.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/.claude-plugin/plugin.json +8 -0
  2. package/README.md +52 -5
  3. package/bmad-workflows/bmm/workflows/4-implementation/implement-epic-with-subagents/steps/step-01b-continue.md +9 -2
  4. package/bmad-workflows/bmm/workflows/4-implementation/implement-epic-with-subagents/steps/step-02-orchestrate.md +108 -2
  5. package/bmad-workflows/bmm/workflows/4-implementation/implement-epic-with-subagents/steps/step-03-complete.md +35 -1
  6. package/commands/deep-audit.md +530 -0
  7. package/commands/dev-story-backend.md +12 -11
  8. package/commands/dev-story-fullstack.md +6 -2
  9. package/commands/dev-story-ui.md +4 -4
  10. package/commands/github-pr-resolve.md +132 -24
  11. package/commands/plan-parallelization.md +20 -3
  12. package/examples/settings.local.example.json +17 -0
  13. package/install.js +14 -3
  14. package/package.json +1 -1
  15. package/skills/deep-audit/INSPIRATIONS.md +26 -0
  16. package/skills/deep-audit/SKILL.md +313 -0
  17. package/skills/deep-audit/agents/api-contract-reviewer.md +42 -0
  18. package/skills/deep-audit/agents/architecture-and-complexity.md +59 -0
  19. package/skills/deep-audit/agents/code-health.md +55 -0
  20. package/skills/deep-audit/agents/data-layer-reviewer.md +50 -0
  21. package/skills/deep-audit/agents/documentation-health.md +44 -0
  22. package/skills/deep-audit/agents/performance-profiler.md +42 -0
  23. package/skills/deep-audit/agents/refactoring-planner.md +161 -0
  24. package/skills/deep-audit/agents/security-and-error-handling.md +56 -0
  25. package/skills/deep-audit/agents/seo-accessibility-auditor.md +53 -0
  26. package/skills/deep-audit/agents/test-strategy-analyst.md +61 -0
  27. package/skills/deep-audit/agents/type-design-analyzer.md +49 -0
  28. package/skills/deep-audit/templates/report-template.md +152 -0
  29. package/skills/designer-founder/SKILL.md +8 -7
  30. package/skills/designer-founder/steps/step-01-context.md +94 -45
  31. package/skills/designer-founder/steps/step-02-scope.md +6 -23
  32. package/skills/designer-founder/steps/step-03-design.md +29 -58
  33. package/skills/designer-founder/steps/step-04-artifacts.md +137 -113
  34. package/skills/designer-founder/steps/step-05-epic-linking.md +81 -53
  35. package/skills/designer-founder/steps/step-06-validate.md +181 -0
  36. package/skills/designer-founder/templates/component-strategy.md +4 -0
  37. package/skills/designer-founder/tools/magicpatterns.md +52 -19
  38. package/skills/designer-founder/tools/stitch.md +97 -67
  39. package/uninstall.js +24 -0
@@ -1,11 +1,11 @@
1
- # Step 4: Convert & Create Artifacts
1
+ # Step 4: Create Artifacts
2
2
 
3
3
  ## MANDATORY EXECUTION RULES (READ FIRST)
4
4
 
5
- - 🛑 NEVER generate artifacts without user approval of content
6
- - 📖 CRITICAL: Use templates from `{installed_path}/templates/`
7
- - ALWAYS create artifacts in the designated output folder
8
- - 🎯 Goal: Transform design into dev-ready documentation
5
+ - NEVER generate artifacts without user approval of content
6
+ - CRITICAL: Use templates from `{installed_path}/templates/`
7
+ - ALWAYS create artifacts in the designated output folder
8
+ - Goal: Transform design into dev-ready documentation
9
9
 
10
10
  ---
11
11
 
@@ -16,7 +16,8 @@ You should have:
16
16
  - `scope`: What was designed
17
17
  - `design.tool_used`: Which tool created the design
18
18
  - `design.output_location`: Where the design lives
19
- - `design.needs_conversion`: Whether HTMLReact conversion is needed
19
+ - `design.needs_conversion`: Whether HTML->React conversion is needed
20
+ - `theme`: Theme info (if detected in Step 1)
20
21
 
21
22
  ---
22
23
 
@@ -34,7 +35,7 @@ Convert design output to dev-ready artifacts and save to `{planning_artifacts}/u
34
35
 
35
36
  Load and execute: `{installed_path}/tools/conversion.md`
36
37
 
37
- This handles HTMLReact conversion with strategies:
38
+ This handles HTML->React conversion with strategies:
38
39
  - Component Mapping (shadcn)
39
40
  - MagicPatterns Conversion
40
41
  - Hybrid
@@ -68,6 +69,10 @@ artifact_data:
68
69
  inspiration_sources: [list]
69
70
  ```
70
71
 
72
+ **File naming convention:** Detect the project's existing file naming convention by checking existing files in `{planning_artifacts}/`. Use that convention (kebab-case, camelCase, etc.) rather than hardcoding kebab-case.
73
+
74
+ **Epic prefix:** All UX design files MUST use the `epic-{N}-{feature}-` prefix to enable cross-referencing with epics. Validate this when naming artifact files.
75
+
71
76
  ---
72
77
 
73
78
  ### 3. Determine Artifacts to Create
@@ -78,15 +83,15 @@ Based on scope and design:
78
83
  ARTIFACTS TO GENERATE
79
84
 
80
85
  Required:
81
- Design Brief - Overview and decisions
82
- Component Strategy - What to install and build
86
+ [check] Design Brief - Overview and decisions
87
+ [check] Component Strategy - What to install and build
83
88
 
84
89
  Conditional:
85
- {✓/✗} Layouts - {if page/screen design, not just component}
86
- {✓/✗} User Journeys - {if multi-step flow}
90
+ {check} Layouts - {if page/screen design, not just component}
91
+ {check} User Journeys - {if multi-step flow}
87
92
 
88
93
  Output folder: {planning_artifacts}/ux-design/
89
- File prefix: {feature_name_kebab_case}-
94
+ File prefix: epic-{N}-{feature}-
90
95
  ```
91
96
 
92
97
  Confirm with user:
@@ -105,18 +110,18 @@ For each artifact, load template and populate:
105
110
  **Template:** `{installed_path}/templates/design-brief.md`
106
111
 
107
112
  Populate placeholders:
108
- - `{feature_name}` Scope item name
109
- - `{overview_description}` What was designed and why
110
- - `{design_decisions}` Key choices made
111
- - `{tool_used}` Design tool
112
- - `{output_location}` Prototype location
113
- - `{visual_direction}` Style notes
114
- - `{inspiration_sources}` References used
115
- - `{date}` Current date
113
+ - `{feature_name}` -> Scope item name
114
+ - `{overview_description}` -> What was designed and why
115
+ - `{design_decisions}` -> Key choices made
116
+ - `{tool_used}` -> Design tool
117
+ - `{output_location}` -> Prototype location
118
+ - `{visual_direction}` -> Style notes
119
+ - `{inspiration_sources}` -> References used
120
+ - `{date}` -> Current date
116
121
 
117
122
  **Tool-specific placeholders:**
118
123
 
119
- - `{tool_specific_notes}` Generate based on tool used:
124
+ - `{tool_specific_notes}` -> Generate based on tool used:
120
125
  - **MagicPatterns:** "React/TypeScript code ready for extraction. Use `read_files` MCP tool to access."
121
126
  - **SuperDesign:** "HTML/CSS prototype. Requires conversion to React components."
122
127
  - **Stitch (with react-components):** "React/TypeScript components generated via Google's react-components skill. AST-validated, includes hooks extraction and data decoupling."
@@ -124,7 +129,7 @@ Populate placeholders:
124
129
  - **Wireframe:** "Structure reference only. Build components from scratch."
125
130
  - **Direct:** "Component mapping provided. No visual prototype created."
126
131
 
127
- - `{implementation_source_section}` When MagicPatterns used:
132
+ - `{implementation_source_section}` -> When MagicPatterns used:
128
133
  ```markdown
129
134
  | Component | Source URL | Files to Extract |
130
135
  |-----------|------------|------------------|
@@ -141,18 +146,77 @@ Populate placeholders:
141
146
  **Template:** `{installed_path}/templates/component-strategy.md`
142
147
 
143
148
  Populate placeholders:
144
- - `{feature_name}` Scope item name
145
- - `{shadcn_components}` Installation command components
146
- - `{component_mapping_rows}` Table rows of elementcomponent mapping
147
- - `{shadcn_component_details}` Details for each shadcn component
148
- - `{custom_component_details}` Build approach for custom components
149
- - `{magicpatterns_section}` URLs and extraction instructions (if used)
150
- - `{implementation_notes}` Any special considerations
151
- - `{date}` Current date
149
+ - `{feature_name}` -> Scope item name
150
+ - `{shadcn_components}` -> Installation command components
151
+ - `{component_mapping_rows}` -> Table rows of element->component mapping
152
+ - `{shadcn_component_details}` -> Details for each shadcn component
153
+ - `{custom_component_details}` -> Build approach for custom components
154
+ - `{magicpatterns_section}` -> URLs and extraction instructions (if used)
155
+ - `{implementation_notes}` -> Any special considerations
156
+ - `{date}` -> Current date
157
+
158
+ **Theme integration placeholder (`{theme_integration_section}`):**
159
+
160
+ When a theme was provided in Step 1, populate with:
161
+ ```markdown
162
+ ## Theme Integration
163
+
164
+ ### Token File
165
+ Reference: `{theme.tokens_file}`
166
+
167
+ ### CSS Custom Properties Setup
168
+ Add to `globals.css`:
169
+ ```css
170
+ @layer base {
171
+ :root {
172
+ /* Map from tokens.json HSL values to shadcn CSS variables */
173
+ --background: {tokens.background};
174
+ --foreground: {tokens.foreground};
175
+ --primary: {tokens.primary};
176
+ --primary-foreground: {tokens.primary-foreground};
177
+ /* ... map all token values */
178
+ }
179
+ }
180
+ ```
181
+
182
+ ### Token-to-shadcn Mapping
183
+ shadcn components use `hsl(var(--primary))` pattern. Ensure all tokens.json values
184
+ are mapped to the corresponding CSS custom properties in globals.css.
185
+ ```
186
+
187
+ When no theme was provided: Empty string.
188
+
189
+ **Interaction patterns placeholder (`{interaction_patterns_section}`):**
190
+
191
+ When designs reference transient/interaction UI patterns, populate with:
192
+ ```markdown
193
+ ## Interaction Patterns
194
+
195
+ ### Toast/Notification
196
+ - Library: sonner (recommended with shadcn)
197
+ - Setup: `npx shadcn@latest add sonner`
198
+ - Usage: Success confirmations, error alerts, action feedback
199
+
200
+ ### Loading States
201
+ - Skeleton: `npx shadcn@latest add skeleton`
202
+ - Spinner: [custom or library recommendation]
203
+ - Usage: Data fetching, form submission, page transitions
204
+
205
+ ### Error States
206
+ - Inline: Form field validation errors
207
+ - Toast: API/network errors
208
+ - Page-level: 404, 500, empty results
209
+
210
+ ### Empty States
211
+ - Pattern: Centered illustration + message + CTA
212
+ - Usage: No data, first-time use, search with no results
213
+ ```
214
+
215
+ When designs don't reference these patterns: Empty string.
152
216
 
153
217
  **MagicPatterns-specific placeholders (when `design.tool_used` = magicpatterns):**
154
218
 
155
- - `{magicpatterns_extraction_warning}` Include this warning block:
219
+ - `{magicpatterns_extraction_warning}` -> Include this warning block:
156
220
  ```markdown
157
221
  > **CRITICAL: EXTRACT CODE, DO NOT REBUILD**
158
222
  >
@@ -161,7 +225,7 @@ Populate placeholders:
161
225
  > Only adapt for project patterns (Supabase auth, react-hook-form, etc.)
162
226
  ```
163
227
 
164
- - `{extraction_table}` Generate extraction guide from design registry:
228
+ - `{extraction_table}` -> Generate extraction guide from design registry:
165
229
  ```markdown
166
230
  | Design | MagicPatterns URL | Primary File | Key Elements |
167
231
  |--------|-------------------|--------------|--------------|
@@ -169,7 +233,7 @@ Populate placeholders:
169
233
  | Sign Up | [View](url) | SignUpForm.tsx | Multi-step form, password strength |
170
234
  ```
171
235
 
172
- - `{what_not_to_do_section}` Include this section:
236
+ - `{what_not_to_do_section}` -> Include this section:
173
237
  ```markdown
174
238
  ## What NOT to Do
175
239
 
@@ -182,9 +246,9 @@ Populate placeholders:
182
246
  ```
183
247
 
184
248
  **For non-MagicPatterns tools:**
185
- - `{magicpatterns_extraction_warning}` Empty string
186
- - `{extraction_table}` Empty string or "N/A - Design created with {tool_used}"
187
- - `{what_not_to_do_section}` Empty string
249
+ - `{magicpatterns_extraction_warning}` -> Empty string
250
+ - `{extraction_table}` -> Empty string or "N/A - Design created with {tool_used}"
251
+ - `{what_not_to_do_section}` -> Empty string
188
252
 
189
253
  **Save to:** `{planning_artifacts}/ux-design/{prefix}component-strategy.md`
190
254
 
@@ -197,19 +261,19 @@ Populate placeholders:
197
261
  Only generate if designing pages/screens (not standalone components).
198
262
 
199
263
  Populate placeholders:
200
- - `{feature_name}` Scope item name
201
- - `{desktop_layout_ascii}` Desktop wireframe
202
- - `{desktop_notes}` Layout notes
203
- - `{tablet_layout_ascii}` Tablet wireframe
204
- - `{tablet_changes}` What changes
205
- - `{mobile_layout_ascii}` Mobile wireframe
206
- - `{mobile_changes}` What changes
207
- - `{responsive_summary_rows}` Table of element behavior
208
- - `{date}` Current date
264
+ - `{feature_name}` -> Scope item name
265
+ - `{desktop_layout_ascii}` -> Desktop wireframe
266
+ - `{desktop_notes}` -> Layout notes
267
+ - `{tablet_layout_ascii}` -> Tablet wireframe
268
+ - `{tablet_changes}` -> What changes
269
+ - `{mobile_layout_ascii}` -> Mobile wireframe
270
+ - `{mobile_changes}` -> What changes
271
+ - `{responsive_summary_rows}` -> Table of element behavior
272
+ - `{date}` -> Current date
209
273
 
210
274
  **Implementation note placeholder:**
211
275
 
212
- - `{layout_implementation_note}` When MagicPatterns used:
276
+ - `{layout_implementation_note}` -> When MagicPatterns used:
213
277
  ```markdown
214
278
  > **NOTE: Layouts Already Implemented**
215
279
  >
@@ -232,20 +296,20 @@ Populate placeholders:
232
296
  Only generate if multi-step flow (wizard, checkout, onboarding, etc.).
233
297
 
234
298
  Populate placeholders:
235
- - `{feature_name}` Scope item name
236
- - `{journey_name}` Name of the flow
237
- - `{journey_trigger}` What starts the journey
238
- - `{journey_goal}` What user accomplishes
239
- - `{mermaid_flowchart}` Flow diagram in Mermaid syntax
240
- - `{journey_steps}` Detailed step descriptions
241
- - `{alternative_flows}` Other paths
242
- - `{edge_cases}` Edge case handling
243
- - `{error_states}` Error handling
244
- - `{date}` Current date
299
+ - `{feature_name}` -> Scope item name
300
+ - `{journey_name}` -> Name of the flow
301
+ - `{journey_trigger}` -> What starts the journey
302
+ - `{journey_goal}` -> What user accomplishes
303
+ - `{mermaid_flowchart}` -> Flow diagram in Mermaid syntax
304
+ - `{journey_steps}` -> Detailed step descriptions
305
+ - `{alternative_flows}` -> Other paths
306
+ - `{edge_cases}` -> Edge case handling
307
+ - `{error_states}` -> Error handling
308
+ - `{date}` -> Current date
245
309
 
246
310
  **Implementation source placeholder:**
247
311
 
248
- - `{journey_implementation_sources}` Link each journey step to its design source:
312
+ - `{journey_implementation_sources}` -> Link each journey step to its design source:
249
313
  ```markdown
250
314
  | Step | Design Source | Primary File | Key Feature |
251
315
  |------|---------------|--------------|-------------|
@@ -267,15 +331,15 @@ ARTIFACTS CREATED
267
331
  Location: {planning_artifacts}/ux-design/
268
332
 
269
333
  Files:
270
- {prefix}design-brief.md
271
- {prefix}component-strategy.md
272
- { {prefix}layouts.md}
273
- { {prefix}user-journeys.md}
334
+ [done] {prefix}design-brief.md
335
+ [done] {prefix}component-strategy.md
336
+ {[done] {prefix}layouts.md}
337
+ {[done] {prefix}user-journeys.md}
274
338
 
275
339
  Options:
276
340
  [R] Review - Show artifact contents
277
341
  [E] Edit - Make changes to an artifact
278
- [C] Complete - Finalize workflow
342
+ [C] Continue - Proceed to update product docs
279
343
  ```
280
344
 
281
345
  **If R (Review):**
@@ -288,45 +352,8 @@ Options:
288
352
  - Update the file
289
353
  - Return to options
290
354
 
291
- ---
292
-
293
- ### 6. Workflow Complete
294
-
295
- ```
296
- DESIGN WORKFLOW COMPLETE ✓
297
-
298
- Summary:
299
- ─────────────────────────────────────
300
- Mode: {mode}
301
- Tool: {design.tool_used}
302
- Prototype: {design.output_location}
303
-
304
- Artifacts:
305
- {list of created files with paths}
306
-
307
- Next Steps for Development:
308
- ─────────────────────────────────────
309
- 1. Install components:
310
- {install_command}
311
-
312
- 2. Review component strategy for custom builds
313
-
314
- 3. Reference layouts during implementation
315
-
316
- {If related story exists:}
317
- This design supports: {story_reference}
318
- Ready for implementation via /dev-story workflow.
319
- ─────────────────────────────────────
320
-
321
- [L] Link to Epics - Update implementation plans with UX references
322
- [N] New Design - Start another design session
323
- [D] Done - Exit workflow
324
- ```
325
-
326
- **Menu Handlers:**
327
- - **L**: Load `./step-05-epic-linking.md` to cross-reference designs in epic files
328
- - **N**: Restart workflow from Step 1
329
- - **D**: Exit workflow
355
+ **If C (Continue):**
356
+ - Auto-advance to Step 5
330
357
 
331
358
  ---
332
359
 
@@ -359,20 +386,17 @@ Options:
359
386
 
360
387
  ---
361
388
 
362
- ## COLLABORATION MENU
389
+ ## SUCCESS CRITERIA
363
390
 
364
- ```
365
- [A] Advanced - Refine artifacts further
366
- [P] Party Mode - Get dev/PM review of artifacts
367
- [C] Complete - Finish workflow
368
- ```
391
+ - Design converted to component mapping (if needed)
392
+ - All applicable artifacts created
393
+ - Files saved to correct location with epic-{N}-{feature}- prefix
394
+ - shadcn installation command provided
395
+ - Custom components identified with build approach
396
+ - Theme integration documented (if theme provided)
369
397
 
370
398
  ---
371
399
 
372
- ## SUCCESS CRITERIA
400
+ ## NEXT STEP
373
401
 
374
- Design converted to component mapping (if needed)
375
- ✅ All applicable artifacts created
376
- ✅ Files saved to correct location
377
- ✅ shadcn installation command provided
378
- ✅ Custom components identified with build approach
402
+ Auto-advance to `./step-05-epic-linking.md`
@@ -1,11 +1,11 @@
1
- # Step 5: Epic Linking
1
+ # Step 5: Update Product Artifacts
2
2
 
3
3
  ## MANDATORY EXECUTION RULES (READ FIRST)
4
4
 
5
- - 🛑 NEVER modify epic files without user approval
6
- - 📖 CRITICAL: Preview all changes before applying
7
- - ALWAYS preserve existing epic content (targeted edits only)
8
- - 🎯 Goal: Cross-reference UX designs in implementation plans
5
+ - NEVER modify epic files without user approval
6
+ - CRITICAL: Preview all changes before applying
7
+ - ALWAYS preserve existing epic content (targeted edits only)
8
+ - Goal: Cross-reference UX designs in implementation plans and backport scope changes
9
9
 
10
10
  ---
11
11
 
@@ -14,15 +14,17 @@
14
14
  You should have from Step 4:
15
15
  - `artifact_data.feature_name`: What was designed
16
16
  - `artifact_data.date`: Current date
17
- - `design.tool_used`: Which tool created the design (magicpatterns, superdesign, wireframe, direct)
17
+ - `design.tool_used`: Which tool created the design (magicpatterns, superdesign, stitch, wireframe, direct)
18
18
  - `design.output_location`: Where the design lives (URL or folder path)
19
19
  - Files created in `{planning_artifacts}/ux-design/` with prefix like `epic-3-onboarding-*`
20
+ - `theme`: Theme info (if used)
20
21
 
21
22
  ---
22
23
 
23
24
  ## YOUR TASK
24
25
 
25
- Connect UX design artifacts to epic files so developers can find designs during implementation.
26
+ 1. Connect UX design artifacts to epic files so developers can find designs during implementation.
27
+ 2. Backport any scope changes discovered during design to upstream product docs.
26
28
 
27
29
  ---
28
30
 
@@ -30,13 +32,12 @@ Connect UX design artifacts to epic files so developers can find designs during
30
32
 
31
33
  ### 1. Detect Related Epics
32
34
 
33
- Extract epic number from artifact prefix:
35
+ Auto-detect related epics from artifact prefix:
34
36
 
35
37
  **Pattern:** `{prefix}design-brief.md` where prefix = `epic-{N}-{feature-name}-`
36
38
 
37
39
  ```
38
40
  SCANNING FOR RELATED EPICS
39
- ─────────────────────────────────────
40
41
 
41
42
  Artifact prefix: {prefix}
42
43
  Detected epic: Epic {N}
@@ -45,7 +46,7 @@ Searching: {planning_artifacts}/epics/
45
46
  ```
46
47
 
47
48
  **Search logic:**
48
- 1. Parse artifact filename prefix (e.g., `epic-3-onboarding-` Epic 3)
49
+ 1. Parse artifact filename prefix (e.g., `epic-3-onboarding-` -> Epic 3)
49
50
  2. Find epic file: `epic-{N}-*.md` in `{planning_artifacts}/epics/`
50
51
  3. If multiple matches, list all and ask user to select
51
52
 
@@ -80,7 +81,6 @@ epic_analysis:
80
81
  **Report to user:**
81
82
  ```
82
83
  EPIC ANALYSIS
83
- ─────────────────────────────────────
84
84
 
85
85
  Found: {Epic N: Title}
86
86
  Location: {epic_file_path}
@@ -150,6 +150,13 @@ For each story, determine if there's a matching design:
150
150
  - **Components:** shadcn `Button`, custom `FeatureCard`
151
151
  ```
152
152
 
153
+ **Stitch:**
154
+ ```markdown
155
+ **UX Design:**
156
+ - **Prototype:** [Screen Title]({stitch_project_url})
157
+ - **Components:** shadcn `Card`, custom `DashboardLayout`
158
+ ```
159
+
153
160
  **Direct Mapping (shadcn research):**
154
161
  ```markdown
155
162
  **UX Design:**
@@ -166,13 +173,46 @@ For each story, determine if there's a matching design:
166
173
 
167
174
  ---
168
175
 
169
- ### 5. Preview Changes
176
+ ### 5. Upstream Doc Updates
177
+
178
+ Check if the design process revealed scope changes that should be backported:
179
+
180
+ **Look for:**
181
+ - New screens/pages that weren't in original epics
182
+ - Modified user flows (steps added/removed/reordered)
183
+ - Dropped features (designed but determined unnecessary)
184
+ - New components or patterns not anticipated in stories
185
+
186
+ **If scope changes detected:**
187
+ ```
188
+ SCOPE CHANGES FROM DESIGN
189
+
190
+ The design process revealed these differences from current specs:
191
+
192
+ Added:
193
+ + {new screen/flow/component} - Not in current epics
194
+
195
+ Modified:
196
+ ~ {changed flow} - Original: {old}, Design: {new}
197
+
198
+ Dropped:
199
+ - {removed feature} - Determined unnecessary during design
200
+
201
+ Should I update the epic/stories to reflect these changes?
202
+ [Y] Yes - Update upstream docs
203
+ [N] No - Keep epics as-is (design artifacts document the changes)
204
+ ```
205
+
206
+ **If Y:** Apply targeted edits to epic/story files to reflect design decisions.
207
+
208
+ ---
209
+
210
+ ### 6. Preview Changes
170
211
 
171
212
  Present all changes before applying:
172
213
 
173
214
  ```
174
215
  PROPOSED CHANGES
175
- ─────────────────────────────────────
176
216
 
177
217
  Epic: {Epic N: Title}
178
218
  File: {epic_file_path}
@@ -184,31 +224,28 @@ EPIC-LEVEL (after Goal line):
184
224
  + - [User Journeys](../ux-design/{prefix}user-journeys.md)
185
225
 
186
226
  STORY-LEVEL:
187
- Story {N.1}: {title}
227
+ o Story {N.1}: {title}
188
228
  + **UX Design:**
189
229
  + - **Prototype:** [{title}]({url})
190
230
  + - **Components:** `Component.tsx`
191
231
 
192
- Story {N.2}: {title}
232
+ o Story {N.2}: {title}
193
233
  (no matching design found - skipping)
194
234
 
195
- Story {N.3}: {title}
235
+ o Story {N.3}: {title}
196
236
  + **UX Design:**
197
237
  + - **Prototype:** [{title}]({url})
198
238
  + - **Components:** shadcn `Select`, `Preferences.tsx`
199
239
 
200
- ─────────────────────────────────────
201
-
202
240
  Options:
203
241
  [A] Apply all - Add all UX references
204
- [E] Epic only - Only add epic-level section
205
242
  [S] Select - Choose which stories to update
206
243
  [X] Cancel - Return without changes
207
244
  ```
208
245
 
209
246
  ---
210
247
 
211
- ### 6. Apply Changes
248
+ ### 7. Apply Changes
212
249
 
213
250
  **If user approves:**
214
251
 
@@ -219,7 +256,7 @@ Execute targeted edits:
219
256
  - Insert after match: UX Design Artifacts section + blank line
220
257
 
221
258
  2. **Story-level:** Insert after `**Acceptance Criteria:**` section, before `---`
222
- - Find: Story heading Acceptance Criteria last criterion line
259
+ - Find: Story heading -> Acceptance Criteria -> last criterion line
223
260
  - Insert before `---`: UX Design section + blank line
224
261
 
225
262
  **Use Edit tool for each change:**
@@ -232,14 +269,15 @@ Editing: {epic_file_path}
232
269
 
233
270
  **After all edits:**
234
271
  ```
235
- EPIC LINKING COMPLETE ✓
272
+ PRODUCT DOCS UPDATED
236
273
 
237
274
  Updated: {epic_file_path}
238
275
 
239
276
  Changes made:
240
- Epic-level UX Design Artifacts section
241
- Story {N.1} UX Design reference
242
- Story {N.3} UX Design reference
277
+ [done] Epic-level UX Design Artifacts section
278
+ [done] Story {N.1} UX Design reference
279
+ [done] Story {N.3} UX Design reference
280
+ {[done] Upstream scope changes applied}
243
281
 
244
282
  Stories skipped (no matching design):
245
283
  - Story {N.2}
@@ -247,23 +285,6 @@ Stories skipped (no matching design):
247
285
 
248
286
  ---
249
287
 
250
- ### 7. Return to Completion Menu
251
-
252
- ```
253
- ─────────────────────────────────────
254
-
255
- [L] Link more - Link to additional epics
256
- [N] New Design - Start another design session
257
- [D] Done - Exit workflow
258
- ```
259
-
260
- **Menu Handlers:**
261
- - **L**: Restart from Section 1 (epic detection)
262
- - **N**: Load `./step-01-context.md`
263
- - **D**: Exit workflow
264
-
265
- ---
266
-
267
288
  ## EDGE CASE HANDLING
268
289
 
269
290
  ### No Related Epic Found
@@ -289,14 +310,14 @@ Options:
289
310
 
290
311
  **If C:**
291
312
  - Display formatted markdown sections for user to copy
292
- - Return to completion menu
313
+ - Proceed to Step 6
293
314
 
294
315
  ### Epic Already Has Complete UX Section
295
316
 
296
317
  ```
297
318
  Epic {N} already has UX Design references:
298
319
 
299
- Epic-level: Present
320
+ Epic-level: Present
300
321
  Stories with UX: 5/5
301
322
 
302
323
  Options:
@@ -324,14 +345,13 @@ When design doesn't map cleanly to stories:
324
345
 
325
346
  ```
326
347
  DESIGN-TO-STORY MAPPING
327
- ─────────────────────────────────────
328
348
 
329
349
  Design: {feature_name}
330
350
  Stories in Epic {N}: 7
331
351
 
332
352
  Auto-matched:
333
- Story 3.1 Onboarding Step 1 design
334
- Story 3.3 Preferences design
353
+ [done] Story 3.1 -> Onboarding Step 1 design
354
+ [done] Story 3.3 -> Preferences design
335
355
 
336
356
  Unmatched stories (manual mapping needed):
337
357
  ? Story 3.2 - Feature Tour
@@ -356,15 +376,23 @@ linking_result:
356
376
  epic_level_added: true
357
377
  stories_linked: ["3.1", "3.3", "3.5"]
358
378
  stories_skipped: ["3.2", "3.4"]
379
+ upstream_changes_applied: true/false
359
380
  ```
360
381
 
361
382
  ---
362
383
 
363
384
  ## SUCCESS CRITERIA
364
385
 
365
- Related epic file identified (or user provided path)
366
- Changes previewed before applying
367
- Epic-level UX Design Artifacts section added
368
- Story-level UX Design sections added where applicable
369
- Existing epic content preserved
370
- Relative paths correct (`../ux-design/...`)
386
+ - Related epic file identified (or user provided path)
387
+ - Changes previewed before applying
388
+ - Epic-level UX Design Artifacts section added
389
+ - Story-level UX Design sections added where applicable
390
+ - Existing epic content preserved
391
+ - Relative paths correct (`../ux-design/...`)
392
+ - Upstream scope changes backported (if any)
393
+
394
+ ---
395
+
396
+ ## NEXT STEP
397
+
398
+ Auto-advance to `./step-06-validate.md`