claude-autopm 1.26.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/agents/frameworks/e2e-test-engineer.md +1 -18
- package/autopm/.claude/agents/frameworks/nats-messaging-expert.md +1 -18
- package/autopm/.claude/agents/frameworks/react-frontend-engineer.md +1 -18
- package/autopm/.claude/agents/frameworks/react-ui-expert.md +1 -18
- package/autopm/.claude/agents/frameworks/tailwindcss-expert.md +1 -18
- package/autopm/.claude/agents/frameworks/ux-design-expert.md +1 -18
- package/autopm/.claude/agents/languages/bash-scripting-expert.md +1 -18
- package/autopm/.claude/agents/languages/javascript-frontend-engineer.md +1 -18
- package/autopm/.claude/agents/languages/nodejs-backend-engineer.md +1 -18
- package/autopm/.claude/agents/languages/python-backend-engineer.md +1 -18
- package/autopm/.claude/agents/languages/python-backend-expert.md +1 -18
- package/autopm/.claude/commands/pm/epic-decompose.md +19 -5
- package/autopm/.claude/commands/pm/prd-new.md +14 -1
- package/autopm/.claude/includes/task-creation-excellence.md +18 -0
- package/autopm/.claude/lib/ai-task-generator.js +84 -0
- package/autopm/.claude/lib/cli-parser.js +148 -0
- package/autopm/.claude/lib/dependency-analyzer.js +157 -0
- package/autopm/.claude/lib/frontmatter.js +224 -0
- package/autopm/.claude/lib/task-utils.js +64 -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/scripts/pm-epic-decompose-local.js +158 -0
- package/autopm/.claude/scripts/pm-epic-list-local.js +103 -0
- package/autopm/.claude/scripts/pm-epic-show-local.js +70 -0
- package/autopm/.claude/scripts/pm-epic-update-local.js +56 -0
- package/autopm/.claude/scripts/pm-prd-list-local.js +111 -0
- package/autopm/.claude/scripts/pm-prd-new-local.js +196 -0
- package/autopm/.claude/scripts/pm-prd-parse-local.js +360 -0
- package/autopm/.claude/scripts/pm-prd-show-local.js +101 -0
- package/autopm/.claude/scripts/pm-prd-update-local.js +153 -0
- package/autopm/.claude/scripts/pm-sync-download-local.js +424 -0
- package/autopm/.claude/scripts/pm-sync-upload-local.js +473 -0
- package/autopm/.claude/scripts/pm-task-list-local.js +86 -0
- package/autopm/.claude/scripts/pm-task-show-local.js +92 -0
- package/autopm/.claude/scripts/pm-task-update-local.js +109 -0
- package/autopm/.claude/scripts/setup-local-mode.js +127 -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 +5 -3
- package/scripts/create-task-issues.sh +26 -0
- package/scripts/fix-invalid-command-refs.sh +4 -3
- package/scripts/fix-invalid-refs-simple.sh +8 -3
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Update Local Task
|
|
3
|
+
*
|
|
4
|
+
* Updates task frontmatter and automatically updates epic counters.
|
|
5
|
+
* Optionally validates dependency constraints.
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* const { updateLocalTask } = require('./pm-task-update-local');
|
|
9
|
+
*
|
|
10
|
+
* // Update task status
|
|
11
|
+
* await updateLocalTask('epic-001', 'task-001', { status: 'completed' });
|
|
12
|
+
*
|
|
13
|
+
* // Update with dependency validation
|
|
14
|
+
* await updateLocalTask('epic-001', 'task-002', {
|
|
15
|
+
* status: 'completed',
|
|
16
|
+
* validateDependencies: true
|
|
17
|
+
* });
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
const fs = require('fs').promises;
|
|
21
|
+
const path = require('path');
|
|
22
|
+
const { parseFrontmatter, stringifyFrontmatter } = require('../lib/frontmatter');
|
|
23
|
+
const { showLocalTask } = require('./pm-task-show-local');
|
|
24
|
+
const { listLocalTasks } = require('./pm-task-list-local');
|
|
25
|
+
const { updateLocalEpic } = require('./pm-epic-update-local');
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Update task frontmatter
|
|
29
|
+
*
|
|
30
|
+
* @param {string} epicId - Epic ID containing the task
|
|
31
|
+
* @param {string} taskId - Task ID to update
|
|
32
|
+
* @param {Object} updates - Fields to update
|
|
33
|
+
* @param {boolean} [updates.validateDependencies] - Validate dependencies before update
|
|
34
|
+
* @returns {Promise<Object>} Updated task object
|
|
35
|
+
* @throws {Error} If task not found or dependencies not met
|
|
36
|
+
*/
|
|
37
|
+
async function updateLocalTask(epicId, taskId, updates) {
|
|
38
|
+
const { validateDependencies, ...frontmatterUpdates } = updates;
|
|
39
|
+
|
|
40
|
+
// Get current task
|
|
41
|
+
const task = await showLocalTask(epicId, taskId);
|
|
42
|
+
|
|
43
|
+
// Validate dependencies if requested and status is changing to completed
|
|
44
|
+
if (validateDependencies && frontmatterUpdates.status === 'completed') {
|
|
45
|
+
const dependencies = task.frontmatter.dependencies || [];
|
|
46
|
+
|
|
47
|
+
if (dependencies.length > 0) {
|
|
48
|
+
// Check if all dependencies are completed
|
|
49
|
+
const allTasks = await listLocalTasks(epicId);
|
|
50
|
+
|
|
51
|
+
for (const depId of dependencies) {
|
|
52
|
+
const depTask = allTasks.find(t =>
|
|
53
|
+
t.id === depId ||
|
|
54
|
+
t.id === `task-${epicId}-${depId.replace('task-', '')}` ||
|
|
55
|
+
t.filename === `${depId}.md`
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
if (depTask && depTask.status !== 'completed') {
|
|
59
|
+
throw new Error(
|
|
60
|
+
`Dependencies not met: ${depId} (status: ${depTask.status}) must be completed first`
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// Track if status changed to/from completed
|
|
68
|
+
const oldStatus = task.frontmatter.status;
|
|
69
|
+
const newStatus = frontmatterUpdates.status || oldStatus;
|
|
70
|
+
const statusChanged = oldStatus !== newStatus;
|
|
71
|
+
const wasCompleted = oldStatus === 'completed';
|
|
72
|
+
const nowCompleted = newStatus === 'completed';
|
|
73
|
+
|
|
74
|
+
// Merge updates into frontmatter
|
|
75
|
+
const updatedFrontmatter = {
|
|
76
|
+
...task.frontmatter,
|
|
77
|
+
...frontmatterUpdates
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
// Preserve body content
|
|
81
|
+
const updatedContent = stringifyFrontmatter(updatedFrontmatter, task.body);
|
|
82
|
+
|
|
83
|
+
// Write updated content back to file
|
|
84
|
+
await fs.writeFile(task.path, updatedContent, 'utf8');
|
|
85
|
+
|
|
86
|
+
// Update epic tasks_completed counter if status changed
|
|
87
|
+
if (statusChanged && (wasCompleted || nowCompleted)) {
|
|
88
|
+
const allTasks = await listLocalTasks(epicId);
|
|
89
|
+
const completedCount = allTasks.filter(t => {
|
|
90
|
+
if (t.id === task.frontmatter.id || t.id === updatedFrontmatter.id) {
|
|
91
|
+
return nowCompleted;
|
|
92
|
+
}
|
|
93
|
+
return t.status === 'completed';
|
|
94
|
+
}).length;
|
|
95
|
+
|
|
96
|
+
await updateLocalEpic(epicId, {
|
|
97
|
+
tasks_completed: completedCount
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
return {
|
|
102
|
+
taskId,
|
|
103
|
+
epicId,
|
|
104
|
+
frontmatter: updatedFrontmatter,
|
|
105
|
+
body: task.body
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
module.exports = { updateLocalTask };
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
const fs = require('fs').promises;
|
|
2
|
+
const path = require('path');
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Setup local mode directory structure
|
|
6
|
+
* Creates .claude/prds/, .claude/epics/, .claude/context/, .claude/logs/
|
|
7
|
+
*
|
|
8
|
+
* @returns {Promise<void>}
|
|
9
|
+
*/
|
|
10
|
+
async function setupLocalDirectories() {
|
|
11
|
+
const baseDir = path.join(process.cwd(), '.claude');
|
|
12
|
+
|
|
13
|
+
const directories = [
|
|
14
|
+
'prds', // Product Requirements Documents
|
|
15
|
+
'epics', // Epic definitions and task breakdowns
|
|
16
|
+
'context', // Project context files (NEW)
|
|
17
|
+
'logs' // Verification and operation logs (NEW)
|
|
18
|
+
];
|
|
19
|
+
|
|
20
|
+
for (const dir of directories) {
|
|
21
|
+
const dirPath = path.join(baseDir, dir);
|
|
22
|
+
|
|
23
|
+
try {
|
|
24
|
+
await fs.mkdir(dirPath, { recursive: true, mode: 0o755 });
|
|
25
|
+
console.log(`✅ Created ${dirPath}`);
|
|
26
|
+
} catch (err) {
|
|
27
|
+
// EEXIST is OK - directory already exists
|
|
28
|
+
if (err.code !== 'EEXIST') {
|
|
29
|
+
throw err;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Update .gitignore with ClaudeAutoPM local mode entries
|
|
37
|
+
* Creates .gitignore if it doesn't exist
|
|
38
|
+
* Appends entries if .gitignore exists (idempotent)
|
|
39
|
+
*
|
|
40
|
+
* @returns {Promise<void>}
|
|
41
|
+
*/
|
|
42
|
+
async function updateGitignore() {
|
|
43
|
+
const gitignorePath = path.join(process.cwd(), '.gitignore');
|
|
44
|
+
|
|
45
|
+
const entries = [
|
|
46
|
+
'# ClaudeAutoPM Local Mode',
|
|
47
|
+
'.claude/logs/*.log',
|
|
48
|
+
'.claude/context/.context-version',
|
|
49
|
+
'.claude/prds/drafts/',
|
|
50
|
+
''
|
|
51
|
+
].join('\n');
|
|
52
|
+
|
|
53
|
+
try {
|
|
54
|
+
// Try to read existing .gitignore
|
|
55
|
+
const existing = await fs.readFile(gitignorePath, 'utf8');
|
|
56
|
+
|
|
57
|
+
// Check if our entries are already present
|
|
58
|
+
if (!existing.includes('.claude/logs/')) {
|
|
59
|
+
// Append our entries
|
|
60
|
+
await fs.appendFile(gitignorePath, '\n' + entries);
|
|
61
|
+
console.log('✅ Updated .gitignore');
|
|
62
|
+
} else {
|
|
63
|
+
console.log('ℹ️ .gitignore already contains ClaudeAutoPM entries');
|
|
64
|
+
}
|
|
65
|
+
} catch (err) {
|
|
66
|
+
if (err.code === 'ENOENT') {
|
|
67
|
+
// .gitignore doesn't exist, create it
|
|
68
|
+
await fs.writeFile(gitignorePath, entries);
|
|
69
|
+
console.log('✅ Created .gitignore');
|
|
70
|
+
} else {
|
|
71
|
+
throw err;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Main setup function
|
|
78
|
+
* Called during `autopm install` or standalone
|
|
79
|
+
*
|
|
80
|
+
* @returns {Promise<void>}
|
|
81
|
+
*/
|
|
82
|
+
async function setup() {
|
|
83
|
+
console.log('🚀 Setting up ClaudeAutoPM local mode...\n');
|
|
84
|
+
|
|
85
|
+
try {
|
|
86
|
+
await setupLocalDirectories();
|
|
87
|
+
await updateGitignore();
|
|
88
|
+
|
|
89
|
+
console.log('\n✅ Local mode setup complete!');
|
|
90
|
+
console.log('\nCreated directories:');
|
|
91
|
+
console.log(' - .claude/prds/ (Product Requirements Documents)');
|
|
92
|
+
console.log(' - .claude/epics/ (Epic breakdowns and tasks)');
|
|
93
|
+
console.log(' - .claude/context/ (Project context files)');
|
|
94
|
+
console.log(' - .claude/logs/ (Operation logs)');
|
|
95
|
+
console.log('\nUpdated .gitignore with exclusions for:');
|
|
96
|
+
console.log(' - .claude/logs/*.log');
|
|
97
|
+
console.log(' - .claude/context/.context-version');
|
|
98
|
+
console.log(' - .claude/prds/drafts/');
|
|
99
|
+
console.log('\nYou can now use local mode commands:');
|
|
100
|
+
console.log(' /pm:prd-new --local "Feature Name"');
|
|
101
|
+
console.log(' /pm:epic-decompose --local <id>');
|
|
102
|
+
console.log(' /pm:context-create');
|
|
103
|
+
|
|
104
|
+
} catch (error) {
|
|
105
|
+
console.error('❌ Setup failed:', error.message);
|
|
106
|
+
|
|
107
|
+
// Provide helpful error messages
|
|
108
|
+
if (error.code === 'EACCES') {
|
|
109
|
+
console.error('\nPermission denied. Try running with sudo or check directory permissions.');
|
|
110
|
+
} else if (error.code === 'ENOSPC') {
|
|
111
|
+
console.error('\nNo space left on device. Free up some space and try again.');
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
process.exit(1);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// If run directly (not required as module)
|
|
119
|
+
if (require.main === module) {
|
|
120
|
+
setup();
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
module.exports = {
|
|
124
|
+
setupLocalDirectories,
|
|
125
|
+
updateGitignore,
|
|
126
|
+
setup
|
|
127
|
+
};
|
|
@@ -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*
|