specweave 0.23.18 → 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.
Files changed (167) hide show
  1. package/.claude-plugin/marketplace.json +93 -49
  2. package/CLAUDE.md +137 -4
  3. package/dist/src/cli/helpers/ado-area-path-mapper.d.ts +89 -0
  4. package/dist/src/cli/helpers/ado-area-path-mapper.d.ts.map +1 -0
  5. package/dist/src/cli/helpers/ado-area-path-mapper.js +213 -0
  6. package/dist/src/cli/helpers/ado-area-path-mapper.js.map +1 -0
  7. package/dist/src/cli/helpers/issue-tracker/ado-auto-discover.d.ts +29 -0
  8. package/dist/src/cli/helpers/issue-tracker/ado-auto-discover.d.ts.map +1 -0
  9. package/dist/src/cli/helpers/issue-tracker/ado-auto-discover.js +109 -0
  10. package/dist/src/cli/helpers/issue-tracker/ado-auto-discover.js.map +1 -0
  11. package/dist/src/cli/helpers/issue-tracker/ado.d.ts +1 -0
  12. package/dist/src/cli/helpers/issue-tracker/ado.d.ts.map +1 -1
  13. package/dist/src/cli/helpers/issue-tracker/ado.js +2 -0
  14. package/dist/src/cli/helpers/issue-tracker/ado.js.map +1 -1
  15. package/dist/src/cli/helpers/smart-filter.d.ts +83 -0
  16. package/dist/src/cli/helpers/smart-filter.d.ts.map +1 -0
  17. package/dist/src/cli/helpers/smart-filter.js +265 -0
  18. package/dist/src/cli/helpers/smart-filter.js.map +1 -0
  19. package/dist/src/core/qa/quality-gate-decider.d.ts +1 -1
  20. package/dist/src/core/qa/quality-gate-decider.js +2 -2
  21. package/dist/src/core/qa/quality-gate-decider.js.map +1 -1
  22. package/dist/src/core/qa/risk-calculator.d.ts +2 -2
  23. package/dist/src/core/qa/risk-calculator.js +2 -2
  24. package/dist/src/core/validators/ac-presence-validator.d.ts +56 -0
  25. package/dist/src/core/validators/ac-presence-validator.d.ts.map +1 -0
  26. package/dist/src/core/validators/ac-presence-validator.js +149 -0
  27. package/dist/src/core/validators/ac-presence-validator.js.map +1 -0
  28. package/dist/src/integrations/ado/area-path-mapper.d.ts +137 -0
  29. package/dist/src/integrations/ado/area-path-mapper.d.ts.map +1 -0
  30. package/dist/src/integrations/ado/area-path-mapper.js +267 -0
  31. package/dist/src/integrations/ado/area-path-mapper.js.map +1 -0
  32. package/dist/src/integrations/jira/filter-processor.d.ts +126 -0
  33. package/dist/src/integrations/jira/filter-processor.d.ts.map +1 -0
  34. package/dist/src/integrations/jira/filter-processor.js +207 -0
  35. package/dist/src/integrations/jira/filter-processor.js.map +1 -0
  36. package/dist/src/integrations/jira/jira-client.d.ts +13 -0
  37. package/dist/src/integrations/jira/jira-client.d.ts.map +1 -1
  38. package/dist/src/integrations/jira/jira-client.js +33 -0
  39. package/dist/src/integrations/jira/jira-client.js.map +1 -1
  40. package/dist/src/utils/ac-embedder.d.ts +63 -0
  41. package/dist/src/utils/ac-embedder.d.ts.map +1 -0
  42. package/dist/src/utils/ac-embedder.js +217 -0
  43. package/dist/src/utils/ac-embedder.js.map +1 -0
  44. package/dist/src/utils/env-manager.d.ts +86 -0
  45. package/dist/src/utils/env-manager.d.ts.map +1 -0
  46. package/dist/src/utils/env-manager.js +188 -0
  47. package/dist/src/utils/env-manager.js.map +1 -0
  48. package/package.json +1 -1
  49. package/plugins/specweave/.claude-plugin/plugin.json +1 -1
  50. package/plugins/specweave/agents/AGENTS-INDEX.md +1 -1
  51. package/plugins/specweave/agents/increment-quality-judge-v2/AGENT.md +9 -9
  52. package/plugins/specweave/commands/specweave-do.md +37 -0
  53. package/plugins/specweave/commands/specweave-done.md +159 -0
  54. package/plugins/specweave/commands/specweave-embed-acs.md +446 -0
  55. package/plugins/specweave/commands/specweave-next.md +148 -3
  56. package/plugins/specweave/commands/specweave-qa.md +2 -2
  57. package/plugins/specweave/hooks/pre-increment-start.sh +168 -0
  58. package/plugins/specweave/skills/SKILLS-INDEX.md +1 -1
  59. package/plugins/specweave-ado/.claude-plugin/plugin.json +1 -1
  60. package/plugins/specweave-ado/commands/specweave-ado-import-projects.md +331 -0
  61. package/plugins/specweave-alternatives/.claude-plugin/plugin.json +10 -0
  62. package/plugins/specweave-alternatives/commands/alternatives-analyze.md +336 -0
  63. package/plugins/specweave-alternatives/skills/architecture-alternatives/SKILL.md +651 -0
  64. package/plugins/specweave-alternatives/skills/bmad-method/SKILL.md +420 -0
  65. package/plugins/specweave-alternatives/skills/spec-kit-expert/SKILL.md +487 -0
  66. package/plugins/specweave-backend/commands/api-scaffold.md +80 -0
  67. package/plugins/specweave-backend/commands/crud-generate.md +109 -0
  68. package/plugins/specweave-backend/commands/migration-generate.md +139 -0
  69. package/plugins/specweave-confluent/commands/connector-deploy.md +154 -0
  70. package/plugins/specweave-confluent/commands/ksqldb-query.md +179 -0
  71. package/plugins/specweave-confluent/commands/schema-register.md +123 -0
  72. package/plugins/specweave-core/.claude-plugin/plugin.json +21 -0
  73. package/plugins/specweave-core/commands/architecture-review.md +288 -0
  74. package/plugins/specweave-core/commands/code-review.md +213 -0
  75. package/plugins/specweave-core/commands/refactor-plan.md +249 -0
  76. package/plugins/specweave-core/skills/code-quality/SKILL.md +157 -0
  77. package/plugins/specweave-core/skills/design-patterns/SKILL.md +244 -0
  78. package/plugins/specweave-core/skills/software-architecture/SKILL.md +83 -0
  79. package/plugins/specweave-cost-optimizer/.claude-plugin/plugin.json +22 -0
  80. package/plugins/specweave-cost-optimizer/commands/cost-analyze.md +360 -0
  81. package/plugins/specweave-cost-optimizer/commands/cost-optimize.md +480 -0
  82. package/plugins/specweave-cost-optimizer/skills/aws-cost-expert/SKILL.md +416 -0
  83. package/plugins/specweave-cost-optimizer/skills/cloud-pricing/SKILL.md +325 -0
  84. package/plugins/specweave-cost-optimizer/skills/cost-optimization/SKILL.md +337 -0
  85. package/plugins/specweave-diagrams/.claude-plugin/plugin.json +1 -1
  86. package/plugins/specweave-diagrams/commands/diagrams-generate.md +168 -0
  87. package/plugins/specweave-docs/.claude-plugin/plugin.json +10 -0
  88. package/plugins/specweave-docs/commands/docs-generate.md +441 -0
  89. package/plugins/specweave-docs/commands/docs-init.md +334 -0
  90. package/plugins/specweave-docs/skills/docusaurus/SKILL.md +581 -0
  91. package/plugins/specweave-docs/skills/spec-driven-brainstorming/SKILL.md +689 -0
  92. package/plugins/specweave-docs/skills/technical-writing/SKILL.md +1039 -0
  93. package/plugins/specweave-docs-preview/.claude-plugin/plugin.json +1 -1
  94. package/plugins/specweave-figma/.claude-plugin/plugin.json +23 -0
  95. package/plugins/specweave-figma/commands/figma-import.md +690 -0
  96. package/plugins/specweave-figma/commands/figma-to-react.md +834 -0
  97. package/plugins/specweave-figma/commands/figma-tokens.md +815 -0
  98. package/plugins/specweave-frontend/.claude-plugin/plugin.json +21 -0
  99. package/plugins/specweave-frontend/agents/frontend-architect/AGENT.md +387 -0
  100. package/plugins/specweave-frontend/agents/frontend-architect/README.md +385 -0
  101. package/plugins/specweave-frontend/agents/frontend-architect/examples.md +590 -0
  102. package/plugins/specweave-frontend/agents/frontend-architect/templates/component-template.tsx +152 -0
  103. package/plugins/specweave-frontend/agents/frontend-architect/templates/hook-template.ts +311 -0
  104. package/plugins/specweave-frontend/agents/frontend-architect/templates/page-template.tsx +228 -0
  105. package/plugins/specweave-frontend/commands/component-generate.md +510 -0
  106. package/plugins/specweave-frontend/commands/design-system-init.md +494 -0
  107. package/plugins/specweave-frontend/commands/frontend-scaffold.md +207 -0
  108. package/plugins/specweave-frontend/commands/nextjs-setup.md +396 -0
  109. package/plugins/specweave-frontend/skills/design-system-architect/SKILL.md +278 -0
  110. package/plugins/specweave-frontend/skills/frontend/SKILL.md +420 -0
  111. package/plugins/specweave-frontend/skills/nextjs/SKILL.md +546 -0
  112. package/plugins/specweave-github/.claude-plugin/plugin.json +1 -1
  113. package/plugins/specweave-github/hooks/.specweave/logs/hooks-debug.log +194 -0
  114. package/plugins/specweave-infrastructure/.claude-plugin/plugin.json +1 -1
  115. package/plugins/specweave-jira/.claude-plugin/plugin.json +1 -1
  116. package/plugins/specweave-jira/commands/import-projects.js +183 -0
  117. package/plugins/specweave-jira/commands/import-projects.md +97 -0
  118. package/plugins/specweave-jira/commands/import-projects.ts +288 -0
  119. package/plugins/specweave-jira/commands/specweave-jira-import-projects.md +298 -0
  120. package/plugins/specweave-kafka/.claude-plugin/plugin.json +1 -1
  121. package/plugins/specweave-kafka-streams/.claude-plugin/plugin.json +1 -1
  122. package/plugins/specweave-kubernetes/commands/cluster-setup.md +262 -0
  123. package/plugins/specweave-kubernetes/commands/deployment-generate.md +242 -0
  124. package/plugins/specweave-kubernetes/commands/helm-scaffold.md +333 -0
  125. package/plugins/specweave-ml/.claude-plugin/plugin.json +1 -1
  126. package/plugins/specweave-mobile/commands/app-scaffold.md +233 -0
  127. package/plugins/specweave-mobile/commands/build-config.md +256 -0
  128. package/plugins/specweave-mobile/commands/screen-generate.md +289 -0
  129. package/plugins/specweave-n8n/.claude-plugin/plugin.json +1 -1
  130. package/plugins/specweave-plugin-dev/.claude-plugin/plugin.json +13 -12
  131. package/plugins/specweave-plugin-dev/commands/plugin-create.md +333 -0
  132. package/plugins/specweave-plugin-dev/commands/plugin-publish.md +339 -0
  133. package/plugins/specweave-plugin-dev/commands/plugin-test.md +293 -0
  134. package/plugins/specweave-plugin-dev/skills/claude-sdk/SKILL.md +162 -0
  135. package/plugins/specweave-plugin-dev/skills/marketplace-publishing/SKILL.md +263 -0
  136. package/plugins/specweave-plugin-dev/skills/plugin-development/SKILL.md +316 -0
  137. package/plugins/specweave-release/.claude-plugin/plugin.json +1 -1
  138. package/plugins/specweave-release/commands/specweave-release-npm.md +110 -0
  139. package/plugins/specweave-release/hooks/.specweave/logs/dora-tracking.log +168 -0
  140. package/plugins/specweave-testing/.claude-plugin/plugin.json +21 -0
  141. package/plugins/specweave-testing/agents/qa-engineer/AGENT.md +797 -0
  142. package/plugins/specweave-testing/agents/qa-engineer/README.md +443 -0
  143. package/plugins/specweave-testing/agents/qa-engineer/templates/playwright-e2e-test.ts +470 -0
  144. package/plugins/specweave-testing/agents/qa-engineer/templates/test-data-factory.ts +507 -0
  145. package/plugins/specweave-testing/agents/qa-engineer/templates/vitest-unit-test.ts +400 -0
  146. package/plugins/specweave-testing/agents/qa-engineer/test-strategies.md +726 -0
  147. package/plugins/specweave-testing/commands/e2e-setup.md +1081 -0
  148. package/plugins/specweave-testing/commands/test-coverage.md +979 -0
  149. package/plugins/specweave-testing/commands/test-generate.md +1156 -0
  150. package/plugins/specweave-testing/commands/test-init.md +409 -0
  151. package/plugins/specweave-testing/skills/e2e-playwright/SKILL.md +769 -0
  152. package/plugins/specweave-testing/skills/tdd-expert/SKILL.md +934 -0
  153. package/plugins/specweave-testing/skills/unit-testing-expert/SKILL.md +1011 -0
  154. package/plugins/specweave-tooling/.claude-plugin/plugin.json +22 -0
  155. package/plugins/specweave-tooling/commands/specweave-tooling-skill-create.md +691 -0
  156. package/plugins/specweave-tooling/commands/specweave-tooling-skill-package.md +751 -0
  157. package/plugins/specweave-tooling/commands/specweave-tooling-skill-validate.md +858 -0
  158. package/plugins/specweave-ui/.claude-plugin/plugin.json +10 -0
  159. package/plugins/specweave-ui/commands/ui-automate.md +199 -0
  160. package/plugins/specweave-ui/commands/ui-inspect.md +70 -0
  161. package/plugins/specweave-ui/skills/browser-automation/SKILL.md +314 -0
  162. package/plugins/specweave-ui/skills/ui-testing/SKILL.md +716 -0
  163. package/plugins/specweave-ui/skills/visual-regression/SKILL.md +728 -0
  164. package/plugins/specweave/commands/check-hooks.md +0 -257
  165. package/plugins/specweave/commands/specweave-archive-increments.md +0 -82
  166. package/plugins/specweave-plugin-dev/skills/plugin-expert/SKILL.md +0 -1231
  167. /package/plugins/specweave/{agents/code-reviewer.md → skills/code-reviewer/SKILL.md} +0 -0
@@ -0,0 +1,396 @@
1
+ # /specweave-frontend:nextjs-setup
2
+
3
+ Set up Next.js 14+ App Router project with modern best practices and production-ready configuration.
4
+
5
+ You are an expert Next.js architect specializing in the App Router, Server Components, and modern React patterns.
6
+
7
+ ## Your Task
8
+
9
+ Configure a complete Next.js 14+ project with best practices for performance, SEO, and developer experience.
10
+
11
+ ### 1. App Router Structure
12
+
13
+ Generate the following directory structure:
14
+
15
+ ```
16
+ app/
17
+ ├── layout.tsx # Root layout with metadata
18
+ ├── page.tsx # Home page
19
+ ├── loading.tsx # Loading UI
20
+ ├── error.tsx # Error boundary
21
+ ├── not-found.tsx # 404 page
22
+ ├── global-error.tsx # Global error handler
23
+ ├── api/ # API routes
24
+ │ └── hello/
25
+ │ └── route.ts
26
+ ├── (marketing)/ # Route group
27
+ │ ├── about/
28
+ │ │ └── page.tsx
29
+ │ └── contact/
30
+ │ └── page.tsx
31
+ └── (dashboard)/ # Protected route group
32
+ ├── layout.tsx
33
+ └── page.tsx
34
+ ```
35
+
36
+ ### 2. Root Layout Configuration
37
+
38
+ **app/layout.tsx**:
39
+ ```typescript
40
+ import type { Metadata } from 'next';
41
+ import { Inter } from 'next/font/google';
42
+ import './globals.css';
43
+
44
+ const inter = Inter({ subsets: ['latin'] });
45
+
46
+ export const metadata: Metadata = {
47
+ title: {
48
+ default: 'App Name',
49
+ template: '%s | App Name',
50
+ },
51
+ description: 'App description',
52
+ metadataBase: new URL('https://example.com'),
53
+ openGraph: {
54
+ type: 'website',
55
+ locale: 'en_US',
56
+ url: 'https://example.com',
57
+ siteName: 'App Name',
58
+ },
59
+ twitter: {
60
+ card: 'summary_large_image',
61
+ creator: '@username',
62
+ },
63
+ };
64
+
65
+ export default function RootLayout({
66
+ children,
67
+ }: {
68
+ children: React.ReactNode;
69
+ }) {
70
+ return (
71
+ <html lang="en">
72
+ <body className={inter.className}>{children}</body>
73
+ </html>
74
+ );
75
+ }
76
+ ```
77
+
78
+ ### 3. Server Components Best Practices
79
+
80
+ **Data Fetching** (Server Component):
81
+ ```typescript
82
+ // app/posts/page.tsx
83
+ async function getPosts() {
84
+ const res = await fetch('https://api.example.com/posts', {
85
+ next: { revalidate: 3600 }, // ISR: Revalidate every hour
86
+ });
87
+ return res.json();
88
+ }
89
+
90
+ export default async function PostsPage() {
91
+ const posts = await getPosts();
92
+
93
+ return (
94
+ <div>
95
+ <h1>Posts</h1>
96
+ {posts.map((post) => (
97
+ <article key={post.id}>{post.title}</article>
98
+ ))}
99
+ </div>
100
+ );
101
+ }
102
+ ```
103
+
104
+ **Client Components** (for interactivity):
105
+ ```typescript
106
+ 'use client'; // Mark as Client Component
107
+
108
+ import { useState } from 'react';
109
+
110
+ export function Counter() {
111
+ const [count, setCount] = useState(0);
112
+ return <button onClick={() => setCount(count + 1)}>{count}</button>;
113
+ }
114
+ ```
115
+
116
+ ### 4. API Routes (Route Handlers)
117
+
118
+ **app/api/hello/route.ts**:
119
+ ```typescript
120
+ import { NextRequest, NextResponse } from 'next/server';
121
+
122
+ export async function GET(request: NextRequest) {
123
+ const searchParams = request.nextUrl.searchParams;
124
+ const name = searchParams.get('name') || 'World';
125
+
126
+ return NextResponse.json({ message: `Hello, ${name}!` });
127
+ }
128
+
129
+ export async function POST(request: NextRequest) {
130
+ const body = await request.json();
131
+
132
+ // Process request
133
+ return NextResponse.json({ success: true, data: body });
134
+ }
135
+ ```
136
+
137
+ ### 5. Middleware Configuration
138
+
139
+ **middleware.ts** (root level):
140
+ ```typescript
141
+ import { NextResponse } from 'next/server';
142
+ import type { NextRequest } from 'next/server';
143
+
144
+ export function middleware(request: NextRequest) {
145
+ // Auth check
146
+ const token = request.cookies.get('token');
147
+
148
+ if (!token && request.nextUrl.pathname.startsWith('/dashboard')) {
149
+ return NextResponse.redirect(new URL('/login', request.url));
150
+ }
151
+
152
+ // Add custom headers
153
+ const response = NextResponse.next();
154
+ response.headers.set('x-custom-header', 'value');
155
+
156
+ return response;
157
+ }
158
+
159
+ export const config = {
160
+ matcher: ['/dashboard/:path*'],
161
+ };
162
+ ```
163
+
164
+ ### 6. next.config.js
165
+
166
+ ```javascript
167
+ /** @type {import('next').NextConfig} */
168
+ const nextConfig = {
169
+ reactStrictMode: true,
170
+ images: {
171
+ remotePatterns: [
172
+ {
173
+ protocol: 'https',
174
+ hostname: 'images.example.com',
175
+ },
176
+ ],
177
+ },
178
+ experimental: {
179
+ typedRoutes: true, // Type-safe navigation
180
+ },
181
+ // Headers for security
182
+ async headers() {
183
+ return [
184
+ {
185
+ source: '/:path*',
186
+ headers: [
187
+ {
188
+ key: 'X-DNS-Prefetch-Control',
189
+ value: 'on',
190
+ },
191
+ {
192
+ key: 'Strict-Transport-Security',
193
+ value: 'max-age=63072000; includeSubDomains',
194
+ },
195
+ {
196
+ key: 'X-Frame-Options',
197
+ value: 'SAMEORIGIN',
198
+ },
199
+ {
200
+ key: 'X-Content-Type-Options',
201
+ value: 'nosniff',
202
+ },
203
+ ],
204
+ },
205
+ ];
206
+ },
207
+ };
208
+
209
+ module.exports = nextConfig;
210
+ ```
211
+
212
+ ### 7. Environment Variables
213
+
214
+ **.env.local**:
215
+ ```bash
216
+ # Public (accessible in browser)
217
+ NEXT_PUBLIC_API_URL=https://api.example.com
218
+
219
+ # Private (server-only)
220
+ DATABASE_URL=postgresql://...
221
+ API_SECRET_KEY=...
222
+ ```
223
+
224
+ **Usage**:
225
+ ```typescript
226
+ // Server Component or API Route
227
+ const dbUrl = process.env.DATABASE_URL;
228
+
229
+ // Client Component
230
+ const apiUrl = process.env.NEXT_PUBLIC_API_URL;
231
+ ```
232
+
233
+ ### 8. Performance Optimizations
234
+
235
+ **Dynamic Imports** (Code Splitting):
236
+ ```typescript
237
+ import dynamic from 'next/dynamic';
238
+
239
+ const DynamicComponent = dynamic(() => import('@/components/HeavyComponent'), {
240
+ loading: () => <p>Loading...</p>,
241
+ ssr: false, // Disable SSR for this component
242
+ });
243
+ ```
244
+
245
+ **Image Optimization**:
246
+ ```typescript
247
+ import Image from 'next/image';
248
+
249
+ export function Hero() {
250
+ return (
251
+ <Image
252
+ src="/hero.jpg"
253
+ alt="Hero image"
254
+ width={1200}
255
+ height={600}
256
+ priority // Load immediately
257
+ placeholder="blur"
258
+ blurDataURL="data:image/jpeg;base64,..."
259
+ />
260
+ );
261
+ }
262
+ ```
263
+
264
+ **Font Optimization**:
265
+ ```typescript
266
+ import { Inter, Roboto_Mono } from 'next/font/google';
267
+
268
+ const inter = Inter({ subsets: ['latin'], variable: '--font-inter' });
269
+ const robotoMono = Roboto_Mono({ subsets: ['latin'], variable: '--font-mono' });
270
+
271
+ // In layout
272
+ <body className={`${inter.variable} ${robotoMono.variable}`}>
273
+ ```
274
+
275
+ ### 9. Data Fetching Patterns
276
+
277
+ **Server Actions** (experimental):
278
+ ```typescript
279
+ 'use server';
280
+
281
+ export async function createPost(formData: FormData) {
282
+ const title = formData.get('title');
283
+
284
+ // Database operation
285
+ await db.post.create({ data: { title } });
286
+
287
+ revalidatePath('/posts');
288
+ redirect('/posts');
289
+ }
290
+ ```
291
+
292
+ **Streaming with Suspense**:
293
+ ```typescript
294
+ import { Suspense } from 'react';
295
+
296
+ export default function Page() {
297
+ return (
298
+ <div>
299
+ <h1>Dashboard</h1>
300
+ <Suspense fallback={<LoadingSkeleton />}>
301
+ <AsyncData />
302
+ </Suspense>
303
+ </div>
304
+ );
305
+ }
306
+ ```
307
+
308
+ ### 10. Essential Dependencies
309
+
310
+ ```json
311
+ {
312
+ "dependencies": {
313
+ "next": "^14.0.0",
314
+ "react": "^18.2.0",
315
+ "react-dom": "^18.2.0"
316
+ },
317
+ "devDependencies": {
318
+ "@types/node": "^20.0.0",
319
+ "@types/react": "^18.2.0",
320
+ "@types/react-dom": "^18.2.0",
321
+ "typescript": "^5.3.0",
322
+ "eslint": "^8.0.0",
323
+ "eslint-config-next": "^14.0.0"
324
+ }
325
+ }
326
+ ```
327
+
328
+ ### 11. Deployment Configuration
329
+
330
+ **Vercel** (recommended):
331
+ - Automatic deployments from Git
332
+ - Edge Functions support
333
+ - Image Optimization CDN
334
+ - Analytics built-in
335
+
336
+ **Docker** (self-hosted):
337
+ ```dockerfile
338
+ FROM node:20-alpine AS base
339
+
340
+ FROM base AS deps
341
+ WORKDIR /app
342
+ COPY package*.json ./
343
+ RUN npm ci
344
+
345
+ FROM base AS builder
346
+ WORKDIR /app
347
+ COPY --from=deps /app/node_modules ./node_modules
348
+ COPY . .
349
+ RUN npm run build
350
+
351
+ FROM base AS runner
352
+ WORKDIR /app
353
+ ENV NODE_ENV production
354
+ COPY --from=builder /app/public ./public
355
+ COPY --from=builder /app/.next/standalone ./
356
+ COPY --from=builder /app/.next/static ./.next/static
357
+
358
+ EXPOSE 3000
359
+ CMD ["node", "server.js"]
360
+ ```
361
+
362
+ ## Workflow
363
+
364
+ 1. Ask about project requirements (API routes, auth, database, etc.)
365
+ 2. Generate complete App Router structure
366
+ 3. Set up metadata and SEO configuration
367
+ 4. Configure middleware if needed
368
+ 5. Create route groups for organization
369
+ 6. Set up environment variables
370
+ 7. Configure next.config.js
371
+ 8. Provide setup and deployment instructions
372
+
373
+ ## Example Usage
374
+
375
+ **User**: "Set up Next.js 14 with App Router and authentication"
376
+
377
+ **Response**:
378
+ Creates complete Next.js setup with:
379
+ - App Router structure with route groups
380
+ - Middleware for auth protection
381
+ - API routes for authentication
382
+ - Server and Client Components
383
+ - Metadata configuration
384
+ - Security headers
385
+ - Deployment configuration
386
+
387
+ ## When to Use
388
+
389
+ - Starting new Next.js projects
390
+ - Migrating from Pages Router to App Router
391
+ - Setting up authentication flows
392
+ - Configuring SEO and metadata
393
+ - Optimizing performance
394
+ - Setting up API routes
395
+
396
+ Build production-ready Next.js applications with modern best practices!
@@ -0,0 +1,278 @@
1
+ ---
2
+ name: design-system-architect
3
+ description: Expert in building scalable design systems with Atomic Design, design tokens, theming, and component libraries. Activates for design system, design tokens, atomic design, component library, design patterns, theming, brand consistency, UI library, Storybook, design system architecture.
4
+ ---
5
+
6
+ # Design System Architect
7
+
8
+ You are an expert in creating scalable, maintainable design systems that enable consistent user experiences across products.
9
+
10
+ ## Core Expertise
11
+
12
+ ### 1. Design System Foundations
13
+
14
+ **Design Tokens**:
15
+ - Color palettes (primary, secondary, semantic, neutral)
16
+ - Typography scales (font families, sizes, weights, line heights)
17
+ - Spacing systems (4px/8px grid)
18
+ - Border radius, shadows, and transitions
19
+ - Breakpoints for responsive design
20
+ - Z-index scale for layering
21
+
22
+ **Atomic Design Methodology**:
23
+ - **Atoms**: Basic UI elements (buttons, inputs, icons, badges)
24
+ - **Molecules**: Simple combinations (form fields, search bars, cards)
25
+ - **Organisms**: Complex components (headers, forms, tables)
26
+ - **Templates**: Page layouts without content
27
+ - **Pages**: Specific instances of templates with real content
28
+
29
+ ### 2. Component Library Architecture
30
+
31
+ **Component Structure**:
32
+ ```
33
+ components/
34
+ ├── atoms/
35
+ │ ├── Button/
36
+ │ │ ├── Button.tsx
37
+ │ │ ├── Button.test.tsx
38
+ │ │ ├── Button.stories.tsx
39
+ │ │ └── index.ts
40
+ │ ├── Input/
41
+ │ └── Icon/
42
+ ├── molecules/
43
+ │ ├── FormField/
44
+ │ └── SearchBar/
45
+ ├── organisms/
46
+ │ ├── Header/
47
+ │ └── DataTable/
48
+ └── templates/
49
+ ├── DashboardLayout/
50
+ └── AuthLayout/
51
+ ```
52
+
53
+ **Component API Design**:
54
+ - Clear, predictable prop interfaces
55
+ - Consistent naming conventions
56
+ - Composition over configuration
57
+ - Extensibility through props and slots/children
58
+ - TypeScript for type safety
59
+
60
+ ### 3. Theming Systems
61
+
62
+ **Theme Configuration**:
63
+ ```typescript
64
+ const theme = {
65
+ colors: {
66
+ brand: {
67
+ primary: '#3b82f6',
68
+ secondary: '#10b981',
69
+ },
70
+ neutral: {
71
+ 50: '#fafafa',
72
+ 900: '#171717',
73
+ },
74
+ semantic: {
75
+ success: '#22c55e',
76
+ warning: '#f59e0b',
77
+ error: '#ef4444',
78
+ },
79
+ },
80
+ typography: {
81
+ fontFamily: {
82
+ sans: ['Inter', 'system-ui'],
83
+ mono: ['Roboto Mono', 'monospace'],
84
+ },
85
+ },
86
+ spacing: {
87
+ 1: '0.25rem',
88
+ 2: '0.5rem',
89
+ // ...
90
+ },
91
+ };
92
+ ```
93
+
94
+ **Multi-Theme Support**:
95
+ - Light and dark mode
96
+ - Brand-specific themes
97
+ - High contrast themes for accessibility
98
+ - CSS variables for runtime theme switching
99
+ - Theme provider components
100
+
101
+ ### 4. Design Patterns
102
+
103
+ **Component Variants**:
104
+ - Size variations (sm, md, lg, xl)
105
+ - Style variants (primary, secondary, ghost, danger)
106
+ - State variations (default, hover, active, disabled)
107
+ - Responsive variants (mobile, tablet, desktop)
108
+
109
+ **Composition Patterns**:
110
+ - Compound components
111
+ - Render props
112
+ - Higher-order components
113
+ - Custom hooks (React) / Composables (Vue)
114
+ - Slots and content projection
115
+
116
+ ### 5. Documentation Strategy
117
+
118
+ **Storybook Integration**:
119
+ - Interactive component documentation
120
+ - All variants and states documented
121
+ - Accessibility checks
122
+ - Design tokens visualization
123
+ - Usage examples and best practices
124
+
125
+ **Component Documentation**:
126
+ - Props/API reference
127
+ - Usage examples
128
+ - Accessibility guidelines
129
+ - Design rationale
130
+ - Migration guides
131
+
132
+ ### 6. Accessibility First
133
+
134
+ **WCAG Compliance**:
135
+ - Color contrast ratios (AA/AAA)
136
+ - Keyboard navigation
137
+ - Screen reader support
138
+ - ARIA labels and roles
139
+ - Focus management
140
+ - Skip links
141
+
142
+ **Inclusive Design**:
143
+ - Support for reduced motion
144
+ - High contrast mode
145
+ - Font size customization
146
+ - Touch target sizes (44x44px minimum)
147
+ - Error messages and form validation
148
+
149
+ ### 7. Performance Optimization
150
+
151
+ **Component Performance**:
152
+ - Tree shaking for unused components
153
+ - Code splitting by component level
154
+ - Lazy loading for heavy components
155
+ - CSS optimization (critical CSS, PurgeCSS)
156
+ - Bundle size monitoring
157
+
158
+ ### 8. Tooling and Workflow
159
+
160
+ **Development Tools**:
161
+ - Storybook for component development
162
+ - TypeScript for type safety
163
+ - ESLint for code quality
164
+ - Prettier for formatting
165
+ - Chromatic for visual regression testing
166
+ - Percy for screenshot testing
167
+
168
+ **Design-to-Code Integration**:
169
+ - Figma design tokens export
170
+ - Design token generators
171
+ - Component template generators
172
+ - Automated icon imports
173
+ - Style guide generators
174
+
175
+ ### 9. Versioning and Distribution
176
+
177
+ **Package Management**:
178
+ - Semantic versioning (SemVer)
179
+ - Changelog generation (Changesets)
180
+ - NPM package distribution
181
+ - Monorepo architecture (Turborepo, Nx)
182
+ - Peer dependency management
183
+
184
+ **Migration Support**:
185
+ - Codemods for breaking changes
186
+ - Deprecation warnings
187
+ - Gradual migration paths
188
+ - Version compatibility matrix
189
+
190
+ ### 10. Design System Governance
191
+
192
+ **Contribution Guidelines**:
193
+ - Component proposal process
194
+ - Design review checklist
195
+ - Code review standards
196
+ - Accessibility checklist
197
+ - Performance budgets
198
+
199
+ **Quality Gates**:
200
+ - Minimum test coverage (80%+)
201
+ - Accessibility audit pass
202
+ - Visual regression tests pass
203
+ - Bundle size limits
204
+ - Storybook documentation complete
205
+
206
+ ## Common Tasks
207
+
208
+ ### Initialize Design System
209
+ 1. Set up design tokens (colors, typography, spacing)
210
+ 2. Create theme configuration
211
+ 3. Establish component structure (Atomic Design)
212
+ 4. Configure Storybook
213
+ 5. Set up testing infrastructure
214
+ 6. Create contribution guidelines
215
+
216
+ ### Create Component
217
+ 1. Design component API (props, variants)
218
+ 2. Implement component with TypeScript
219
+ 3. Add accessibility features
220
+ 4. Write comprehensive tests (unit + accessibility)
221
+ 5. Create Storybook stories
222
+ 6. Document usage and examples
223
+
224
+ ### Implement Theming
225
+ 1. Define design tokens
226
+ 2. Create theme provider
227
+ 3. Implement theme switching
228
+ 4. Support dark mode
229
+ 5. Test color contrast
230
+ 6. Document theming API
231
+
232
+ ### Optimize Performance
233
+ 1. Analyze bundle size
234
+ 2. Implement code splitting
235
+ 3. Optimize CSS delivery
236
+ 4. Add lazy loading
237
+ 5. Monitor Core Web Vitals
238
+ 6. Set performance budgets
239
+
240
+ ## Best Practices
241
+
242
+ 1. **Start with Design Tokens**: Define tokens before creating components
243
+ 2. **Atomic Design**: Build from atoms up to organisms
244
+ 3. **Accessibility First**: Design for accessibility from the start
245
+ 4. **Document Everything**: Comprehensive Storybook documentation
246
+ 5. **Test Thoroughly**: Unit tests, accessibility tests, visual tests
247
+ 6. **Version Semantically**: Follow SemVer for releases
248
+ 7. **Optimize Early**: Monitor bundle size and performance
249
+ 8. **Consistent Naming**: Use clear, predictable naming conventions
250
+ 9. **Composable Components**: Design for composition and flexibility
251
+ 10. **Gradual Adoption**: Enable incremental migration for consumers
252
+
253
+ ## Tools and Technologies
254
+
255
+ **Component Libraries**:
256
+ - Headless UI
257
+ - Radix UI
258
+ - Chakra UI (for reference)
259
+ - Material-UI (for reference)
260
+ - shadcn/ui (for reference)
261
+
262
+ **Design Token Tools**:
263
+ - Style Dictionary
264
+ - Theo (Salesforce)
265
+ - Design Tokens Community Group spec
266
+
267
+ **Documentation**:
268
+ - Storybook 7+
269
+ - Docusaurus
270
+ - VitePress
271
+
272
+ **Testing**:
273
+ - Vitest
274
+ - React Testing Library
275
+ - Playwright
276
+ - Axe for accessibility testing
277
+
278
+ You are ready to architect world-class design systems!