@torka/claude-workflows 0.6.1 → 0.6.3

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.1",
3
+ "version": "0.6.3",
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
 
@@ -134,6 +134,66 @@ Ready to create dev handover artifacts.
134
134
 
135
135
  ---
136
136
 
137
+ ### 5.5 Validate All Designs (Before Step 4)
138
+
139
+ **When scope has multiple items**, validate coverage before proceeding to artifacts:
140
+
141
+ ```
142
+ DESIGN VALIDATION
143
+
144
+ Checking scope coverage:
145
+ {foreach scope_item}
146
+ [✓/✗] {item_name}: {url_or_missing}
147
+ {/foreach}
148
+
149
+ ─────────────────────────────────────
150
+ Coverage: {completed_count} of {total_count} scope items
151
+ ```
152
+
153
+ **If any items missing:**
154
+ ```
155
+ Some designs are incomplete.
156
+
157
+ Missing:
158
+ {foreach missing_item}
159
+ - {item_name}
160
+ {/foreach}
161
+
162
+ Options:
163
+ [C] Create missing - Generate remaining designs now
164
+ [S] Skip - Proceed with partial coverage (will note gaps in artifacts)
165
+ [R] Revise scope - Remove items that don't need designs
166
+ ```
167
+
168
+ **If C (Create missing):**
169
+ - Return to step 2 for each missing item
170
+ - Update design registry after each creation
171
+ - Return to validation after all created
172
+
173
+ **If S (Skip):**
174
+ - Mark skipped items in design state
175
+ - Add "NOT DESIGNED" note to artifact generation
176
+ - Proceed to step 4 with partial coverage
177
+
178
+ **If R (Revise scope):**
179
+ - Show current scope items
180
+ - Allow removal of items
181
+ - Recalculate coverage
182
+ - Return to validation
183
+
184
+ **If all items covered:**
185
+ ```
186
+ VALIDATION PASSED ✓
187
+
188
+ All {total_count} scope items have approved designs.
189
+ Ready for artifact generation.
190
+
191
+ [C] Continue to artifacts
192
+ [R] Review designs before continuing
193
+ ```
194
+
195
+ ---
196
+
137
197
  ## COLLABORATION MENU
138
198
 
139
199
  ```
@@ -114,6 +114,22 @@ Populate placeholders:
114
114
  - `{inspiration_sources}` → References used
115
115
  - `{date}` → Current date
116
116
 
117
+ **Tool-specific placeholders:**
118
+
119
+ - `{tool_specific_notes}` → Generate based on tool used:
120
+ - **MagicPatterns:** "React/TypeScript code ready for extraction. Use `read_files` MCP tool to access."
121
+ - **SuperDesign:** "HTML/CSS prototype. Requires conversion to React components."
122
+ - **Wireframe:** "Structure reference only. Build components from scratch."
123
+ - **Direct:** "Component mapping provided. No visual prototype created."
124
+
125
+ - `{implementation_source_section}` → When MagicPatterns used:
126
+ ```markdown
127
+ | Component | Source URL | Files to Extract |
128
+ |-----------|------------|------------------|
129
+ | {component_name} | [{design_name}]({url}) | {file_list} |
130
+ ```
131
+ For other tools: "See Component Strategy for implementation details."
132
+
117
133
  **Save to:** `{planning_artifacts}/ux-design/{prefix}design-brief.md`
118
134
 
119
135
  ---
@@ -132,6 +148,42 @@ Populate placeholders:
132
148
  - `{implementation_notes}` → Any special considerations
133
149
  - `{date}` → Current date
134
150
 
151
+ **MagicPatterns-specific placeholders (when `design.tool_used` = magicpatterns):**
152
+
153
+ - `{magicpatterns_extraction_warning}` → Include this warning block:
154
+ ```markdown
155
+ > **CRITICAL: EXTRACT CODE, DO NOT REBUILD**
156
+ >
157
+ > MagicPatterns designs contain **production-ready React/TypeScript**.
158
+ > Use `mcp__magic-patterns__read_files` to extract code directly.
159
+ > Only adapt for project patterns (Supabase auth, react-hook-form, etc.)
160
+ ```
161
+
162
+ - `{extraction_table}` → Generate extraction guide from design registry:
163
+ ```markdown
164
+ | Design | MagicPatterns URL | Primary File | Key Elements |
165
+ |--------|-------------------|--------------|--------------|
166
+ | Sign In | [View](url) | SignInForm.tsx | Form, validation, social buttons |
167
+ | Sign Up | [View](url) | SignUpForm.tsx | Multi-step form, password strength |
168
+ ```
169
+
170
+ - `{what_not_to_do_section}` → Include this section:
171
+ ```markdown
172
+ ## What NOT to Do
173
+
174
+ | Don't | Instead |
175
+ |-------|---------|
176
+ | Build layouts from scratch | Extract from MagicPatterns designs |
177
+ | Create custom form components | Extract existing form patterns |
178
+ | Write CSS for auth cards | Extract Tailwind classes from designs |
179
+ | Guess component structure | Read files with `read_files` tool first |
180
+ ```
181
+
182
+ **For non-MagicPatterns tools:**
183
+ - `{magicpatterns_extraction_warning}` → Empty string
184
+ - `{extraction_table}` → Empty string or "N/A - Design created with {tool_used}"
185
+ - `{what_not_to_do_section}` → Empty string
186
+
135
187
  **Save to:** `{planning_artifacts}/ux-design/{prefix}component-strategy.md`
136
188
 
137
189
  ---
@@ -153,6 +205,20 @@ Populate placeholders:
153
205
  - `{responsive_summary_rows}` → Table of element behavior
154
206
  - `{date}` → Current date
155
207
 
208
+ **Implementation note placeholder:**
209
+
210
+ - `{layout_implementation_note}` → When MagicPatterns used:
211
+ ```markdown
212
+ > **NOTE: Layouts Already Implemented**
213
+ >
214
+ > These layouts are reference documentation. The actual responsive layouts
215
+ > are already built into the MagicPatterns designs. Extract the Tailwind
216
+ > responsive classes directly from the design files rather than rebuilding.
217
+ >
218
+ > **Source:** Extract from [{design_name}]({url}) using `read_files` tool.
219
+ ```
220
+ For other tools: Empty string or omit placeholder
221
+
156
222
  **Save to:** `{planning_artifacts}/ux-design/{prefix}layouts.md`
157
223
 
158
224
  ---
@@ -175,6 +241,18 @@ Populate placeholders:
175
241
  - `{error_states}` → Error handling
176
242
  - `{date}` → Current date
177
243
 
244
+ **Implementation source placeholder:**
245
+
246
+ - `{journey_implementation_sources}` → Link each journey step to its design source:
247
+ ```markdown
248
+ | Step | Design Source | Primary File | Key Feature |
249
+ |------|---------------|--------------|-------------|
250
+ | 1. Enter email | [Sign In]({url}) | SignInForm.tsx | Email input with validation |
251
+ | 2. Enter password | [Sign In]({url}) | SignInForm.tsx | Password field with show/hide |
252
+ | 3. Submit | [Sign In]({url}) | SignInForm.tsx | Loading state, error handling |
253
+ ```
254
+ For non-MagicPatterns: "Reference {tool_used} prototype at {output_location}"
255
+
178
256
  **Save to:** `{planning_artifacts}/ux-design/{prefix}user-journeys.md`
179
257
 
180
258
  ---
@@ -238,10 +316,16 @@ This design supports: {story_reference}
238
316
  Ready for implementation via /dev-story workflow.
239
317
  ─────────────────────────────────────
240
318
 
319
+ [L] Link to Epics - Update implementation plans with UX references
241
320
  [N] New Design - Start another design session
242
321
  [D] Done - Exit workflow
243
322
  ```
244
323
 
324
+ **Menu Handlers:**
325
+ - **L**: Load `./step-05-epic-linking.md` to cross-reference designs in epic files
326
+ - **N**: Restart workflow from Step 1
327
+ - **D**: Exit workflow
328
+
245
329
  ---
246
330
 
247
331
  ## 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/...`)
@@ -1,13 +1,19 @@
1
1
  # {feature_name} Component Strategy
2
2
 
3
+ {magicpatterns_extraction_warning}
4
+
3
5
  ## Quick Reference
4
6
 
5
- ### Installation Command
7
+ ### 1. Install shadcn Components
6
8
 
7
9
  ```bash
8
10
  npx shadcn@latest add {shadcn_components}
9
11
  ```
10
12
 
13
+ ### 2. Extract Code from MagicPatterns
14
+
15
+ {extraction_table}
16
+
11
17
  ## Component Mapping
12
18
 
13
19
  | UI Element | Source | Component | Variant/Props | Notes |
@@ -26,6 +32,8 @@ npx shadcn@latest add {shadcn_components}
26
32
 
27
33
  {magicpatterns_section}
28
34
 
35
+ {what_not_to_do_section}
36
+
29
37
  ## Implementation Notes
30
38
 
31
39
  {implementation_notes}
@@ -11,7 +11,9 @@
11
11
  ## Prototype Location
12
12
 
13
13
  - **Tool:** {tool_used}
14
- - **File:** {output_location}
14
+ - **Location:** {output_location}
15
+
16
+ {tool_specific_notes}
15
17
 
16
18
  ## Visual Direction
17
19
 
@@ -21,6 +23,10 @@
21
23
 
22
24
  {inspiration_sources}
23
25
 
26
+ ## Implementation Source
27
+
28
+ {implementation_source_section}
29
+
24
30
  ---
25
31
 
26
32
  *Generated by designer-founder workflow on {date}*
@@ -1,5 +1,7 @@
1
1
  # {feature_name} Layouts
2
2
 
3
+ {layout_implementation_note}
4
+
3
5
  ## Desktop (lg: 1024px+)
4
6
 
5
7
  ```
@@ -15,6 +15,10 @@
15
15
 
16
16
  {journey_steps}
17
17
 
18
+ ### Implementation Sources
19
+
20
+ {journey_implementation_sources}
21
+
18
22
  ## Alternative Flows
19
23
 
20
24
  {alternative_flows}
@@ -63,6 +63,36 @@ Parameters:
63
63
  imageUrls: [{inspiration_image_urls}] // optional
64
64
  ```
65
65
 
66
+ ### 2.5 Handle Empty Response
67
+
68
+ If `create_design` returns no URL or empty response:
69
+
70
+ ```
71
+ DESIGN CREATION ISSUE
72
+
73
+ The design may have been created but the URL wasn't returned.
74
+
75
+ Options:
76
+ [P] Paste URL - I'll provide the URL from MagicPatterns browser
77
+ [R] Retry - Try creating the design again
78
+ [S] Switch - Use a different design tool
79
+ ```
80
+
81
+ **If P (Paste URL):**
82
+ - Accept URL from user
83
+ - Validate format (must contain `magicpatterns.com/c/` or `magicpatterns.app`)
84
+ - Call `get_design` to verify design exists
85
+ - If valid, continue to step 3
86
+ - If invalid, show error and return to options
87
+
88
+ **If R (Retry):**
89
+ - Re-execute step 2 with same parameters
90
+ - If fails again, suggest P or S options
91
+
92
+ **If S (Switch):**
93
+ - Return to tool selection in step-03-design.md
94
+ - Mark current design attempt as abandoned
95
+
66
96
  ### 3. Present Result
67
97
 
68
98
  ```
@@ -191,3 +221,83 @@ Parameters:
191
221
  ```
192
222
 
193
223
  This is useful in the conversion step when the user chooses MagicPatterns for HTML→React conversion.
224
+
225
+ ---
226
+
227
+ ## Design Registry Pattern
228
+
229
+ When creating multiple designs (e.g., auth flows with 6 screens), maintain a registry to track progress:
230
+
231
+ ### Registry Structure
232
+
233
+ ```yaml
234
+ designs:
235
+ - name: "{scope_item_name}"
236
+ url: "{url_or_pending}"
237
+ status: [pending | created | approved]
238
+ files: [list from get_design]
239
+ ```
240
+
241
+ ### Progress Display
242
+
243
+ After each design is created or approved, show progress:
244
+
245
+ ```
246
+ DESIGN PROGRESS: {completed} of {total} complete
247
+
248
+ {foreach design in designs}
249
+ {if status = approved}✓{/if}{if status = created}◐{/if}{if status = pending}○{/if} {name} - {status}{if url} ({url}){/if}
250
+ {/foreach}
251
+
252
+ Options:
253
+ [N] Next - Create next pending design
254
+ [R] Review - Review a specific design
255
+ [C] Continue - Proceed to artifacts (if all approved)
256
+ ```
257
+
258
+ ### Batch Creation Flow
259
+
260
+ When scope has multiple items:
261
+
262
+ 1. **Show scope overview:**
263
+ ```
264
+ DESIGNS TO CREATE ({count} items)
265
+
266
+ {foreach scope_item}
267
+ ○ {item_name}
268
+ {/foreach}
269
+
270
+ Options:
271
+ [O] One-by-one - Create and approve each design individually
272
+ [B] Batch - Create all designs, then review together
273
+ ```
274
+
275
+ 2. **If One-by-one:** Execute steps 1-4 for each item, updating registry after each
276
+
277
+ 3. **If Batch:**
278
+ - Create all designs (steps 1-3) without waiting for approval
279
+ - Present all designs for bulk review
280
+ - Allow individual updates before final approval
281
+
282
+ ### Registry State
283
+
284
+ Store in workflow context:
285
+
286
+ ```yaml
287
+ design_registry:
288
+ total_items: {count}
289
+ completed: {approved_count}
290
+ designs:
291
+ - name: "Sign In"
292
+ url: "https://magicpatterns.com/c/abc123"
293
+ status: approved
294
+ files: ["SignInForm.tsx", "styles.css"]
295
+ - name: "Sign Up"
296
+ url: "https://magicpatterns.com/c/def456"
297
+ status: created
298
+ files: ["SignUpForm.tsx"]
299
+ - name: "Forgot Password"
300
+ url: null
301
+ status: pending
302
+ files: []
303
+ ```