@torka/claude-workflows 0.10.0 → 0.12.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.
- package/.claude-plugin/plugin.json +4 -0
- package/commands/dev-story-fullstack.md +19 -5
- package/commands/dev-story-ui.md +28 -5
- package/install.js +124 -1
- package/package.json +1 -1
- package/skills/designer-founder/SKILL.md +2 -0
- package/skills/designer-founder/steps/step-03-design.md +7 -1
- package/skills/designer-founder/steps/step-04-artifacts.md +3 -1
- package/skills/designer-founder/templates/design-system.md +180 -0
- package/skills/designer-founder/tools/conversion.md +100 -3
- package/skills/designer-founder/tools/stitch.md +347 -0
- package/skills/product-architect/SKILL.md +308 -0
- package/skills/product-architect/agents/architect-agent.md +64 -0
- package/skills/product-architect/agents/pm-agent.md +65 -0
- package/skills/product-architect/references/escalation-guide.md +70 -0
- package/skills/product-architect/vt-preferences.md +44 -0
- package/uninstall.js +14 -0
|
@@ -34,6 +34,10 @@
|
|
|
34
34
|
{
|
|
35
35
|
"name": "agent-creator",
|
|
36
36
|
"description": "Creates custom Claude Code sub-agents for project tasks"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"name": "product-architect",
|
|
40
|
+
"description": "Agent team that creates PRD + Architecture from product notes. PM and Architect collaborate, escalating only for key decisions."
|
|
37
41
|
}
|
|
38
42
|
],
|
|
39
43
|
"hooks": {
|
|
@@ -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.
|
|
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
|
-
|
|
216
|
+
5. Add Tests (after visual validation):
|
|
203
217
|
- E2E tests for user flows
|
|
204
218
|
- Unit tests for component logic
|
|
205
219
|
|
|
206
|
-
|
|
220
|
+
6. Run test suite and verify all pass
|
|
207
221
|
```
|
|
208
222
|
|
|
209
223
|
### 6.3 Backend Task Execution (TDD)
|
package/commands/dev-story-ui.md
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
188
|
+
5. Document design decisions:
|
|
170
189
|
- Components to use
|
|
171
190
|
- Styling approach
|
|
172
191
|
- Layout patterns
|
|
173
192
|
|
|
174
|
-
|
|
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
|
@@ -13,6 +13,11 @@ const fs = require('fs');
|
|
|
13
13
|
const path = require('path');
|
|
14
14
|
const os = require('os');
|
|
15
15
|
|
|
16
|
+
// Files that should not be overwritten if user has customized them
|
|
17
|
+
const PROTECTED_FILES = [
|
|
18
|
+
'vt-preferences.md',
|
|
19
|
+
];
|
|
20
|
+
|
|
16
21
|
// ANSI colors for output
|
|
17
22
|
const colors = {
|
|
18
23
|
green: '\x1b[32m',
|
|
@@ -44,6 +49,10 @@ function logSkip(message) {
|
|
|
44
49
|
log(` ○ ${message}`, 'yellow');
|
|
45
50
|
}
|
|
46
51
|
|
|
52
|
+
function logPreserve(message) {
|
|
53
|
+
log(` ★ ${message}`, 'yellow');
|
|
54
|
+
}
|
|
55
|
+
|
|
47
56
|
function logError(message) {
|
|
48
57
|
log(` ✗ ${message}`, 'red');
|
|
49
58
|
}
|
|
@@ -137,6 +146,13 @@ function copyDirRecursive(src, dest, stats) {
|
|
|
137
146
|
copyDirRecursive(srcPath, destPath, stats);
|
|
138
147
|
} else {
|
|
139
148
|
if (fs.existsSync(destPath)) {
|
|
149
|
+
// Check if this is a protected user config file
|
|
150
|
+
if (PROTECTED_FILES.includes(entry.name)) {
|
|
151
|
+
stats.preserved.push(destPath);
|
|
152
|
+
logPreserve(`Preserved (user config): ${path.relative(stats.targetBase, destPath)}`);
|
|
153
|
+
continue;
|
|
154
|
+
}
|
|
155
|
+
|
|
140
156
|
// File exists - check if content differs
|
|
141
157
|
const srcContent = fs.readFileSync(srcPath);
|
|
142
158
|
const destContent = fs.readFileSync(destPath);
|
|
@@ -198,6 +214,7 @@ function install() {
|
|
|
198
214
|
'agents/desk-check-gate.md',
|
|
199
215
|
'skills/agent-creator/',
|
|
200
216
|
'skills/designer-founder/',
|
|
217
|
+
'skills/product-architect/',
|
|
201
218
|
'*.backup',
|
|
202
219
|
];
|
|
203
220
|
const addedCount = ensureGitignoreEntries(
|
|
@@ -214,6 +231,7 @@ function install() {
|
|
|
214
231
|
updated: [],
|
|
215
232
|
unchanged: [],
|
|
216
233
|
backups: [],
|
|
234
|
+
preserved: [],
|
|
217
235
|
targetBase,
|
|
218
236
|
};
|
|
219
237
|
|
|
@@ -264,6 +282,7 @@ function install() {
|
|
|
264
282
|
const bmadOutputGitignorePath = path.join(bmadOutputDir, '.gitignore');
|
|
265
283
|
const bmadOutputEntries = [
|
|
266
284
|
'epic-executions/',
|
|
285
|
+
'screenshots/',
|
|
267
286
|
];
|
|
268
287
|
const outputAdded = ensureGitignoreEntries(
|
|
269
288
|
bmadOutputGitignorePath,
|
|
@@ -280,6 +299,9 @@ function install() {
|
|
|
280
299
|
log(` Files copied (new): ${stats.copied.length}`, 'green');
|
|
281
300
|
log(` Files updated: ${stats.updated.length}`, 'cyan');
|
|
282
301
|
log(` Files unchanged: ${stats.unchanged.length}`, 'yellow');
|
|
302
|
+
if (stats.preserved.length > 0) {
|
|
303
|
+
log(` Files preserved: ${stats.preserved.length} (user config)`, 'yellow');
|
|
304
|
+
}
|
|
283
305
|
if (stats.backups.length > 0) {
|
|
284
306
|
log(` Backups created: ${stats.backups.length} (*.backup files)`, 'yellow');
|
|
285
307
|
}
|
|
@@ -288,7 +310,8 @@ function install() {
|
|
|
288
310
|
log('\n' + colors.bold + '📝 Next Steps' + colors.reset);
|
|
289
311
|
log(' 1. Run /git-cleanup-and-merge or /plan-parallelization to test');
|
|
290
312
|
log(' 2. Try /designer-founder for UI/UX design workflows');
|
|
291
|
-
log(' 3.
|
|
313
|
+
log(' 3. Try /product-architect for autonomous PRD + Architecture (requires Agent Teams)');
|
|
314
|
+
log(' 4. Use /dev-story-ui, /dev-story-backend, or /dev-story-fullstack for story execution\n');
|
|
292
315
|
|
|
293
316
|
// Note about BMAD dependencies
|
|
294
317
|
log(colors.yellow + '⚠️ Note: Some components work better with BMAD Method installed:' + colors.reset);
|
|
@@ -301,12 +324,112 @@ function install() {
|
|
|
301
324
|
log(' ✓ dev-story-ui, dev-story-backend, dev-story-fullstack');
|
|
302
325
|
log(' ✓ agent-creator skill (with expertise profiles)');
|
|
303
326
|
log(' ✓ designer-founder skill');
|
|
327
|
+
log(' ✓ product-architect skill (requires Agent Teams + BMAD)');
|
|
304
328
|
log(' ✓ desk-check-gate agent\n');
|
|
305
329
|
}
|
|
306
330
|
|
|
331
|
+
/**
|
|
332
|
+
* Auto-install Vercel react-best-practices skill for performance optimization
|
|
333
|
+
* Provides 57 React/Next.js performance rules with built-in guidance
|
|
334
|
+
*/
|
|
335
|
+
async function installReactBestPractices(isGlobal) {
|
|
336
|
+
const { execSync } = require('child_process');
|
|
337
|
+
|
|
338
|
+
log('\n' + colors.bold + '════════════════════════════════════════════════════════════' + colors.reset);
|
|
339
|
+
log(colors.bold + ' REACT BEST PRACTICES SETUP' + colors.reset);
|
|
340
|
+
log(colors.bold + '════════════════════════════════════════════════════════════' + colors.reset);
|
|
341
|
+
log('\nInstalling Vercel react-best-practices skill (57 performance rules)...\n');
|
|
342
|
+
|
|
343
|
+
const globalFlag = isGlobal ? ' -g' : '';
|
|
344
|
+
const execOptions = {
|
|
345
|
+
stdio: 'inherit',
|
|
346
|
+
timeout: 90000,
|
|
347
|
+
cwd: isGlobal ? undefined : (process.env.INIT_CWD || process.cwd()),
|
|
348
|
+
};
|
|
349
|
+
|
|
350
|
+
try {
|
|
351
|
+
execSync(`npx skills add vercel-labs/agent-skills --skill react-best-practices${globalFlag} -a claude-code -y`, execOptions);
|
|
352
|
+
|
|
353
|
+
log('\n' + colors.bold + '════════════════════════════════════════════════════════════' + colors.reset);
|
|
354
|
+
log(colors.green + colors.bold + ' ✓ REACT BEST PRACTICES INSTALLED' + colors.reset);
|
|
355
|
+
log('');
|
|
356
|
+
log(' The skill provides guidance for:');
|
|
357
|
+
log(' - Eliminating waterfalls (CRITICAL)');
|
|
358
|
+
log(' - Bundle size optimization (CRITICAL)');
|
|
359
|
+
log(' - Server-side performance (HIGH)');
|
|
360
|
+
log(' - Re-render optimization (MEDIUM)');
|
|
361
|
+
log('');
|
|
362
|
+
log(' To update: npx skills update');
|
|
363
|
+
log(colors.bold + '════════════════════════════════════════════════════════════' + colors.reset + '\n');
|
|
364
|
+
|
|
365
|
+
} catch (error) {
|
|
366
|
+
log('\n' + colors.bold + '════════════════════════════════════════════════════════════' + colors.reset);
|
|
367
|
+
log(colors.yellow + colors.bold + ' ⚠ REACT BEST PRACTICES INSTALLATION SKIPPED' + colors.reset);
|
|
368
|
+
log('');
|
|
369
|
+
log(' To install manually:');
|
|
370
|
+
log(' npx skills add vercel-labs/agent-skills --skill react-best-practices -g -a claude-code');
|
|
371
|
+
log(colors.bold + '════════════════════════════════════════════════════════════' + colors.reset + '\n');
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
/**
|
|
376
|
+
* Auto-install Google's stitch-skills for Stitch integration
|
|
377
|
+
* These skills enhance the designer-founder workflow with Stitch support
|
|
378
|
+
*/
|
|
379
|
+
async function installStitchSkills(isGlobal) {
|
|
380
|
+
const { execSync } = require('child_process');
|
|
381
|
+
|
|
382
|
+
log('\n' + colors.bold + '════════════════════════════════════════════════════════════' + colors.reset);
|
|
383
|
+
log(colors.bold + ' STITCH INTEGRATION SETUP' + colors.reset);
|
|
384
|
+
log(colors.bold + '════════════════════════════════════════════════════════════' + colors.reset);
|
|
385
|
+
log('\nInstalling Google stitch-skills for Stitch design tool...\n');
|
|
386
|
+
|
|
387
|
+
const globalFlag = isGlobal ? ' -g' : '';
|
|
388
|
+
const execOptions = {
|
|
389
|
+
stdio: 'inherit',
|
|
390
|
+
timeout: 60000,
|
|
391
|
+
cwd: isGlobal ? undefined : (process.env.INIT_CWD || process.cwd()),
|
|
392
|
+
};
|
|
393
|
+
|
|
394
|
+
try {
|
|
395
|
+
// Install design-md skill (required for Stitch)
|
|
396
|
+
execSync(`npx skills add google-labs-code/stitch-skills --skill design-md${globalFlag} -a claude-code -y`, execOptions);
|
|
397
|
+
|
|
398
|
+
// Install react-components skill (for HTML→React conversion)
|
|
399
|
+
execSync(`npx skills add google-labs-code/stitch-skills --skill react-components${globalFlag} -a claude-code -y`, execOptions);
|
|
400
|
+
|
|
401
|
+
log('\n' + colors.bold + '════════════════════════════════════════════════════════════' + colors.reset);
|
|
402
|
+
log(colors.green + colors.bold + ' ✓ STITCH SKILLS INSTALLED SUCCESSFULLY' + colors.reset);
|
|
403
|
+
log('');
|
|
404
|
+
log(' To use Stitch in designer-founder workflow:');
|
|
405
|
+
log(' 1. Configure Stitch MCP server');
|
|
406
|
+
log(' 2. Run /designer-founder and select [T] Stitch');
|
|
407
|
+
log('');
|
|
408
|
+
log(' To update skills later: npx skills update');
|
|
409
|
+
log(colors.bold + '════════════════════════════════════════════════════════════' + colors.reset + '\n');
|
|
410
|
+
|
|
411
|
+
} catch (error) {
|
|
412
|
+
log('\n' + colors.bold + '════════════════════════════════════════════════════════════' + colors.reset);
|
|
413
|
+
log(colors.yellow + colors.bold + ' ⚠ STITCH SKILLS INSTALLATION SKIPPED' + colors.reset);
|
|
414
|
+
log('');
|
|
415
|
+
log(' Could not auto-install stitch-skills.');
|
|
416
|
+
log(' This may be due to network issues or missing dependencies.');
|
|
417
|
+
log('');
|
|
418
|
+
log(' To install manually later:');
|
|
419
|
+
log(' npx skills add google-labs-code/stitch-skills -g -a claude-code');
|
|
420
|
+
log('');
|
|
421
|
+
log(' You can still use other design tools (SuperDesign, MagicPatterns).');
|
|
422
|
+
log(colors.bold + '════════════════════════════════════════════════════════════' + colors.reset + '\n');
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
|
|
307
426
|
// Run installation
|
|
308
427
|
try {
|
|
428
|
+
const isGlobal = process.env.npm_config_global === 'true';
|
|
309
429
|
install();
|
|
430
|
+
// Attempt to install external skills (non-blocking)
|
|
431
|
+
installReactBestPractices(isGlobal);
|
|
432
|
+
installStitchSkills(isGlobal);
|
|
310
433
|
} catch (error) {
|
|
311
434
|
logError(`Installation failed: ${error.message}`);
|
|
312
435
|
// Don't exit with error code - allow npm install to complete
|
package/package.json
CHANGED
|
@@ -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
|
+
```
|