claude-autopm 1.27.0 → 1.29.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/README.md +72 -0
- package/autopm/.claude/scripts/pm/analytics.js +425 -0
- package/autopm/.claude/scripts/pm/prd-new.js +292 -2
- package/autopm/.claude/scripts/pm/sync-batch.js +337 -0
- package/autopm/.claude/scripts/pm/template-list.js +119 -0
- package/autopm/.claude/scripts/pm/template-new.js +344 -0
- package/autopm/.claude/templates/prds/README.md +334 -0
- package/autopm/.claude/templates/prds/api-feature.md +306 -0
- package/autopm/.claude/templates/prds/bug-fix.md +413 -0
- package/autopm/.claude/templates/prds/data-migration.md +483 -0
- package/autopm/.claude/templates/prds/documentation.md +439 -0
- package/autopm/.claude/templates/prds/ui-feature.md +365 -0
- package/lib/README-FILTER-SEARCH.md +285 -0
- package/lib/analytics-engine.js +689 -0
- package/lib/batch-processor-integration.js +366 -0
- package/lib/batch-processor.js +278 -0
- package/lib/burndown-chart.js +415 -0
- package/lib/dependency-analyzer.js +466 -0
- package/lib/filter-engine.js +414 -0
- package/lib/query-parser.js +322 -0
- package/lib/template-engine.js +347 -0
- package/package.json +5 -4
|
@@ -0,0 +1,334 @@
|
|
|
1
|
+
# Built-in PRD Templates
|
|
2
|
+
|
|
3
|
+
**Version**: v1.28.0
|
|
4
|
+
**Total Templates**: 5
|
|
5
|
+
**Status**: Production Ready ✅
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 📋 Available Templates
|
|
10
|
+
|
|
11
|
+
### 1. API Feature (`api-feature.md`)
|
|
12
|
+
**Use for**: REST/GraphQL API development
|
|
13
|
+
|
|
14
|
+
**Best for**:
|
|
15
|
+
- Microservices endpoints
|
|
16
|
+
- Public APIs
|
|
17
|
+
- Internal service APIs
|
|
18
|
+
- Authentication systems
|
|
19
|
+
|
|
20
|
+
**Includes**:
|
|
21
|
+
- OpenAPI specification (contract-first)
|
|
22
|
+
- JWT authentication & security
|
|
23
|
+
- Performance benchmarks (< 100ms)
|
|
24
|
+
- Rate limiting & error handling
|
|
25
|
+
- Comprehensive testing (TDD)
|
|
26
|
+
|
|
27
|
+
**Example Variables**:
|
|
28
|
+
```yaml
|
|
29
|
+
title: "User Authentication API"
|
|
30
|
+
api_purpose: "user authentication"
|
|
31
|
+
http_method: "POST"
|
|
32
|
+
api_endpoint: "/api/auth/login"
|
|
33
|
+
auth_method: "JWT"
|
|
34
|
+
rate_limit: "100 req/min"
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
### 2. UI Feature (`ui-feature.md`)
|
|
40
|
+
**Use for**: Frontend components and pages
|
|
41
|
+
|
|
42
|
+
**Best for**:
|
|
43
|
+
- React/Vue/Angular components
|
|
44
|
+
- Dashboard pages
|
|
45
|
+
- Forms and modals
|
|
46
|
+
- Responsive layouts
|
|
47
|
+
|
|
48
|
+
**Includes**:
|
|
49
|
+
- WCAG 2.1 AA compliance (legal requirement 2025)
|
|
50
|
+
- Core Web Vitals (LCP, FID, CLS)
|
|
51
|
+
- Mobile-first responsive design
|
|
52
|
+
- Accessibility testing (screen readers)
|
|
53
|
+
- Lighthouse performance targets
|
|
54
|
+
|
|
55
|
+
**Example Variables**:
|
|
56
|
+
```yaml
|
|
57
|
+
title: "User Dashboard"
|
|
58
|
+
component_type: "Page"
|
|
59
|
+
platform: "Web"
|
|
60
|
+
frontend_framework: "React 18"
|
|
61
|
+
state_management: "Zustand"
|
|
62
|
+
styling_approach: "Tailwind CSS"
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
### 3. Bug Fix (`bug-fix.md`)
|
|
68
|
+
**Use for**: Bug resolution with root cause analysis
|
|
69
|
+
|
|
70
|
+
**Best for**:
|
|
71
|
+
- Critical production bugs
|
|
72
|
+
- Performance issues
|
|
73
|
+
- Data corruption fixes
|
|
74
|
+
- Security vulnerabilities
|
|
75
|
+
|
|
76
|
+
**Includes**:
|
|
77
|
+
- 5 Whys root cause analysis
|
|
78
|
+
- Severity classification (P0-P3)
|
|
79
|
+
- Impact analysis (users, revenue, system)
|
|
80
|
+
- Comprehensive rollback plan
|
|
81
|
+
- Post-mortem documentation
|
|
82
|
+
|
|
83
|
+
**Example Variables**:
|
|
84
|
+
```yaml
|
|
85
|
+
title: "Fix Login Timeout Issue"
|
|
86
|
+
severity: "High"
|
|
87
|
+
bug_id: "BUG-1234"
|
|
88
|
+
affected_users: "5,000 (20%)"
|
|
89
|
+
environment: "Production"
|
|
90
|
+
root_cause: "Database connection pool exhaustion"
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
### 4. Data Migration (`data-migration.md`)
|
|
96
|
+
**Use for**: Database schema changes and data migration
|
|
97
|
+
|
|
98
|
+
**Best for**:
|
|
99
|
+
- Database migrations
|
|
100
|
+
- Cloud migrations
|
|
101
|
+
- Data consolidation
|
|
102
|
+
- Schema refactoring
|
|
103
|
+
|
|
104
|
+
**Includes**:
|
|
105
|
+
- Data profiling & quality assessment
|
|
106
|
+
- Migration strategies (Big Bang, Trickle, Phased)
|
|
107
|
+
- Comprehensive validation (pre/post)
|
|
108
|
+
- Performance optimization
|
|
109
|
+
- Rollback procedures
|
|
110
|
+
|
|
111
|
+
**Example Variables**:
|
|
112
|
+
```yaml
|
|
113
|
+
title: "Migrate User Data to PostgreSQL"
|
|
114
|
+
migration_type: "Platform Migration"
|
|
115
|
+
source_system: "MySQL 5.7"
|
|
116
|
+
target_system: "PostgreSQL 15"
|
|
117
|
+
data_volume: "10M records"
|
|
118
|
+
estimated_duration: "4 hours"
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
### 5. Documentation (`documentation.md`)
|
|
124
|
+
**Use for**: Technical and user documentation
|
|
125
|
+
|
|
126
|
+
**Best for**:
|
|
127
|
+
- API documentation
|
|
128
|
+
- User guides
|
|
129
|
+
- Developer documentation
|
|
130
|
+
- Runbooks
|
|
131
|
+
- Tutorials
|
|
132
|
+
|
|
133
|
+
**Includes**:
|
|
134
|
+
- Documentation-as-Code approach
|
|
135
|
+
- WCAG 2.1 AA accessibility
|
|
136
|
+
- SEO optimization
|
|
137
|
+
- Analytics & measurement
|
|
138
|
+
- Localization (i18n) support
|
|
139
|
+
|
|
140
|
+
**Example Variables**:
|
|
141
|
+
```yaml
|
|
142
|
+
title: "API Reference Documentation"
|
|
143
|
+
doc_type: "API Documentation"
|
|
144
|
+
target_audience: "External Developers"
|
|
145
|
+
delivery_format: "Web (Docusaurus)"
|
|
146
|
+
platform: "GitHub Pages"
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## 🚀 Quick Start
|
|
152
|
+
|
|
153
|
+
### Using a Template
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
# With autopm CLI (coming in v1.28.0)
|
|
157
|
+
autopm prd:new --template api-feature "User Authentication API"
|
|
158
|
+
autopm prd:new --template ui-feature "Dashboard Redesign"
|
|
159
|
+
autopm prd:new --template bug-fix "Fix Login Issue"
|
|
160
|
+
autopm prd:new --template data-migration "Migrate to PostgreSQL"
|
|
161
|
+
autopm prd:new --template documentation "API Reference"
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
### Manual Usage
|
|
165
|
+
|
|
166
|
+
1. Copy template file to your PRDs directory
|
|
167
|
+
2. Replace `{{variables}}` with actual values
|
|
168
|
+
3. Fill in optional sections as needed
|
|
169
|
+
4. Remove unused sections
|
|
170
|
+
|
|
171
|
+
---
|
|
172
|
+
|
|
173
|
+
## 🎯 Template Selection Guide
|
|
174
|
+
|
|
175
|
+
**Choose based on your feature type**:
|
|
176
|
+
|
|
177
|
+
| Feature Type | Template | Why |
|
|
178
|
+
|-------------|----------|-----|
|
|
179
|
+
| REST/GraphQL API | `api-feature` | OpenAPI spec, security, performance |
|
|
180
|
+
| Frontend UI | `ui-feature` | WCAG compliance, Core Web Vitals |
|
|
181
|
+
| Production Bug | `bug-fix` | RCA, rollback, post-mortem |
|
|
182
|
+
| Data Work | `data-migration` | Validation, rollback, compliance |
|
|
183
|
+
| Docs Update | `documentation` | Accessibility, SEO, analytics |
|
|
184
|
+
|
|
185
|
+
---
|
|
186
|
+
|
|
187
|
+
## 📝 Variable Reference
|
|
188
|
+
|
|
189
|
+
### Common Variables (All Templates)
|
|
190
|
+
|
|
191
|
+
**Auto-generated**:
|
|
192
|
+
- `{{id}}` - Sequential ID (prd-001, prd-002...)
|
|
193
|
+
- `{{timestamp}}` - ISO 8601 datetime
|
|
194
|
+
- `{{date}}` - YYYY-MM-DD
|
|
195
|
+
- `{{author}}` - From $USER or git config
|
|
196
|
+
|
|
197
|
+
**User-provided**:
|
|
198
|
+
- `{{title}}` - Feature/PRD title (required)
|
|
199
|
+
- `{{priority}}` - P0/P1/P2/P3 or Critical/High/Medium/Low
|
|
200
|
+
- `{{timeline}}` - Estimated timeline or "TBD"
|
|
201
|
+
|
|
202
|
+
### Template-Specific Variables
|
|
203
|
+
|
|
204
|
+
**api-feature.md**:
|
|
205
|
+
- `{{api_purpose}}`, `{{http_method}}`, `{{api_endpoint}}`
|
|
206
|
+
- `{{auth_method}}`, `{{rate_limit}}`
|
|
207
|
+
- `{{request_body_example}}`, `{{response_body_example}}`
|
|
208
|
+
|
|
209
|
+
**ui-feature.md**:
|
|
210
|
+
- `{{component_type}}`, `{{platform}}`, `{{frontend_framework}}`
|
|
211
|
+
- `{{wireframe_link}}`, `{{design_link}}`
|
|
212
|
+
- `{{lighthouse_target}}`, `{{usability_score}}`
|
|
213
|
+
|
|
214
|
+
**bug-fix.md**:
|
|
215
|
+
- `{{severity}}`, `{{bug_id}}`, `{{affected_users}}`
|
|
216
|
+
- `{{root_cause}}`, `{{solution_approach}}`
|
|
217
|
+
- `{{why_1}}` through `{{why_5}}` (5 Whys)
|
|
218
|
+
|
|
219
|
+
**data-migration.md**:
|
|
220
|
+
- `{{migration_type}}`, `{{source_system}}`, `{{target_system}}`
|
|
221
|
+
- `{{data_volume}}`, `{{migration_strategy}}`
|
|
222
|
+
- `{{source_schema}}`, `{{target_schema}}`
|
|
223
|
+
|
|
224
|
+
**documentation.md**:
|
|
225
|
+
- `{{doc_type}}`, `{{target_audience}}`, `{{delivery_format}}`
|
|
226
|
+
- `{{platform}}`, `{{content_sections}}`
|
|
227
|
+
- `{{reading_level}}`, `{{adoption_target}}`
|
|
228
|
+
|
|
229
|
+
---
|
|
230
|
+
|
|
231
|
+
## ✨ Features
|
|
232
|
+
|
|
233
|
+
### All Templates Include
|
|
234
|
+
|
|
235
|
+
✅ **2025 Best Practices**: Context7-verified industry standards
|
|
236
|
+
✅ **TDD Methodology**: Red-Green-Refactor testing approach
|
|
237
|
+
✅ **SMART Goals**: Specific, Measurable, Achievable, Relevant, Time-bound
|
|
238
|
+
✅ **INVEST User Stories**: Independent, Negotiable, Valuable, Estimable, Small, Testable
|
|
239
|
+
✅ **Risk Assessment**: Comprehensive risk analysis and mitigation
|
|
240
|
+
✅ **Rollback Plans**: Detailed rollback procedures and triggers
|
|
241
|
+
✅ **Monitoring**: Metrics, alerts, and observability
|
|
242
|
+
✅ **Communication Plans**: Internal and external stakeholder communication
|
|
243
|
+
|
|
244
|
+
### Special Features by Template
|
|
245
|
+
|
|
246
|
+
**API Feature**:
|
|
247
|
+
- OpenAPI/Swagger specification
|
|
248
|
+
- OWASP security compliance
|
|
249
|
+
- Performance targets (p50, p95, p99)
|
|
250
|
+
|
|
251
|
+
**UI Feature**:
|
|
252
|
+
- WCAG 2.1 AA compliance (legal requirement)
|
|
253
|
+
- Core Web Vitals optimization
|
|
254
|
+
- Cross-browser testing matrix
|
|
255
|
+
|
|
256
|
+
**Bug Fix**:
|
|
257
|
+
- 5 Whys root cause analysis
|
|
258
|
+
- Post-mortem documentation
|
|
259
|
+
- Prevention strategies
|
|
260
|
+
|
|
261
|
+
**Data Migration**:
|
|
262
|
+
- Multiple migration strategies
|
|
263
|
+
- Data quality assessment
|
|
264
|
+
- Compliance & security
|
|
265
|
+
|
|
266
|
+
**Documentation**:
|
|
267
|
+
- Documentation-as-Code
|
|
268
|
+
- SEO optimization
|
|
269
|
+
- Analytics tracking
|
|
270
|
+
|
|
271
|
+
---
|
|
272
|
+
|
|
273
|
+
## 📚 References
|
|
274
|
+
|
|
275
|
+
### Best Practices Sources
|
|
276
|
+
- [PRD Best Practices 2025](https://productschool.com/blog/product-strategy/product-template-requirements-document-prd)
|
|
277
|
+
- [INVEST Criteria](https://ones.com/blog/invest-criteria-scrum-user-stories-guide/)
|
|
278
|
+
- [REST API Design](https://learn.microsoft.com/en-us/azure/architecture/best-practices/api-design)
|
|
279
|
+
- [WCAG 2.1 Guidelines](https://www.w3.org/TR/WCAG21/)
|
|
280
|
+
- [Root Cause Analysis](https://asana.com/resources/root-cause-analysis-template)
|
|
281
|
+
|
|
282
|
+
### Technical Standards
|
|
283
|
+
- [OpenAPI Specification](https://swagger.io/specification/)
|
|
284
|
+
- [Core Web Vitals](https://web.dev/vitals/)
|
|
285
|
+
- [TDD Methodology](https://martinfowler.com/bliki/TestDrivenDevelopment.html)
|
|
286
|
+
- [SMART Goals](https://www.atlassian.com/blog/productivity/how-to-write-smart-goals)
|
|
287
|
+
|
|
288
|
+
---
|
|
289
|
+
|
|
290
|
+
## 🔄 Customization
|
|
291
|
+
|
|
292
|
+
### Creating Custom Templates
|
|
293
|
+
|
|
294
|
+
1. **Copy an existing template** as starting point
|
|
295
|
+
2. **Modify sections** to match your needs
|
|
296
|
+
3. **Add/remove variables** as required
|
|
297
|
+
4. **Save to** `.claude/templates/prds/custom-name.md`
|
|
298
|
+
5. **User templates override** built-in templates
|
|
299
|
+
|
|
300
|
+
### Template Inheritance
|
|
301
|
+
|
|
302
|
+
Templates support:
|
|
303
|
+
- `{{#if variable}}...{{/if}}` - Conditional sections
|
|
304
|
+
- `{{#each items}}...{{/each}}` - Loops
|
|
305
|
+
- Nested variables and logic
|
|
306
|
+
|
|
307
|
+
---
|
|
308
|
+
|
|
309
|
+
## 📊 Template Statistics
|
|
310
|
+
|
|
311
|
+
| Template | Lines | Size | Variables | Complexity |
|
|
312
|
+
|----------|-------|------|-----------|------------|
|
|
313
|
+
| api-feature.md | 306 | 7.4KB | ~45 | Medium |
|
|
314
|
+
| ui-feature.md | 365 | 10KB | ~60 | High |
|
|
315
|
+
| bug-fix.md | 413 | 9.5KB | ~70 | High |
|
|
316
|
+
| data-migration.md | 483 | 12KB | ~80 | High |
|
|
317
|
+
| documentation.md | 439 | 11KB | ~75 | High |
|
|
318
|
+
|
|
319
|
+
**Total**: 2,006 lines across 5 templates
|
|
320
|
+
|
|
321
|
+
---
|
|
322
|
+
|
|
323
|
+
## 🆘 Support
|
|
324
|
+
|
|
325
|
+
**Documentation**: See `docs/templates-design.md` for detailed design
|
|
326
|
+
**Implementation**: See `docs/template-engine-implementation.md` for technical details
|
|
327
|
+
**Examples**: See `docs/built-in-templates-summary.md` for comprehensive overview
|
|
328
|
+
|
|
329
|
+
**Issues**: Report template issues to the ClaudeAutoPM repository
|
|
330
|
+
|
|
331
|
+
---
|
|
332
|
+
|
|
333
|
+
*Built-in PRD Templates - v1.28.0*
|
|
334
|
+
*Context7-verified 2025 best practices*
|
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: {{id}}
|
|
3
|
+
title: {{title}}
|
|
4
|
+
type: prd
|
|
5
|
+
status: draft
|
|
6
|
+
priority: {{priority}}
|
|
7
|
+
created: {{timestamp}}
|
|
8
|
+
author: {{author}}
|
|
9
|
+
timeline: {{timeline}}
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# PRD: {{title}}
|
|
13
|
+
|
|
14
|
+
## Executive Summary
|
|
15
|
+
|
|
16
|
+
Design and implement {{title}} - a RESTful API endpoint for {{api_purpose}}.
|
|
17
|
+
|
|
18
|
+
**API Endpoint**: `{{http_method}} {{api_endpoint}}`
|
|
19
|
+
|
|
20
|
+
## Problem Statement
|
|
21
|
+
|
|
22
|
+
### Background
|
|
23
|
+
{{problem}}
|
|
24
|
+
|
|
25
|
+
### Business Value
|
|
26
|
+
{{business_value}}
|
|
27
|
+
|
|
28
|
+
### API Requirements
|
|
29
|
+
- **Endpoint**: `{{http_method}} {{api_endpoint}}`
|
|
30
|
+
- **Authentication**: {{auth_method}}
|
|
31
|
+
- **Rate Limiting**: {{rate_limit}}
|
|
32
|
+
- **Performance**: < 100ms (internal) / < 1s (complex)
|
|
33
|
+
|
|
34
|
+
## User Stories
|
|
35
|
+
|
|
36
|
+
Following INVEST criteria (Independent, Negotiable, Valuable, Estimable, Small, Testable):
|
|
37
|
+
|
|
38
|
+
- As a **{{user_role}}**, I want to **{{api_action}}** so that **{{user_benefit}}**
|
|
39
|
+
|
|
40
|
+
{{#if additional_stories}}
|
|
41
|
+
{{#each additional_stories}}
|
|
42
|
+
- As a **{{role}}**, I want to **{{action}}** so that **{{benefit}}**
|
|
43
|
+
{{/each}}
|
|
44
|
+
{{/if}}
|
|
45
|
+
|
|
46
|
+
## API Specification
|
|
47
|
+
|
|
48
|
+
### OpenAPI Contract (Design-First Approach)
|
|
49
|
+
|
|
50
|
+
**Method**: `{{http_method}}`
|
|
51
|
+
**Endpoint**: `{{api_endpoint}}`
|
|
52
|
+
**Content-Type**: `application/json`
|
|
53
|
+
|
|
54
|
+
### Request
|
|
55
|
+
|
|
56
|
+
**Headers**:
|
|
57
|
+
```
|
|
58
|
+
Authorization: Bearer <token>
|
|
59
|
+
Content-Type: application/json
|
|
60
|
+
{{#if custom_headers}}{{custom_headers}}{{/if}}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
**Body** (JSON):
|
|
64
|
+
```json
|
|
65
|
+
{{request_body_example}}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
**Validation Rules**:
|
|
69
|
+
{{#if validation_rules}}
|
|
70
|
+
{{#each validation_rules}}
|
|
71
|
+
- {{field}}: {{rule}}
|
|
72
|
+
{{/each}}
|
|
73
|
+
{{/if}}
|
|
74
|
+
|
|
75
|
+
### Response
|
|
76
|
+
|
|
77
|
+
**Success (200 OK)**:
|
|
78
|
+
```json
|
|
79
|
+
{{response_body_example}}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
**Created (201)**:
|
|
83
|
+
```json
|
|
84
|
+
{
|
|
85
|
+
"id": "{{resource_id}}",
|
|
86
|
+
"message": "Resource created successfully",
|
|
87
|
+
"data": {{response_body_example}}
|
|
88
|
+
}
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
**Error Responses**:
|
|
92
|
+
|
|
93
|
+
```json
|
|
94
|
+
{
|
|
95
|
+
"error": {
|
|
96
|
+
"code": "ERROR_CODE",
|
|
97
|
+
"message": "Human-readable message",
|
|
98
|
+
"details": [
|
|
99
|
+
{
|
|
100
|
+
"field": "field_name",
|
|
101
|
+
"message": "Specific error"
|
|
102
|
+
}
|
|
103
|
+
]
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
**Status Codes**:
|
|
109
|
+
- `200 OK` - Success
|
|
110
|
+
- `201 Created` - Resource created
|
|
111
|
+
- `400 Bad Request` - Invalid input
|
|
112
|
+
- `401 Unauthorized` - Missing/invalid auth
|
|
113
|
+
- `403 Forbidden` - Insufficient permissions
|
|
114
|
+
- `404 Not Found` - Resource not found
|
|
115
|
+
- `429 Too Many Requests` - Rate limit exceeded
|
|
116
|
+
- `500 Internal Server Error` - Server error
|
|
117
|
+
- `503 Service Unavailable` - Temporary unavailability
|
|
118
|
+
|
|
119
|
+
## Technical Requirements
|
|
120
|
+
|
|
121
|
+
### Architecture
|
|
122
|
+
- **Service**: {{service_name}}
|
|
123
|
+
- **Database**: {{database_tables}}
|
|
124
|
+
- **Cache**: {{cache_strategy}}
|
|
125
|
+
- **Message Queue**: {{queue_system}}
|
|
126
|
+
|
|
127
|
+
### Security (2025 Best Practices)
|
|
128
|
+
- [ ] **Authentication**: JWT (JSON Web Tokens) with refresh tokens
|
|
129
|
+
- [ ] **Authorization**: Role-based access control (RBAC)
|
|
130
|
+
- [ ] **Input Validation**: Whitelist approach, sanitize all inputs
|
|
131
|
+
- [ ] **SQL Injection Prevention**: Parameterized queries only
|
|
132
|
+
- [ ] **XSS Prevention**: Content-Type headers, output encoding
|
|
133
|
+
- [ ] **CSRF Protection**: Token-based validation
|
|
134
|
+
- [ ] **HTTPS/TLS**: SSL/TLS 1.3 minimum
|
|
135
|
+
- [ ] **API Keys**: Encrypted storage, rotation policy
|
|
136
|
+
- [ ] **Rate Limiting**: Per-user and per-IP limits
|
|
137
|
+
|
|
138
|
+
### Performance Targets
|
|
139
|
+
- **Response Time**: < 100ms (p50), < 200ms (p95), < 1s (p99)
|
|
140
|
+
- **Throughput**: {{requests_per_second}} req/s
|
|
141
|
+
- **Concurrent Users**: {{concurrent_users}}
|
|
142
|
+
- **Availability**: 99.9% uptime (SLA)
|
|
143
|
+
- **Error Rate**: < 0.1%
|
|
144
|
+
|
|
145
|
+
### Data Model
|
|
146
|
+
```
|
|
147
|
+
{{database_schema}}
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### Dependencies
|
|
151
|
+
- [ ] External APIs: {{external_apis}}
|
|
152
|
+
- [ ] Internal Services: {{internal_services}}
|
|
153
|
+
- [ ] Third-party Libraries: {{libraries}}
|
|
154
|
+
|
|
155
|
+
## Testing Requirements
|
|
156
|
+
|
|
157
|
+
### Unit Tests (TDD - Red-Green-Refactor)
|
|
158
|
+
- [ ] Request validation (all fields)
|
|
159
|
+
- [ ] Business logic (core functionality)
|
|
160
|
+
- [ ] Error handling (all error cases)
|
|
161
|
+
- [ ] Edge cases (boundary conditions)
|
|
162
|
+
- [ ] Mock external dependencies
|
|
163
|
+
|
|
164
|
+
### Integration Tests
|
|
165
|
+
- [ ] Database operations (CRUD)
|
|
166
|
+
- [ ] External API calls
|
|
167
|
+
- [ ] Cache operations
|
|
168
|
+
- [ ] Message queue integration
|
|
169
|
+
- [ ] Authentication flow
|
|
170
|
+
|
|
171
|
+
### E2E Tests
|
|
172
|
+
- [ ] Happy path (complete flow)
|
|
173
|
+
- [ ] Authentication/Authorization
|
|
174
|
+
- [ ] Error scenarios
|
|
175
|
+
- [ ] Rate limiting
|
|
176
|
+
- [ ] Load testing ({{load_test_target}} concurrent users)
|
|
177
|
+
|
|
178
|
+
### Security Tests
|
|
179
|
+
- [ ] Penetration testing
|
|
180
|
+
- [ ] OWASP Top 10 validation
|
|
181
|
+
- [ ] Authentication bypass attempts
|
|
182
|
+
- [ ] SQL injection tests
|
|
183
|
+
- [ ] XSS vulnerability scanning
|
|
184
|
+
|
|
185
|
+
## Success Metrics (SMART Goals)
|
|
186
|
+
|
|
187
|
+
- **Adoption**: {{adoption_target}}% of users within {{adoption_timeframe}}
|
|
188
|
+
- **Performance**: {{performance_target}}ms p95 response time
|
|
189
|
+
- **Reliability**: {{uptime_target}}% uptime
|
|
190
|
+
- **Error Rate**: < {{error_rate_target}}%
|
|
191
|
+
- **User Satisfaction**: {{satisfaction_target}} NPS score
|
|
192
|
+
|
|
193
|
+
## API Documentation
|
|
194
|
+
|
|
195
|
+
### Interactive Documentation
|
|
196
|
+
- [ ] OpenAPI/Swagger UI
|
|
197
|
+
- [ ] Postman Collection
|
|
198
|
+
- [ ] Code examples (cURL, JavaScript, Python)
|
|
199
|
+
- [ ] Authentication guide
|
|
200
|
+
- [ ] Rate limiting documentation
|
|
201
|
+
|
|
202
|
+
### Developer Experience
|
|
203
|
+
- [ ] SDK availability (if applicable)
|
|
204
|
+
- [ ] Versioning strategy (semantic versioning)
|
|
205
|
+
- [ ] Deprecation policy
|
|
206
|
+
- [ ] Migration guides
|
|
207
|
+
|
|
208
|
+
## Implementation Plan
|
|
209
|
+
|
|
210
|
+
### Phase 1: Design & Setup (Week 1)
|
|
211
|
+
- [ ] OpenAPI specification finalized
|
|
212
|
+
- [ ] Database schema design
|
|
213
|
+
- [ ] Security review and approval
|
|
214
|
+
- [ ] Development environment setup
|
|
215
|
+
|
|
216
|
+
### Phase 2: Core Development (Week 2-3)
|
|
217
|
+
- [ ] Write failing tests (TDD Red phase)
|
|
218
|
+
- [ ] Implement endpoint logic (Green phase)
|
|
219
|
+
- [ ] Refactor and optimize (Refactor phase)
|
|
220
|
+
- [ ] Code review and approval
|
|
221
|
+
- [ ] Security scanning
|
|
222
|
+
|
|
223
|
+
### Phase 3: Testing (Week 4)
|
|
224
|
+
- [ ] Integration testing
|
|
225
|
+
- [ ] Load testing ({{load_test_target}} req/s)
|
|
226
|
+
- [ ] Security testing (OWASP)
|
|
227
|
+
- [ ] Performance optimization
|
|
228
|
+
- [ ] Documentation review
|
|
229
|
+
|
|
230
|
+
### Phase 4: Release (Week 5)
|
|
231
|
+
- [ ] Staging deployment
|
|
232
|
+
- [ ] Final QA validation
|
|
233
|
+
- [ ] Production deployment
|
|
234
|
+
- [ ] Monitoring setup (metrics, alerts)
|
|
235
|
+
- [ ] Post-release verification
|
|
236
|
+
|
|
237
|
+
## Monitoring & Observability
|
|
238
|
+
|
|
239
|
+
### Metrics to Track
|
|
240
|
+
- Request rate (req/s)
|
|
241
|
+
- Response time (p50, p95, p99)
|
|
242
|
+
- Error rate (%)
|
|
243
|
+
- Active users
|
|
244
|
+
- Cache hit rate
|
|
245
|
+
|
|
246
|
+
### Logging
|
|
247
|
+
- Request/response logging
|
|
248
|
+
- Error tracking (stack traces)
|
|
249
|
+
- Audit logs (authentication/authorization)
|
|
250
|
+
- Performance profiling
|
|
251
|
+
|
|
252
|
+
### Alerts
|
|
253
|
+
- Error rate > {{error_threshold}}%
|
|
254
|
+
- Response time > {{latency_threshold}}ms
|
|
255
|
+
- Availability < {{availability_threshold}}%
|
|
256
|
+
- Rate limit violations
|
|
257
|
+
|
|
258
|
+
## Rollback Plan
|
|
259
|
+
|
|
260
|
+
### Rollback Triggers
|
|
261
|
+
- Error rate > {{rollback_error_threshold}}%
|
|
262
|
+
- Critical security vulnerability discovered
|
|
263
|
+
- Data corruption detected
|
|
264
|
+
- Performance degradation > {{rollback_perf_threshold}}%
|
|
265
|
+
|
|
266
|
+
### Rollback Procedure
|
|
267
|
+
1. {{rollback_step_1}}
|
|
268
|
+
2. {{rollback_step_2}}
|
|
269
|
+
3. {{rollback_step_3}}
|
|
270
|
+
4. Notify stakeholders
|
|
271
|
+
5. Post-mortem analysis
|
|
272
|
+
|
|
273
|
+
## Risks and Mitigation
|
|
274
|
+
|
|
275
|
+
### Technical Risks
|
|
276
|
+
| Risk | Impact | Probability | Mitigation |
|
|
277
|
+
|------|--------|-------------|------------|
|
|
278
|
+
| {{risk_1}} | {{impact_1}} | {{prob_1}} | {{mitigation_1}} |
|
|
279
|
+
| {{risk_2}} | {{impact_2}} | {{prob_2}} | {{mitigation_2}} |
|
|
280
|
+
|
|
281
|
+
### Business Risks
|
|
282
|
+
| Risk | Impact | Probability | Mitigation |
|
|
283
|
+
|------|--------|-------------|------------|
|
|
284
|
+
| {{business_risk_1}} | {{b_impact_1}} | {{b_prob_1}} | {{b_mitigation_1}} |
|
|
285
|
+
|
|
286
|
+
## Open Questions
|
|
287
|
+
|
|
288
|
+
- [ ] {{question_1}}
|
|
289
|
+
- [ ] {{question_2}}
|
|
290
|
+
- [ ] {{question_3}}
|
|
291
|
+
|
|
292
|
+
## Appendix
|
|
293
|
+
|
|
294
|
+
### References
|
|
295
|
+
- [OpenAPI Specification](https://swagger.io/specification/)
|
|
296
|
+
- [REST API Best Practices 2025](https://stackoverflow.blog/2020/03/02/best-practices-for-rest-api-design/)
|
|
297
|
+
- [JWT Authentication](https://jwt.io/introduction)
|
|
298
|
+
- [OWASP API Security Top 10](https://owasp.org/www-project-api-security/)
|
|
299
|
+
|
|
300
|
+
### Changelog
|
|
301
|
+
- {{timestamp}}: Initial PRD created by {{author}}
|
|
302
|
+
|
|
303
|
+
---
|
|
304
|
+
|
|
305
|
+
*API Feature PRD - Generated from template: api-feature*
|
|
306
|
+
*Template follows 2025 best practices: OpenAPI contract-first, JWT auth, WCAG compliance, TDD methodology*
|