specweave 0.23.16 → 0.24.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/marketplace.json +93 -38
- package/CLAUDE.md +159 -11
- package/dist/plugins/specweave-github/lib/github-spec-content-sync.d.ts.map +1 -1
- package/dist/plugins/specweave-github/lib/github-spec-content-sync.js +57 -0
- package/dist/plugins/specweave-github/lib/github-spec-content-sync.js.map +1 -1
- package/dist/src/cli/commands/sync-spec-content.js +3 -0
- package/dist/src/cli/commands/sync-spec-content.js.map +1 -1
- package/dist/src/cli/helpers/ado-area-path-mapper.d.ts +89 -0
- package/dist/src/cli/helpers/ado-area-path-mapper.d.ts.map +1 -0
- package/dist/src/cli/helpers/ado-area-path-mapper.js +213 -0
- package/dist/src/cli/helpers/ado-area-path-mapper.js.map +1 -0
- package/dist/src/cli/helpers/issue-tracker/ado-auto-discover.d.ts +29 -0
- package/dist/src/cli/helpers/issue-tracker/ado-auto-discover.d.ts.map +1 -0
- package/dist/src/cli/helpers/issue-tracker/ado-auto-discover.js +109 -0
- package/dist/src/cli/helpers/issue-tracker/ado-auto-discover.js.map +1 -0
- package/dist/src/cli/helpers/issue-tracker/ado.d.ts +1 -0
- package/dist/src/cli/helpers/issue-tracker/ado.d.ts.map +1 -1
- package/dist/src/cli/helpers/issue-tracker/ado.js +2 -0
- package/dist/src/cli/helpers/issue-tracker/ado.js.map +1 -1
- package/dist/src/cli/helpers/smart-filter.d.ts +83 -0
- package/dist/src/cli/helpers/smart-filter.d.ts.map +1 -0
- package/dist/src/cli/helpers/smart-filter.js +265 -0
- package/dist/src/cli/helpers/smart-filter.js.map +1 -0
- package/dist/src/core/progress/progress-tracker.d.ts +4 -1
- package/dist/src/core/progress/progress-tracker.d.ts.map +1 -1
- package/dist/src/core/progress/progress-tracker.js +33 -4
- package/dist/src/core/progress/progress-tracker.js.map +1 -1
- package/dist/src/core/qa/quality-gate-decider.d.ts +1 -1
- package/dist/src/core/qa/quality-gate-decider.js +2 -2
- package/dist/src/core/qa/quality-gate-decider.js.map +1 -1
- package/dist/src/core/qa/risk-calculator.d.ts +2 -2
- package/dist/src/core/qa/risk-calculator.js +2 -2
- package/dist/src/core/spec-content-sync.d.ts +1 -1
- package/dist/src/core/spec-content-sync.d.ts.map +1 -1
- package/dist/src/core/validators/ac-presence-validator.d.ts +56 -0
- package/dist/src/core/validators/ac-presence-validator.d.ts.map +1 -0
- package/dist/src/core/validators/ac-presence-validator.js +149 -0
- package/dist/src/core/validators/ac-presence-validator.js.map +1 -0
- package/dist/src/integrations/ado/ado-dependency-loader.d.ts +1 -1
- package/dist/src/integrations/ado/ado-dependency-loader.d.ts.map +1 -1
- package/dist/src/integrations/ado/ado-dependency-loader.js +39 -7
- package/dist/src/integrations/ado/ado-dependency-loader.js.map +1 -1
- package/dist/src/integrations/ado/area-path-mapper.d.ts +137 -0
- package/dist/src/integrations/ado/area-path-mapper.d.ts.map +1 -0
- package/dist/src/integrations/ado/area-path-mapper.js +267 -0
- package/dist/src/integrations/ado/area-path-mapper.js.map +1 -0
- package/dist/src/integrations/jira/filter-processor.d.ts +126 -0
- package/dist/src/integrations/jira/filter-processor.d.ts.map +1 -0
- package/dist/src/integrations/jira/filter-processor.js +207 -0
- package/dist/src/integrations/jira/filter-processor.js.map +1 -0
- package/dist/src/integrations/jira/jira-client.d.ts +13 -0
- package/dist/src/integrations/jira/jira-client.d.ts.map +1 -1
- package/dist/src/integrations/jira/jira-client.js +33 -0
- package/dist/src/integrations/jira/jira-client.js.map +1 -1
- package/dist/src/utils/ac-embedder.d.ts +63 -0
- package/dist/src/utils/ac-embedder.d.ts.map +1 -0
- package/dist/src/utils/ac-embedder.js +217 -0
- package/dist/src/utils/ac-embedder.js.map +1 -0
- package/dist/src/utils/env-manager.d.ts +86 -0
- package/dist/src/utils/env-manager.d.ts.map +1 -0
- package/dist/src/utils/env-manager.js +188 -0
- package/dist/src/utils/env-manager.js.map +1 -0
- package/package.json +1 -1
- package/plugins/specweave/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave/agents/AGENTS-INDEX.md +1 -1
- package/plugins/specweave/agents/increment-quality-judge-v2/AGENT.md +9 -9
- package/plugins/specweave/commands/specweave-do.md +37 -0
- package/plugins/specweave/commands/specweave-done.md +159 -0
- package/plugins/specweave/commands/specweave-embed-acs.md +446 -0
- package/plugins/specweave/commands/specweave-next.md +148 -3
- package/plugins/specweave/commands/specweave-qa.md +2 -2
- package/plugins/specweave/hooks/lib/migrate-increment-work.sh +1 -1
- package/plugins/specweave/hooks/lib/migrate-increment-work.sh.bak +245 -0
- package/plugins/specweave/hooks/lib/sync-spec-content.sh +2 -2
- package/plugins/specweave/hooks/lib/sync-spec-content.sh.bak +149 -0
- package/plugins/specweave/hooks/lib/update-status-line.sh +34 -4
- package/plugins/specweave/hooks/lib/validate-spec-status.sh +1 -1
- package/plugins/specweave/hooks/lib/validate-spec-status.sh.bak +163 -0
- package/plugins/specweave/hooks/post-first-increment.sh +1 -1
- package/plugins/specweave/hooks/post-first-increment.sh.bak +61 -0
- package/plugins/specweave/hooks/post-spec-update.sh +1 -1
- package/plugins/specweave/hooks/post-spec-update.sh.bak +158 -0
- package/plugins/specweave/hooks/post-user-story-complete.sh +1 -1
- package/plugins/specweave/hooks/post-user-story-complete.sh.bak +179 -0
- package/plugins/specweave/hooks/pre-command-deduplication.sh +1 -1
- package/plugins/specweave/hooks/pre-command-deduplication.sh.bak +83 -0
- package/plugins/specweave/hooks/pre-increment-start.sh +168 -0
- package/plugins/specweave/hooks/user-prompt-submit.sh +1 -1
- package/plugins/specweave/hooks/user-prompt-submit.sh.bak +386 -0
- package/plugins/specweave/skills/SKILLS-INDEX.md +1 -1
- package/plugins/specweave/skills/specweave-framework/SKILL.md +1 -1
- package/plugins/specweave-ado/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave-ado/agents/ado-manager/AGENT.md +23 -0
- package/plugins/specweave-ado/agents/ado-multi-project-mapper/AGENT.md +23 -0
- package/plugins/specweave-ado/agents/ado-sync-judge/AGENT.md +23 -0
- package/plugins/specweave-ado/commands/specweave-ado-import-projects.md +331 -0
- package/plugins/specweave-alternatives/.claude-plugin/plugin.json +10 -0
- package/plugins/specweave-alternatives/commands/alternatives-analyze.md +336 -0
- package/plugins/specweave-alternatives/skills/architecture-alternatives/SKILL.md +651 -0
- package/plugins/specweave-alternatives/skills/bmad-method/SKILL.md +420 -0
- package/plugins/specweave-alternatives/skills/spec-kit-expert/SKILL.md +487 -0
- package/plugins/specweave-backend/agents/database-optimizer/AGENT.md +23 -0
- package/plugins/specweave-backend/commands/api-scaffold.md +80 -0
- package/plugins/specweave-backend/commands/crud-generate.md +109 -0
- package/plugins/specweave-backend/commands/migration-generate.md +139 -0
- package/plugins/specweave-confluent/agents/confluent-architect/AGENT.md +23 -0
- package/plugins/specweave-confluent/commands/connector-deploy.md +154 -0
- package/plugins/specweave-confluent/commands/ksqldb-query.md +179 -0
- package/plugins/specweave-confluent/commands/schema-register.md +123 -0
- package/plugins/specweave-core/.claude-plugin/plugin.json +21 -0
- package/plugins/specweave-core/commands/architecture-review.md +288 -0
- package/plugins/specweave-core/commands/code-review.md +213 -0
- package/plugins/specweave-core/commands/refactor-plan.md +249 -0
- package/plugins/specweave-core/skills/code-quality/SKILL.md +157 -0
- package/plugins/specweave-core/skills/design-patterns/SKILL.md +244 -0
- package/plugins/specweave-core/skills/software-architecture/SKILL.md +83 -0
- package/plugins/specweave-cost-optimizer/.claude-plugin/plugin.json +22 -0
- package/plugins/specweave-cost-optimizer/commands/cost-analyze.md +360 -0
- package/plugins/specweave-cost-optimizer/commands/cost-optimize.md +480 -0
- package/plugins/specweave-cost-optimizer/skills/aws-cost-expert/SKILL.md +416 -0
- package/plugins/specweave-cost-optimizer/skills/cloud-pricing/SKILL.md +325 -0
- package/plugins/specweave-cost-optimizer/skills/cost-optimization/SKILL.md +337 -0
- package/plugins/specweave-diagrams/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave-diagrams/agents/diagrams-architect/AGENT.md +23 -0
- package/plugins/specweave-diagrams/commands/diagrams-generate.md +168 -0
- package/plugins/specweave-docs/.claude-plugin/plugin.json +10 -0
- package/plugins/specweave-docs/commands/docs-generate.md +441 -0
- package/plugins/specweave-docs/commands/docs-init.md +334 -0
- package/plugins/specweave-docs/skills/docusaurus/SKILL.md +581 -0
- package/plugins/specweave-docs/skills/spec-driven-brainstorming/SKILL.md +689 -0
- package/plugins/specweave-docs/skills/technical-writing/SKILL.md +1039 -0
- package/plugins/specweave-docs-preview/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave-figma/.claude-plugin/plugin.json +23 -0
- package/plugins/specweave-figma/commands/figma-import.md +690 -0
- package/plugins/specweave-figma/commands/figma-to-react.md +834 -0
- package/plugins/specweave-figma/commands/figma-tokens.md +815 -0
- package/plugins/specweave-frontend/.claude-plugin/plugin.json +21 -0
- package/plugins/specweave-frontend/agents/frontend-architect/AGENT.md +387 -0
- package/plugins/specweave-frontend/agents/frontend-architect/README.md +385 -0
- package/plugins/specweave-frontend/agents/frontend-architect/examples.md +590 -0
- package/plugins/specweave-frontend/agents/frontend-architect/templates/component-template.tsx +152 -0
- package/plugins/specweave-frontend/agents/frontend-architect/templates/hook-template.ts +311 -0
- package/plugins/specweave-frontend/agents/frontend-architect/templates/page-template.tsx +228 -0
- package/plugins/specweave-frontend/commands/component-generate.md +510 -0
- package/plugins/specweave-frontend/commands/design-system-init.md +494 -0
- package/plugins/specweave-frontend/commands/frontend-scaffold.md +207 -0
- package/plugins/specweave-frontend/commands/nextjs-setup.md +396 -0
- package/plugins/specweave-frontend/skills/design-system-architect/SKILL.md +278 -0
- package/plugins/specweave-frontend/skills/frontend/SKILL.md +420 -0
- package/plugins/specweave-frontend/skills/nextjs/SKILL.md +546 -0
- package/plugins/specweave-github/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave-github/agents/github-manager/AGENT.md +23 -0
- package/plugins/specweave-github/agents/github-task-splitter/AGENT.md +25 -0
- package/plugins/specweave-github/agents/user-story-updater/AGENT.md +25 -0
- package/plugins/specweave-github/hooks/.specweave/logs/hooks-debug.log +194 -0
- package/plugins/specweave-github/lib/github-spec-content-sync.js +49 -0
- package/plugins/specweave-github/lib/github-spec-content-sync.ts +67 -0
- package/plugins/specweave-infrastructure/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave-infrastructure/agents/devops/AGENT.md +26 -0
- package/plugins/specweave-infrastructure/agents/network-engineer/AGENT.md +26 -0
- package/plugins/specweave-infrastructure/agents/observability-engineer/AGENT.md +26 -0
- package/plugins/specweave-infrastructure/agents/performance-engineer/AGENT.md +26 -0
- package/plugins/specweave-infrastructure/agents/sre/AGENT.md +26 -0
- package/plugins/specweave-jira/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave-jira/agents/jira-manager/AGENT.md +26 -0
- package/plugins/specweave-jira/commands/import-projects.js +183 -0
- package/plugins/specweave-jira/commands/import-projects.md +97 -0
- package/plugins/specweave-jira/commands/import-projects.ts +288 -0
- package/plugins/specweave-jira/commands/specweave-jira-import-projects.md +298 -0
- package/plugins/specweave-kafka/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave-kafka/agents/kafka-architect/AGENT.md +26 -0
- package/plugins/specweave-kafka/agents/kafka-devops/AGENT.md +26 -0
- package/plugins/specweave-kafka/agents/kafka-observability/AGENT.md +26 -0
- package/plugins/specweave-kafka-streams/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave-kubernetes/agents/kubernetes-architect/AGENT.md +26 -0
- package/plugins/specweave-kubernetes/commands/cluster-setup.md +262 -0
- package/plugins/specweave-kubernetes/commands/deployment-generate.md +242 -0
- package/plugins/specweave-kubernetes/commands/helm-scaffold.md +333 -0
- package/plugins/specweave-ml/.claude-plugin/plugin.json +3 -3
- package/plugins/specweave-ml/agents/data-scientist/AGENT.md +26 -0
- package/plugins/specweave-ml/agents/ml-engineer/AGENT.md +26 -0
- package/plugins/specweave-ml/agents/mlops-engineer/AGENT.md +26 -0
- package/plugins/specweave-mobile/agents/mobile-architect/AGENT.md +26 -0
- package/plugins/specweave-mobile/commands/app-scaffold.md +233 -0
- package/plugins/specweave-mobile/commands/build-config.md +256 -0
- package/plugins/specweave-mobile/commands/screen-generate.md +289 -0
- package/plugins/specweave-n8n/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave-payments/agents/payment-integration/AGENT.md +26 -0
- package/plugins/specweave-plugin-dev/.claude-plugin/plugin.json +20 -0
- package/plugins/specweave-plugin-dev/commands/plugin-create.md +333 -0
- package/plugins/specweave-plugin-dev/commands/plugin-publish.md +339 -0
- package/plugins/specweave-plugin-dev/commands/plugin-test.md +293 -0
- package/plugins/specweave-plugin-dev/skills/claude-sdk/SKILL.md +162 -0
- package/plugins/specweave-plugin-dev/skills/marketplace-publishing/SKILL.md +263 -0
- package/plugins/specweave-plugin-dev/skills/plugin-development/SKILL.md +316 -0
- package/plugins/specweave-release/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave-release/agents/release-manager/AGENT.md +27 -0
- package/plugins/specweave-release/commands/specweave-release-npm.md +110 -0
- package/plugins/specweave-release/hooks/.specweave/logs/dora-tracking.log +168 -0
- package/plugins/specweave-testing/.claude-plugin/plugin.json +21 -0
- package/plugins/specweave-testing/agents/qa-engineer/AGENT.md +797 -0
- package/plugins/specweave-testing/agents/qa-engineer/README.md +443 -0
- package/plugins/specweave-testing/agents/qa-engineer/templates/playwright-e2e-test.ts +470 -0
- package/plugins/specweave-testing/agents/qa-engineer/templates/test-data-factory.ts +507 -0
- package/plugins/specweave-testing/agents/qa-engineer/templates/vitest-unit-test.ts +400 -0
- package/plugins/specweave-testing/agents/qa-engineer/test-strategies.md +726 -0
- package/plugins/specweave-testing/commands/e2e-setup.md +1081 -0
- package/plugins/specweave-testing/commands/test-coverage.md +979 -0
- package/plugins/specweave-testing/commands/test-generate.md +1156 -0
- package/plugins/specweave-testing/commands/test-init.md +409 -0
- package/plugins/specweave-testing/skills/e2e-playwright/SKILL.md +769 -0
- package/plugins/specweave-testing/skills/tdd-expert/SKILL.md +934 -0
- package/plugins/specweave-testing/skills/unit-testing-expert/SKILL.md +1011 -0
- package/plugins/specweave-tooling/.claude-plugin/plugin.json +22 -0
- package/plugins/specweave-tooling/commands/specweave-tooling-skill-create.md +691 -0
- package/plugins/specweave-tooling/commands/specweave-tooling-skill-package.md +751 -0
- package/plugins/specweave-tooling/commands/specweave-tooling-skill-validate.md +858 -0
- package/plugins/specweave-ui/.claude-plugin/plugin.json +10 -0
- package/plugins/specweave-ui/commands/ui-automate.md +199 -0
- package/plugins/specweave-ui/commands/ui-inspect.md +70 -0
- package/plugins/specweave-ui/skills/browser-automation/SKILL.md +314 -0
- package/plugins/specweave-ui/skills/ui-testing/SKILL.md +716 -0
- package/plugins/specweave-ui/skills/visual-regression/SKILL.md +728 -0
- package/plugins/specweave/commands/check-hooks.md +0 -257
- package/plugins/specweave/commands/specweave-archive-increments.md +0 -82
- package/plugins/specweave/skills/plugin-expert/SKILL.md +0 -340
- /package/plugins/specweave/{agents/code-reviewer.md → skills/code-reviewer/SKILL.md} +0 -0
|
@@ -0,0 +1,494 @@
|
|
|
1
|
+
# /specweave-frontend:design-system-init
|
|
2
|
+
|
|
3
|
+
Initialize a complete design system with Atomic Design principles, design tokens, and component library.
|
|
4
|
+
|
|
5
|
+
You are an expert design system architect who creates scalable, maintainable component libraries.
|
|
6
|
+
|
|
7
|
+
## Your Task
|
|
8
|
+
|
|
9
|
+
Create a production-ready design system foundation with design tokens, theming, and Atomic Design component structure.
|
|
10
|
+
|
|
11
|
+
### 1. Design System Architecture
|
|
12
|
+
|
|
13
|
+
**Atomic Design Hierarchy**:
|
|
14
|
+
```
|
|
15
|
+
src/components/
|
|
16
|
+
├── atoms/ # Basic building blocks
|
|
17
|
+
│ ├── Button/
|
|
18
|
+
│ │ ├── Button.tsx
|
|
19
|
+
│ │ ├── Button.test.tsx
|
|
20
|
+
│ │ ├── Button.stories.tsx
|
|
21
|
+
│ │ └── index.ts
|
|
22
|
+
│ ├── Input/
|
|
23
|
+
│ ├── Text/
|
|
24
|
+
│ └── Icon/
|
|
25
|
+
├── molecules/ # Simple component groups
|
|
26
|
+
│ ├── FormField/ # Label + Input + Error
|
|
27
|
+
│ ├── SearchBar/ # Input + Button
|
|
28
|
+
│ └── Card/
|
|
29
|
+
├── organisms/ # Complex components
|
|
30
|
+
│ ├── Header/
|
|
31
|
+
│ ├── Footer/
|
|
32
|
+
│ ├── Form/
|
|
33
|
+
│ └── Navigation/
|
|
34
|
+
├── templates/ # Page layouts
|
|
35
|
+
│ ├── DashboardLayout/
|
|
36
|
+
│ ├── AuthLayout/
|
|
37
|
+
│ └── MarketingLayout/
|
|
38
|
+
└── pages/ # Full pages (if not using framework routing)
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### 2. Design Tokens
|
|
42
|
+
|
|
43
|
+
**tokens/colors.ts**:
|
|
44
|
+
```typescript
|
|
45
|
+
export const colors = {
|
|
46
|
+
// Brand colors
|
|
47
|
+
brand: {
|
|
48
|
+
primary: {
|
|
49
|
+
50: '#eff6ff',
|
|
50
|
+
100: '#dbeafe',
|
|
51
|
+
500: '#3b82f6',
|
|
52
|
+
600: '#2563eb',
|
|
53
|
+
900: '#1e3a8a',
|
|
54
|
+
},
|
|
55
|
+
secondary: {
|
|
56
|
+
50: '#f0fdf4',
|
|
57
|
+
500: '#22c55e',
|
|
58
|
+
900: '#14532d',
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
// Neutral colors
|
|
62
|
+
neutral: {
|
|
63
|
+
white: '#ffffff',
|
|
64
|
+
black: '#000000',
|
|
65
|
+
50: '#fafafa',
|
|
66
|
+
100: '#f5f5f5',
|
|
67
|
+
500: '#737373',
|
|
68
|
+
900: '#171717',
|
|
69
|
+
},
|
|
70
|
+
// Semantic colors
|
|
71
|
+
semantic: {
|
|
72
|
+
success: '#22c55e',
|
|
73
|
+
warning: '#f59e0b',
|
|
74
|
+
error: '#ef4444',
|
|
75
|
+
info: '#3b82f6',
|
|
76
|
+
},
|
|
77
|
+
} as const;
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
**tokens/typography.ts**:
|
|
81
|
+
```typescript
|
|
82
|
+
export const typography = {
|
|
83
|
+
fontFamily: {
|
|
84
|
+
sans: ['Inter', 'system-ui', 'sans-serif'],
|
|
85
|
+
mono: ['Roboto Mono', 'monospace'],
|
|
86
|
+
},
|
|
87
|
+
fontSize: {
|
|
88
|
+
xs: '0.75rem', // 12px
|
|
89
|
+
sm: '0.875rem', // 14px
|
|
90
|
+
base: '1rem', // 16px
|
|
91
|
+
lg: '1.125rem', // 18px
|
|
92
|
+
xl: '1.25rem', // 20px
|
|
93
|
+
'2xl': '1.5rem', // 24px
|
|
94
|
+
'3xl': '1.875rem', // 30px
|
|
95
|
+
'4xl': '2.25rem', // 36px
|
|
96
|
+
},
|
|
97
|
+
fontWeight: {
|
|
98
|
+
normal: 400,
|
|
99
|
+
medium: 500,
|
|
100
|
+
semibold: 600,
|
|
101
|
+
bold: 700,
|
|
102
|
+
},
|
|
103
|
+
lineHeight: {
|
|
104
|
+
none: 1,
|
|
105
|
+
tight: 1.25,
|
|
106
|
+
normal: 1.5,
|
|
107
|
+
relaxed: 1.75,
|
|
108
|
+
},
|
|
109
|
+
} as const;
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
**tokens/spacing.ts**:
|
|
113
|
+
```typescript
|
|
114
|
+
export const spacing = {
|
|
115
|
+
0: '0',
|
|
116
|
+
1: '0.25rem', // 4px
|
|
117
|
+
2: '0.5rem', // 8px
|
|
118
|
+
3: '0.75rem', // 12px
|
|
119
|
+
4: '1rem', // 16px
|
|
120
|
+
5: '1.25rem', // 20px
|
|
121
|
+
6: '1.5rem', // 24px
|
|
122
|
+
8: '2rem', // 32px
|
|
123
|
+
10: '2.5rem', // 40px
|
|
124
|
+
12: '3rem', // 48px
|
|
125
|
+
16: '4rem', // 64px
|
|
126
|
+
20: '5rem', // 80px
|
|
127
|
+
} as const;
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
**tokens/index.ts**:
|
|
131
|
+
```typescript
|
|
132
|
+
export { colors } from './colors';
|
|
133
|
+
export { typography } from './typography';
|
|
134
|
+
export { spacing } from './spacing';
|
|
135
|
+
export { breakpoints } from './breakpoints';
|
|
136
|
+
export { shadows } from './shadows';
|
|
137
|
+
export { radii } from './radii';
|
|
138
|
+
export { transitions } from './transitions';
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### 3. Theme Configuration
|
|
142
|
+
|
|
143
|
+
**theme/index.ts**:
|
|
144
|
+
```typescript
|
|
145
|
+
import { colors, typography, spacing } from '../tokens';
|
|
146
|
+
|
|
147
|
+
export const theme = {
|
|
148
|
+
colors,
|
|
149
|
+
typography,
|
|
150
|
+
spacing,
|
|
151
|
+
components: {
|
|
152
|
+
Button: {
|
|
153
|
+
variants: {
|
|
154
|
+
primary: {
|
|
155
|
+
bg: colors.brand.primary[500],
|
|
156
|
+
color: colors.neutral.white,
|
|
157
|
+
hover: {
|
|
158
|
+
bg: colors.brand.primary[600],
|
|
159
|
+
},
|
|
160
|
+
},
|
|
161
|
+
secondary: {
|
|
162
|
+
bg: 'transparent',
|
|
163
|
+
color: colors.brand.primary[500],
|
|
164
|
+
border: `1px solid ${colors.brand.primary[500]}`,
|
|
165
|
+
hover: {
|
|
166
|
+
bg: colors.brand.primary[50],
|
|
167
|
+
},
|
|
168
|
+
},
|
|
169
|
+
ghost: {
|
|
170
|
+
bg: 'transparent',
|
|
171
|
+
color: colors.neutral[700],
|
|
172
|
+
hover: {
|
|
173
|
+
bg: colors.neutral[100],
|
|
174
|
+
},
|
|
175
|
+
},
|
|
176
|
+
},
|
|
177
|
+
sizes: {
|
|
178
|
+
sm: {
|
|
179
|
+
height: '32px',
|
|
180
|
+
px: spacing[3],
|
|
181
|
+
fontSize: typography.fontSize.sm,
|
|
182
|
+
},
|
|
183
|
+
md: {
|
|
184
|
+
height: '40px',
|
|
185
|
+
px: spacing[4],
|
|
186
|
+
fontSize: typography.fontSize.base,
|
|
187
|
+
},
|
|
188
|
+
lg: {
|
|
189
|
+
height: '48px',
|
|
190
|
+
px: spacing[6],
|
|
191
|
+
fontSize: typography.fontSize.lg,
|
|
192
|
+
},
|
|
193
|
+
},
|
|
194
|
+
},
|
|
195
|
+
},
|
|
196
|
+
} as const;
|
|
197
|
+
|
|
198
|
+
export type Theme = typeof theme;
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
### 4. Component Template (Button)
|
|
202
|
+
|
|
203
|
+
**components/atoms/Button/Button.tsx**:
|
|
204
|
+
```typescript
|
|
205
|
+
import React from 'react';
|
|
206
|
+
import { cn } from '@/lib/utils';
|
|
207
|
+
|
|
208
|
+
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
209
|
+
variant?: 'primary' | 'secondary' | 'ghost' | 'danger';
|
|
210
|
+
size?: 'sm' | 'md' | 'lg';
|
|
211
|
+
isLoading?: boolean;
|
|
212
|
+
leftIcon?: React.ReactNode;
|
|
213
|
+
rightIcon?: React.ReactNode;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
export const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
|
217
|
+
(
|
|
218
|
+
{
|
|
219
|
+
children,
|
|
220
|
+
variant = 'primary',
|
|
221
|
+
size = 'md',
|
|
222
|
+
isLoading = false,
|
|
223
|
+
leftIcon,
|
|
224
|
+
rightIcon,
|
|
225
|
+
className,
|
|
226
|
+
disabled,
|
|
227
|
+
...props
|
|
228
|
+
},
|
|
229
|
+
ref
|
|
230
|
+
) => {
|
|
231
|
+
const baseStyles = 'inline-flex items-center justify-center font-medium rounded-lg transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2';
|
|
232
|
+
|
|
233
|
+
const variants = {
|
|
234
|
+
primary: 'bg-blue-600 text-white hover:bg-blue-700 focus:ring-blue-500',
|
|
235
|
+
secondary: 'border border-blue-600 text-blue-600 hover:bg-blue-50 focus:ring-blue-500',
|
|
236
|
+
ghost: 'text-gray-700 hover:bg-gray-100 focus:ring-gray-500',
|
|
237
|
+
danger: 'bg-red-600 text-white hover:bg-red-700 focus:ring-red-500',
|
|
238
|
+
};
|
|
239
|
+
|
|
240
|
+
const sizes = {
|
|
241
|
+
sm: 'h-8 px-3 text-sm',
|
|
242
|
+
md: 'h-10 px-4 text-base',
|
|
243
|
+
lg: 'h-12 px-6 text-lg',
|
|
244
|
+
};
|
|
245
|
+
|
|
246
|
+
return (
|
|
247
|
+
<button
|
|
248
|
+
ref={ref}
|
|
249
|
+
className={cn(
|
|
250
|
+
baseStyles,
|
|
251
|
+
variants[variant],
|
|
252
|
+
sizes[size],
|
|
253
|
+
(disabled || isLoading) && 'opacity-50 cursor-not-allowed',
|
|
254
|
+
className
|
|
255
|
+
)}
|
|
256
|
+
disabled={disabled || isLoading}
|
|
257
|
+
{...props}
|
|
258
|
+
>
|
|
259
|
+
{isLoading && <LoadingSpinner className="mr-2" />}
|
|
260
|
+
{!isLoading && leftIcon && <span className="mr-2">{leftIcon}</span>}
|
|
261
|
+
{children}
|
|
262
|
+
{!isLoading && rightIcon && <span className="ml-2">{rightIcon}</span>}
|
|
263
|
+
</button>
|
|
264
|
+
);
|
|
265
|
+
}
|
|
266
|
+
);
|
|
267
|
+
|
|
268
|
+
Button.displayName = 'Button';
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
**components/atoms/Button/Button.test.tsx**:
|
|
272
|
+
```typescript
|
|
273
|
+
import { render, screen, fireEvent } from '@testing-library/react';
|
|
274
|
+
import { Button } from './Button';
|
|
275
|
+
|
|
276
|
+
describe('Button', () => {
|
|
277
|
+
it('renders correctly', () => {
|
|
278
|
+
render(<Button>Click me</Button>);
|
|
279
|
+
expect(screen.getByText('Click me')).toBeInTheDocument();
|
|
280
|
+
});
|
|
281
|
+
|
|
282
|
+
it('handles click events', () => {
|
|
283
|
+
const onClick = vi.fn();
|
|
284
|
+
render(<Button onClick={onClick}>Click me</Button>);
|
|
285
|
+
fireEvent.click(screen.getByText('Click me'));
|
|
286
|
+
expect(onClick).toHaveBeenCalledTimes(1);
|
|
287
|
+
});
|
|
288
|
+
|
|
289
|
+
it('shows loading state', () => {
|
|
290
|
+
render(<Button isLoading>Click me</Button>);
|
|
291
|
+
expect(screen.getByRole('button')).toBeDisabled();
|
|
292
|
+
});
|
|
293
|
+
|
|
294
|
+
it('applies variant styles', () => {
|
|
295
|
+
const { rerender } = render(<Button variant="primary">Primary</Button>);
|
|
296
|
+
expect(screen.getByRole('button')).toHaveClass('bg-blue-600');
|
|
297
|
+
|
|
298
|
+
rerender(<Button variant="secondary">Secondary</Button>);
|
|
299
|
+
expect(screen.getByRole('button')).toHaveClass('border-blue-600');
|
|
300
|
+
});
|
|
301
|
+
});
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
### 5. Storybook Integration
|
|
305
|
+
|
|
306
|
+
**components/atoms/Button/Button.stories.tsx**:
|
|
307
|
+
```typescript
|
|
308
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
309
|
+
import { Button } from './Button';
|
|
310
|
+
|
|
311
|
+
const meta: Meta<typeof Button> = {
|
|
312
|
+
title: 'Atoms/Button',
|
|
313
|
+
component: Button,
|
|
314
|
+
tags: ['autodocs'],
|
|
315
|
+
argTypes: {
|
|
316
|
+
variant: {
|
|
317
|
+
control: 'select',
|
|
318
|
+
options: ['primary', 'secondary', 'ghost', 'danger'],
|
|
319
|
+
},
|
|
320
|
+
size: {
|
|
321
|
+
control: 'select',
|
|
322
|
+
options: ['sm', 'md', 'lg'],
|
|
323
|
+
},
|
|
324
|
+
},
|
|
325
|
+
};
|
|
326
|
+
|
|
327
|
+
export default meta;
|
|
328
|
+
type Story = StoryObj<typeof Button>;
|
|
329
|
+
|
|
330
|
+
export const Primary: Story = {
|
|
331
|
+
args: {
|
|
332
|
+
variant: 'primary',
|
|
333
|
+
children: 'Primary Button',
|
|
334
|
+
},
|
|
335
|
+
};
|
|
336
|
+
|
|
337
|
+
export const Secondary: Story = {
|
|
338
|
+
args: {
|
|
339
|
+
variant: 'secondary',
|
|
340
|
+
children: 'Secondary Button',
|
|
341
|
+
},
|
|
342
|
+
};
|
|
343
|
+
|
|
344
|
+
export const Loading: Story = {
|
|
345
|
+
args: {
|
|
346
|
+
variant: 'primary',
|
|
347
|
+
isLoading: true,
|
|
348
|
+
children: 'Loading...',
|
|
349
|
+
},
|
|
350
|
+
};
|
|
351
|
+
|
|
352
|
+
export const WithIcons: Story = {
|
|
353
|
+
args: {
|
|
354
|
+
variant: 'primary',
|
|
355
|
+
leftIcon: <IconPlus />,
|
|
356
|
+
children: 'Add Item',
|
|
357
|
+
},
|
|
358
|
+
};
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
### 6. Utility Function (cn)
|
|
362
|
+
|
|
363
|
+
**lib/utils.ts**:
|
|
364
|
+
```typescript
|
|
365
|
+
import { clsx, type ClassValue } from 'clsx';
|
|
366
|
+
import { twMerge } from 'tailwind-merge';
|
|
367
|
+
|
|
368
|
+
export function cn(...inputs: ClassValue[]) {
|
|
369
|
+
return twMerge(clsx(inputs));
|
|
370
|
+
}
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
### 7. TailwindCSS Configuration
|
|
374
|
+
|
|
375
|
+
**tailwind.config.ts**:
|
|
376
|
+
```typescript
|
|
377
|
+
import type { Config } from 'tailwindcss';
|
|
378
|
+
import { colors, typography, spacing } from './src/tokens';
|
|
379
|
+
|
|
380
|
+
const config: Config = {
|
|
381
|
+
content: ['./src/**/*.{js,ts,jsx,tsx,mdx}'],
|
|
382
|
+
theme: {
|
|
383
|
+
extend: {
|
|
384
|
+
colors: {
|
|
385
|
+
brand: colors.brand,
|
|
386
|
+
neutral: colors.neutral,
|
|
387
|
+
},
|
|
388
|
+
fontFamily: typography.fontFamily,
|
|
389
|
+
fontSize: typography.fontSize,
|
|
390
|
+
spacing,
|
|
391
|
+
},
|
|
392
|
+
},
|
|
393
|
+
plugins: [],
|
|
394
|
+
};
|
|
395
|
+
|
|
396
|
+
export default config;
|
|
397
|
+
```
|
|
398
|
+
|
|
399
|
+
### 8. Documentation Template
|
|
400
|
+
|
|
401
|
+
**components/atoms/Button/README.md**:
|
|
402
|
+
```markdown
|
|
403
|
+
# Button Component
|
|
404
|
+
|
|
405
|
+
A versatile button component with multiple variants and sizes.
|
|
406
|
+
|
|
407
|
+
## Usage
|
|
408
|
+
|
|
409
|
+
\`\`\`tsx
|
|
410
|
+
import { Button } from '@/components/atoms/Button';
|
|
411
|
+
|
|
412
|
+
<Button variant="primary" size="md" onClick={handleClick}>
|
|
413
|
+
Click me
|
|
414
|
+
</Button>
|
|
415
|
+
\`\`\`
|
|
416
|
+
|
|
417
|
+
## Props
|
|
418
|
+
|
|
419
|
+
| Prop | Type | Default | Description |
|
|
420
|
+
|------|------|---------|-------------|
|
|
421
|
+
| variant | 'primary' \| 'secondary' \| 'ghost' \| 'danger' | 'primary' | Button style variant |
|
|
422
|
+
| size | 'sm' \| 'md' \| 'lg' | 'md' | Button size |
|
|
423
|
+
| isLoading | boolean | false | Shows loading spinner |
|
|
424
|
+
| leftIcon | ReactNode | - | Icon before text |
|
|
425
|
+
| rightIcon | ReactNode | - | Icon after text |
|
|
426
|
+
|
|
427
|
+
## Examples
|
|
428
|
+
|
|
429
|
+
See Storybook for interactive examples.
|
|
430
|
+
```
|
|
431
|
+
|
|
432
|
+
### 9. Essential Dependencies
|
|
433
|
+
|
|
434
|
+
```json
|
|
435
|
+
{
|
|
436
|
+
"dependencies": {
|
|
437
|
+
"clsx": "^2.0.0",
|
|
438
|
+
"tailwind-merge": "^2.0.0"
|
|
439
|
+
},
|
|
440
|
+
"devDependencies": {
|
|
441
|
+
"@storybook/react": "^7.6.0",
|
|
442
|
+
"@testing-library/react": "^14.0.0",
|
|
443
|
+
"tailwindcss": "^3.4.0"
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
```
|
|
447
|
+
|
|
448
|
+
### 10. Component Checklist
|
|
449
|
+
|
|
450
|
+
For each component, ensure:
|
|
451
|
+
- [ ] TypeScript props interface with JSDoc
|
|
452
|
+
- [ ] Accessibility (ARIA labels, keyboard navigation)
|
|
453
|
+
- [ ] Unit tests (>80% coverage)
|
|
454
|
+
- [ ] Storybook stories
|
|
455
|
+
- [ ] README documentation
|
|
456
|
+
- [ ] Responsive design
|
|
457
|
+
- [ ] Dark mode support (if applicable)
|
|
458
|
+
- [ ] Performance optimized (React.memo if needed)
|
|
459
|
+
|
|
460
|
+
## Workflow
|
|
461
|
+
|
|
462
|
+
1. Ask about design system requirements (brand colors, components needed)
|
|
463
|
+
2. Generate design tokens (colors, typography, spacing)
|
|
464
|
+
3. Set up theme configuration
|
|
465
|
+
4. Create component structure (Atomic Design)
|
|
466
|
+
5. Implement essential atoms (Button, Input, Text, Icon)
|
|
467
|
+
6. Add Storybook for component documentation
|
|
468
|
+
7. Configure Tailwind with design tokens
|
|
469
|
+
8. Provide usage guidelines and examples
|
|
470
|
+
|
|
471
|
+
## Example Usage
|
|
472
|
+
|
|
473
|
+
**User**: "Initialize a design system with blue brand color and Atomic Design"
|
|
474
|
+
|
|
475
|
+
**Response**:
|
|
476
|
+
Creates complete design system with:
|
|
477
|
+
- Design tokens (colors, typography, spacing)
|
|
478
|
+
- Theme configuration
|
|
479
|
+
- Atomic Design component structure
|
|
480
|
+
- Button, Input, Text components
|
|
481
|
+
- Storybook setup
|
|
482
|
+
- TailwindCSS integration
|
|
483
|
+
- Testing setup
|
|
484
|
+
- Documentation templates
|
|
485
|
+
|
|
486
|
+
## When to Use
|
|
487
|
+
|
|
488
|
+
- Starting new design systems
|
|
489
|
+
- Standardizing component libraries
|
|
490
|
+
- Rebranding existing applications
|
|
491
|
+
- Creating white-label products
|
|
492
|
+
- Building component libraries for teams
|
|
493
|
+
|
|
494
|
+
Build scalable, maintainable design systems with Atomic Design principles!
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
# /specweave-frontend:frontend-scaffold
|
|
2
|
+
|
|
3
|
+
Scaffold a complete frontend project with modern tooling and best practices.
|
|
4
|
+
|
|
5
|
+
You are an expert frontend architect who creates production-ready project structures.
|
|
6
|
+
|
|
7
|
+
## Your Task
|
|
8
|
+
|
|
9
|
+
Generate a complete frontend project scaffold based on the user's requirements. Support React, Vue, Angular, and Next.js with modern tooling.
|
|
10
|
+
|
|
11
|
+
### 1. Supported Frameworks
|
|
12
|
+
|
|
13
|
+
**React**:
|
|
14
|
+
- TypeScript + Vite
|
|
15
|
+
- ESLint + Prettier
|
|
16
|
+
- Vitest + React Testing Library
|
|
17
|
+
- TailwindCSS or styled-components
|
|
18
|
+
- React Router v6
|
|
19
|
+
- React Query for data fetching
|
|
20
|
+
|
|
21
|
+
**Next.js 14+**:
|
|
22
|
+
- App Router (default)
|
|
23
|
+
- TypeScript
|
|
24
|
+
- TailwindCSS
|
|
25
|
+
- Server Components
|
|
26
|
+
- Route Handlers
|
|
27
|
+
- Metadata API
|
|
28
|
+
|
|
29
|
+
**Vue 3**:
|
|
30
|
+
- TypeScript + Vite
|
|
31
|
+
- Composition API
|
|
32
|
+
- Vue Router v4
|
|
33
|
+
- Pinia for state management
|
|
34
|
+
- Vitest
|
|
35
|
+
|
|
36
|
+
**Angular 17+**:
|
|
37
|
+
- Standalone Components
|
|
38
|
+
- TypeScript (strict)
|
|
39
|
+
- Angular Material
|
|
40
|
+
- RxJS
|
|
41
|
+
- Jest
|
|
42
|
+
|
|
43
|
+
### 2. Project Structure
|
|
44
|
+
|
|
45
|
+
**React/Next.js**:
|
|
46
|
+
```
|
|
47
|
+
src/
|
|
48
|
+
├── app/ # Next.js App Router
|
|
49
|
+
│ ├── layout.tsx
|
|
50
|
+
│ ├── page.tsx
|
|
51
|
+
│ └── api/
|
|
52
|
+
├── components/
|
|
53
|
+
│ ├── atoms/ # Atomic Design
|
|
54
|
+
│ ├── molecules/
|
|
55
|
+
│ ├── organisms/
|
|
56
|
+
│ └── templates/
|
|
57
|
+
├── hooks/
|
|
58
|
+
├── lib/
|
|
59
|
+
│ ├── api/
|
|
60
|
+
│ ├── utils/
|
|
61
|
+
│ └── constants/
|
|
62
|
+
├── styles/
|
|
63
|
+
│ └── globals.css
|
|
64
|
+
└── types/
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
**Vue**:
|
|
68
|
+
```
|
|
69
|
+
src/
|
|
70
|
+
├── components/
|
|
71
|
+
├── composables/
|
|
72
|
+
├── router/
|
|
73
|
+
├── stores/
|
|
74
|
+
├── views/
|
|
75
|
+
├── assets/
|
|
76
|
+
└── types/
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### 3. Configuration Files
|
|
80
|
+
|
|
81
|
+
Generate these essential config files:
|
|
82
|
+
|
|
83
|
+
**TypeScript** (`tsconfig.json`):
|
|
84
|
+
```json
|
|
85
|
+
{
|
|
86
|
+
"compilerOptions": {
|
|
87
|
+
"target": "ES2022",
|
|
88
|
+
"lib": ["ES2022", "DOM", "DOM.Iterable"],
|
|
89
|
+
"jsx": "react-jsx",
|
|
90
|
+
"module": "ESNext",
|
|
91
|
+
"moduleResolution": "bundler",
|
|
92
|
+
"resolveJsonModule": true,
|
|
93
|
+
"strict": true,
|
|
94
|
+
"skipLibCheck": true,
|
|
95
|
+
"esModuleInterop": true,
|
|
96
|
+
"baseUrl": ".",
|
|
97
|
+
"paths": {
|
|
98
|
+
"@/*": ["./src/*"]
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
**ESLint** (`.eslintrc.json`):
|
|
105
|
+
- TypeScript rules
|
|
106
|
+
- React Hooks rules
|
|
107
|
+
- Accessibility rules (jsx-a11y)
|
|
108
|
+
- Import ordering
|
|
109
|
+
|
|
110
|
+
**Prettier** (`.prettierrc`):
|
|
111
|
+
- Consistent formatting
|
|
112
|
+
- Tailwind plugin if using Tailwind
|
|
113
|
+
|
|
114
|
+
**Vite/Next Config**:
|
|
115
|
+
- Path aliases
|
|
116
|
+
- Environment variables
|
|
117
|
+
- Build optimization
|
|
118
|
+
|
|
119
|
+
### 4. Essential Dependencies
|
|
120
|
+
|
|
121
|
+
**Core**:
|
|
122
|
+
```json
|
|
123
|
+
{
|
|
124
|
+
"dependencies": {
|
|
125
|
+
"react": "^18.2.0",
|
|
126
|
+
"react-dom": "^18.2.0"
|
|
127
|
+
},
|
|
128
|
+
"devDependencies": {
|
|
129
|
+
"@types/react": "^18.2.0",
|
|
130
|
+
"@types/react-dom": "^18.2.0",
|
|
131
|
+
"typescript": "^5.3.0",
|
|
132
|
+
"vite": "^5.0.0"
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
**State Management**:
|
|
138
|
+
- Zustand (lightweight)
|
|
139
|
+
- Redux Toolkit (complex state)
|
|
140
|
+
- React Query (server state)
|
|
141
|
+
|
|
142
|
+
**Styling**:
|
|
143
|
+
- TailwindCSS (utility-first)
|
|
144
|
+
- styled-components (CSS-in-JS)
|
|
145
|
+
- CSS Modules (scoped styles)
|
|
146
|
+
|
|
147
|
+
**Testing**:
|
|
148
|
+
- Vitest (unit tests)
|
|
149
|
+
- React Testing Library
|
|
150
|
+
- Playwright (E2E)
|
|
151
|
+
|
|
152
|
+
### 5. Features to Include
|
|
153
|
+
|
|
154
|
+
1. **TypeScript Configuration**: Strict mode, path aliases
|
|
155
|
+
2. **Linting & Formatting**: ESLint, Prettier, Husky pre-commit hooks
|
|
156
|
+
3. **Testing Setup**: Unit test framework + E2E setup
|
|
157
|
+
4. **CI/CD**: GitHub Actions workflow
|
|
158
|
+
5. **Environment Management**: `.env` files for different environments
|
|
159
|
+
6. **Error Handling**: Error boundaries, global error handling
|
|
160
|
+
7. **Loading States**: Skeleton loaders, suspense boundaries
|
|
161
|
+
8. **Routing**: File-based (Next.js) or configured routing
|
|
162
|
+
9. **API Integration**: Fetch wrapper, error handling, typing
|
|
163
|
+
10. **Performance**: Code splitting, lazy loading, memoization
|
|
164
|
+
|
|
165
|
+
### 6. Best Practices
|
|
166
|
+
|
|
167
|
+
- **Component Organization**: Atomic Design pattern
|
|
168
|
+
- **Type Safety**: No `any` types, strict mode
|
|
169
|
+
- **Accessibility**: ARIA labels, keyboard navigation
|
|
170
|
+
- **Performance**: React.memo, useMemo, useCallback
|
|
171
|
+
- **SEO**: Metadata, Open Graph tags (Next.js)
|
|
172
|
+
- **Security**: CSP headers, XSS prevention
|
|
173
|
+
- **Code Quality**: Consistent naming, clear structure
|
|
174
|
+
|
|
175
|
+
### 7. Workflow
|
|
176
|
+
|
|
177
|
+
1. Ask about framework choice (React/Next/Vue/Angular)
|
|
178
|
+
2. Confirm styling approach (Tailwind/styled-components/CSS Modules)
|
|
179
|
+
3. Verify state management needs
|
|
180
|
+
4. Generate complete file structure
|
|
181
|
+
5. Create configuration files
|
|
182
|
+
6. Set up package.json with scripts
|
|
183
|
+
7. Provide setup instructions
|
|
184
|
+
|
|
185
|
+
## Example Usage
|
|
186
|
+
|
|
187
|
+
**User**: "Scaffold a Next.js 14 project with TailwindCSS and TypeScript"
|
|
188
|
+
|
|
189
|
+
**Response**:
|
|
190
|
+
Creates complete Next.js 14 App Router project with:
|
|
191
|
+
- TypeScript configuration
|
|
192
|
+
- TailwindCSS setup
|
|
193
|
+
- ESLint + Prettier
|
|
194
|
+
- Path aliases
|
|
195
|
+
- Testing setup
|
|
196
|
+
- CI/CD workflow
|
|
197
|
+
- Example components
|
|
198
|
+
|
|
199
|
+
## When to Use
|
|
200
|
+
|
|
201
|
+
- Starting new frontend projects
|
|
202
|
+
- Converting to TypeScript
|
|
203
|
+
- Modernizing legacy projects
|
|
204
|
+
- Setting up best practices
|
|
205
|
+
- Creating consistent team structure
|
|
206
|
+
|
|
207
|
+
Scaffold production-ready frontend projects with modern tooling and best practices!
|