claude-autopm 1.27.0 → 1.28.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 +40 -0
- package/autopm/.claude/scripts/pm/prd-new.js +292 -2
- 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/template-engine.js +347 -0
- package/package.json +1 -1
|
@@ -0,0 +1,344 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Template New - Create custom template
|
|
4
|
+
*
|
|
5
|
+
* Usage:
|
|
6
|
+
* autopm template:new prd my-custom-template
|
|
7
|
+
* autopm template:new epic my-sprint-template
|
|
8
|
+
* autopm template:new task my-task-template
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
const fs = require('fs');
|
|
12
|
+
const path = require('path');
|
|
13
|
+
const { execSync } = require('child_process');
|
|
14
|
+
|
|
15
|
+
// Dynamically resolve template engine path
|
|
16
|
+
let TemplateEngine;
|
|
17
|
+
try {
|
|
18
|
+
TemplateEngine = require(path.join(__dirname, '..', '..', '..', '..', 'lib', 'template-engine'));
|
|
19
|
+
} catch (err) {
|
|
20
|
+
try {
|
|
21
|
+
TemplateEngine = require(path.join(process.cwd(), 'lib', 'template-engine'));
|
|
22
|
+
} catch (err2) {
|
|
23
|
+
TemplateEngine = require('../../../lib/template-engine');
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
class TemplateCreator {
|
|
28
|
+
constructor() {
|
|
29
|
+
this.templateEngine = new TemplateEngine();
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Get base template for type
|
|
34
|
+
*/
|
|
35
|
+
getBaseTemplate(type) {
|
|
36
|
+
const templates = {
|
|
37
|
+
prd: `---
|
|
38
|
+
id: {{id}}
|
|
39
|
+
title: {{title}}
|
|
40
|
+
type: prd
|
|
41
|
+
status: draft
|
|
42
|
+
priority: {{priority}}
|
|
43
|
+
created: {{timestamp}}
|
|
44
|
+
author: {{author}}
|
|
45
|
+
timeline: {{timeline}}
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
# PRD: {{title}}
|
|
49
|
+
|
|
50
|
+
## Executive Summary
|
|
51
|
+
|
|
52
|
+
{{executive_summary}}
|
|
53
|
+
|
|
54
|
+
## Problem Statement
|
|
55
|
+
|
|
56
|
+
### Background
|
|
57
|
+
{{problem_background}}
|
|
58
|
+
|
|
59
|
+
### Current State
|
|
60
|
+
{{current_state}}
|
|
61
|
+
|
|
62
|
+
### Desired State
|
|
63
|
+
{{desired_state}}
|
|
64
|
+
|
|
65
|
+
## Target Users
|
|
66
|
+
|
|
67
|
+
{{target_users}}
|
|
68
|
+
|
|
69
|
+
## Key Features
|
|
70
|
+
|
|
71
|
+
### Must Have (P0)
|
|
72
|
+
{{#if must_have_features}}
|
|
73
|
+
{{#each must_have_features}}
|
|
74
|
+
- [ ] {{this}}
|
|
75
|
+
{{/each}}
|
|
76
|
+
{{/if}}
|
|
77
|
+
|
|
78
|
+
### Should Have (P1)
|
|
79
|
+
{{#if should_have_features}}
|
|
80
|
+
{{#each should_have_features}}
|
|
81
|
+
- [ ] {{this}}
|
|
82
|
+
{{/each}}
|
|
83
|
+
{{/if}}
|
|
84
|
+
|
|
85
|
+
## Success Metrics
|
|
86
|
+
|
|
87
|
+
{{success_metrics}}
|
|
88
|
+
|
|
89
|
+
## Technical Requirements
|
|
90
|
+
|
|
91
|
+
{{technical_requirements}}
|
|
92
|
+
|
|
93
|
+
## Implementation Plan
|
|
94
|
+
|
|
95
|
+
### Phase 1: Design (Week 1)
|
|
96
|
+
- [ ] Requirements finalized
|
|
97
|
+
- [ ] Technical design review
|
|
98
|
+
- [ ] Development environment setup
|
|
99
|
+
|
|
100
|
+
### Phase 2: Development (Week 2-3)
|
|
101
|
+
- [ ] Implement core features
|
|
102
|
+
- [ ] Write tests (TDD)
|
|
103
|
+
- [ ] Code review
|
|
104
|
+
|
|
105
|
+
### Phase 3: Testing (Week 4)
|
|
106
|
+
- [ ] Integration testing
|
|
107
|
+
- [ ] User acceptance testing
|
|
108
|
+
- [ ] Performance testing
|
|
109
|
+
|
|
110
|
+
### Phase 4: Release (Week 5)
|
|
111
|
+
- [ ] Documentation
|
|
112
|
+
- [ ] Deployment
|
|
113
|
+
- [ ] Monitoring setup
|
|
114
|
+
|
|
115
|
+
## Risks and Mitigation
|
|
116
|
+
|
|
117
|
+
{{risks_and_mitigation}}
|
|
118
|
+
|
|
119
|
+
## Open Questions
|
|
120
|
+
|
|
121
|
+
- [ ] {{open_question_1}}
|
|
122
|
+
- [ ] {{open_question_2}}
|
|
123
|
+
|
|
124
|
+
## Appendix
|
|
125
|
+
|
|
126
|
+
### Changelog
|
|
127
|
+
- {{timestamp}}: Initial PRD created by {{author}}
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
*Custom PRD Template*
|
|
132
|
+
`,
|
|
133
|
+
epic: `---
|
|
134
|
+
id: {{id}}
|
|
135
|
+
title: {{title}}
|
|
136
|
+
type: epic
|
|
137
|
+
status: planning
|
|
138
|
+
priority: {{priority}}
|
|
139
|
+
created: {{timestamp}}
|
|
140
|
+
author: {{author}}
|
|
141
|
+
start_date: {{start_date}}
|
|
142
|
+
end_date: {{end_date}}
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
# Epic: {{title}}
|
|
146
|
+
|
|
147
|
+
## Overview
|
|
148
|
+
|
|
149
|
+
{{overview}}
|
|
150
|
+
|
|
151
|
+
## Goals
|
|
152
|
+
|
|
153
|
+
{{#each goals}}
|
|
154
|
+
- {{this}}
|
|
155
|
+
{{/each}}
|
|
156
|
+
|
|
157
|
+
## User Stories
|
|
158
|
+
|
|
159
|
+
{{#each user_stories}}
|
|
160
|
+
- As a {{role}}, I want to {{action}}, so that {{benefit}}
|
|
161
|
+
{{/each}}
|
|
162
|
+
|
|
163
|
+
## Tasks
|
|
164
|
+
|
|
165
|
+
{{#each tasks}}
|
|
166
|
+
- [ ] {{this}}
|
|
167
|
+
{{/each}}
|
|
168
|
+
|
|
169
|
+
## Success Criteria
|
|
170
|
+
|
|
171
|
+
{{success_criteria}}
|
|
172
|
+
|
|
173
|
+
## Dependencies
|
|
174
|
+
|
|
175
|
+
{{dependencies}}
|
|
176
|
+
|
|
177
|
+
---
|
|
178
|
+
|
|
179
|
+
*Custom Epic Template*
|
|
180
|
+
`,
|
|
181
|
+
task: `---
|
|
182
|
+
id: {{id}}
|
|
183
|
+
title: {{title}}
|
|
184
|
+
type: task
|
|
185
|
+
status: todo
|
|
186
|
+
priority: {{priority}}
|
|
187
|
+
created: {{timestamp}}
|
|
188
|
+
author: {{author}}
|
|
189
|
+
assigned_to: {{assigned_to}}
|
|
190
|
+
estimated_hours: {{estimated_hours}}
|
|
191
|
+
---
|
|
192
|
+
|
|
193
|
+
# Task: {{title}}
|
|
194
|
+
|
|
195
|
+
## Description
|
|
196
|
+
|
|
197
|
+
{{description}}
|
|
198
|
+
|
|
199
|
+
## Acceptance Criteria
|
|
200
|
+
|
|
201
|
+
{{#each acceptance_criteria}}
|
|
202
|
+
- [ ] {{this}}
|
|
203
|
+
{{/each}}
|
|
204
|
+
|
|
205
|
+
## Technical Details
|
|
206
|
+
|
|
207
|
+
{{technical_details}}
|
|
208
|
+
|
|
209
|
+
## Testing
|
|
210
|
+
|
|
211
|
+
{{testing_notes}}
|
|
212
|
+
|
|
213
|
+
## Notes
|
|
214
|
+
|
|
215
|
+
{{notes}}
|
|
216
|
+
|
|
217
|
+
---
|
|
218
|
+
|
|
219
|
+
*Custom Task Template*
|
|
220
|
+
`
|
|
221
|
+
};
|
|
222
|
+
|
|
223
|
+
return templates[type] || templates.prd;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* Create new template
|
|
228
|
+
*/
|
|
229
|
+
create(type, name) {
|
|
230
|
+
console.log(`\n📝 Creating Custom Template`);
|
|
231
|
+
console.log(`${'═'.repeat(50)}\n`);
|
|
232
|
+
|
|
233
|
+
// Validate type
|
|
234
|
+
const validTypes = ['prd', 'epic', 'task'];
|
|
235
|
+
if (!validTypes.includes(type)) {
|
|
236
|
+
console.error(`❌ Invalid type: ${type}`);
|
|
237
|
+
console.log(`Valid types: ${validTypes.join(', ')}`);
|
|
238
|
+
return false;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
// Ensure template directory exists
|
|
242
|
+
const typeDir = type === 'prd' ? 'prds' : type === 'epic' ? 'epics' : 'tasks';
|
|
243
|
+
this.templateEngine.ensureTemplateDir(typeDir);
|
|
244
|
+
|
|
245
|
+
const templatePath = path.join('.claude', 'templates', typeDir, `${name}.md`);
|
|
246
|
+
|
|
247
|
+
// Check if template already exists
|
|
248
|
+
if (fs.existsSync(templatePath)) {
|
|
249
|
+
console.error(`❌ Template already exists: ${templatePath}`);
|
|
250
|
+
console.log(`💡 Edit file directly or choose a different name`);
|
|
251
|
+
return false;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
// Get base template
|
|
255
|
+
const baseTemplate = this.getBaseTemplate(type);
|
|
256
|
+
|
|
257
|
+
// Write template file
|
|
258
|
+
fs.writeFileSync(templatePath, baseTemplate);
|
|
259
|
+
|
|
260
|
+
console.log(`✅ Template created: ${templatePath}`);
|
|
261
|
+
console.log(`\n📋 Template Structure:`);
|
|
262
|
+
console.log(` - Frontmatter: Define metadata variables`);
|
|
263
|
+
console.log(` - Variables: Use {{variable_name}} for substitution`);
|
|
264
|
+
console.log(` - Conditionals: {{#if var}}...{{/if}}`);
|
|
265
|
+
console.log(` - Loops: {{#each items}}...{{/each}}`);
|
|
266
|
+
|
|
267
|
+
console.log(`\n🛠️ Next Steps:`);
|
|
268
|
+
console.log(` 1. Edit template: nano ${templatePath}`);
|
|
269
|
+
console.log(` 2. Add custom variables and sections`);
|
|
270
|
+
console.log(` 3. Test template: autopm ${type}:new --template ${name} "Test"`);
|
|
271
|
+
|
|
272
|
+
// Try to open in editor
|
|
273
|
+
this.openInEditor(templatePath);
|
|
274
|
+
|
|
275
|
+
return true;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* Open template in editor
|
|
280
|
+
*/
|
|
281
|
+
openInEditor(templatePath) {
|
|
282
|
+
const editors = ['code', 'nano', 'vim', 'vi'];
|
|
283
|
+
|
|
284
|
+
for (const editor of editors) {
|
|
285
|
+
try {
|
|
286
|
+
// Check if editor exists
|
|
287
|
+
execSync(`which ${editor}`, { stdio: 'ignore' });
|
|
288
|
+
|
|
289
|
+
console.log(`\n📝 Opening in ${editor}...`);
|
|
290
|
+
console.log(` Edit the template, save, and exit`);
|
|
291
|
+
|
|
292
|
+
// Open editor (blocking)
|
|
293
|
+
execSync(`${editor} ${templatePath}`, { stdio: 'inherit' });
|
|
294
|
+
|
|
295
|
+
// Validate template after editing
|
|
296
|
+
const content = fs.readFileSync(templatePath, 'utf8');
|
|
297
|
+
const validation = this.templateEngine.validate(content);
|
|
298
|
+
|
|
299
|
+
if (!validation.valid) {
|
|
300
|
+
console.log(`\n⚠️ Template validation warnings:`);
|
|
301
|
+
validation.errors.forEach(err => console.log(` - ${err}`));
|
|
302
|
+
console.log(`\n💡 These are suggestions. Template will still work.`);
|
|
303
|
+
} else {
|
|
304
|
+
console.log(`\n✅ Template is valid!`);
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
return true;
|
|
308
|
+
} catch (err) {
|
|
309
|
+
// Editor not found, try next
|
|
310
|
+
continue;
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
// No editor found
|
|
315
|
+
console.log(`\n💡 Edit manually: ${templatePath}`);
|
|
316
|
+
return false;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
run(args) {
|
|
320
|
+
if (args.length < 2) {
|
|
321
|
+
console.error('❌ Usage: autopm template:new <type> <name>');
|
|
322
|
+
console.log('\nExamples:');
|
|
323
|
+
console.log(' autopm template:new prd my-custom-prd');
|
|
324
|
+
console.log(' autopm template:new epic my-sprint');
|
|
325
|
+
console.log(' autopm template:new task my-development-task');
|
|
326
|
+
console.log('\nTypes: prd, epic, task');
|
|
327
|
+
process.exit(1);
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
const type = args[0];
|
|
331
|
+
const name = args[1];
|
|
332
|
+
|
|
333
|
+
const success = this.create(type, name);
|
|
334
|
+
process.exit(success ? 0 : 1);
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
// Main execution
|
|
339
|
+
if (require.main === module) {
|
|
340
|
+
const creator = new TemplateCreator();
|
|
341
|
+
creator.run(process.argv.slice(2));
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
module.exports = TemplateCreator;
|
|
@@ -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*
|