specweave 0.23.14 → 0.23.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/CLAUDE.md +55 -0
  2. package/dist/src/core/spec-detector.d.ts +5 -0
  3. package/dist/src/core/spec-detector.d.ts.map +1 -1
  4. package/dist/src/core/spec-detector.js +91 -33
  5. package/dist/src/core/spec-detector.js.map +1 -1
  6. package/package.json +1 -1
  7. package/plugins/specweave-github/.claude-plugin/plugin.json +15 -1
  8. package/plugins/specweave-github/hooks/.specweave/logs/hooks-debug.log +16 -0
  9. package/plugins/specweave-github/hooks/post-task-completion.sh +53 -0
  10. package/plugins/specweave-release/hooks/.specweave/logs/dora-tracking.log +24 -0
  11. package/plugins/specweave-alternatives/.claude-plugin/plugin.json +0 -21
  12. package/plugins/specweave-alternatives/skills/bmad-method-expert/SKILL.md +0 -626
  13. package/plugins/specweave-alternatives/skills/bmad-method-expert/scripts/analyze-project.js +0 -318
  14. package/plugins/specweave-alternatives/skills/bmad-method-expert/scripts/check-setup.js +0 -208
  15. package/plugins/specweave-alternatives/skills/bmad-method-expert/scripts/generate-template.js +0 -1149
  16. package/plugins/specweave-alternatives/skills/bmad-method-expert/scripts/validate-documents.js +0 -340
  17. package/plugins/specweave-alternatives/skills/spec-kit-expert/SKILL.md +0 -1010
  18. package/plugins/specweave-cost-optimizer/.claude-plugin/plugin.json +0 -20
  19. package/plugins/specweave-cost-optimizer/skills/cost-optimizer/SKILL.md +0 -190
  20. package/plugins/specweave-docs/.claude-plugin/plugin.json +0 -19
  21. package/plugins/specweave-docs/skills/docusaurus/SKILL.md +0 -613
  22. package/plugins/specweave-docs/skills/spec-driven-brainstorming/README.md +0 -264
  23. package/plugins/specweave-docs/skills/spec-driven-brainstorming/SKILL.md +0 -439
  24. package/plugins/specweave-docs/skills/spec-driven-debugging/README.md +0 -479
  25. package/plugins/specweave-docs/skills/spec-driven-debugging/SKILL.md +0 -652
  26. package/plugins/specweave-figma/.claude-plugin/.mcp.json +0 -12
  27. package/plugins/specweave-figma/.claude-plugin/plugin.json +0 -20
  28. package/plugins/specweave-figma/ARCHITECTURE.md +0 -453
  29. package/plugins/specweave-figma/README.md +0 -728
  30. package/plugins/specweave-figma/skills/figma-to-code/SKILL.md +0 -632
  31. package/plugins/specweave-figma/skills/figma-to-code/test-1-token-generation.yaml +0 -29
  32. package/plugins/specweave-figma/skills/figma-to-code/test-2-component-generation.yaml +0 -27
  33. package/plugins/specweave-figma/skills/figma-to-code/test-3-typescript-generation.yaml +0 -28
  34. package/plugins/specweave-frontend/.claude-plugin/plugin.json +0 -21
  35. package/plugins/specweave-frontend/skills/design-system-architect/SKILL.md +0 -107
  36. package/plugins/specweave-frontend/skills/frontend/SKILL.md +0 -177
  37. package/plugins/specweave-frontend/skills/nextjs/SKILL.md +0 -176
  38. package/plugins/specweave-testing/.claude-plugin/plugin.json +0 -20
  39. package/plugins/specweave-testing/skills/e2e-playwright/README.md +0 -506
  40. package/plugins/specweave-testing/skills/e2e-playwright/SKILL.md +0 -457
  41. package/plugins/specweave-testing/skills/e2e-playwright/execute.js +0 -373
  42. package/plugins/specweave-testing/skills/e2e-playwright/lib/utils.js +0 -514
  43. package/plugins/specweave-testing/skills/e2e-playwright/package.json +0 -33
  44. package/plugins/specweave-tooling/.claude-plugin/plugin.json +0 -19
  45. package/plugins/specweave-tooling/skills/skill-creator/LICENSE.txt +0 -202
  46. package/plugins/specweave-tooling/skills/skill-creator/SKILL.md +0 -209
  47. package/plugins/specweave-tooling/skills/skill-creator/scripts/init_skill.py +0 -303
  48. package/plugins/specweave-tooling/skills/skill-creator/scripts/package_skill.py +0 -110
  49. package/plugins/specweave-tooling/skills/skill-creator/scripts/quick_validate.py +0 -65
  50. package/plugins/specweave-tooling/skills/skill-router/SKILL.md +0 -479
  51. package/plugins/specweave-ui/.claude-plugin/plugin.json +0 -26
  52. package/plugins/specweave-ui/.mcp.json +0 -10
  53. package/plugins/specweave-ui/README.md +0 -492
  54. package/plugins/specweave-ui/skills/browser-automation/SKILL.md +0 -676
@@ -1,632 +0,0 @@
1
- ---
2
- name: figma-to-code
3
- description: Design-to-code workflow patterns for Figma. Assumes Figma MCP server provides design data. Converts design tokens to CSS/TypeScript, scaffolds components following Atomic Design, generates tests, and integrates with SpecWeave living docs. Activates for figma to code, implement design, convert figma to react, design tokens, component generation, figma url.
4
- ---
5
-
6
- # Figma to Code - Workflow Patterns
7
-
8
- This skill provides workflow patterns for converting Figma designs to production-ready code.
9
-
10
- **IMPORTANT**: This skill assumes the Figma MCP server is configured and providing design data. It does NOT fetch Figma data directly - that's handled by the MCP layer.
11
-
12
- ---
13
-
14
- ## Prerequisites
15
-
16
- Before using this skill, ensure:
17
-
18
- 1. **Figma MCP Server is connected**:
19
- - Desktop: `http://127.0.0.1:3845/mcp` (Figma Desktop app)
20
- - OR Remote: `https://mcp.figma.com/mcp`
21
-
22
- 2. **Figma Access Token is set**:
23
- - Environment variable: `FIGMA_PERSONAL_ACCESS_TOKEN`
24
- - Get token from: Figma → Settings → Personal access tokens
25
-
26
- 3. **User provides Figma URL or file key**:
27
- - Full URL: `https://figma.com/file/ABC123/Design-System`
28
- - Or file key: `ABC123`
29
-
30
- **Note**: If MCP is not configured, guide the user to enable it (see ARCHITECTURE.md).
31
-
32
- ---
33
-
34
- ## Supported Frameworks
35
-
36
- - **React** (TypeScript + CSS Modules or Tailwind)
37
- - **Angular** (Standalone Components + SCSS)
38
- - **Vue** (Composition API + Scoped Styles)
39
- - **Svelte** (TypeScript + Scoped Styles)
40
-
41
- ---
42
-
43
- ## Workflow Patterns
44
-
45
- ### Pattern 1: Extract Design Tokens
46
-
47
- **When to use**: User wants to create/update design system tokens from Figma variables.
48
-
49
- **Steps**:
50
-
51
- 1. **Use MCP to get Figma file data**:
52
- - MCP tool: `get-file(fileKey)`
53
- - Claude Code handles this automatically
54
-
55
- 2. **Extract Variables** → Map to token structure:
56
-
57
- **Colors**:
58
- ```typescript
59
- // Figma variable: color/primary/500 = #3b82f6
60
- // → CSS custom property:
61
- :root {
62
- --color-primary-500: #3b82f6;
63
- }
64
-
65
- // → TypeScript token:
66
- export const colors = {
67
- primary: {
68
- 500: '#3b82f6'
69
- }
70
- };
71
-
72
- // → Tailwind config:
73
- theme: {
74
- extend: {
75
- colors: {
76
- primary: {
77
- 500: '#3b82f6'
78
- }
79
- }
80
- }
81
- }
82
- ```
83
-
84
- **Typography**:
85
- ```typescript
86
- // Figma text style: Heading 1
87
- // Properties: 36px, Bold (700), 1.2 line-height, Inter font
88
-
89
- // → CSS:
90
- :root {
91
- --font-size-heading1: 2.25rem; /* 36px */
92
- --line-height-heading1: 1.2;
93
- --font-weight-heading1: 700;
94
- --font-family-heading1: 'Inter', sans-serif;
95
- }
96
-
97
- // → TypeScript:
98
- export const typography = {
99
- heading1: {
100
- fontSize: '2.25rem',
101
- lineHeight: '1.2',
102
- fontWeight: '700',
103
- fontFamily: 'Inter, sans-serif'
104
- }
105
- };
106
- ```
107
-
108
- **Spacing**:
109
- ```typescript
110
- // Use 4px/8px grid system
111
- // Figma spacing values → Token scale
112
-
113
- :root {
114
- --spacing-1: 0.25rem; /* 4px */
115
- --spacing-2: 0.5rem; /* 8px */
116
- --spacing-3: 0.75rem; /* 12px */
117
- --spacing-4: 1rem; /* 16px */
118
- --spacing-6: 1.5rem; /* 24px */
119
- --spacing-8: 2rem; /* 32px */
120
- --spacing-12: 3rem; /* 48px */
121
- --spacing-16: 4rem; /* 64px */
122
- }
123
- ```
124
-
125
- 3. **Generate Token Files**:
126
-
127
- ```
128
- src/design-tokens/
129
- ├── theme.css # CSS custom properties
130
- ├── tokens.ts # TypeScript tokens
131
- ├── tailwind.config.ts # Tailwind theme (if using Tailwind)
132
- └── types.ts # TypeScript type definitions
133
- ```
134
-
135
- 4. **Update Living Docs**:
136
- - Document token naming conventions
137
- - Record design decisions (why these values?)
138
- - Link to Figma source of truth
139
-
140
- ---
141
-
142
- ### Pattern 2: Generate Component from Frame
143
-
144
- **When to use**: User wants to convert a Figma component to code.
145
-
146
- **Steps**:
147
-
148
- 1. **Analyze Figma Component Structure**:
149
- - Extract variants (e.g., Button: primary, secondary, text)
150
- - Extract properties (e.g., size: sm, md, lg)
151
- - Extract layout (Auto Layout → Flexbox/Grid)
152
- - Extract styles (fill, stroke, effects → CSS)
153
-
154
- 2. **Map to Component Props**:
155
-
156
- | Figma Property | React Prop | Angular Input | TypeScript Type |
157
- |----------------|------------|---------------|-----------------|
158
- | Variant | `variant` | `@Input() variant` | `'primary' \| 'secondary' \| 'text'` |
159
- | Boolean Property | `disabled` | `@Input() disabled` | `boolean` |
160
- | Text Content | `children` | `<ng-content>` | `ReactNode` |
161
- | Instance Swap | Component composition | Component usage | Component type |
162
-
163
- 3. **Generate Component Files**:
164
-
165
- **React Example** (Button component):
166
-
167
- ```typescript
168
- // src/components/atoms/Button/Button.tsx
169
- import React from 'react';
170
- import styles from './Button.module.css';
171
-
172
- export type ButtonVariant = 'primary' | 'secondary' | 'text';
173
- export type ButtonSize = 'sm' | 'md' | 'lg';
174
-
175
- export interface ButtonProps {
176
- variant?: ButtonVariant;
177
- size?: ButtonSize;
178
- disabled?: boolean;
179
- children: React.ReactNode;
180
- onClick?: () => void;
181
- }
182
-
183
- export const Button: React.FC<ButtonProps> = ({
184
- variant = 'primary',
185
- size = 'md',
186
- disabled = false,
187
- children,
188
- onClick
189
- }) => {
190
- return (
191
- <button
192
- className={`${styles.button} ${styles[variant]} ${styles[size]}`}
193
- disabled={disabled}
194
- onClick={onClick}
195
- >
196
- {children}
197
- </button>
198
- );
199
- };
200
- ```
201
-
202
- ```css
203
- /* src/components/atoms/Button/Button.module.css */
204
- .button {
205
- /* Base styles from Figma */
206
- font-family: var(--font-family-body);
207
- font-weight: var(--font-weight-medium);
208
- border-radius: var(--border-radius-md);
209
- transition: all 0.2s ease-in-out;
210
- cursor: pointer;
211
- border: none;
212
- }
213
-
214
- .primary {
215
- background-color: var(--color-primary-500);
216
- color: var(--color-white);
217
- }
218
-
219
- .primary:hover:not(:disabled) {
220
- background-color: var(--color-primary-600);
221
- }
222
-
223
- .sm {
224
- padding: var(--spacing-2) var(--spacing-4);
225
- font-size: var(--font-size-sm);
226
- }
227
-
228
- .md {
229
- padding: var(--spacing-3) var(--spacing-6);
230
- font-size: var(--font-size-base);
231
- }
232
-
233
- .lg {
234
- padding: var(--spacing-4) var(--spacing-8);
235
- font-size: var(--font-size-lg);
236
- }
237
-
238
- .button:disabled {
239
- opacity: 0.5;
240
- cursor: not-allowed;
241
- }
242
- ```
243
-
244
- ```typescript
245
- // src/components/atoms/Button/Button.test.tsx
246
- import { render, screen, fireEvent } from '@testing-library/react';
247
- import { Button } from './Button';
248
-
249
- describe('Button', () => {
250
- it('renders children', () => {
251
- render(<Button>Click me</Button>);
252
- expect(screen.getByText('Click me')).toBeInTheDocument();
253
- });
254
-
255
- it('calls onClick when clicked', () => {
256
- const handleClick = jest.fn();
257
- render(<Button onClick={handleClick}>Click me</Button>);
258
- fireEvent.click(screen.getByText('Click me'));
259
- expect(handleClick).toHaveBeenCalledTimes(1);
260
- });
261
-
262
- it('is disabled when disabled prop is true', () => {
263
- render(<Button disabled>Click me</Button>);
264
- expect(screen.getByText('Click me')).toBeDisabled();
265
- });
266
-
267
- it('applies variant class', () => {
268
- const { container } = render(<Button variant="secondary">Click me</Button>);
269
- expect(container.firstChild).toHaveClass('secondary');
270
- });
271
- });
272
- ```
273
-
274
- ```typescript
275
- // src/components/atoms/Button/index.ts
276
- export { Button } from './Button';
277
- export type { ButtonProps, ButtonVariant, ButtonSize } from './Button';
278
- ```
279
-
280
- 4. **File Structure** (Atomic Design):
281
-
282
- ```
283
- src/components/
284
- ├── atoms/ # Basic building blocks
285
- │ ├── Button/
286
- │ ├── Input/
287
- │ ├── Label/
288
- │ └── Icon/
289
- ├── molecules/ # Simple combinations
290
- │ ├── FormField/
291
- │ ├── Card/
292
- │ └── MenuItem/
293
- └── organisms/ # Complex components
294
- ├── Navigation/
295
- ├── Hero/
296
- └── Form/
297
- ```
298
-
299
- ---
300
-
301
- ### Pattern 3: Convert Layout (Auto Layout → Flexbox/Grid)
302
-
303
- **When to use**: Converting Figma frames with Auto Layout to CSS.
304
-
305
- **Mapping Rules**:
306
-
307
- | Figma Auto Layout | CSS Flexbox | Tailwind Classes |
308
- |-------------------|-------------|------------------|
309
- | Direction: Horizontal | `flex-direction: row` | `flex flex-row` |
310
- | Direction: Vertical | `flex-direction: column` | `flex flex-col` |
311
- | Spacing: 16px | `gap: 1rem` | `gap-4` |
312
- | Padding: 24px | `padding: 1.5rem` | `p-6` |
313
- | Align: Center | `align-items: center` | `items-center` |
314
- | Justify: Space Between | `justify-content: space-between` | `justify-between` |
315
-
316
- **Example**:
317
-
318
- ```typescript
319
- // Figma: Auto Layout (Horizontal, gap=16, padding=24, align=center)
320
-
321
- // → CSS:
322
- .container {
323
- display: flex;
324
- flex-direction: row;
325
- gap: 1rem;
326
- padding: 1.5rem;
327
- align-items: center;
328
- }
329
-
330
- // → Tailwind:
331
- <div className="flex flex-row gap-4 p-6 items-center">
332
- {/* content */}
333
- </div>
334
- ```
335
-
336
- ---
337
-
338
- ### Pattern 4: Responsive Design (Constraints → Media Queries)
339
-
340
- **When to use**: Converting Figma constraints to responsive CSS.
341
-
342
- **Mapping**:
343
-
344
- | Figma Constraint | CSS | Tailwind |
345
- |------------------|-----|----------|
346
- | Left + Right | `width: 100%` | `w-full` |
347
- | Top + Bottom | `height: 100%` | `h-full` |
348
- | Center | `margin: 0 auto` | `mx-auto` |
349
- | Scale | `max-width: 100%; height: auto` | `max-w-full h-auto` |
350
-
351
- **Responsive Breakpoints**:
352
-
353
- ```css
354
- /* Mobile-first approach */
355
- .component {
356
- /* Mobile styles (default) */
357
- width: 100%;
358
- padding: var(--spacing-4);
359
- }
360
-
361
- @media (min-width: 768px) {
362
- /* Tablet */
363
- .component {
364
- width: 50%;
365
- padding: var(--spacing-6);
366
- }
367
- }
368
-
369
- @media (min-width: 1024px) {
370
- /* Desktop */
371
- .component {
372
- max-width: 1200px;
373
- padding: var(--spacing-8);
374
- margin: 0 auto;
375
- }
376
- }
377
- ```
378
-
379
- ---
380
-
381
- ## Best Practices
382
-
383
- ### 1. Use Design Tokens (Never Hardcode)
384
-
385
- **❌ Wrong**:
386
- ```css
387
- .button {
388
- background-color: #3b82f6;
389
- padding: 12px 24px;
390
- font-size: 16px;
391
- }
392
- ```
393
-
394
- **✅ Right**:
395
- ```css
396
- .button {
397
- background-color: var(--color-primary-500);
398
- padding: var(--spacing-3) var(--spacing-6);
399
- font-size: var(--font-size-base);
400
- }
401
- ```
402
-
403
- **Why**: Enables theming, maintainability, consistency.
404
-
405
- ### 2. Type Safety (Generate TypeScript Interfaces)
406
-
407
- **Always export types**:
408
- ```typescript
409
- export type ButtonVariant = 'primary' | 'secondary' | 'text';
410
- export type ButtonSize = 'sm' | 'md' | 'lg';
411
- export interface ButtonProps {
412
- variant?: ButtonVariant;
413
- size?: ButtonSize;
414
- disabled?: boolean;
415
- children: ReactNode;
416
- }
417
- ```
418
-
419
- ### 3. Accessibility (ARIA + Keyboard)
420
-
421
- **Add ARIA labels**:
422
- ```typescript
423
- <button
424
- aria-label="Close dialog"
425
- aria-disabled={disabled}
426
- onClick={onClick}
427
- >
428
- {children}
429
- </button>
430
- ```
431
-
432
- **Support keyboard navigation**:
433
- - All interactive elements focusable
434
- - Tab order logical
435
- - Enter/Space trigger actions
436
-
437
- ### 4. Component Structure (Co-locate Files)
438
-
439
- **One component per folder**:
440
- ```
441
- Button/
442
- ├── Button.tsx # Component implementation
443
- ├── Button.module.css # Styles
444
- ├── Button.test.tsx # Tests
445
- ├── Button.stories.tsx # Storybook (optional)
446
- └── index.ts # Public exports
447
- ```
448
-
449
- ### 5. Documentation (JSDoc + Usage Examples)
450
-
451
- ```typescript
452
- /**
453
- * Button component with variants and sizes.
454
- *
455
- * @example
456
- * ```tsx
457
- * <Button variant="primary" size="md" onClick={handleClick}>
458
- * Click me
459
- * </Button>
460
- * ```
461
- */
462
- export const Button: React.FC<ButtonProps> = ({ ... }) => { ... };
463
- ```
464
-
465
- ---
466
-
467
- ## SpecWeave Integration
468
-
469
- ### Living Docs
470
-
471
- After generating components, update living docs:
472
-
473
- ```markdown
474
- # Component Library
475
-
476
- ## Button
477
-
478
- **Source**: [Figma Button](https://figma.com/file/ABC123/Button)
479
- **Status**: Implemented (2025-11-02)
480
- **Location**: `src/components/atoms/Button/`
481
-
482
- **Variants**:
483
- - Primary: Main CTA actions
484
- - Secondary: Secondary actions
485
- - Text: Tertiary/subtle actions
486
-
487
- **Design Decisions**:
488
- - Rounded corners (8px) for friendly feel
489
- - 2:1 padding ratio (horizontal:vertical) for better click targets
490
- - Disabled state at 50% opacity (WCAG compliant)
491
-
492
- **Implementation Notes**:
493
- - Uses CSS Modules for scoping
494
- - TypeScript for type safety
495
- - React Testing Library for tests
496
- ```
497
-
498
- ### Increment Tracking
499
-
500
- Track component implementation progress:
501
-
502
- ```yaml
503
- # .specweave/increments/0006-design-system/tasks.md
504
-
505
- - [x] T-001: Extract design tokens
506
- - [x] T-002: Generate Button component
507
- - [ ] T-003: Generate Input component
508
- - [ ] T-004: Generate Card component
509
- - [ ] T-005: Visual regression tests
510
- ```
511
-
512
- ### Test Generation
513
-
514
- Generate test scaffolds:
515
-
516
- ```typescript
517
- // Button.test.tsx (generated)
518
- describe('Button', () => {
519
- it('matches Figma snapshot', () => {
520
- // Visual regression test
521
- const { container } = render(<Button>Text</Button>);
522
- expect(container).toMatchSnapshot();
523
- });
524
-
525
- it('handles all variants', () => {
526
- const variants: ButtonVariant[] = ['primary', 'secondary', 'text'];
527
- variants.forEach(variant => {
528
- render(<Button variant={variant}>Test</Button>);
529
- // Assert variant class applied
530
- });
531
- });
532
- });
533
- ```
534
-
535
- ---
536
-
537
- ## Common Workflows
538
-
539
- ### Workflow 1: Bootstrap Design System
540
-
541
- **User Request**: "Create a design system from this Figma file"
542
-
543
- **Steps**:
544
- 1. Extract design tokens (colors, typography, spacing, shadows)
545
- 2. Generate token files (CSS + TypeScript)
546
- 3. Set up Tailwind config (if using Tailwind)
547
- 4. Create folder structure (atoms/molecules/organisms)
548
- 5. Generate Storybook setup (optional)
549
- 6. Update living docs with design decisions
550
-
551
- ### Workflow 2: Implement Single Component
552
-
553
- **User Request**: "Implement this Button component from Figma"
554
-
555
- **Steps**:
556
- 1. Analyze component (variants, properties, states)
557
- 2. Generate TypeScript interfaces
558
- 3. Scaffold component files (tsx, css, test)
559
- 4. Implement layout (Auto Layout → Flexbox)
560
- 5. Apply styles (tokens, not hardcoded values)
561
- 6. Generate test cases
562
- 7. Update component documentation
563
-
564
- ### Workflow 3: Update Existing Component
565
-
566
- **User Request**: "Update Button to match latest Figma designs"
567
-
568
- **Steps**:
569
- 1. Compare current code vs. Figma
570
- 2. Identify changes (new variants, style updates, prop changes)
571
- 3. Update TypeScript interfaces (if props changed)
572
- 4. Update styles (preserve custom properties usage)
573
- 5. Update tests (if behavior changed)
574
- 6. Document breaking changes (if any)
575
-
576
- ---
577
-
578
- ## Limitations
579
-
580
- ### What This Skill Does NOT Do
581
-
582
- 1. **❌ Fetch Figma data directly**
583
- - MCP handles this
584
- - Skill assumes data is provided
585
-
586
- 2. **❌ Handle authentication**
587
- - MCP server handles token auth
588
- - Skill doesn't touch credentials
589
-
590
- 3. **❌ Make design decisions**
591
- - Skill applies conventions, doesn't invent designs
592
- - Always defer to Figma as source of truth
593
-
594
- 4. **❌ Generate perfect pixel-perfect code**
595
- - Provides scaffold, human review needed
596
- - Some manual refinement expected
597
-
598
- ### When to Ask for Help
599
-
600
- If MCP server is not connected:
601
- > "I need Figma MCP server to be configured first. Please enable it in the Figma Desktop app or set up the remote server. See ARCHITECTURE.md for instructions."
602
-
603
- If Figma URL is invalid:
604
- > "This doesn't look like a valid Figma URL. Please provide a URL like: https://figma.com/file/ABC123/Design-Name"
605
-
606
- If rate limits hit:
607
- > "Figma API rate limit reached. Free accounts: 6 calls/month. Paid plans: Tier 1 limits. Try again later or upgrade your Figma plan."
608
-
609
- ---
610
-
611
- ## Test Cases
612
-
613
- See `test-cases/` directory for validation scenarios:
614
-
615
- 1. **test-1-token-generation.yaml** - Extract design tokens
616
- 2. **test-2-component-generation.yaml** - Generate React component
617
- 3. **test-3-typescript-generation.yaml** - Generate TypeScript types
618
-
619
- ---
620
-
621
- ## References
622
-
623
- - [Figma MCP Server Guide](https://help.figma.com/hc/en-us/articles/32132100833559-Guide-to-the-Figma-MCP-server)
624
- - [Figma Variables Documentation](https://help.figma.com/hc/en-us/articles/15339657135383-Guide-to-variables-in-Figma)
625
- - [Atomic Design Methodology](https://atomicdesign.bradfrost.com/)
626
- - [CSS Custom Properties](https://developer.mozilla.org/en-US/docs/Web/CSS/--*)
627
- - [Tailwind CSS](https://tailwindcss.com/)
628
-
629
- ---
630
-
631
- **Last Updated**: 2025-11-02
632
- **Status**: MCP-first workflow patterns
@@ -1,29 +0,0 @@
1
- ---
2
- name: "Design Tokens Generation"
3
- description: "Test generation of design tokens from Figma variables"
4
- input:
5
- figma_variables:
6
- - name: "color/primary/500"
7
- value: "#3b82f6"
8
- - name: "spacing/4"
9
- value: "4px"
10
- framework: "react"
11
- expected_output:
12
- type: "design_tokens"
13
- css_variables:
14
- - "--color-primary-500: #3b82f6;"
15
- - "--spacing-4: 0.25rem;"
16
- tailwind_config:
17
- colors:
18
- primary:
19
- 500: "#3b82f6"
20
- spacing:
21
- 4: "0.25rem"
22
- validation:
23
- - "CSS variables correctly formatted"
24
- - "Tailwind config valid"
25
- - "TypeScript types generated"
26
- success_criteria:
27
- - "All tokens converted"
28
- - "No syntax errors"
29
- ---
@@ -1,27 +0,0 @@
1
- ---
2
- name: "React Component Generation"
3
- description: "Test generation of React component from Figma component"
4
- input:
5
- figma_component:
6
- name: "Button"
7
- variants:
8
- - variant: "primary"
9
- size: "md"
10
- properties:
11
- - name: "disabled"
12
- type: "boolean"
13
- framework: "react"
14
- expected_output:
15
- type: "react_component"
16
- files:
17
- - "Button.tsx"
18
- - "types.ts"
19
- typescript_interface: true
20
- validation:
21
- - "Component structure correct"
22
- - "Props match Figma properties"
23
- - "TypeScript types exported"
24
- success_criteria:
25
- - "Component compiles"
26
- - "No TypeScript errors"
27
- ---
@@ -1,28 +0,0 @@
1
- ---
2
- name: "TypeScript Interface Generation"
3
- description: "Test generation of TypeScript interfaces from Figma properties"
4
- input:
5
- figma_component: "Button"
6
- properties:
7
- - name: "variant"
8
- type: "enum"
9
- values: ["primary", "secondary"]
10
- - name: "size"
11
- type: "enum"
12
- values: ["sm", "md", "lg"]
13
- - name: "disabled"
14
- type: "boolean"
15
- expected_output:
16
- type: "typescript_interfaces"
17
- types:
18
- - "type ButtonVariant = 'primary' | 'secondary';"
19
- - "type ButtonSize = 'sm' | 'md' | 'lg';"
20
- - "interface ButtonProps { variant?: ButtonVariant; size?: ButtonSize; disabled?: boolean; }"
21
- validation:
22
- - "Types follow TypeScript conventions"
23
- - "All properties mapped"
24
- - "Exports correct"
25
- success_criteria:
26
- - "TypeScript compiles"
27
- - "No type errors"
28
- ---