@eskoubar95/spec 0.1.0 → 0.1.3
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/dist/commands/help.d.ts +5 -0
- package/dist/commands/help.d.ts.map +1 -0
- package/dist/commands/help.js +23 -0
- package/dist/commands/help.js.map +1 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +30 -14
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/install.d.ts +5 -0
- package/dist/commands/install.d.ts.map +1 -0
- package/dist/commands/install.js +88 -0
- package/dist/commands/install.js.map +1 -0
- package/dist/commands/update.d.ts +5 -0
- package/dist/commands/update.d.ts.map +1 -0
- package/dist/commands/update.js +72 -0
- package/dist/commands/update.js.map +1 -0
- package/dist/commands/workspace.d.ts +5 -0
- package/dist/commands/workspace.d.ts.map +1 -0
- package/dist/commands/workspace.js +17 -0
- package/dist/commands/workspace.js.map +1 -0
- package/dist/index.js +42 -9
- package/dist/index.js.map +1 -1
- package/dist/lib/backup-cursor.d.ts +16 -0
- package/dist/lib/backup-cursor.d.ts.map +1 -0
- package/dist/lib/backup-cursor.js +50 -0
- package/dist/lib/backup-cursor.js.map +1 -0
- package/dist/lib/copy-template.d.ts +9 -1
- package/dist/lib/copy-template.d.ts.map +1 -1
- package/dist/lib/copy-template.js +94 -3
- package/dist/lib/copy-template.js.map +1 -1
- package/dist/lib/cursor-detection.d.ts +6 -0
- package/dist/lib/cursor-detection.d.ts.map +1 -0
- package/dist/lib/cursor-detection.js +31 -0
- package/dist/lib/cursor-detection.js.map +1 -0
- package/dist/lib/detection.d.ts +25 -0
- package/dist/lib/detection.d.ts.map +1 -0
- package/dist/lib/detection.js +186 -0
- package/dist/lib/detection.js.map +1 -0
- package/dist/lib/install-existing.d.ts +6 -0
- package/dist/lib/install-existing.d.ts.map +1 -0
- package/dist/lib/install-existing.js +63 -0
- package/dist/lib/install-existing.js.map +1 -0
- package/dist/lib/project-name.d.ts +7 -0
- package/dist/lib/project-name.d.ts.map +1 -0
- package/dist/lib/project-name.js +13 -0
- package/dist/lib/project-name.js.map +1 -0
- package/dist/lib/prompts.d.ts +6 -5
- package/dist/lib/prompts.d.ts.map +1 -1
- package/dist/lib/prompts.js +114 -0
- package/dist/lib/prompts.js.map +1 -1
- package/dist/lib/version-check.d.ts +21 -0
- package/dist/lib/version-check.d.ts.map +1 -0
- package/dist/lib/version-check.js +49 -0
- package/dist/lib/version-check.js.map +1 -0
- package/dist/lib/workspace.d.ts +7 -0
- package/dist/lib/workspace.d.ts.map +1 -0
- package/dist/lib/workspace.js +38 -0
- package/dist/lib/workspace.js.map +1 -0
- package/dist/types.d.ts +32 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/package.json +2 -2
- package/template/.cursor/commands/_shared/activation.md +220 -0
- package/template/.cursor/commands/_shared/coderabbit-integration.md +278 -0
- package/template/.cursor/commands/_shared/command-stacks.md +124 -0
- package/template/.cursor/commands/_shared/deployment-detection.md +294 -0
- package/template/.cursor/commands/_shared/detection.md +277 -0
- package/template/.cursor/commands/_shared/documentation-lookup.md +321 -0
- package/template/.cursor/commands/_shared/git-workflow.md +288 -0
- package/template/.cursor/commands/_shared/github-helpers.md +337 -0
- package/template/.cursor/commands/_shared/github-workflows.md +351 -0
- package/template/.cursor/commands/_shared/helper-metadata.md +481 -0
- package/template/.cursor/commands/_shared/linear-automation.md +388 -0
- package/template/.cursor/commands/_shared/linear-helpers.md +254 -0
- package/template/.cursor/commands/_shared/performance-monitoring.md +369 -0
- package/template/.cursor/commands/_shared/pr-description.md +279 -0
- package/template/.cursor/commands/_shared/retrospective-spec-creation.md +977 -0
- package/template/.cursor/commands/_shared/scaling.md +264 -0
- package/template/.cursor/commands/_shared/state-assertions.md +174 -0
- package/template/.cursor/commands/_shared/test-automation.md +388 -0
- package/template/.cursor/commands/_shared/verification-checkpoints.md +145 -0
- package/template/.cursor/commands/spec/audit.md +240 -0
- package/template/.cursor/commands/spec/evolve.md +163 -0
- package/template/.cursor/commands/spec/sync.md +196 -0
- package/template/.cursor/commands/tools/refactor.md +555 -0
- package/template/.cursor/rules/10-engineering.mdc +149 -0
- package/template/.cursor/rules/11-design.mdc +129 -0
- package/template/.cursor/rules/12-business.mdc +132 -0
- package/template/.cursor/rules/20-nextjs.mdc +146 -0
- package/template/.cursor/rules/21-api-design.mdc +176 -0
- package/template/.cursor/rules/30-database.mdc +183 -0
- package/template/.cursor/rules/31-testing.mdc +191 -0
- package/template/.cursor/scripts/validate-helpers.js +254 -0
- package/template/.sdd/detection-cache.json +1 -0
- package/template/.sdd/install-info.json +1 -0
- package/template/.sdd/version +1 -0
- package/template/spec/00-root-spec.md +8 -1
- package/template/work/backlog/tasks.local.md +92 -0
|
@@ -0,0 +1,369 @@
|
|
|
1
|
+
---
|
|
2
|
+
helper_id: performance-monitoring
|
|
3
|
+
load_when:
|
|
4
|
+
- preview_url_available
|
|
5
|
+
- performance_enabled
|
|
6
|
+
- validation_step
|
|
7
|
+
- refactoring_analysis
|
|
8
|
+
sections:
|
|
9
|
+
metrics:
|
|
10
|
+
title: "Performance Metrics Collection"
|
|
11
|
+
lines: [37, 80]
|
|
12
|
+
tools:
|
|
13
|
+
title: "Monitoring Tools Integration"
|
|
14
|
+
lines: [104, 146]
|
|
15
|
+
regression:
|
|
16
|
+
title: "Performance Regression Detection"
|
|
17
|
+
lines: [170, 180]
|
|
18
|
+
lighthouse:
|
|
19
|
+
title: "Lighthouse Integration"
|
|
20
|
+
lines: [222, 250]
|
|
21
|
+
always_load: false
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
# Performance Monitoring Integration
|
|
25
|
+
|
|
26
|
+
This helper provides logic for performance metrics collection, monitoring tools integration, performance regression detection, and Lighthouse integration - all framework-agnostic and dynamically adaptable.
|
|
27
|
+
|
|
28
|
+
## Purpose
|
|
29
|
+
|
|
30
|
+
Monitor and track performance metrics:
|
|
31
|
+
- Collect performance metrics (bundle size, load time, API response time)
|
|
32
|
+
- Integrate with monitoring tools (Vercel Analytics, Google Analytics, Sentry, etc.)
|
|
33
|
+
- Detect performance regressions
|
|
34
|
+
- Run Lighthouse audits
|
|
35
|
+
- Report performance metrics in PRs
|
|
36
|
+
|
|
37
|
+
## Section: Performance Metrics Collection (Lines 14-80)
|
|
38
|
+
|
|
39
|
+
### Bundle Size Tracking
|
|
40
|
+
|
|
41
|
+
**Framework-Agnostic Detection:**
|
|
42
|
+
- Check build output directory (dist/, build/, .next/, out/)
|
|
43
|
+
- Calculate total bundle size
|
|
44
|
+
- Track individual file sizes
|
|
45
|
+
- Detect large files (> 100KB)
|
|
46
|
+
|
|
47
|
+
**Bundle Analysis:**
|
|
48
|
+
- Parse build output for size information
|
|
49
|
+
- Track bundle size over time
|
|
50
|
+
- Compare bundle size before/after changes
|
|
51
|
+
- Alert if bundle size increases significantly (> 20%)
|
|
52
|
+
|
|
53
|
+
**Storage:**
|
|
54
|
+
- Store bundle size data in `.sdd/performance-metrics.json`
|
|
55
|
+
- Track trends over time
|
|
56
|
+
- Compare with previous builds
|
|
57
|
+
|
|
58
|
+
### Load Time Metrics
|
|
59
|
+
|
|
60
|
+
**Frontend Load Time:**
|
|
61
|
+
- Measure initial page load time
|
|
62
|
+
- Measure time to interactive (TTI)
|
|
63
|
+
- Measure first contentful paint (FCP)
|
|
64
|
+
- Measure largest contentful paint (LCP)
|
|
65
|
+
|
|
66
|
+
**Backend Response Time:**
|
|
67
|
+
- Measure API endpoint response times
|
|
68
|
+
- Track database query performance
|
|
69
|
+
- Monitor server response times
|
|
70
|
+
|
|
71
|
+
**Collection Methods:**
|
|
72
|
+
- Browser DevTools Performance API
|
|
73
|
+
- Server-side timing headers
|
|
74
|
+
- Custom performance marks
|
|
75
|
+
- Framework-agnostic timing
|
|
76
|
+
|
|
77
|
+
### API Response Time Tracking
|
|
78
|
+
|
|
79
|
+
**Endpoint Monitoring:**
|
|
80
|
+
- Track response times per endpoint
|
|
81
|
+
- Identify slow endpoints (> 500ms)
|
|
82
|
+
- Track p50, p95, p99 percentiles
|
|
83
|
+
- Monitor error rates
|
|
84
|
+
|
|
85
|
+
**Database Query Performance:**
|
|
86
|
+
- Track query execution time
|
|
87
|
+
- Identify slow queries (> 100ms)
|
|
88
|
+
- Monitor query frequency
|
|
89
|
+
- Detect N+1 query problems
|
|
90
|
+
|
|
91
|
+
### Database Query Performance
|
|
92
|
+
|
|
93
|
+
**Query Monitoring:**
|
|
94
|
+
- Track query execution time
|
|
95
|
+
- Identify slow queries
|
|
96
|
+
- Monitor query patterns
|
|
97
|
+
- Detect inefficient queries
|
|
98
|
+
|
|
99
|
+
**Framework-Agnostic:**
|
|
100
|
+
- Works with any database (PostgreSQL, MySQL, MongoDB, etc.)
|
|
101
|
+
- Parse query logs or use database-specific tools
|
|
102
|
+
- Track query performance over time
|
|
103
|
+
|
|
104
|
+
## Section: Monitoring Tools Integration (Lines 81-146)
|
|
105
|
+
|
|
106
|
+
### Vercel Analytics
|
|
107
|
+
|
|
108
|
+
**Integration:**
|
|
109
|
+
- Check if Vercel Analytics is enabled
|
|
110
|
+
- Read analytics data from Vercel API
|
|
111
|
+
- Track Core Web Vitals
|
|
112
|
+
- Monitor performance metrics
|
|
113
|
+
|
|
114
|
+
**Metrics:**
|
|
115
|
+
- Real User Monitoring (RUM) data
|
|
116
|
+
- Core Web Vitals (LCP, FID, CLS)
|
|
117
|
+
- Performance scores
|
|
118
|
+
- Error rates
|
|
119
|
+
|
|
120
|
+
### Google Analytics
|
|
121
|
+
|
|
122
|
+
**Integration:**
|
|
123
|
+
- Check for Google Analytics configuration
|
|
124
|
+
- Read analytics data via API (if available)
|
|
125
|
+
- Track page load times
|
|
126
|
+
- Monitor user experience metrics
|
|
127
|
+
|
|
128
|
+
**Metrics:**
|
|
129
|
+
- Page load time
|
|
130
|
+
- Time to interactive
|
|
131
|
+
- Bounce rate
|
|
132
|
+
- User engagement
|
|
133
|
+
|
|
134
|
+
### Sentry Performance
|
|
135
|
+
|
|
136
|
+
**Integration:**
|
|
137
|
+
- Check if Sentry is configured
|
|
138
|
+
- Read performance data from Sentry API
|
|
139
|
+
- Track transaction performance
|
|
140
|
+
- Monitor error rates
|
|
141
|
+
|
|
142
|
+
**Metrics:**
|
|
143
|
+
- Transaction duration
|
|
144
|
+
- Transaction throughput
|
|
145
|
+
- Error rate
|
|
146
|
+
- Apdex score
|
|
147
|
+
|
|
148
|
+
### New Relic / Datadog
|
|
149
|
+
|
|
150
|
+
**Integration:**
|
|
151
|
+
- Check for New Relic or Datadog configuration
|
|
152
|
+
- Read performance data via API
|
|
153
|
+
- Track application performance
|
|
154
|
+
- Monitor infrastructure metrics
|
|
155
|
+
|
|
156
|
+
**Metrics:**
|
|
157
|
+
- Application response time
|
|
158
|
+
- Throughput
|
|
159
|
+
- Error rate
|
|
160
|
+
- Infrastructure metrics
|
|
161
|
+
|
|
162
|
+
### Custom Performance APIs
|
|
163
|
+
|
|
164
|
+
**Integration:**
|
|
165
|
+
- Support for custom performance monitoring
|
|
166
|
+
- Read from custom APIs
|
|
167
|
+
- Parse custom metrics format
|
|
168
|
+
- Framework-agnostic integration
|
|
169
|
+
|
|
170
|
+
## Section: Performance Regression Detection (Lines 147-180)
|
|
171
|
+
|
|
172
|
+
### Before/After Comparison
|
|
173
|
+
|
|
174
|
+
**Compare Performance:**
|
|
175
|
+
- Get baseline performance from previous build/commit
|
|
176
|
+
- Compare current performance with baseline
|
|
177
|
+
- Calculate performance delta
|
|
178
|
+
- Flag significant regressions (> 20% degradation)
|
|
179
|
+
|
|
180
|
+
### Performance Budgets
|
|
181
|
+
|
|
182
|
+
**Budget Definition:**
|
|
183
|
+
- Set maximum bundle size (e.g., 500KB)
|
|
184
|
+
- Set maximum load time (e.g., 2 seconds)
|
|
185
|
+
- Set maximum API response time (e.g., 200ms)
|
|
186
|
+
- Set minimum Lighthouse score (e.g., 90)
|
|
187
|
+
|
|
188
|
+
**Budget Enforcement:**
|
|
189
|
+
- Check if metrics exceed budgets
|
|
190
|
+
- Flag budget violations
|
|
191
|
+
- Block PR if budgets exceeded (optional)
|
|
192
|
+
- Report budget status in PR
|
|
193
|
+
|
|
194
|
+
### Performance Reports
|
|
195
|
+
|
|
196
|
+
**PR Comments:**
|
|
197
|
+
- Add performance metrics to PR comments
|
|
198
|
+
- Show before/after comparison
|
|
199
|
+
- Highlight regressions
|
|
200
|
+
- Suggest optimizations
|
|
201
|
+
|
|
202
|
+
**Report Format:**
|
|
203
|
+
```markdown
|
|
204
|
+
## Performance Metrics
|
|
205
|
+
|
|
206
|
+
### Bundle Size
|
|
207
|
+
- Current: 450KB
|
|
208
|
+
- Previous: 420KB
|
|
209
|
+
- Change: +30KB (+7.1%) ⚠️
|
|
210
|
+
|
|
211
|
+
### Load Time
|
|
212
|
+
- Current: 1.8s
|
|
213
|
+
- Previous: 1.6s
|
|
214
|
+
- Change: +0.2s (+12.5%) ⚠️
|
|
215
|
+
|
|
216
|
+
### API Response Time
|
|
217
|
+
- Current: 150ms (p95)
|
|
218
|
+
- Previous: 140ms (p95)
|
|
219
|
+
- Change: +10ms (+7.1%)
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
## Section: Lighthouse Integration (Lines 199-250)
|
|
223
|
+
|
|
224
|
+
### Lighthouse Audits
|
|
225
|
+
|
|
226
|
+
**Automatic Audits:**
|
|
227
|
+
- Run Lighthouse audit on preview URL
|
|
228
|
+
- Collect performance, accessibility, SEO, best practices scores
|
|
229
|
+
- Generate Lighthouse report
|
|
230
|
+
- Parse Lighthouse JSON output
|
|
231
|
+
|
|
232
|
+
**Audit Configuration:**
|
|
233
|
+
- Desktop or mobile audit
|
|
234
|
+
- Performance budget
|
|
235
|
+
- Custom categories
|
|
236
|
+
- Framework-agnostic (works with any web app)
|
|
237
|
+
|
|
238
|
+
### Lighthouse Scores
|
|
239
|
+
|
|
240
|
+
**Performance Score:**
|
|
241
|
+
- 0-100 performance score
|
|
242
|
+
- Core Web Vitals (LCP, FID, CLS)
|
|
243
|
+
- Performance metrics
|
|
244
|
+
- Opportunities for improvement
|
|
245
|
+
|
|
246
|
+
**Accessibility Score:**
|
|
247
|
+
- 0-100 accessibility score
|
|
248
|
+
- Accessibility violations
|
|
249
|
+
- ARIA issues
|
|
250
|
+
- Color contrast issues
|
|
251
|
+
|
|
252
|
+
**SEO Score:**
|
|
253
|
+
- 0-100 SEO score
|
|
254
|
+
- Meta tags
|
|
255
|
+
- Structured data
|
|
256
|
+
- Mobile-friendly
|
|
257
|
+
|
|
258
|
+
**Best Practices Score:**
|
|
259
|
+
- 0-100 best practices score
|
|
260
|
+
- Security issues
|
|
261
|
+
- HTTPS usage
|
|
262
|
+
- Console errors
|
|
263
|
+
|
|
264
|
+
### Lighthouse Reporting
|
|
265
|
+
|
|
266
|
+
**PR Comments:**
|
|
267
|
+
- Add Lighthouse scores to PR comments
|
|
268
|
+
- Show score changes
|
|
269
|
+
- Highlight regressions
|
|
270
|
+
- Link to full Lighthouse report
|
|
271
|
+
|
|
272
|
+
**Report Format:**
|
|
273
|
+
```markdown
|
|
274
|
+
## Lighthouse Audit Results
|
|
275
|
+
|
|
276
|
+
### Performance: 92 (was 95) ⚠️
|
|
277
|
+
- LCP: 1.2s
|
|
278
|
+
- FID: 10ms
|
|
279
|
+
- CLS: 0.05
|
|
280
|
+
|
|
281
|
+
### Accessibility: 98 (was 98) ✅
|
|
282
|
+
### SEO: 95 (was 95) ✅
|
|
283
|
+
### Best Practices: 100 (was 100) ✅
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
## Integration Points
|
|
287
|
+
|
|
288
|
+
### In `/task/validate`:
|
|
289
|
+
|
|
290
|
+
**After validation:**
|
|
291
|
+
1. Collect performance metrics (if enabled)
|
|
292
|
+
2. Run Lighthouse audit (if preview URL available)
|
|
293
|
+
3. Compare with baseline
|
|
294
|
+
4. Report performance status
|
|
295
|
+
5. Add performance metrics to PR comment (if PR exists)
|
|
296
|
+
|
|
297
|
+
### In GitHub Actions:
|
|
298
|
+
|
|
299
|
+
**In CI workflows:**
|
|
300
|
+
1. Build application
|
|
301
|
+
2. Measure bundle size
|
|
302
|
+
3. Run Lighthouse audit (if possible)
|
|
303
|
+
4. Report performance metrics
|
|
304
|
+
5. Fail build if budgets exceeded (optional)
|
|
305
|
+
|
|
306
|
+
## Error Handling
|
|
307
|
+
|
|
308
|
+
- **Metrics collection fails:** Skip metrics, continue workflow
|
|
309
|
+
- **Monitoring tool unavailable:** Skip monitoring, continue workflow
|
|
310
|
+
- **Lighthouse audit fails:** Skip Lighthouse, continue workflow
|
|
311
|
+
- **Performance regression detected:** Report warning, don't block (unless configured)
|
|
312
|
+
- **Never block workflow:** All performance features optional
|
|
313
|
+
|
|
314
|
+
## Configuration
|
|
315
|
+
|
|
316
|
+
### Performance Configuration Options
|
|
317
|
+
|
|
318
|
+
**Via spec or config:**
|
|
319
|
+
- `COLLECT_PERFORMANCE_METRICS=true/false` (default: true)
|
|
320
|
+
- `RUN_LIGHTHOUSE_AUDITS=true/false` (default: true)
|
|
321
|
+
- `PERFORMANCE_BUDGET_BUNDLE_SIZE=500KB` (max bundle size)
|
|
322
|
+
- `PERFORMANCE_BUDGET_LOAD_TIME=2000ms` (max load time)
|
|
323
|
+
- `PERFORMANCE_BUDGET_LIGHTHOUSE=90` (min Lighthouse score)
|
|
324
|
+
- `BLOCK_ON_PERFORMANCE_REGRESSION=true/false` (default: false)
|
|
325
|
+
|
|
326
|
+
### Sensible Defaults
|
|
327
|
+
|
|
328
|
+
- Collect metrics: **true**
|
|
329
|
+
- Run Lighthouse: **true** (if preview URL available)
|
|
330
|
+
- Performance budgets: **none** (report only)
|
|
331
|
+
- Block on regression: **false** (warn only)
|
|
332
|
+
|
|
333
|
+
## Best Practices
|
|
334
|
+
|
|
335
|
+
1. **Auto-detect monitoring tools:** Don't require manual configuration
|
|
336
|
+
2. **Graceful degradation:** Work even if monitoring unavailable
|
|
337
|
+
3. **Report clearly:** Show performance metrics clearly
|
|
338
|
+
4. **Don't block by default:** Performance is important but not blocking unless configured
|
|
339
|
+
5. **Track trends:** Monitor performance over time
|
|
340
|
+
|
|
341
|
+
## Examples
|
|
342
|
+
|
|
343
|
+
### Example 1: Bundle Size Tracking
|
|
344
|
+
|
|
345
|
+
**Detection:** Build output in `dist/` directory
|
|
346
|
+
**Measurement:** Calculate total bundle size
|
|
347
|
+
**Comparison:** Compare with previous build
|
|
348
|
+
**Report:** "Bundle size: 450KB (+30KB from previous build)"
|
|
349
|
+
|
|
350
|
+
### Example 2: Lighthouse Audit
|
|
351
|
+
|
|
352
|
+
**Trigger:** Preview URL available
|
|
353
|
+
**Audit:** Run Lighthouse on preview URL
|
|
354
|
+
**Scores:** Performance: 92, Accessibility: 98, SEO: 95
|
|
355
|
+
**Report:** Add scores to PR comment
|
|
356
|
+
|
|
357
|
+
### Example 3: Performance Regression
|
|
358
|
+
|
|
359
|
+
**Baseline:** Previous build performance metrics
|
|
360
|
+
**Current:** Current build performance metrics
|
|
361
|
+
**Comparison:** Detect 20% degradation in load time
|
|
362
|
+
**Action:** Report warning in PR comment
|
|
363
|
+
|
|
364
|
+
### Example 4: No Monitoring Available
|
|
365
|
+
|
|
366
|
+
**Detection:** No monitoring tools configured
|
|
367
|
+
**Action:** Skip performance monitoring
|
|
368
|
+
**Report:** "Performance monitoring not configured. Skipping."
|
|
369
|
+
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
---
|
|
2
|
+
helper_id: pr-description
|
|
3
|
+
load_when:
|
|
4
|
+
- pr_creation_needed
|
|
5
|
+
- pr_update_needed
|
|
6
|
+
sections:
|
|
7
|
+
template:
|
|
8
|
+
title: "PR Description Template"
|
|
9
|
+
lines: [1, 100]
|
|
10
|
+
generation:
|
|
11
|
+
title: "Auto-generation Logic"
|
|
12
|
+
lines: [101, 200]
|
|
13
|
+
always_load: false
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
# PR Description Generation
|
|
17
|
+
|
|
18
|
+
This helper provides logic for automatically generating meaningful PR descriptions based on task specs, commit history, and changes.
|
|
19
|
+
|
|
20
|
+
## Purpose
|
|
21
|
+
|
|
22
|
+
Generate comprehensive PR descriptions that include:
|
|
23
|
+
- Task information
|
|
24
|
+
- Changes summary
|
|
25
|
+
- Testing notes
|
|
26
|
+
- Acceptance criteria
|
|
27
|
+
- Related issues
|
|
28
|
+
|
|
29
|
+
## Template Structure
|
|
30
|
+
|
|
31
|
+
### Standard Template
|
|
32
|
+
|
|
33
|
+
```markdown
|
|
34
|
+
## Task: [task-id] - [task description]
|
|
35
|
+
|
|
36
|
+
### Changes
|
|
37
|
+
[Auto-generated summary of changes from git diff and commit history]
|
|
38
|
+
|
|
39
|
+
### Testing
|
|
40
|
+
[Testing notes from task spec or manual testing]
|
|
41
|
+
|
|
42
|
+
### Acceptance Criteria
|
|
43
|
+
[Acceptance criteria from task spec]
|
|
44
|
+
|
|
45
|
+
### Related
|
|
46
|
+
[Related Linear issues, dependencies, or related tasks]
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Detailed Template (for complex tasks)
|
|
50
|
+
|
|
51
|
+
```markdown
|
|
52
|
+
## Task: [task-id] - [task description]
|
|
53
|
+
|
|
54
|
+
### Overview
|
|
55
|
+
[Brief overview of what this PR accomplishes]
|
|
56
|
+
|
|
57
|
+
### Changes
|
|
58
|
+
[Detailed summary of changes]
|
|
59
|
+
|
|
60
|
+
#### Files Changed
|
|
61
|
+
- [List of key files changed]
|
|
62
|
+
|
|
63
|
+
#### Key Changes
|
|
64
|
+
- [Bullet points of main changes]
|
|
65
|
+
|
|
66
|
+
### Testing
|
|
67
|
+
[Testing notes]
|
|
68
|
+
|
|
69
|
+
### Acceptance Criteria
|
|
70
|
+
[Acceptance criteria checklist]
|
|
71
|
+
|
|
72
|
+
### Related
|
|
73
|
+
[Related issues, dependencies, etc.]
|
|
74
|
+
|
|
75
|
+
### Notes
|
|
76
|
+
[Any additional notes or context]
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Auto-Generation Process
|
|
80
|
+
|
|
81
|
+
### Step 1: Read Task Information
|
|
82
|
+
|
|
83
|
+
**From task spec:**
|
|
84
|
+
1. Read `work/backlog/tasks.local.md` for task details
|
|
85
|
+
2. If task-level spec exists (`spec/tasks/[task-id]/spec.md`), read it
|
|
86
|
+
3. Extract:
|
|
87
|
+
- Task ID
|
|
88
|
+
- Task description
|
|
89
|
+
- Acceptance criteria
|
|
90
|
+
- Dependencies
|
|
91
|
+
- Testing requirements
|
|
92
|
+
|
|
93
|
+
### Step 2: Generate Changes Summary
|
|
94
|
+
|
|
95
|
+
**From git diff:**
|
|
96
|
+
1. Get diff summary: `git diff main...HEAD --stat`
|
|
97
|
+
2. Get commit history: `git log main..HEAD --oneline`
|
|
98
|
+
3. Analyze changed files:
|
|
99
|
+
- Count files changed
|
|
100
|
+
- Identify file types (components, services, tests, etc.)
|
|
101
|
+
- Note key additions/deletions
|
|
102
|
+
|
|
103
|
+
**Format changes summary:**
|
|
104
|
+
- "Modified X files: [key files]"
|
|
105
|
+
- "Added Y new files: [new files]"
|
|
106
|
+
- "Removed Z files: [removed files]"
|
|
107
|
+
- Include commit messages in summary
|
|
108
|
+
|
|
109
|
+
### Step 3: Extract Testing Notes
|
|
110
|
+
|
|
111
|
+
**From task spec:**
|
|
112
|
+
- If task spec includes testing notes → use them
|
|
113
|
+
- If task spec mentions manual testing → include that
|
|
114
|
+
- If tests were added → mention test files
|
|
115
|
+
|
|
116
|
+
**From commit history:**
|
|
117
|
+
- Check if test files were added/modified
|
|
118
|
+
- Mention test coverage if applicable
|
|
119
|
+
|
|
120
|
+
### Step 4: Include Acceptance Criteria
|
|
121
|
+
|
|
122
|
+
**From task spec:**
|
|
123
|
+
- Read acceptance criteria from task
|
|
124
|
+
- Format as checklist:
|
|
125
|
+
```markdown
|
|
126
|
+
- [ ] Criteria 1
|
|
127
|
+
- [ ] Criteria 2
|
|
128
|
+
- [ ] Criteria 3
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### Step 5: Add Related Information
|
|
132
|
+
|
|
133
|
+
**Linear issues:**
|
|
134
|
+
- If Linear enabled and task is Linear issue → reference Linear issue
|
|
135
|
+
- Format: `Related to [Linear issue ID]`
|
|
136
|
+
|
|
137
|
+
**Dependencies:**
|
|
138
|
+
- If task has dependencies → list them
|
|
139
|
+
- Format: `Depends on: [task IDs]`
|
|
140
|
+
|
|
141
|
+
**Related tasks:**
|
|
142
|
+
- If related tasks exist → mention them
|
|
143
|
+
- Format: `Related: [task IDs]`
|
|
144
|
+
|
|
145
|
+
## Integration with GitHub Helpers
|
|
146
|
+
|
|
147
|
+
### PR Creation
|
|
148
|
+
|
|
149
|
+
**When creating PR:**
|
|
150
|
+
1. Generate PR description using this helper
|
|
151
|
+
2. Use description in PR creation (via GitHub MCP or CLI)
|
|
152
|
+
3. Update PR description if needed after deployment
|
|
153
|
+
|
|
154
|
+
### PR Updates
|
|
155
|
+
|
|
156
|
+
**After deployment:**
|
|
157
|
+
1. If preview URL available → add to PR description
|
|
158
|
+
2. Format: `### Preview\n[Preview URL](url)`
|
|
159
|
+
|
|
160
|
+
**After CodeRabbit comments:**
|
|
161
|
+
1. If significant changes made → update PR description
|
|
162
|
+
2. Note changes in "Changes" section
|
|
163
|
+
|
|
164
|
+
## Framework-Specific Adaptations
|
|
165
|
+
|
|
166
|
+
### Next.js Projects
|
|
167
|
+
|
|
168
|
+
**Include:**
|
|
169
|
+
- Route changes (if App Router)
|
|
170
|
+
- API route changes (if applicable)
|
|
171
|
+
- Component changes
|
|
172
|
+
- Build/configuration changes
|
|
173
|
+
|
|
174
|
+
### API Projects
|
|
175
|
+
|
|
176
|
+
**Include:**
|
|
177
|
+
- Endpoint changes
|
|
178
|
+
- Request/response format changes
|
|
179
|
+
- Database schema changes (if applicable)
|
|
180
|
+
- Authentication changes
|
|
181
|
+
|
|
182
|
+
### Library Projects
|
|
183
|
+
|
|
184
|
+
**Include:**
|
|
185
|
+
- API changes
|
|
186
|
+
- Breaking changes (if any)
|
|
187
|
+
- New exports
|
|
188
|
+
- Documentation updates
|
|
189
|
+
|
|
190
|
+
## Error Handling
|
|
191
|
+
|
|
192
|
+
- **Task spec not found:** Use git diff and commit history only
|
|
193
|
+
- **Git operations fail:** Use task description as fallback
|
|
194
|
+
- **Linear not available:** Skip Linear references
|
|
195
|
+
- **Deployment not available:** Skip preview URL
|
|
196
|
+
|
|
197
|
+
## Best Practices
|
|
198
|
+
|
|
199
|
+
1. **Be comprehensive:** Include all relevant information
|
|
200
|
+
2. **Be concise:** Keep descriptions readable
|
|
201
|
+
3. **Use checklists:** Make acceptance criteria actionable
|
|
202
|
+
4. **Reference related work:** Link to related issues/tasks
|
|
203
|
+
5. **Update as needed:** Keep PR description current
|
|
204
|
+
|
|
205
|
+
## Examples
|
|
206
|
+
|
|
207
|
+
### Example 1: Simple Feature
|
|
208
|
+
|
|
209
|
+
```markdown
|
|
210
|
+
## Task: T1.2 - Add user authentication
|
|
211
|
+
|
|
212
|
+
### Changes
|
|
213
|
+
Modified 5 files:
|
|
214
|
+
- Added `src/auth/service.ts` (authentication service)
|
|
215
|
+
- Updated `src/app/login/page.tsx` (login UI)
|
|
216
|
+
- Added `src/app/api/auth/route.ts` (auth API route)
|
|
217
|
+
- Updated `src/middleware.ts` (auth middleware)
|
|
218
|
+
- Added tests: `src/auth/__tests__/service.test.ts`
|
|
219
|
+
|
|
220
|
+
### Testing
|
|
221
|
+
- Manual testing: Login flow tested
|
|
222
|
+
- Unit tests: Authentication service tests added
|
|
223
|
+
- Integration tests: API route tests added
|
|
224
|
+
|
|
225
|
+
### Acceptance Criteria
|
|
226
|
+
- [x] User can log in with email/password
|
|
227
|
+
- [x] User session is maintained
|
|
228
|
+
- [x] Protected routes require authentication
|
|
229
|
+
- [x] Error handling for invalid credentials
|
|
230
|
+
|
|
231
|
+
### Related
|
|
232
|
+
Related to LIN-123 (User Authentication Epic)
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
### Example 2: Bug Fix
|
|
236
|
+
|
|
237
|
+
```markdown
|
|
238
|
+
## Task: T2.3 - Fix database connection timeout
|
|
239
|
+
|
|
240
|
+
### Changes
|
|
241
|
+
Modified 2 files:
|
|
242
|
+
- Updated `src/db/connection.ts` (increased timeout, added retry logic)
|
|
243
|
+
- Updated `src/db/__tests__/connection.test.ts` (added timeout tests)
|
|
244
|
+
|
|
245
|
+
### Testing
|
|
246
|
+
- Manual testing: Verified connection works under load
|
|
247
|
+
- Unit tests: Connection retry logic tested
|
|
248
|
+
- Integration tests: Database operations tested
|
|
249
|
+
|
|
250
|
+
### Acceptance Criteria
|
|
251
|
+
- [x] Database connection doesn't timeout under normal load
|
|
252
|
+
- [x] Connection retries on failure
|
|
253
|
+
- [x] Error messages are clear
|
|
254
|
+
|
|
255
|
+
### Related
|
|
256
|
+
Fixes issue reported in LIN-456
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
### Example 3: With Preview Deployment
|
|
260
|
+
|
|
261
|
+
```markdown
|
|
262
|
+
## Task: T3.1 - Refactor payment processing
|
|
263
|
+
|
|
264
|
+
### Changes
|
|
265
|
+
[Changes summary...]
|
|
266
|
+
|
|
267
|
+
### Testing
|
|
268
|
+
[Testing notes...]
|
|
269
|
+
|
|
270
|
+
### Acceptance Criteria
|
|
271
|
+
[Acceptance criteria...]
|
|
272
|
+
|
|
273
|
+
### Preview
|
|
274
|
+
[Preview URL](https://preview-url.vercel.app)
|
|
275
|
+
|
|
276
|
+
### Related
|
|
277
|
+
[Related issues...]
|
|
278
|
+
```
|
|
279
|
+
|