@torka/claude-workflows 0.9.0 → 0.11.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.
@@ -41,11 +41,14 @@ Execute fullstack stories using a **hybrid approach** - applying design-first me
41
41
 
42
42
  ### 2.2 Optional MCPs (graceful degradation)
43
43
 
44
- | MCP | Purpose | Fallback |
45
- |-----|---------|----------|
44
+ | MCP/Skill | Purpose | Fallback |
45
+ |-----------|---------|----------|
46
46
  | Context7 | Library docs | Web search |
47
47
  | MagicPatterns | Design code fetch | Manual implementation |
48
+ | Stitch | Design screen conversion | Manual implementation |
48
49
  | Serena | Codebase analysis | Manual Glob/Grep |
50
+ | react-best-practices (skill) | React/Next.js performance | Standard implementation |
51
+ | Stitch react-components (skill) | Converting Stitch designs to React code | Standard implementation |
49
52
 
50
53
  ### 2.3 Probe Execution
51
54
 
@@ -181,6 +184,7 @@ IF task type is UI:
181
184
 
182
185
  1. Design Analysis:
183
186
  - Check for MagicPatterns link
187
+ - Check for Stitch screen reference
184
188
  - Check for shadcn component mentions
185
189
  - Identify visual requirements
186
190
 
@@ -188,22 +192,32 @@ IF task type is UI:
188
192
  IF MagicPatterns link:
189
193
  - Fetch code via MCP
190
194
  - Adapt for project structure
195
+ IF Stitch screen :
196
+ * IF component already exists → Log: "using existing" → SKIP Stitch
197
+ * IF component NOT exists →
198
+ - Fetch via Stitch MCP
199
+ - Convert to React components using Stitch react-components skill
200
+ - Run validation scripts
191
201
  IF shadcn components:
192
202
  - ALWAYS call get_item_examples_from_registries FIRST
193
203
  - Review demo output
194
204
  - Implement with correct patterns
195
205
 
196
- 3. Visual Validation:
206
+ 3. Apply Performance Patterns:
207
+ IF react-best-practices skill available:
208
+ - Apply skill guidance during implementation
209
+
210
+ 4. Visual Validation:
197
211
  - Navigate to affected page via Playwright
198
212
  - Take screenshot
199
213
  - Check console for errors
200
214
  - Fix and retry if issues (max 3 iterations)
201
215
 
202
- 4. Add Tests (after visual validation):
216
+ 5. Add Tests (after visual validation):
203
217
  - E2E tests for user flows
204
218
  - Unit tests for component logic
205
219
 
206
- 5. Run test suite and verify all pass
220
+ 6. Run test suite and verify all pass
207
221
  ```
208
222
 
209
223
  ### 6.3 Backend Task Execution (TDD)
@@ -48,10 +48,13 @@ Scan story content (tasks, dev notes, acceptance criteria) for:
48
48
 
49
49
  ### 2.3 Optional MCPs (graceful degradation)
50
50
 
51
- | MCP | Purpose | Fallback |
52
- |-----|---------|----------|
51
+ | MCP/Skill | Purpose | Fallback |
52
+ |-----------|---------|----------|
53
53
  | Context7 | Library docs | Web search |
54
54
  | MagicPatterns | Design code fetch | Manual implementation from design |
55
+ | Stitch | Design screen conversion | Manual implementation |
56
+ | react-best-practices (skill) | React/Next.js performance | Standard implementation |
57
+ | Stitch react-components (skill) | Converting Stitch designs to React code | Standard implementation |
55
58
 
56
59
  ### 2.4 Probe Execution
57
60
 
@@ -154,6 +157,7 @@ Dev Agent Record update:
154
157
  ```
155
158
  1. Extract design references from story:
156
159
  - MagicPatterns links
160
+ - Stitch screen references
157
161
  - Figma links
158
162
  - Screenshot paths
159
163
  - Component specifications in Dev Notes
@@ -162,16 +166,31 @@ Dev Agent Record update:
162
166
  - CRITICAL: Fetch code via MCP (NEVER build from scratch)
163
167
  - Adapt for project structure
164
168
 
165
- 3. IF shadcn components needed:
169
+ 2. IF Stitch screen reference (stitch.new or stitch: prefix):
170
+ - Extract target component name from reference
171
+ - CHECK IF COMPONENT EXISTS:
172
+ * Look for: .stitch/{ComponentName}.tsx
173
+ * Look for: src/components/{ComponentName}.tsx
174
+ * Look for: src/app/**/components/{ComponentName}.tsx
175
+ - IF component exists:
176
+ * Log: "Component {name} already exists - using existing"
177
+ * SKIP Stitch fetch
178
+ - IF component NOT exists AND Stitch MCP available:
179
+ * Fetch via Stitch MCP
180
+ * Run validation: npm run validate <file_path>
181
+ - IF Stitch MCP unavailable:
182
+ * Log: "Stitch MCP not configured - manual implementation"
183
+
184
+ 4. IF shadcn components needed:
166
185
  - Call mcp__shadcn__search_items_in_registries for relevant components
167
186
  - Note component names for implementation
168
187
 
169
- 4. Document design decisions:
188
+ 5. Document design decisions:
170
189
  - Components to use
171
190
  - Styling approach
172
191
  - Layout patterns
173
192
 
174
- 5. Log design analysis in Dev Agent Record
193
+ 6. Log design analysis in Dev Agent Record
175
194
  ```
176
195
 
177
196
  ---
@@ -214,6 +233,10 @@ IF using shadcn components:
214
233
  3. Use semantic HTML
215
234
  4. Apply consistent styling (Tailwind classes)
216
235
  5. Ensure accessibility basics (alt text, labels, ARIA)
236
+
237
+ IF react-best-practices skill available:
238
+ - Apply skill guidance during implementation
239
+ - The skill provides built-in priority and "when to use" guidance
217
240
  ```
218
241
 
219
242
  ---
package/install.js CHANGED
@@ -85,6 +85,32 @@ function getTargetBase() {
85
85
  return path.join(process.env.INIT_CWD || process.cwd(), '.claude');
86
86
  }
87
87
 
88
+ /**
89
+ * Ensure entries exist in a .gitignore file (append if missing)
90
+ */
91
+ function ensureGitignoreEntries(gitignorePath, entries, header) {
92
+ let existingContent = '';
93
+ if (fs.existsSync(gitignorePath)) {
94
+ existingContent = fs.readFileSync(gitignorePath, 'utf8');
95
+ }
96
+
97
+ const existingLines = new Set(
98
+ existingContent.split('\n').map(line => line.trim()).filter(Boolean)
99
+ );
100
+
101
+ const missingEntries = entries.filter(entry => !existingLines.has(entry));
102
+
103
+ if (missingEntries.length > 0) {
104
+ const newContent = existingContent.trimEnd() +
105
+ (existingContent ? '\n\n' : '') +
106
+ `# ${header}\n` +
107
+ missingEntries.join('\n') + '\n';
108
+ fs.writeFileSync(gitignorePath, newContent);
109
+ return missingEntries.length;
110
+ }
111
+ return 0;
112
+ }
113
+
88
114
  /**
89
115
  * Recursively copy directory contents
90
116
  * - New files: copied
@@ -157,6 +183,32 @@ function install() {
157
183
  fs.mkdirSync(targetBase, { recursive: true });
158
184
  }
159
185
 
186
+ // Ensure gitignore entries for package-installed files
187
+ const gitignorePath = path.join(targetBase, '.gitignore');
188
+ const gitignoreEntries = [
189
+ 'commands/implement-epic-with-subagents.md',
190
+ 'commands/plan-parallelization.md',
191
+ 'commands/git-local-cleanup-push-pr.md',
192
+ 'commands/github-pr-resolve.md',
193
+ 'commands/dev-story-backend.md',
194
+ 'commands/dev-story-fullstack.md',
195
+ 'commands/dev-story-ui.md',
196
+ 'agents/principal-code-reviewer.md',
197
+ 'agents/story-prep-master.md',
198
+ 'agents/desk-check-gate.md',
199
+ 'skills/agent-creator/',
200
+ 'skills/designer-founder/',
201
+ '*.backup',
202
+ ];
203
+ const addedCount = ensureGitignoreEntries(
204
+ gitignorePath,
205
+ gitignoreEntries,
206
+ 'Installed by @torka/claude-workflows'
207
+ );
208
+ if (addedCount > 0) {
209
+ log(` Updated .claude/.gitignore (added ${addedCount} entries)`, 'green');
210
+ }
211
+
160
212
  const stats = {
161
213
  copied: [],
162
214
  updated: [],
@@ -189,6 +241,41 @@ function install() {
189
241
  }
190
242
  }
191
243
 
244
+ // Ensure gitignore entries for BMAD workflow
245
+ const bmadDir = path.join(targetBase, '../_bmad');
246
+ if (fs.existsSync(bmadDir)) {
247
+ const bmadGitignorePath = path.join(bmadDir, '.gitignore');
248
+ const bmadEntries = [
249
+ 'bmm/workflows/4-implementation/implement-epic-with-subagents/',
250
+ ];
251
+ const bmadAdded = ensureGitignoreEntries(
252
+ bmadGitignorePath,
253
+ bmadEntries,
254
+ 'Installed by @torka/claude-workflows'
255
+ );
256
+ if (bmadAdded > 0) {
257
+ log(` Updated _bmad/.gitignore (added ${bmadAdded} entries)`, 'green');
258
+ }
259
+ }
260
+
261
+ // Ensure gitignore entries for BMAD output
262
+ const bmadOutputDir = path.join(targetBase, '../_bmad-output');
263
+ if (fs.existsSync(bmadOutputDir)) {
264
+ const bmadOutputGitignorePath = path.join(bmadOutputDir, '.gitignore');
265
+ const bmadOutputEntries = [
266
+ 'epic-executions/',
267
+ 'screenshots/',
268
+ ];
269
+ const outputAdded = ensureGitignoreEntries(
270
+ bmadOutputGitignorePath,
271
+ bmadOutputEntries,
272
+ 'Runtime output from @torka/claude-workflows'
273
+ );
274
+ if (outputAdded > 0) {
275
+ log(` Updated _bmad-output/.gitignore (added ${outputAdded} entries)`, 'green');
276
+ }
277
+ }
278
+
192
279
  // Summary
193
280
  log('\n' + colors.bold + '📊 Installation Summary' + colors.reset);
194
281
  log(` Files copied (new): ${stats.copied.length}`, 'green');
@@ -218,9 +305,108 @@ function install() {
218
305
  log(' ✓ desk-check-gate agent\n');
219
306
  }
220
307
 
308
+ /**
309
+ * Auto-install Vercel react-best-practices skill for performance optimization
310
+ * Provides 57 React/Next.js performance rules with built-in guidance
311
+ */
312
+ async function installReactBestPractices(isGlobal) {
313
+ const { execSync } = require('child_process');
314
+
315
+ log('\n' + colors.bold + '════════════════════════════════════════════════════════════' + colors.reset);
316
+ log(colors.bold + ' REACT BEST PRACTICES SETUP' + colors.reset);
317
+ log(colors.bold + '════════════════════════════════════════════════════════════' + colors.reset);
318
+ log('\nInstalling Vercel react-best-practices skill (57 performance rules)...\n');
319
+
320
+ const globalFlag = isGlobal ? ' -g' : '';
321
+ const execOptions = {
322
+ stdio: 'inherit',
323
+ timeout: 90000,
324
+ cwd: isGlobal ? undefined : (process.env.INIT_CWD || process.cwd()),
325
+ };
326
+
327
+ try {
328
+ execSync(`npx skills add vercel-labs/agent-skills --skill react-best-practices${globalFlag} -a claude-code -y`, execOptions);
329
+
330
+ log('\n' + colors.bold + '════════════════════════════════════════════════════════════' + colors.reset);
331
+ log(colors.green + colors.bold + ' ✓ REACT BEST PRACTICES INSTALLED' + colors.reset);
332
+ log('');
333
+ log(' The skill provides guidance for:');
334
+ log(' - Eliminating waterfalls (CRITICAL)');
335
+ log(' - Bundle size optimization (CRITICAL)');
336
+ log(' - Server-side performance (HIGH)');
337
+ log(' - Re-render optimization (MEDIUM)');
338
+ log('');
339
+ log(' To update: npx skills update');
340
+ log(colors.bold + '════════════════════════════════════════════════════════════' + colors.reset + '\n');
341
+
342
+ } catch (error) {
343
+ log('\n' + colors.bold + '════════════════════════════════════════════════════════════' + colors.reset);
344
+ log(colors.yellow + colors.bold + ' ⚠ REACT BEST PRACTICES INSTALLATION SKIPPED' + colors.reset);
345
+ log('');
346
+ log(' To install manually:');
347
+ log(' npx skills add vercel-labs/agent-skills --skill react-best-practices -g -a claude-code');
348
+ log(colors.bold + '════════════════════════════════════════════════════════════' + colors.reset + '\n');
349
+ }
350
+ }
351
+
352
+ /**
353
+ * Auto-install Google's stitch-skills for Stitch integration
354
+ * These skills enhance the designer-founder workflow with Stitch support
355
+ */
356
+ async function installStitchSkills(isGlobal) {
357
+ const { execSync } = require('child_process');
358
+
359
+ log('\n' + colors.bold + '════════════════════════════════════════════════════════════' + colors.reset);
360
+ log(colors.bold + ' STITCH INTEGRATION SETUP' + colors.reset);
361
+ log(colors.bold + '════════════════════════════════════════════════════════════' + colors.reset);
362
+ log('\nInstalling Google stitch-skills for Stitch design tool...\n');
363
+
364
+ const globalFlag = isGlobal ? ' -g' : '';
365
+ const execOptions = {
366
+ stdio: 'inherit',
367
+ timeout: 60000,
368
+ cwd: isGlobal ? undefined : (process.env.INIT_CWD || process.cwd()),
369
+ };
370
+
371
+ try {
372
+ // Install design-md skill (required for Stitch)
373
+ execSync(`npx skills add google-labs-code/stitch-skills --skill design-md${globalFlag} -a claude-code -y`, execOptions);
374
+
375
+ // Install react-components skill (for HTML→React conversion)
376
+ execSync(`npx skills add google-labs-code/stitch-skills --skill react-components${globalFlag} -a claude-code -y`, execOptions);
377
+
378
+ log('\n' + colors.bold + '════════════════════════════════════════════════════════════' + colors.reset);
379
+ log(colors.green + colors.bold + ' ✓ STITCH SKILLS INSTALLED SUCCESSFULLY' + colors.reset);
380
+ log('');
381
+ log(' To use Stitch in designer-founder workflow:');
382
+ log(' 1. Configure Stitch MCP server');
383
+ log(' 2. Run /designer-founder and select [T] Stitch');
384
+ log('');
385
+ log(' To update skills later: npx skills update');
386
+ log(colors.bold + '════════════════════════════════════════════════════════════' + colors.reset + '\n');
387
+
388
+ } catch (error) {
389
+ log('\n' + colors.bold + '════════════════════════════════════════════════════════════' + colors.reset);
390
+ log(colors.yellow + colors.bold + ' ⚠ STITCH SKILLS INSTALLATION SKIPPED' + colors.reset);
391
+ log('');
392
+ log(' Could not auto-install stitch-skills.');
393
+ log(' This may be due to network issues or missing dependencies.');
394
+ log('');
395
+ log(' To install manually later:');
396
+ log(' npx skills add google-labs-code/stitch-skills -g -a claude-code');
397
+ log('');
398
+ log(' You can still use other design tools (SuperDesign, MagicPatterns).');
399
+ log(colors.bold + '════════════════════════════════════════════════════════════' + colors.reset + '\n');
400
+ }
401
+ }
402
+
221
403
  // Run installation
222
404
  try {
405
+ const isGlobal = process.env.npm_config_global === 'true';
223
406
  install();
407
+ // Attempt to install external skills (non-blocking)
408
+ installReactBestPractices(isGlobal);
409
+ installStitchSkills(isGlobal);
224
410
  } catch (error) {
225
411
  logError(`Installation failed: ${error.message}`);
226
412
  // Don't exit with error code - allow npm install to complete
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@torka/claude-workflows",
3
- "version": "0.9.0",
3
+ "version": "0.11.0",
4
4
  "description": "Claude Code workflow helpers: epic automation, git cleanup, agents, and design workflows",
5
5
  "keywords": [
6
6
  "claude-code",
@@ -73,6 +73,8 @@ MagicPatterns MCP: [check if mcp__magicpatterns tools available]
73
73
  shadcn MCP: [check if mcp__shadcn tools available]
74
74
  Playwright MCP: [check if mcp__playwright tools available]
75
75
  SuperDesign: [check if .superdesign/ folder and instructions exist]
76
+ Stitch MCP: [check if mcp__stitch* or stitch* tools available]
77
+ Stitch Skills: [check if design-md skill installed via `npx skills list`]
76
78
  ```
77
79
 
78
80
  Adjust tool menus based on availability. Tools marked as unavailable should show "(not configured)" in menus.
@@ -41,6 +41,11 @@ Choose your design approach:
41
41
  → Quick HTML/CSS prototypes via VS Code
42
42
  → Best for: Rapid visual exploration, custom styling
43
43
 
44
+ [T] Stitch (Google AI Design) {show availability status}
45
+ → AI-generated complete page designs
46
+ → Best for: Full page layouts, design system consistency
47
+ → Requires: Stitch MCP + Google's stitch-skills installed
48
+
44
49
  [M] MagicPatterns {show availability status}
45
50
  → AI-generated React components
46
51
  → Best for: Direct React code, component variations
@@ -53,7 +58,7 @@ Choose your design approach:
53
58
  → Skip visuals, map directly to shadcn
54
59
  → Best for: Standard patterns, known layouts
55
60
 
56
- Which approach? [S/M/W/D]
61
+ Which approach? [S/T/M/W/D]
57
62
  ```
58
63
 
59
64
  ---
@@ -65,6 +70,7 @@ Based on user selection, load the corresponding tool file:
65
70
  | Selection | Tool File |
66
71
  |-----------|-----------|
67
72
  | S | `{installed_path}/tools/superdesign.md` |
73
+ | T | `{installed_path}/tools/stitch.md` |
68
74
  | M | `{installed_path}/tools/magicpatterns.md` |
69
75
  | W | `{installed_path}/tools/wireframe.md` |
70
76
  | D | `{installed_path}/tools/direct-mapping.md` |
@@ -30,7 +30,7 @@ Convert design output to dev-ready artifacts and save to `{planning_artifacts}/u
30
30
 
31
31
  ### 1. Conversion (if needed)
32
32
 
33
- **If `design.needs_conversion` = true (SuperDesign or Wireframe):**
33
+ **If `design.needs_conversion` = true (SuperDesign, Stitch, or Wireframe):**
34
34
 
35
35
  Load and execute: `{installed_path}/tools/conversion.md`
36
36
 
@@ -119,6 +119,8 @@ Populate placeholders:
119
119
  - `{tool_specific_notes}` → Generate based on tool used:
120
120
  - **MagicPatterns:** "React/TypeScript code ready for extraction. Use `read_files` MCP tool to access."
121
121
  - **SuperDesign:** "HTML/CSS prototype. Requires conversion to React components."
122
+ - **Stitch (with react-components):** "React/TypeScript components generated via Google's react-components skill. AST-validated, includes hooks extraction and data decoupling."
123
+ - **Stitch (quick mapping):** "HTML/CSS prototype converted via shadcn component mapping."
122
124
  - **Wireframe:** "Structure reference only. Build components from scratch."
123
125
  - **Direct:** "Component mapping provided. No visual prototype created."
124
126
 
@@ -0,0 +1,180 @@
1
+ # Design System: {project_name}
2
+
3
+ **Stitch Project ID:** {stitch_project_id}
4
+ **Generated:** {date}
5
+ **Last Updated:** {date}
6
+
7
+ ---
8
+
9
+ ## 1. Visual Theme & Atmosphere
10
+
11
+ ### Overall Feel
12
+ {describe the overall visual feel - e.g., "Modern and minimalist with soft edges and subtle depth"}
13
+
14
+ ### Design Principles
15
+ - {principle_1}
16
+ - {principle_2}
17
+ - {principle_3}
18
+
19
+ ---
20
+
21
+ ## 2. Color Palette & Roles
22
+
23
+ ### Primary Colors
24
+ | Name | Value | Usage |
25
+ |------|-------|-------|
26
+ | Primary | `{color}` | Main CTAs, active states |
27
+ | Primary Hover | `{color}` | Hover state for primary |
28
+ | Primary Foreground | `{color}` | Text on primary backgrounds |
29
+
30
+ ### Secondary Colors
31
+ | Name | Value | Usage |
32
+ |------|-------|-------|
33
+ | Secondary | `{color}` | Secondary actions |
34
+ | Secondary Hover | `{color}` | Hover state for secondary |
35
+ | Secondary Foreground | `{color}` | Text on secondary backgrounds |
36
+
37
+ ### Neutral Colors
38
+ | Name | Value | Usage |
39
+ |------|-------|-------|
40
+ | Background | `{color}` | Page background |
41
+ | Foreground | `{color}` | Primary text |
42
+ | Muted | `{color}` | Subtle backgrounds |
43
+ | Muted Foreground | `{color}` | Secondary text |
44
+ | Border | `{color}` | Borders and dividers |
45
+
46
+ ### Semantic Colors
47
+ | Name | Value | Usage |
48
+ |------|-------|-------|
49
+ | Destructive | `{color}` | Errors, delete actions |
50
+ | Success | `{color}` | Success states |
51
+ | Warning | `{color}` | Warning states |
52
+
53
+ ### Dark Mode Variants
54
+ {if dark_mode_supported}
55
+ | Light Mode | Dark Mode | Usage |
56
+ |------------|-----------|-------|
57
+ | `{light}` | `{dark}` | Background |
58
+ | `{light}` | `{dark}` | Foreground |
59
+ {/if}
60
+
61
+ ---
62
+
63
+ ## 3. Typography Rules
64
+
65
+ ### Font Family
66
+ - **Sans:** `{font_family}` (e.g., Inter, system-ui)
67
+ - **Mono:** `{mono_family}` (e.g., JetBrains Mono, monospace)
68
+
69
+ ### Scale
70
+ | Name | Size | Weight | Line Height | Usage |
71
+ |------|------|--------|-------------|-------|
72
+ | H1 | `{size}` | `{weight}` | `{lh}` | Page titles |
73
+ | H2 | `{size}` | `{weight}` | `{lh}` | Section headers |
74
+ | H3 | `{size}` | `{weight}` | `{lh}` | Subsections |
75
+ | Body | `{size}` | `{weight}` | `{lh}` | Default text |
76
+ | Small | `{size}` | `{weight}` | `{lh}` | Captions, labels |
77
+
78
+ ### Text Colors
79
+ - Primary: `foreground`
80
+ - Secondary: `muted-foreground`
81
+ - Links: `primary`
82
+ - Disabled: `muted-foreground` with 50% opacity
83
+
84
+ ---
85
+
86
+ ## 4. Component Stylings
87
+
88
+ ### Buttons
89
+ | Variant | Background | Text | Border | Hover |
90
+ |---------|------------|------|--------|-------|
91
+ | Default | `primary` | `primary-foreground` | none | `primary/90` |
92
+ | Secondary | `secondary` | `secondary-foreground` | none | `secondary/80` |
93
+ | Outline | transparent | `foreground` | `border` | `muted` |
94
+ | Ghost | transparent | `foreground` | none | `muted` |
95
+ | Destructive | `destructive` | `destructive-foreground` | none | `destructive/90` |
96
+
97
+ ### Border Radius
98
+ | Element | Radius |
99
+ |---------|--------|
100
+ | Buttons | `{radius}` |
101
+ | Cards | `{radius}` |
102
+ | Inputs | `{radius}` |
103
+ | Modals | `{radius}` |
104
+
105
+ ### Shadows
106
+ | Name | Value | Usage |
107
+ |------|-------|-------|
108
+ | sm | `{shadow}` | Subtle elevation |
109
+ | md | `{shadow}` | Cards, dropdowns |
110
+ | lg | `{shadow}` | Modals, popovers |
111
+
112
+ ### Spacing Scale
113
+ Base unit: `{base}` (e.g., 4px)
114
+
115
+ | Name | Value | Usage |
116
+ |------|-------|-------|
117
+ | xs | `{value}` | Tight spacing |
118
+ | sm | `{value}` | Compact elements |
119
+ | md | `{value}` | Default spacing |
120
+ | lg | `{value}` | Section spacing |
121
+ | xl | `{value}` | Large gaps |
122
+
123
+ ---
124
+
125
+ ## 5. Layout Principles
126
+
127
+ ### Grid System
128
+ - **Container max-width:** `{width}` (e.g., 1280px)
129
+ - **Columns:** {columns} (e.g., 12)
130
+ - **Gutter:** `{gutter}` (e.g., 24px)
131
+
132
+ ### Breakpoints
133
+ | Name | Width | Notes |
134
+ |------|-------|-------|
135
+ | sm | `{width}` | Mobile landscape |
136
+ | md | `{width}` | Tablet |
137
+ | lg | `{width}` | Desktop |
138
+ | xl | `{width}` | Large desktop |
139
+
140
+ ### Content Widths
141
+ - **Prose:** max-width `{width}` for readable text
142
+ - **Forms:** max-width `{width}` for form containers
143
+ - **Full:** 100% width containers
144
+
145
+ ---
146
+
147
+ ## 6. Animation & Motion
148
+
149
+ ### Transitions
150
+ | Property | Duration | Easing |
151
+ |----------|----------|--------|
152
+ | Colors | `{duration}` | `{easing}` |
153
+ | Transform | `{duration}` | `{easing}` |
154
+ | Opacity | `{duration}` | `{easing}` |
155
+
156
+ ### Micro-interactions
157
+ - **Hover:** {describe hover behavior}
158
+ - **Focus:** {describe focus behavior}
159
+ - **Active:** {describe active state}
160
+
161
+ ---
162
+
163
+ ## Notes for Stitch
164
+
165
+ When generating screens with Stitch, reference this document to maintain consistency:
166
+
167
+ 1. **Include design system context** in prompts
168
+ 2. **Reference color names** (e.g., "primary", "muted") not hex values
169
+ 3. **Use typography scale names** for consistent sizing
170
+ 4. **Apply spacing scale** for consistent rhythm
171
+
172
+ ### Example Stitch Prompt Addition
173
+
174
+ ```
175
+ Use the design system:
176
+ - Primary color for CTAs
177
+ - Border radius: {radius}
178
+ - Font: {font_family}
179
+ - Spacing: 4px base unit
180
+ ```
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## Overview
4
4
 
5
- Convert SuperDesign HTML/CSS output to React components. Used when `design.tool_used` = `superdesign`.
5
+ Convert HTML/CSS output to React components. Used when `design.tool_used` = `superdesign`, `stitch`, or `wireframe`.
6
6
 
7
7
  ---
8
8
 
@@ -26,6 +26,21 @@ Map standard elements to shadcn, use MagicPatterns for custom components.
26
26
 
27
27
  **Best for:** Mix of standard and custom elements
28
28
 
29
+ ### Strategy G: Google's react-components (Stitch only)
30
+
31
+ Use Google's react-components skill for full modular React architecture.
32
+
33
+ **Best for:** Production-quality components, enforced architecture patterns
34
+ **Available:** Only when `design.tool_used` = `stitch`
35
+
36
+ Features:
37
+ - Modular file structure (Atomic/Composite patterns)
38
+ - Logic extraction to `src/hooks/`
39
+ - Data decoupling to `src/data/mockData.ts`
40
+ - TypeScript interfaces with `Readonly<T>`
41
+ - AST-based validation (no hardcoded hex values)
42
+ - Dark mode support validation
43
+
29
44
  ---
30
45
 
31
46
  ## Execution Flow
@@ -35,7 +50,7 @@ Map standard elements to shadcn, use MagicPatterns for custom components.
35
50
  ```
36
51
  CONVERSION STRATEGY
37
52
 
38
- Your SuperDesign prototype is HTML/CSS. Let's convert to React components.
53
+ Your {tool_name} prototype is HTML/CSS. Let's convert to React components.
39
54
 
40
55
  Prototype location: {design.output_location}
41
56
 
@@ -46,6 +61,13 @@ Choose your approach:
46
61
  → You install via CLI, minimal custom code
47
62
  → Best for: Standard UI patterns
48
63
 
64
+ {if design.tool_used = stitch}
65
+ [G] Google's react-components
66
+ → Full modular React architecture
67
+ → AST validation, data decoupling, hooks extraction
68
+ → Best for: Production-quality Stitch conversions
69
+ {/if}
70
+
49
71
  [M] MagicPatterns Conversion {if available, else "(not configured)"}
50
72
  → Generate React code from the design
51
73
  → Direct component code output
@@ -56,7 +78,7 @@ Choose your approach:
56
78
  → Use MagicPatterns for custom components
57
79
  → Best for: Mix of standard and custom
58
80
 
59
- Which approach? [C/M/H]
81
+ Which approach? [C/{if stitch}G/{/if}M/H]
60
82
  ```
61
83
 
62
84
  ---
@@ -212,6 +234,81 @@ Starting analysis...
212
234
 
213
235
  ---
214
236
 
237
+ ### 2G. Google react-components Execution (Stitch only)
238
+
239
+ **Prerequisites:** This strategy is only available when `design.tool_used` = `stitch`.
240
+
241
+ Check if react-components skill is installed. If not:
242
+
243
+ ```
244
+ REACT-COMPONENTS SKILL NOT FOUND
245
+
246
+ The react-components skill is required for this conversion strategy.
247
+
248
+ This should have been auto-installed. Install manually with:
249
+ npx skills add google-labs-code/stitch-skills --skill react-components -g -a claude-code -y
250
+
251
+ Then restart Claude Code and try again.
252
+
253
+ [B] Back to strategy selection
254
+ ```
255
+
256
+ If installed, invoke the skill:
257
+
258
+ ```
259
+ REACT-COMPONENTS CONVERSION
260
+
261
+ Invoking Google's react-components skill...
262
+
263
+ This will:
264
+ 1. Fetch HTML from Stitch design
265
+ 2. Create modular React components
266
+ 3. Extract logic to hooks
267
+ 4. Decouple data to mockData.ts
268
+ 5. Validate with AST parser
269
+ ```
270
+
271
+ The skill handles:
272
+ - Downloads HTML from Stitch using built-in scripts
273
+ - Creates components from template patterns
274
+ - Validates against architecture checklist
275
+ - Ensures no hardcoded hex values (uses CSS variables)
276
+ - Checks dark mode support
277
+
278
+ After completion:
279
+
280
+ ```
281
+ REACT COMPONENTS CREATED
282
+
283
+ Files generated:
284
+ - src/components/{ComponentName}.tsx
285
+ - src/hooks/use{ComponentName}.ts (if logic extracted)
286
+ - src/data/mockData.ts
287
+
288
+ Validation: {PASSED | FAILED}
289
+
290
+ shadcn components identified for installation:
291
+ {list from our component mapping}
292
+
293
+ [R] Review generated files
294
+ [V] Validate again
295
+ [C] Continue to artifacts
296
+ ```
297
+
298
+ **If validation fails:**
299
+ ```
300
+ VALIDATION ISSUES
301
+
302
+ {list of issues}
303
+
304
+ Options:
305
+ [F] Fix issues - Adjust generated code
306
+ [I] Ignore - Proceed with warnings
307
+ [B] Back - Choose different strategy
308
+ ```
309
+
310
+ ---
311
+
215
312
  ### 3. Generate Installation Command
216
313
 
217
314
  After any conversion strategy:
@@ -0,0 +1,347 @@
1
+ # Stitch Tool Execution
2
+
3
+ ## Overview
4
+
5
+ Stitch is Google's AI design tool that generates web UI screens from text prompts.
6
+ This tool requires both Stitch MCP and Google's stitch-skills to be installed.
7
+
8
+ **Output Location:** `.stitch/screens/`
9
+ **Output Format:** HTML + CSS files + screenshots
10
+ **MCP Tools Used:** `generate_screen_from_text`, `get_screen`, `list_projects`, `create_project`
11
+ **Dependencies:** Google's stitch-skills (design-md skill at minimum)
12
+
13
+ ---
14
+
15
+ ## Prerequisites
16
+
17
+ Check availability before proceeding:
18
+
19
+ ```
20
+ Stitch MCP: [check if mcp__stitch* or stitch* tools available]
21
+ Stitch Skills: [check if design-md skill installed]
22
+ ```
23
+
24
+ ### If Stitch MCP not available:
25
+
26
+ ```
27
+ STITCH MCP NOT CONFIGURED
28
+
29
+ Stitch MCP is required for this design tool.
30
+
31
+ To use Stitch:
32
+ 1. Configure Stitch MCP server (see stitch.withgoogle.com/docs/mcp/guide/)
33
+ 2. Restart Claude Code
34
+
35
+ Alternative options:
36
+ [S] SuperDesign - HTML/CSS prototype
37
+ [M] MagicPatterns - AI-generated React components
38
+ [B] Back to tool selection
39
+ ```
40
+
41
+ ### If Stitch Skills not installed:
42
+
43
+ ```
44
+ STITCH SKILLS REQUIRED
45
+
46
+ Google's stitch-skills are required for Stitch integration.
47
+
48
+ Install with:
49
+ npx skills add google-labs-code/stitch-skills --skill design-md -g -a claude-code -y
50
+ npx skills add google-labs-code/stitch-skills --skill react-components -g -a claude-code -y
51
+
52
+ Then restart Claude Code and try again.
53
+
54
+ [B] Back to tool selection
55
+ ```
56
+
57
+ ---
58
+
59
+ ## Execution Flow
60
+
61
+ ### 1. Check for DESIGN.md
62
+
63
+ ```
64
+ STITCH PROJECT SETUP
65
+
66
+ Checking for design system documentation...
67
+ ```
68
+
69
+ **If DESIGN.md exists in project root:**
70
+
71
+ ```
72
+ Found: DESIGN.md
73
+ Design system will be used for prompt consistency.
74
+
75
+ [C] Continue with existing design system
76
+ [U] Update design system first (uses design-md skill)
77
+ ```
78
+
79
+ **If DESIGN.md doesn't exist:**
80
+
81
+ ```
82
+ No DESIGN.md found.
83
+
84
+ DESIGN.md helps Stitch generate consistent designs by documenting
85
+ your color palette, typography, and component styles.
86
+
87
+ Options:
88
+ [G] Generate DESIGN.md (Recommended)
89
+ → Uses design-md skill to create semantic design documentation
90
+ → Best for: New projects, establishing design consistency
91
+
92
+ [S] Skip - proceed without design system
93
+ → Stitch will use default styling
94
+ → Fine for: Quick prototypes, one-off designs
95
+ ```
96
+
97
+ **If G (Generate):**
98
+ - Invoke the design-md skill: `/design-md`
99
+ - Wait for user to complete the skill workflow
100
+ - Continue to design generation after DESIGN.md is created
101
+
102
+ ---
103
+
104
+ ### 2. Prepare Design Prompt
105
+
106
+ Frame the design request from context:
107
+
108
+ ```
109
+ DESIGN REQUEST FOR STITCH
110
+
111
+ Feature: {user_intent}
112
+
113
+ Context:
114
+ - {scope_summary}
115
+ - {inspiration_references}
116
+
117
+ Requirements:
118
+ - Responsive design (desktop-first)
119
+ - Tailwind CSS classes
120
+ - {additional_context_from_scope}
121
+
122
+ {if DESIGN.md exists}
123
+ DESIGN SYSTEM:
124
+ [Include relevant sections from DESIGN.md - colors, typography, component styles]
125
+ {/if}
126
+
127
+ Style Direction:
128
+ - {visual_direction_notes}
129
+ - {inspiration_sources}
130
+ ```
131
+
132
+ ---
133
+
134
+ ### 3. Create or Select Project
135
+
136
+ **If `stitch.json` exists in project root with projectId:**
137
+
138
+ ```
139
+ EXISTING STITCH PROJECT FOUND
140
+
141
+ Project: {project_title}
142
+ Project ID: {projectId}
143
+
144
+ [C] Continue with this project
145
+ [N] Create new project
146
+ ```
147
+
148
+ **If no existing project or user selects [N]:**
149
+
150
+ ```
151
+ Creating new Stitch project...
152
+ ```
153
+
154
+ ```
155
+ Tool: create_project
156
+ Parameters:
157
+ title: "{feature_name} Design"
158
+ description: "{user_intent summary}"
159
+ ```
160
+
161
+ Save projectId to `stitch.json` for future sessions:
162
+
163
+ ```json
164
+ {
165
+ "projectId": "{created_project_id}",
166
+ "projectTitle": "{project_title}",
167
+ "createdAt": "{timestamp}"
168
+ }
169
+ ```
170
+
171
+ ---
172
+
173
+ ### 4. Generate Screen
174
+
175
+ ```
176
+ GENERATING DESIGN
177
+
178
+ Feature: {user_intent}
179
+ Project: {project_name}
180
+
181
+ Please wait while Stitch generates your design...
182
+ ```
183
+
184
+ ```
185
+ Tool: generate_screen_from_text
186
+ Parameters:
187
+ projectId: "{projectId}"
188
+ prompt: "{constructed_prompt}"
189
+ deviceType: "DESKTOP"
190
+ ```
191
+
192
+ ---
193
+
194
+ ### 5. Retrieve and Save Assets
195
+
196
+ After generation completes:
197
+
198
+ ```
199
+ Tool: get_screen
200
+ Parameters:
201
+ projectId: "{projectId}"
202
+ screenId: "{screenId}"
203
+ ```
204
+
205
+ Create output directory if needed:
206
+ ```
207
+ mkdir -p .stitch/screens/
208
+ ```
209
+
210
+ Download and save assets:
211
+ - **HTML:** `htmlCode.downloadUrl` → save to `.stitch/screens/{page}.html`
212
+ - **Screenshot:** `screenshot.downloadUrl` → save to `.stitch/screens/{page}.png`
213
+
214
+ ---
215
+
216
+ ### 6. Present Result
217
+
218
+ ```
219
+ DESIGN CREATED
220
+
221
+ Project: {project_name}
222
+ Screen: {screen_title}
223
+
224
+ Files saved:
225
+ - HTML: .stitch/screens/{page}.html
226
+ - Preview: .stitch/screens/{page}.png
227
+
228
+ Options:
229
+ [V] View - Display screenshot
230
+ [P] Playwright - Capture live rendering (desktop + mobile)
231
+ [U] Update - Request changes via Stitch
232
+ [C] Continue - Design approved, proceed to next step
233
+ ```
234
+
235
+ ### Handle User Selection
236
+
237
+ **If V (View):**
238
+ - Display the screenshot image from `.stitch/screens/{page}.png`
239
+ - Return to options
240
+
241
+ **If P (Playwright) and Playwright available:**
242
+ - Navigate to `file://{absolute_path}/.stitch/screens/{page}.html`
243
+ - Capture desktop screenshot (1280px width)
244
+ - Resize viewport (375px width) and capture mobile screenshot
245
+ - Present both screenshots for comparison
246
+ - Return to options
247
+
248
+ **If U (Update):**
249
+ ```
250
+ What changes would you like to make?
251
+
252
+ Describe the changes and I'll generate an updated design.
253
+ ```
254
+ - Append change request to prompt
255
+ - Generate new screen with updated prompt
256
+ - Return to step 5
257
+
258
+ **If C (Continue):**
259
+ - Store design state
260
+ - Return control to parent step (step-03-design.md)
261
+
262
+ ---
263
+
264
+ ## Output State
265
+
266
+ After completion, set:
267
+
268
+ ```yaml
269
+ design:
270
+ tool_used: stitch
271
+ output_location: ".stitch/screens/{page}.html"
272
+ output_format: html
273
+ needs_conversion: true # HTML needs React conversion in Step 4
274
+ screenshot: ".stitch/screens/{page}.png"
275
+ stitch_project_id: "{projectId}"
276
+ stitch_screen_id: "{screenId}"
277
+ design_md_used: true/false
278
+ ```
279
+
280
+ ---
281
+
282
+ ## Design Registry Pattern
283
+
284
+ When creating multiple screens (scope has multiple items), track progress:
285
+
286
+ ```yaml
287
+ designs:
288
+ - name: "{scope_item_name}"
289
+ screen_id: "{id_or_pending}"
290
+ status: [pending | created | approved]
291
+ html_path: ".stitch/screens/{name}.html"
292
+ screenshot_path: ".stitch/screens/{name}.png"
293
+ ```
294
+
295
+ ### Batch Generation Flow
296
+
297
+ If scope has multiple items:
298
+
299
+ ```
300
+ SCOPE ITEMS TO DESIGN
301
+
302
+ You have {count} items to design:
303
+ {foreach scope_item}
304
+ [ ] {item_name}
305
+ {/foreach}
306
+
307
+ Options:
308
+ [A] All at once - Generate all designs in sequence
309
+ [O] One by one - Generate and approve each individually
310
+
311
+ Which approach? [A/O]
312
+ ```
313
+
314
+ **If A (All at once):**
315
+ - Generate each design in sequence
316
+ - Track status in design registry
317
+ - Present all for review at end
318
+
319
+ **If O (One by one):**
320
+ - Generate first design
321
+ - Present for approval
322
+ - On approval, move to next
323
+ - Repeat until all complete
324
+
325
+ ---
326
+
327
+ ## Conversion Notes
328
+
329
+ Stitch outputs HTML/CSS with Tailwind classes. The conversion step (Step 4) offers two paths:
330
+
331
+ 1. **Quick shadcn mapping** - Our standard `conversion.md` flow
332
+ 2. **Google's react-components** - Full modular React architecture with AST validation
333
+
334
+ Both are presented in Step 4 when `design.tool_used` = `stitch`.
335
+
336
+ ---
337
+
338
+ ## Reference: Stitch MCP Tools
339
+
340
+ | Tool | Purpose |
341
+ |------|---------|
342
+ | `list_projects` | Get all Stitch projects |
343
+ | `get_project` | Get project details |
344
+ | `create_project` | Create new project |
345
+ | `list_screens` | Get all screens in project |
346
+ | `get_screen` | Get screen details + download URLs |
347
+ | `generate_screen_from_text` | Generate new screen from prompt |
package/uninstall.js CHANGED
@@ -38,7 +38,8 @@ const INSTALLED_FILES = {
38
38
  commands: [
39
39
  'implement-epic-with-subagents.md',
40
40
  'plan-parallelization.md',
41
- 'git-cleanup-and-merge.md',
41
+ 'git-local-cleanup-push-pr.md',
42
+ 'github-pr-resolve.md',
42
43
  'dev-story-backend.md',
43
44
  'dev-story-fullstack.md',
44
45
  'dev-story-ui.md',