@torka/claude-workflows 0.6.0 → 0.6.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@torka/claude-workflows",
3
- "version": "0.6.0",
3
+ "version": "0.6.2",
4
4
  "description": "Claude Code workflow helpers: epic automation, git cleanup, agents, and design workflows",
5
5
  "keywords": [
6
6
  "claude-code",
@@ -33,7 +33,7 @@ You are an expert UI/UX designer and visual design specialist who:
33
33
 
34
34
  ## WORKFLOW ARCHITECTURE
35
35
 
36
- This uses **micro-file architecture** with 4 core steps:
36
+ This uses **micro-file architecture** with 5 core steps:
37
37
 
38
38
  | Step | Name | Purpose |
39
39
  |------|------|---------|
@@ -41,9 +41,10 @@ This uses **micro-file architecture** with 4 core steps:
41
41
  | 2 | Scope & Inspiration | Define what to design, gather references |
42
42
  | 3 | Design | Execute design using selected tool |
43
43
  | 4 | Convert & Artifacts | Transform to dev-ready output |
44
+ | 5 | Epic Linking | Connect designs to implementation plans (optional) |
44
45
 
45
46
  **Quick Prototype Mode:** Steps 1 → 3 (skip detailed artifacts)
46
- **Production Mode:** Steps 1 → 2 → 3 → 4 (full flow)
47
+ **Production Mode:** Steps 1 → 2 → 3 → 4 → 5 (optional) (full flow)
47
48
 
48
49
  ---
49
50
 
@@ -238,10 +238,16 @@ This design supports: {story_reference}
238
238
  Ready for implementation via /dev-story workflow.
239
239
  ─────────────────────────────────────
240
240
 
241
+ [L] Link to Epics - Update implementation plans with UX references
241
242
  [N] New Design - Start another design session
242
243
  [D] Done - Exit workflow
243
244
  ```
244
245
 
246
+ **Menu Handlers:**
247
+ - **L**: Load `./step-05-epic-linking.md` to cross-reference designs in epic files
248
+ - **N**: Restart workflow from Step 1
249
+ - **D**: Exit workflow
250
+
245
251
  ---
246
252
 
247
253
  ## OUTPUT FOLDER MANAGEMENT
@@ -0,0 +1,370 @@
1
+ # Step 5: Epic Linking
2
+
3
+ ## MANDATORY EXECUTION RULES (READ FIRST)
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
9
+
10
+ ---
11
+
12
+ ## CONTEXT FROM PREVIOUS STEPS
13
+
14
+ You should have from Step 4:
15
+ - `artifact_data.feature_name`: What was designed
16
+ - `artifact_data.date`: Current date
17
+ - `design.tool_used`: Which tool created the design (magicpatterns, superdesign, wireframe, direct)
18
+ - `design.output_location`: Where the design lives (URL or folder path)
19
+ - Files created in `{planning_artifacts}/ux-design/` with prefix like `epic-3-onboarding-*`
20
+
21
+ ---
22
+
23
+ ## YOUR TASK
24
+
25
+ Connect UX design artifacts to epic files so developers can find designs during implementation.
26
+
27
+ ---
28
+
29
+ ## TASK SEQUENCE
30
+
31
+ ### 1. Detect Related Epics
32
+
33
+ Extract epic number from artifact prefix:
34
+
35
+ **Pattern:** `{prefix}design-brief.md` where prefix = `epic-{N}-{feature-name}-`
36
+
37
+ ```
38
+ SCANNING FOR RELATED EPICS
39
+ ─────────────────────────────────────
40
+
41
+ Artifact prefix: {prefix}
42
+ Detected epic: Epic {N}
43
+
44
+ Searching: {planning_artifacts}/epics/
45
+ ```
46
+
47
+ **Search logic:**
48
+ 1. Parse artifact filename prefix (e.g., `epic-3-onboarding-` → Epic 3)
49
+ 2. Find epic file: `epic-{N}-*.md` in `{planning_artifacts}/epics/`
50
+ 3. If multiple matches, list all and ask user to select
51
+
52
+ **If no epic found:**
53
+ ```
54
+ No matching epic file found for "{prefix}".
55
+
56
+ Options:
57
+ [P] Provide path - Enter epic file path manually
58
+ [S] Skip - Continue without linking
59
+ ```
60
+
61
+ ---
62
+
63
+ ### 2. Analyze Epic Structure
64
+
65
+ Read the epic file and identify:
66
+
67
+ ```yaml
68
+ epic_analysis:
69
+ file_path: "{epic_file_path}"
70
+ title: "{Epic N: Title}"
71
+ has_ux_section: [true/false]
72
+ stories:
73
+ - number: "3.1"
74
+ title: "Story title"
75
+ has_ux_design: [true/false]
76
+ - number: "3.2"
77
+ ...
78
+ ```
79
+
80
+ **Report to user:**
81
+ ```
82
+ EPIC ANALYSIS
83
+ ─────────────────────────────────────
84
+
85
+ Found: {Epic N: Title}
86
+ Location: {epic_file_path}
87
+
88
+ Current UX Design references:
89
+ - Epic level: {Yes/No}
90
+ - Stories with UX Design section: {count}/{total}
91
+
92
+ Artifacts to link:
93
+ - {prefix}design-brief.md
94
+ - {prefix}component-strategy.md
95
+ {- {prefix}layouts.md}
96
+ {- {prefix}user-journeys.md}
97
+ ```
98
+
99
+ ---
100
+
101
+ ### 3. Prepare Epic-Level Link
102
+
103
+ **If epic does NOT have UX Design section:**
104
+
105
+ Generate section to insert after **Goal:** line:
106
+
107
+ ```markdown
108
+ **UX Design Artifacts:**
109
+ - [Design Brief](../ux-design/{prefix}design-brief.md)
110
+ - [Component Strategy](../ux-design/{prefix}component-strategy.md)
111
+ {- [Layouts](../ux-design/{prefix}layouts.md)}
112
+ {- [User Journeys](../ux-design/{prefix}user-journeys.md)}
113
+ ```
114
+
115
+ **If epic already has UX Design section:**
116
+
117
+ ```
118
+ Epic already has UX Design Artifacts section.
119
+
120
+ Options:
121
+ [U] Update - Replace with new links
122
+ [M] Merge - Add new links to existing
123
+ [K] Keep - Leave epic-level unchanged
124
+ ```
125
+
126
+ ---
127
+
128
+ ### 4. Prepare Story-Level Links
129
+
130
+ For each story, determine if there's a matching design:
131
+
132
+ **Matching logic:**
133
+ - Check if `design.output_location` contains story-specific designs
134
+ - For MagicPatterns: Check design registry from Step 3 for story-matched URLs
135
+ - For other tools: Match by feature name similarity
136
+
137
+ **Story-level UX Design format varies by tool:**
138
+
139
+ **MagicPatterns:**
140
+ ```markdown
141
+ **UX Design:**
142
+ - **Prototype:** [Story Title]({magicpatterns_url})
143
+ - **Components:** `ComponentA.tsx`, `ComponentB.tsx`
144
+ ```
145
+
146
+ **SuperDesign:**
147
+ ```markdown
148
+ **UX Design:**
149
+ - **Prototype:** `.superdesign/design_iterations/{feature}/`
150
+ - **Components:** shadcn `Button`, custom `FeatureCard`
151
+ ```
152
+
153
+ **Direct Mapping (shadcn research):**
154
+ ```markdown
155
+ **UX Design:**
156
+ - **Components:** shadcn `Card`, shadcn `Form`, custom `UserCard`
157
+ - **See:** [Component Strategy](../ux-design/{prefix}component-strategy.md)
158
+ ```
159
+
160
+ **Wireframe:**
161
+ ```markdown
162
+ **UX Design:**
163
+ - **Wireframe:** See [Layouts](../ux-design/{prefix}layouts.md)
164
+ - **Components:** shadcn `Card`, custom `WizardStep`
165
+ ```
166
+
167
+ ---
168
+
169
+ ### 5. Preview Changes
170
+
171
+ Present all changes before applying:
172
+
173
+ ```
174
+ PROPOSED CHANGES
175
+ ─────────────────────────────────────
176
+
177
+ Epic: {Epic N: Title}
178
+ File: {epic_file_path}
179
+
180
+ EPIC-LEVEL (after Goal line):
181
+ + **UX Design Artifacts:**
182
+ + - [Design Brief](../ux-design/{prefix}design-brief.md)
183
+ + - [Component Strategy](../ux-design/{prefix}component-strategy.md)
184
+ + - [User Journeys](../ux-design/{prefix}user-journeys.md)
185
+
186
+ STORY-LEVEL:
187
+ ○ Story {N.1}: {title}
188
+ + **UX Design:**
189
+ + - **Prototype:** [{title}]({url})
190
+ + - **Components:** `Component.tsx`
191
+
192
+ ○ Story {N.2}: {title}
193
+ (no matching design found - skipping)
194
+
195
+ ○ Story {N.3}: {title}
196
+ + **UX Design:**
197
+ + - **Prototype:** [{title}]({url})
198
+ + - **Components:** shadcn `Select`, `Preferences.tsx`
199
+
200
+ ─────────────────────────────────────
201
+
202
+ Options:
203
+ [A] Apply all - Add all UX references
204
+ [E] Epic only - Only add epic-level section
205
+ [S] Select - Choose which stories to update
206
+ [X] Cancel - Return without changes
207
+ ```
208
+
209
+ ---
210
+
211
+ ### 6. Apply Changes
212
+
213
+ **If user approves:**
214
+
215
+ Execute targeted edits:
216
+
217
+ 1. **Epic-level:** Insert after the line containing `**Goal:**`
218
+ - Find: `**Goal:**.*\n`
219
+ - Insert after match: UX Design Artifacts section + blank line
220
+
221
+ 2. **Story-level:** Insert after `**Acceptance Criteria:**` section, before `---`
222
+ - Find: Story heading → Acceptance Criteria → last criterion line
223
+ - Insert before `---`: UX Design section + blank line
224
+
225
+ **Use Edit tool for each change:**
226
+ ```
227
+ Editing: {epic_file_path}
228
+ - Adding epic-level UX references...
229
+ - Adding Story {N.1} UX references...
230
+ - Adding Story {N.3} UX references...
231
+ ```
232
+
233
+ **After all edits:**
234
+ ```
235
+ EPIC LINKING COMPLETE ✓
236
+
237
+ Updated: {epic_file_path}
238
+
239
+ Changes made:
240
+ ✓ Epic-level UX Design Artifacts section
241
+ ✓ Story {N.1} UX Design reference
242
+ ✓ Story {N.3} UX Design reference
243
+
244
+ Stories skipped (no matching design):
245
+ - Story {N.2}
246
+ ```
247
+
248
+ ---
249
+
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
+ ## EDGE CASE HANDLING
268
+
269
+ ### No Related Epic Found
270
+
271
+ ```
272
+ No epic file found matching artifact prefix "{prefix}".
273
+
274
+ This may happen when:
275
+ - Design is for a feature without a defined epic
276
+ - Artifact naming doesn't follow epic-{N}- pattern
277
+ - Epic files are in a different location
278
+
279
+ Options:
280
+ [P] Provide path - Enter epic file path manually
281
+ [C] Create reference - Just show the links to copy manually
282
+ [S] Skip - Continue without linking
283
+ ```
284
+
285
+ **If P:**
286
+ - Prompt for epic file path
287
+ - Validate file exists
288
+ - Continue with linking flow
289
+
290
+ **If C:**
291
+ - Display formatted markdown sections for user to copy
292
+ - Return to completion menu
293
+
294
+ ### Epic Already Has Complete UX Section
295
+
296
+ ```
297
+ Epic {N} already has UX Design references:
298
+
299
+ Epic-level: ✓ Present
300
+ Stories with UX: 5/5
301
+
302
+ Options:
303
+ [R] Review current - Show existing UX sections
304
+ [U] Update anyway - Replace with current design references
305
+ [S] Skip - Keep existing references
306
+ ```
307
+
308
+ ### Multiple Epics Match
309
+
310
+ If artifact prefix is ambiguous or design spans epics:
311
+
312
+ ```
313
+ Multiple related epics detected:
314
+
315
+ [1] Epic 2: Authentication Experience
316
+ [2] Epic 3: User Onboarding & Welcome
317
+
318
+ Select which to update (comma-separated, or A for all):
319
+ ```
320
+
321
+ ### Story-Design Mismatch
322
+
323
+ When design doesn't map cleanly to stories:
324
+
325
+ ```
326
+ DESIGN-TO-STORY MAPPING
327
+ ─────────────────────────────────────
328
+
329
+ Design: {feature_name}
330
+ Stories in Epic {N}: 7
331
+
332
+ Auto-matched:
333
+ ✓ Story 3.1 → Onboarding Step 1 design
334
+ ✓ Story 3.3 → Preferences design
335
+
336
+ Unmatched stories (manual mapping needed):
337
+ ? Story 3.2 - Feature Tour
338
+ ? Story 3.4 - Progress & Skip
339
+
340
+ Unmatched designs:
341
+ ? Dashboard Welcome component
342
+
343
+ Options:
344
+ [M] Manual map - Match designs to stories manually
345
+ [A] Auto only - Only link matched stories
346
+ [S] Skip stories - Only add epic-level links
347
+ ```
348
+
349
+ ---
350
+
351
+ ## STATE TO CARRY FORWARD
352
+
353
+ ```yaml
354
+ linking_result:
355
+ epic_file: "{path}"
356
+ epic_level_added: true
357
+ stories_linked: ["3.1", "3.3", "3.5"]
358
+ stories_skipped: ["3.2", "3.4"]
359
+ ```
360
+
361
+ ---
362
+
363
+ ## SUCCESS CRITERIA
364
+
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/...`)