specweave 0.23.18 → 0.24.1

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 (174) hide show
  1. package/.claude-plugin/marketplace.json +144 -45
  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/repo-structure/repo-structure-manager.d.ts.map +1 -1
  25. package/dist/src/core/repo-structure/repo-structure-manager.js +76 -43
  26. package/dist/src/core/repo-structure/repo-structure-manager.js.map +1 -1
  27. package/dist/src/core/validators/ac-presence-validator.d.ts +56 -0
  28. package/dist/src/core/validators/ac-presence-validator.d.ts.map +1 -0
  29. package/dist/src/core/validators/ac-presence-validator.js +149 -0
  30. package/dist/src/core/validators/ac-presence-validator.js.map +1 -0
  31. package/dist/src/integrations/ado/area-path-mapper.d.ts +137 -0
  32. package/dist/src/integrations/ado/area-path-mapper.d.ts.map +1 -0
  33. package/dist/src/integrations/ado/area-path-mapper.js +267 -0
  34. package/dist/src/integrations/ado/area-path-mapper.js.map +1 -0
  35. package/dist/src/integrations/jira/filter-processor.d.ts +126 -0
  36. package/dist/src/integrations/jira/filter-processor.d.ts.map +1 -0
  37. package/dist/src/integrations/jira/filter-processor.js +207 -0
  38. package/dist/src/integrations/jira/filter-processor.js.map +1 -0
  39. package/dist/src/integrations/jira/jira-client.d.ts +13 -0
  40. package/dist/src/integrations/jira/jira-client.d.ts.map +1 -1
  41. package/dist/src/integrations/jira/jira-client.js +33 -0
  42. package/dist/src/integrations/jira/jira-client.js.map +1 -1
  43. package/dist/src/utils/ac-embedder.d.ts +63 -0
  44. package/dist/src/utils/ac-embedder.d.ts.map +1 -0
  45. package/dist/src/utils/ac-embedder.js +217 -0
  46. package/dist/src/utils/ac-embedder.js.map +1 -0
  47. package/dist/src/utils/env-manager.d.ts +86 -0
  48. package/dist/src/utils/env-manager.d.ts.map +1 -0
  49. package/dist/src/utils/env-manager.js +188 -0
  50. package/dist/src/utils/env-manager.js.map +1 -0
  51. package/package.json +1 -1
  52. package/plugins/specweave/.claude-plugin/plugin.json +1 -1
  53. package/plugins/specweave/agents/AGENTS-INDEX.md +1 -1
  54. package/plugins/specweave/agents/increment-quality-judge-v2/AGENT.md +9 -9
  55. package/plugins/specweave/commands/specweave-do.md +37 -0
  56. package/plugins/specweave/commands/specweave-done.md +159 -0
  57. package/plugins/specweave/commands/specweave-embed-acs.md +446 -0
  58. package/plugins/specweave/commands/specweave-next.md +148 -3
  59. package/plugins/specweave/commands/specweave-qa.md +2 -2
  60. package/plugins/specweave/hooks/pre-increment-start.sh +168 -0
  61. package/plugins/specweave/skills/SKILLS-INDEX.md +1 -1
  62. package/plugins/specweave-ado/.claude-plugin/plugin.json +1 -1
  63. package/plugins/specweave-ado/commands/specweave-ado-import-projects.md +331 -0
  64. package/plugins/specweave-alternatives/.claude-plugin/plugin.json +10 -0
  65. package/plugins/specweave-alternatives/commands/alternatives-analyze.md +336 -0
  66. package/plugins/specweave-alternatives/skills/architecture-alternatives/SKILL.md +651 -0
  67. package/plugins/specweave-alternatives/skills/bmad-method/SKILL.md +420 -0
  68. package/plugins/specweave-alternatives/skills/spec-kit-expert/SKILL.md +487 -0
  69. package/plugins/specweave-backend/commands/api-scaffold.md +80 -0
  70. package/plugins/specweave-backend/commands/crud-generate.md +109 -0
  71. package/plugins/specweave-backend/commands/migration-generate.md +139 -0
  72. package/plugins/specweave-confluent/commands/connector-deploy.md +154 -0
  73. package/plugins/specweave-confluent/commands/ksqldb-query.md +179 -0
  74. package/plugins/specweave-confluent/commands/schema-register.md +123 -0
  75. package/plugins/specweave-core/.claude-plugin/plugin.json +21 -0
  76. package/plugins/specweave-core/commands/architecture-review.md +288 -0
  77. package/plugins/specweave-core/commands/code-review.md +213 -0
  78. package/plugins/specweave-core/commands/refactor-plan.md +249 -0
  79. package/plugins/specweave-core/skills/code-quality/SKILL.md +157 -0
  80. package/plugins/specweave-core/skills/design-patterns/SKILL.md +244 -0
  81. package/plugins/specweave-core/skills/software-architecture/SKILL.md +83 -0
  82. package/plugins/specweave-cost-optimizer/.claude-plugin/plugin.json +22 -0
  83. package/plugins/specweave-cost-optimizer/commands/cost-analyze.md +360 -0
  84. package/plugins/specweave-cost-optimizer/commands/cost-optimize.md +480 -0
  85. package/plugins/specweave-cost-optimizer/skills/aws-cost-expert/SKILL.md +416 -0
  86. package/plugins/specweave-cost-optimizer/skills/cloud-pricing/SKILL.md +325 -0
  87. package/plugins/specweave-cost-optimizer/skills/cost-optimization/SKILL.md +337 -0
  88. package/plugins/specweave-diagrams/.claude-plugin/plugin.json +1 -1
  89. package/plugins/specweave-diagrams/commands/diagrams-generate.md +168 -0
  90. package/plugins/specweave-docs/.claude-plugin/plugin.json +10 -0
  91. package/plugins/specweave-docs/commands/docs-generate.md +441 -0
  92. package/plugins/specweave-docs/commands/docs-init.md +334 -0
  93. package/plugins/specweave-docs/skills/docusaurus/SKILL.md +581 -0
  94. package/plugins/specweave-docs/skills/spec-driven-brainstorming/SKILL.md +689 -0
  95. package/plugins/specweave-docs/skills/technical-writing/SKILL.md +1039 -0
  96. package/plugins/specweave-docs-preview/.claude-plugin/plugin.json +1 -1
  97. package/plugins/specweave-figma/.claude-plugin/plugin.json +23 -0
  98. package/plugins/specweave-figma/commands/figma-import.md +690 -0
  99. package/plugins/specweave-figma/commands/figma-to-react.md +834 -0
  100. package/plugins/specweave-figma/commands/figma-tokens.md +815 -0
  101. package/plugins/specweave-frontend/.claude-plugin/plugin.json +21 -0
  102. package/plugins/specweave-frontend/agents/frontend-architect/AGENT.md +408 -0
  103. package/plugins/specweave-frontend/agents/frontend-architect/README.md +385 -0
  104. package/plugins/specweave-frontend/agents/frontend-architect/examples.md +590 -0
  105. package/plugins/specweave-frontend/agents/frontend-architect/templates/component-template.tsx +152 -0
  106. package/plugins/specweave-frontend/agents/frontend-architect/templates/hook-template.ts +311 -0
  107. package/plugins/specweave-frontend/agents/frontend-architect/templates/page-template.tsx +228 -0
  108. package/plugins/specweave-frontend/commands/component-generate.md +510 -0
  109. package/plugins/specweave-frontend/commands/design-system-init.md +494 -0
  110. package/plugins/specweave-frontend/commands/frontend-scaffold.md +207 -0
  111. package/plugins/specweave-frontend/commands/nextjs-setup.md +396 -0
  112. package/plugins/specweave-frontend/skills/design-system-architect/SKILL.md +278 -0
  113. package/plugins/specweave-frontend/skills/frontend/SKILL.md +420 -0
  114. package/plugins/specweave-frontend/skills/nextjs/SKILL.md +546 -0
  115. package/plugins/specweave-github/.claude-plugin/plugin.json +1 -1
  116. package/plugins/specweave-github/hooks/.specweave/logs/hooks-debug.log +212 -0
  117. package/plugins/specweave-infrastructure/.claude-plugin/plugin.json +1 -1
  118. package/plugins/specweave-jira/.claude-plugin/plugin.json +1 -1
  119. package/plugins/specweave-jira/commands/import-projects.js +183 -0
  120. package/plugins/specweave-jira/commands/import-projects.md +97 -0
  121. package/plugins/specweave-jira/commands/import-projects.ts +288 -0
  122. package/plugins/specweave-jira/commands/specweave-jira-import-projects.md +298 -0
  123. package/plugins/specweave-kafka/.claude-plugin/plugin.json +1 -1
  124. package/plugins/specweave-kafka-streams/.claude-plugin/plugin.json +1 -1
  125. package/plugins/specweave-kubernetes/commands/cluster-setup.md +262 -0
  126. package/plugins/specweave-kubernetes/commands/deployment-generate.md +242 -0
  127. package/plugins/specweave-kubernetes/commands/helm-scaffold.md +333 -0
  128. package/plugins/specweave-ml/.claude-plugin/plugin.json +1 -1
  129. package/plugins/specweave-mobile/commands/app-scaffold.md +233 -0
  130. package/plugins/specweave-mobile/commands/build-config.md +256 -0
  131. package/plugins/specweave-mobile/commands/screen-generate.md +289 -0
  132. package/plugins/specweave-n8n/.claude-plugin/plugin.json +1 -1
  133. package/plugins/specweave-payments/commands/stripe-setup.md +931 -0
  134. package/plugins/specweave-payments/commands/subscription-flow.md +1193 -0
  135. package/plugins/specweave-payments/commands/subscription-manage.md +386 -0
  136. package/plugins/specweave-payments/commands/webhook-setup.md +295 -0
  137. package/plugins/specweave-plugin-dev/.claude-plugin/plugin.json +13 -12
  138. package/plugins/specweave-plugin-dev/commands/plugin-create.md +333 -0
  139. package/plugins/specweave-plugin-dev/commands/plugin-publish.md +339 -0
  140. package/plugins/specweave-plugin-dev/commands/plugin-test.md +293 -0
  141. package/plugins/specweave-plugin-dev/skills/claude-sdk/SKILL.md +162 -0
  142. package/plugins/specweave-plugin-dev/skills/marketplace-publishing/SKILL.md +263 -0
  143. package/plugins/specweave-plugin-dev/skills/plugin-development/SKILL.md +316 -0
  144. package/plugins/specweave-release/.claude-plugin/plugin.json +1 -1
  145. package/plugins/specweave-release/commands/specweave-release-npm.md +110 -0
  146. package/plugins/specweave-release/hooks/.specweave/logs/dora-tracking.log +168 -0
  147. package/plugins/specweave-testing/.claude-plugin/plugin.json +21 -0
  148. package/plugins/specweave-testing/agents/qa-engineer/AGENT.md +818 -0
  149. package/plugins/specweave-testing/agents/qa-engineer/README.md +443 -0
  150. package/plugins/specweave-testing/agents/qa-engineer/templates/playwright-e2e-test.ts +470 -0
  151. package/plugins/specweave-testing/agents/qa-engineer/templates/test-data-factory.ts +507 -0
  152. package/plugins/specweave-testing/agents/qa-engineer/templates/vitest-unit-test.ts +400 -0
  153. package/plugins/specweave-testing/agents/qa-engineer/test-strategies.md +726 -0
  154. package/plugins/specweave-testing/commands/e2e-setup.md +1081 -0
  155. package/plugins/specweave-testing/commands/test-coverage.md +979 -0
  156. package/plugins/specweave-testing/commands/test-generate.md +1156 -0
  157. package/plugins/specweave-testing/commands/test-init.md +409 -0
  158. package/plugins/specweave-testing/skills/e2e-playwright/SKILL.md +769 -0
  159. package/plugins/specweave-testing/skills/tdd-expert/SKILL.md +934 -0
  160. package/plugins/specweave-testing/skills/unit-testing-expert/SKILL.md +1011 -0
  161. package/plugins/specweave-tooling/.claude-plugin/plugin.json +22 -0
  162. package/plugins/specweave-tooling/commands/specweave-tooling-skill-create.md +691 -0
  163. package/plugins/specweave-tooling/commands/specweave-tooling-skill-package.md +751 -0
  164. package/plugins/specweave-tooling/commands/specweave-tooling-skill-validate.md +858 -0
  165. package/plugins/specweave-ui/.claude-plugin/plugin.json +10 -0
  166. package/plugins/specweave-ui/commands/ui-automate.md +199 -0
  167. package/plugins/specweave-ui/commands/ui-inspect.md +70 -0
  168. package/plugins/specweave-ui/skills/browser-automation/SKILL.md +314 -0
  169. package/plugins/specweave-ui/skills/ui-testing/SKILL.md +716 -0
  170. package/plugins/specweave-ui/skills/visual-regression/SKILL.md +728 -0
  171. package/plugins/specweave/commands/check-hooks.md +0 -257
  172. package/plugins/specweave/commands/specweave-archive-increments.md +0 -82
  173. package/plugins/specweave-plugin-dev/skills/plugin-expert/SKILL.md +0 -1231
  174. /package/plugins/specweave/{agents/code-reviewer.md → skills/code-reviewer/SKILL.md} +0 -0
@@ -0,0 +1,546 @@
1
+ ---
2
+ name: nextjs
3
+ description: Expert in Next.js 14+ App Router, Server Components, Server Actions, routing, data fetching, caching, and performance optimization. Activates for Next.js, Next, App Router, Server Components, RSC, Next.js 14, SSR, SSG, ISR, metadata, SEO.
4
+ ---
5
+
6
+ # Next.js Expert
7
+
8
+ You are an expert in Next.js 14+ with deep knowledge of the App Router, Server Components, and modern React patterns.
9
+
10
+ ## Core Expertise
11
+
12
+ ### 1. App Router Architecture
13
+
14
+ **File-System Based Routing**:
15
+ ```
16
+ app/
17
+ ├── layout.tsx # Root layout
18
+ ├── page.tsx # Home page (/)
19
+ ├── loading.tsx # Loading UI
20
+ ├── error.tsx # Error boundary
21
+ ├── not-found.tsx # 404 page
22
+ ├── about/
23
+ │ └── page.tsx # /about
24
+ ├── blog/
25
+ │ ├── page.tsx # /blog
26
+ │ └── [slug]/
27
+ │ └── page.tsx # /blog/[slug]
28
+ └── (marketing)/ # Route group (doesn't affect URL)
29
+ ├── layout.tsx
30
+ └── features/
31
+ └── page.tsx # /features
32
+ ```
33
+
34
+ **Route Groups**:
35
+ - `(marketing)`, `(dashboard)` for organizing routes
36
+ - Shared layouts within groups
37
+ - Different root layouts per group
38
+
39
+ **Dynamic Routes**:
40
+ - `[slug]` for single dynamic segment
41
+ - `[...slug]` for catch-all routes
42
+ - `[[...slug]]` for optional catch-all routes
43
+
44
+ ### 2. Server Components (RSC)
45
+
46
+ **Server Component Benefits**:
47
+ - Zero JavaScript sent to client
48
+ - Direct database/API access
49
+ - Automatic code splitting
50
+ - Streaming and Suspense support
51
+ - Better SEO (fully rendered HTML)
52
+
53
+ **Server Component Example**:
54
+ ```typescript
55
+ // app/posts/page.tsx (Server Component by default)
56
+ async function getPosts() {
57
+ const res = await fetch('https://api.example.com/posts', {
58
+ next: { revalidate: 3600 }, // ISR: revalidate every hour
59
+ });
60
+ return res.json();
61
+ }
62
+
63
+ export default async function PostsPage() {
64
+ const posts = await getPosts();
65
+
66
+ return (
67
+ <div>
68
+ <h1>Posts</h1>
69
+ {posts.map((post) => (
70
+ <article key={post.id}>
71
+ <h2>{post.title}</h2>
72
+ <p>{post.excerpt}</p>
73
+ </article>
74
+ ))}
75
+ </div>
76
+ );
77
+ }
78
+ ```
79
+
80
+ **Client Components**:
81
+ ```typescript
82
+ 'use client'; // Mark as Client Component
83
+
84
+ import { useState } from 'react';
85
+
86
+ export function Counter() {
87
+ const [count, setCount] = useState(0);
88
+
89
+ return (
90
+ <button onClick={() => setCount(count + 1)}>
91
+ Count: {count}
92
+ </button>
93
+ );
94
+ }
95
+ ```
96
+
97
+ **Composition Pattern**:
98
+ ```typescript
99
+ // Server Component
100
+ import { ClientButton } from './ClientButton';
101
+
102
+ export default async function Page() {
103
+ const data = await fetchData(); // Server-side data fetching
104
+
105
+ return (
106
+ <div>
107
+ <h1>{data.title}</h1>
108
+ <ClientButton /> {/* Client Component for interactivity */}
109
+ </div>
110
+ );
111
+ }
112
+ ```
113
+
114
+ ### 3. Data Fetching Strategies
115
+
116
+ **Server-Side Rendering (SSR)**:
117
+ ```typescript
118
+ // Dynamic data fetching (SSR)
119
+ async function getData() {
120
+ const res = await fetch('https://api.example.com/data', {
121
+ cache: 'no-store', // Never cache, always fresh
122
+ });
123
+ return res.json();
124
+ }
125
+ ```
126
+
127
+ **Static Site Generation (SSG)**:
128
+ ```typescript
129
+ // Static data fetching (SSG)
130
+ async function getData() {
131
+ const res = await fetch('https://api.example.com/data', {
132
+ cache: 'force-cache', // Cache by default
133
+ });
134
+ return res.json();
135
+ }
136
+ ```
137
+
138
+ **Incremental Static Regeneration (ISR)**:
139
+ ```typescript
140
+ // Revalidate every 60 seconds
141
+ async function getData() {
142
+ const res = await fetch('https://api.example.com/data', {
143
+ next: { revalidate: 60 },
144
+ });
145
+ return res.json();
146
+ }
147
+ ```
148
+
149
+ **On-Demand Revalidation**:
150
+ ```typescript
151
+ // app/api/revalidate/route.ts
152
+ import { revalidatePath, revalidateTag } from 'next/cache';
153
+
154
+ export async function POST() {
155
+ revalidatePath('/posts'); // Revalidate specific path
156
+ revalidateTag('posts'); // Revalidate by cache tag
157
+ return Response.json({ revalidated: true });
158
+ }
159
+ ```
160
+
161
+ ### 4. Caching Strategies
162
+
163
+ **Fetch Caching**:
164
+ ```typescript
165
+ // Force cache (default)
166
+ fetch('...', { cache: 'force-cache' });
167
+
168
+ // No cache (SSR)
169
+ fetch('...', { cache: 'no-store' });
170
+
171
+ // Revalidate periodically (ISR)
172
+ fetch('...', { next: { revalidate: 3600 } });
173
+
174
+ // Tag-based revalidation
175
+ fetch('...', { next: { tags: ['posts'] } });
176
+ ```
177
+
178
+ **React Cache**:
179
+ ```typescript
180
+ import { cache } from 'react';
181
+
182
+ // Deduplicate requests within a single render
183
+ const getUser = cache(async (id: string) => {
184
+ const res = await fetch(`/api/users/${id}`);
185
+ return res.json();
186
+ });
187
+ ```
188
+
189
+ **Unstable Cache** (Experimental):
190
+ ```typescript
191
+ import { unstable_cache } from 'next/cache';
192
+
193
+ const getCachedData = unstable_cache(
194
+ async (id) => {
195
+ return await db.query(id);
196
+ },
197
+ ['data-key'],
198
+ { revalidate: 3600 }
199
+ );
200
+ ```
201
+
202
+ ### 5. Server Actions
203
+
204
+ **Form Handling**:
205
+ ```typescript
206
+ // app/posts/create/page.tsx
207
+ import { createPost } from './actions';
208
+
209
+ export default function CreatePostPage() {
210
+ return (
211
+ <form action={createPost}>
212
+ <input name="title" required />
213
+ <textarea name="content" required />
214
+ <button type="submit">Create Post</button>
215
+ </form>
216
+ );
217
+ }
218
+
219
+ // app/posts/create/actions.ts
220
+ 'use server';
221
+
222
+ import { revalidatePath } from 'next/cache';
223
+ import { redirect } from 'next/navigation';
224
+
225
+ export async function createPost(formData: FormData) {
226
+ const title = formData.get('title') as string;
227
+ const content = formData.get('content') as string;
228
+
229
+ // Validate
230
+ if (!title || !content) {
231
+ throw new Error('Title and content are required');
232
+ }
233
+
234
+ // Database operation
235
+ await db.post.create({ data: { title, content } });
236
+
237
+ // Revalidate and redirect
238
+ revalidatePath('/posts');
239
+ redirect('/posts');
240
+ }
241
+ ```
242
+
243
+ **Progressive Enhancement**:
244
+ ```typescript
245
+ 'use client';
246
+
247
+ import { useFormStatus } from 'react-dom';
248
+
249
+ function SubmitButton() {
250
+ const { pending } = useFormStatus();
251
+
252
+ return (
253
+ <button disabled={pending}>
254
+ {pending ? 'Creating...' : 'Create Post'}
255
+ </button>
256
+ );
257
+ }
258
+ ```
259
+
260
+ ### 6. Routing and Navigation
261
+
262
+ **Link Component**:
263
+ ```typescript
264
+ import Link from 'next/link';
265
+
266
+ <Link href="/about">About</Link>
267
+ <Link href="/posts/123">Post 123</Link>
268
+ <Link href={{ pathname: '/posts/[id]', query: { id: '123' } }}>
269
+ Post 123
270
+ </Link>
271
+ ```
272
+
273
+ **useRouter Hook**:
274
+ ```typescript
275
+ 'use client';
276
+
277
+ import { useRouter } from 'next/navigation';
278
+
279
+ export function NavigateButton() {
280
+ const router = useRouter();
281
+
282
+ return (
283
+ <button onClick={() => router.push('/dashboard')}>
284
+ Go to Dashboard
285
+ </button>
286
+ );
287
+ }
288
+ ```
289
+
290
+ **Parallel Routes**:
291
+ ```
292
+ app/
293
+ ├── @team/
294
+ │ └── page.tsx
295
+ ├── @analytics/
296
+ │ └── page.tsx
297
+ └── layout.tsx # Renders both @team and @analytics
298
+ ```
299
+
300
+ **Intercepting Routes**:
301
+ ```
302
+ app/
303
+ ├── photos/
304
+ │ ├── [id]/
305
+ │ │ └── page.tsx
306
+ │ └── (.)[id]/ # Intercept when navigating from /photos
307
+ │ └── page.tsx
308
+ ```
309
+
310
+ ### 7. Metadata and SEO
311
+
312
+ **Static Metadata**:
313
+ ```typescript
314
+ import type { Metadata } from 'next';
315
+
316
+ export const metadata: Metadata = {
317
+ title: 'My App',
318
+ description: 'App description',
319
+ openGraph: {
320
+ title: 'My App',
321
+ description: 'App description',
322
+ images: ['/og-image.jpg'],
323
+ },
324
+ twitter: {
325
+ card: 'summary_large_image',
326
+ },
327
+ };
328
+ ```
329
+
330
+ **Dynamic Metadata**:
331
+ ```typescript
332
+ export async function generateMetadata({ params }): Promise<Metadata> {
333
+ const post = await getPost(params.id);
334
+
335
+ return {
336
+ title: post.title,
337
+ description: post.excerpt,
338
+ openGraph: {
339
+ title: post.title,
340
+ description: post.excerpt,
341
+ images: [post.image],
342
+ },
343
+ };
344
+ }
345
+ ```
346
+
347
+ **JSON-LD Structured Data**:
348
+ ```typescript
349
+ export default function BlogPost({ post }) {
350
+ const jsonLd = {
351
+ '@context': 'https://schema.org',
352
+ '@type': 'Article',
353
+ headline: post.title,
354
+ author: {
355
+ '@type': 'Person',
356
+ name: post.author,
357
+ },
358
+ datePublished: post.publishedAt,
359
+ };
360
+
361
+ return (
362
+ <>
363
+ <script
364
+ type="application/ld+json"
365
+ dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }}
366
+ />
367
+ <article>{/* ... */}</article>
368
+ </>
369
+ );
370
+ }
371
+ ```
372
+
373
+ ### 8. API Routes (Route Handlers)
374
+
375
+ **Basic API Route**:
376
+ ```typescript
377
+ // app/api/hello/route.ts
378
+ import { NextRequest, NextResponse } from 'next/server';
379
+
380
+ export async function GET(request: NextRequest) {
381
+ return NextResponse.json({ message: 'Hello World' });
382
+ }
383
+
384
+ export async function POST(request: NextRequest) {
385
+ const body = await request.json();
386
+ // Process request
387
+ return NextResponse.json({ success: true, data: body });
388
+ }
389
+ ```
390
+
391
+ **Dynamic API Routes**:
392
+ ```typescript
393
+ // app/api/posts/[id]/route.ts
394
+ export async function GET(
395
+ request: NextRequest,
396
+ { params }: { params: { id: string } }
397
+ ) {
398
+ const post = await getPost(params.id);
399
+ return NextResponse.json(post);
400
+ }
401
+ ```
402
+
403
+ **Middleware**:
404
+ ```typescript
405
+ // middleware.ts (root level)
406
+ import { NextResponse } from 'next/server';
407
+ import type { NextRequest } from 'next/server';
408
+
409
+ export function middleware(request: NextRequest) {
410
+ // Auth check
411
+ const token = request.cookies.get('token');
412
+
413
+ if (!token && request.nextUrl.pathname.startsWith('/dashboard')) {
414
+ return NextResponse.redirect(new URL('/login', request.url));
415
+ }
416
+
417
+ return NextResponse.next();
418
+ }
419
+
420
+ export const config = {
421
+ matcher: ['/dashboard/:path*'],
422
+ };
423
+ ```
424
+
425
+ ### 9. Image Optimization
426
+
427
+ **next/image**:
428
+ ```typescript
429
+ import Image from 'next/image';
430
+
431
+ // Local image
432
+ <Image
433
+ src="/hero.jpg"
434
+ alt="Hero"
435
+ width={1200}
436
+ height={600}
437
+ priority // Load immediately
438
+ />
439
+
440
+ // Remote image
441
+ <Image
442
+ src="https://example.com/image.jpg"
443
+ alt="Remote image"
444
+ width={800}
445
+ height={400}
446
+ placeholder="blur"
447
+ blurDataURL="data:image/jpeg;base64,..."
448
+ />
449
+ ```
450
+
451
+ **Image Configuration**:
452
+ ```javascript
453
+ // next.config.js
454
+ module.exports = {
455
+ images: {
456
+ remotePatterns: [
457
+ {
458
+ protocol: 'https',
459
+ hostname: 'images.example.com',
460
+ },
461
+ ],
462
+ formats: ['image/avif', 'image/webp'],
463
+ },
464
+ };
465
+ ```
466
+
467
+ ### 10. Performance Optimization
468
+
469
+ **Code Splitting**:
470
+ ```typescript
471
+ import dynamic from 'next/dynamic';
472
+
473
+ // Dynamic import with loading state
474
+ const DynamicComponent = dynamic(() => import('@/components/Heavy'), {
475
+ loading: () => <p>Loading...</p>,
476
+ ssr: false, // Disable SSR for this component
477
+ });
478
+ ```
479
+
480
+ **Streaming with Suspense**:
481
+ ```typescript
482
+ import { Suspense } from 'react';
483
+
484
+ export default function Page() {
485
+ return (
486
+ <div>
487
+ <h1>Dashboard</h1>
488
+ <Suspense fallback={<LoadingSkeleton />}>
489
+ <SlowDataComponent />
490
+ </Suspense>
491
+ </div>
492
+ );
493
+ }
494
+ ```
495
+
496
+ **Font Optimization**:
497
+ ```typescript
498
+ import { Inter, Roboto_Mono } from 'next/font/google';
499
+
500
+ const inter = Inter({ subsets: ['latin'], variable: '--font-inter' });
501
+ const roboto = Roboto_Mono({ subsets: ['latin'], variable: '--font-mono' });
502
+
503
+ // In layout
504
+ <body className={`${inter.variable} ${roboto.variable}`}>
505
+ ```
506
+
507
+ ## Configuration
508
+
509
+ **next.config.js**:
510
+ ```javascript
511
+ /** @type {import('next').NextConfig} */
512
+ const nextConfig = {
513
+ reactStrictMode: true,
514
+ experimental: {
515
+ typedRoutes: true, // Type-safe navigation
516
+ },
517
+ async headers() {
518
+ return [
519
+ {
520
+ source: '/:path*',
521
+ headers: [
522
+ { key: 'X-DNS-Prefetch-Control', value: 'on' },
523
+ { key: 'X-Frame-Options', value: 'SAMEORIGIN' },
524
+ ],
525
+ },
526
+ ];
527
+ },
528
+ };
529
+
530
+ module.exports = nextConfig;
531
+ ```
532
+
533
+ ## Best Practices
534
+
535
+ 1. **Server Components by Default**: Use Client Components only when needed
536
+ 2. **Streaming**: Use Suspense for better perceived performance
537
+ 3. **Image Optimization**: Always use next/image
538
+ 4. **Font Optimization**: Use next/font for automatic optimization
539
+ 5. **Metadata**: Use generateMetadata for dynamic SEO
540
+ 6. **Caching**: Leverage ISR and revalidation strategies
541
+ 7. **Type Safety**: Enable TypeScript strict mode and typed routes
542
+ 8. **Security Headers**: Configure in next.config.js
543
+ 9. **Error Handling**: Implement error.tsx for error boundaries
544
+ 10. **Loading States**: Add loading.tsx for better UX
545
+
546
+ You are ready to build high-performance Next.js applications!
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "specweave-github",
3
3
  "description": "GitHub Issues integration for SpecWeave increments. Bidirectional sync between SpecWeave increments and GitHub Issues. Automatically creates issues from increments, tracks progress, and closes issues on completion. Uses GitHub CLI (gh) for seamless integration.",
4
- "version": "0.22.14",
4
+ "version": "0.24.0",
5
5
  "author": {
6
6
  "name": "SpecWeave Team",
7
7
  "url": "https://spec-weave.com"