claude-autopm 2.8.1 → 2.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (273) hide show
  1. package/README.md +116 -8
  2. package/bin/autopm.js +2 -0
  3. package/bin/commands/plugin.js +395 -0
  4. package/bin/commands/team.js +184 -10
  5. package/install/install.js +223 -4
  6. package/lib/plugins/PluginManager.js +1328 -0
  7. package/lib/plugins/PluginManager.old.js +400 -0
  8. package/package.json +4 -1
  9. package/scripts/publish-plugins.sh +166 -0
  10. package/autopm/.claude/agents/cloud/README.md +0 -55
  11. package/autopm/.claude/agents/cloud/aws-cloud-architect.md +0 -521
  12. package/autopm/.claude/agents/cloud/azure-cloud-architect.md +0 -436
  13. package/autopm/.claude/agents/cloud/gcp-cloud-architect.md +0 -385
  14. package/autopm/.claude/agents/cloud/gcp-cloud-functions-engineer.md +0 -306
  15. package/autopm/.claude/agents/cloud/gemini-api-expert.md +0 -880
  16. package/autopm/.claude/agents/cloud/kubernetes-orchestrator.md +0 -566
  17. package/autopm/.claude/agents/cloud/openai-python-expert.md +0 -1087
  18. package/autopm/.claude/agents/cloud/terraform-infrastructure-expert.md +0 -454
  19. package/autopm/.claude/agents/core/agent-manager.md +0 -296
  20. package/autopm/.claude/agents/core/code-analyzer.md +0 -131
  21. package/autopm/.claude/agents/core/file-analyzer.md +0 -162
  22. package/autopm/.claude/agents/core/test-runner.md +0 -200
  23. package/autopm/.claude/agents/data/airflow-orchestration-expert.md +0 -52
  24. package/autopm/.claude/agents/data/kedro-pipeline-expert.md +0 -50
  25. package/autopm/.claude/agents/data/langgraph-workflow-expert.md +0 -520
  26. package/autopm/.claude/agents/databases/README.md +0 -50
  27. package/autopm/.claude/agents/databases/bigquery-expert.md +0 -392
  28. package/autopm/.claude/agents/databases/cosmosdb-expert.md +0 -368
  29. package/autopm/.claude/agents/databases/mongodb-expert.md +0 -398
  30. package/autopm/.claude/agents/databases/postgresql-expert.md +0 -321
  31. package/autopm/.claude/agents/databases/redis-expert.md +0 -52
  32. package/autopm/.claude/agents/devops/README.md +0 -52
  33. package/autopm/.claude/agents/devops/azure-devops-specialist.md +0 -308
  34. package/autopm/.claude/agents/devops/docker-containerization-expert.md +0 -298
  35. package/autopm/.claude/agents/devops/github-operations-specialist.md +0 -335
  36. package/autopm/.claude/agents/devops/mcp-context-manager.md +0 -319
  37. package/autopm/.claude/agents/devops/observability-engineer.md +0 -574
  38. package/autopm/.claude/agents/devops/ssh-operations-expert.md +0 -1093
  39. package/autopm/.claude/agents/devops/traefik-proxy-expert.md +0 -444
  40. package/autopm/.claude/agents/frameworks/README.md +0 -64
  41. package/autopm/.claude/agents/frameworks/e2e-test-engineer.md +0 -360
  42. package/autopm/.claude/agents/frameworks/nats-messaging-expert.md +0 -254
  43. package/autopm/.claude/agents/frameworks/react-frontend-engineer.md +0 -217
  44. package/autopm/.claude/agents/frameworks/react-ui-expert.md +0 -226
  45. package/autopm/.claude/agents/frameworks/tailwindcss-expert.md +0 -770
  46. package/autopm/.claude/agents/frameworks/ux-design-expert.md +0 -244
  47. package/autopm/.claude/agents/integration/message-queue-engineer.md +0 -794
  48. package/autopm/.claude/agents/languages/README.md +0 -50
  49. package/autopm/.claude/agents/languages/bash-scripting-expert.md +0 -541
  50. package/autopm/.claude/agents/languages/javascript-frontend-engineer.md +0 -197
  51. package/autopm/.claude/agents/languages/nodejs-backend-engineer.md +0 -226
  52. package/autopm/.claude/agents/languages/python-backend-engineer.md +0 -214
  53. package/autopm/.claude/agents/languages/python-backend-expert.md +0 -289
  54. package/autopm/.claude/agents/testing/frontend-testing-engineer.md +0 -395
  55. package/autopm/.claude/commands/ai/langgraph-workflow.md +0 -65
  56. package/autopm/.claude/commands/ai/openai-chat.md +0 -65
  57. package/autopm/.claude/commands/azure/COMMANDS.md +0 -107
  58. package/autopm/.claude/commands/azure/COMMAND_MAPPING.md +0 -252
  59. package/autopm/.claude/commands/azure/INTEGRATION_FIX.md +0 -103
  60. package/autopm/.claude/commands/azure/README.md +0 -246
  61. package/autopm/.claude/commands/azure/active-work.md +0 -198
  62. package/autopm/.claude/commands/azure/aliases.md +0 -143
  63. package/autopm/.claude/commands/azure/blocked-items.md +0 -287
  64. package/autopm/.claude/commands/azure/clean.md +0 -93
  65. package/autopm/.claude/commands/azure/docs-query.md +0 -48
  66. package/autopm/.claude/commands/azure/feature-decompose.md +0 -380
  67. package/autopm/.claude/commands/azure/feature-list.md +0 -61
  68. package/autopm/.claude/commands/azure/feature-new.md +0 -115
  69. package/autopm/.claude/commands/azure/feature-show.md +0 -205
  70. package/autopm/.claude/commands/azure/feature-start.md +0 -130
  71. package/autopm/.claude/commands/azure/fix-integration-example.md +0 -93
  72. package/autopm/.claude/commands/azure/help.md +0 -150
  73. package/autopm/.claude/commands/azure/import-us.md +0 -269
  74. package/autopm/.claude/commands/azure/init.md +0 -211
  75. package/autopm/.claude/commands/azure/next-task.md +0 -262
  76. package/autopm/.claude/commands/azure/search.md +0 -160
  77. package/autopm/.claude/commands/azure/sprint-status.md +0 -235
  78. package/autopm/.claude/commands/azure/standup.md +0 -260
  79. package/autopm/.claude/commands/azure/sync-all.md +0 -99
  80. package/autopm/.claude/commands/azure/task-analyze.md +0 -186
  81. package/autopm/.claude/commands/azure/task-close.md +0 -329
  82. package/autopm/.claude/commands/azure/task-edit.md +0 -145
  83. package/autopm/.claude/commands/azure/task-list.md +0 -263
  84. package/autopm/.claude/commands/azure/task-new.md +0 -84
  85. package/autopm/.claude/commands/azure/task-reopen.md +0 -79
  86. package/autopm/.claude/commands/azure/task-show.md +0 -126
  87. package/autopm/.claude/commands/azure/task-start.md +0 -301
  88. package/autopm/.claude/commands/azure/task-status.md +0 -65
  89. package/autopm/.claude/commands/azure/task-sync.md +0 -67
  90. package/autopm/.claude/commands/azure/us-edit.md +0 -164
  91. package/autopm/.claude/commands/azure/us-list.md +0 -202
  92. package/autopm/.claude/commands/azure/us-new.md +0 -265
  93. package/autopm/.claude/commands/azure/us-parse.md +0 -253
  94. package/autopm/.claude/commands/azure/us-show.md +0 -188
  95. package/autopm/.claude/commands/azure/us-status.md +0 -320
  96. package/autopm/.claude/commands/azure/validate.md +0 -86
  97. package/autopm/.claude/commands/azure/work-item-sync.md +0 -47
  98. package/autopm/.claude/commands/cloud/infra-deploy.md +0 -38
  99. package/autopm/.claude/commands/github/workflow-create.md +0 -42
  100. package/autopm/.claude/commands/infrastructure/ssh-security.md +0 -65
  101. package/autopm/.claude/commands/infrastructure/traefik-setup.md +0 -65
  102. package/autopm/.claude/commands/kubernetes/deploy.md +0 -37
  103. package/autopm/.claude/commands/playwright/test-scaffold.md +0 -38
  104. package/autopm/.claude/commands/pm/blocked.md +0 -28
  105. package/autopm/.claude/commands/pm/clean.md +0 -119
  106. package/autopm/.claude/commands/pm/context-create.md +0 -136
  107. package/autopm/.claude/commands/pm/context-prime.md +0 -170
  108. package/autopm/.claude/commands/pm/context-update.md +0 -292
  109. package/autopm/.claude/commands/pm/context.md +0 -28
  110. package/autopm/.claude/commands/pm/epic-close.md +0 -86
  111. package/autopm/.claude/commands/pm/epic-decompose.md +0 -370
  112. package/autopm/.claude/commands/pm/epic-edit.md +0 -83
  113. package/autopm/.claude/commands/pm/epic-list.md +0 -30
  114. package/autopm/.claude/commands/pm/epic-merge.md +0 -222
  115. package/autopm/.claude/commands/pm/epic-oneshot.md +0 -119
  116. package/autopm/.claude/commands/pm/epic-refresh.md +0 -119
  117. package/autopm/.claude/commands/pm/epic-show.md +0 -28
  118. package/autopm/.claude/commands/pm/epic-split.md +0 -120
  119. package/autopm/.claude/commands/pm/epic-start.md +0 -195
  120. package/autopm/.claude/commands/pm/epic-status.md +0 -28
  121. package/autopm/.claude/commands/pm/epic-sync-modular.md +0 -338
  122. package/autopm/.claude/commands/pm/epic-sync-original.md +0 -473
  123. package/autopm/.claude/commands/pm/epic-sync.md +0 -486
  124. package/autopm/.claude/commands/pm/help.md +0 -28
  125. package/autopm/.claude/commands/pm/import.md +0 -115
  126. package/autopm/.claude/commands/pm/in-progress.md +0 -28
  127. package/autopm/.claude/commands/pm/init.md +0 -28
  128. package/autopm/.claude/commands/pm/issue-analyze.md +0 -202
  129. package/autopm/.claude/commands/pm/issue-close.md +0 -119
  130. package/autopm/.claude/commands/pm/issue-edit.md +0 -93
  131. package/autopm/.claude/commands/pm/issue-reopen.md +0 -87
  132. package/autopm/.claude/commands/pm/issue-show.md +0 -41
  133. package/autopm/.claude/commands/pm/issue-start.md +0 -234
  134. package/autopm/.claude/commands/pm/issue-status.md +0 -95
  135. package/autopm/.claude/commands/pm/issue-sync.md +0 -411
  136. package/autopm/.claude/commands/pm/next.md +0 -28
  137. package/autopm/.claude/commands/pm/prd-edit.md +0 -82
  138. package/autopm/.claude/commands/pm/prd-list.md +0 -28
  139. package/autopm/.claude/commands/pm/prd-new.md +0 -55
  140. package/autopm/.claude/commands/pm/prd-parse.md +0 -42
  141. package/autopm/.claude/commands/pm/prd-status.md +0 -28
  142. package/autopm/.claude/commands/pm/search.md +0 -28
  143. package/autopm/.claude/commands/pm/standup.md +0 -28
  144. package/autopm/.claude/commands/pm/status.md +0 -28
  145. package/autopm/.claude/commands/pm/sync.md +0 -99
  146. package/autopm/.claude/commands/pm/test-reference-update.md +0 -151
  147. package/autopm/.claude/commands/pm/validate.md +0 -28
  148. package/autopm/.claude/commands/pm/what-next.md +0 -28
  149. package/autopm/.claude/commands/python/api-scaffold.md +0 -50
  150. package/autopm/.claude/commands/python/docs-query.md +0 -48
  151. package/autopm/.claude/commands/react/app-scaffold.md +0 -50
  152. package/autopm/.claude/commands/testing/prime.md +0 -314
  153. package/autopm/.claude/commands/testing/run.md +0 -125
  154. package/autopm/.claude/commands/ui/bootstrap-scaffold.md +0 -65
  155. package/autopm/.claude/commands/ui/tailwind-system.md +0 -64
  156. package/autopm/.claude/rules/ai-integration-patterns.md +0 -219
  157. package/autopm/.claude/rules/ci-cd-kubernetes-strategy.md +0 -25
  158. package/autopm/.claude/rules/database-management-strategy.md +0 -17
  159. package/autopm/.claude/rules/database-pipeline.md +0 -94
  160. package/autopm/.claude/rules/devops-troubleshooting-playbook.md +0 -450
  161. package/autopm/.claude/rules/docker-first-development.md +0 -404
  162. package/autopm/.claude/rules/infrastructure-pipeline.md +0 -128
  163. package/autopm/.claude/rules/performance-guidelines.md +0 -403
  164. package/autopm/.claude/rules/ui-development-standards.md +0 -281
  165. package/autopm/.claude/rules/ui-framework-rules.md +0 -151
  166. package/autopm/.claude/rules/ux-design-rules.md +0 -209
  167. package/autopm/.claude/rules/visual-testing.md +0 -223
  168. package/autopm/.claude/scripts/azure/README.md +0 -192
  169. package/autopm/.claude/scripts/azure/active-work.js +0 -524
  170. package/autopm/.claude/scripts/azure/active-work.sh +0 -20
  171. package/autopm/.claude/scripts/azure/blocked.js +0 -520
  172. package/autopm/.claude/scripts/azure/blocked.sh +0 -20
  173. package/autopm/.claude/scripts/azure/daily.js +0 -533
  174. package/autopm/.claude/scripts/azure/daily.sh +0 -20
  175. package/autopm/.claude/scripts/azure/dashboard.js +0 -970
  176. package/autopm/.claude/scripts/azure/dashboard.sh +0 -20
  177. package/autopm/.claude/scripts/azure/feature-list.js +0 -254
  178. package/autopm/.claude/scripts/azure/feature-list.sh +0 -20
  179. package/autopm/.claude/scripts/azure/feature-show.js +0 -7
  180. package/autopm/.claude/scripts/azure/feature-show.sh +0 -20
  181. package/autopm/.claude/scripts/azure/feature-status.js +0 -604
  182. package/autopm/.claude/scripts/azure/feature-status.sh +0 -20
  183. package/autopm/.claude/scripts/azure/help.js +0 -342
  184. package/autopm/.claude/scripts/azure/help.sh +0 -20
  185. package/autopm/.claude/scripts/azure/next-task.js +0 -508
  186. package/autopm/.claude/scripts/azure/next-task.sh +0 -20
  187. package/autopm/.claude/scripts/azure/search.js +0 -469
  188. package/autopm/.claude/scripts/azure/search.sh +0 -20
  189. package/autopm/.claude/scripts/azure/setup.js +0 -745
  190. package/autopm/.claude/scripts/azure/setup.sh +0 -20
  191. package/autopm/.claude/scripts/azure/sprint-report.js +0 -1012
  192. package/autopm/.claude/scripts/azure/sprint-report.sh +0 -20
  193. package/autopm/.claude/scripts/azure/sync.js +0 -563
  194. package/autopm/.claude/scripts/azure/sync.sh +0 -20
  195. package/autopm/.claude/scripts/azure/us-list.js +0 -210
  196. package/autopm/.claude/scripts/azure/us-list.sh +0 -20
  197. package/autopm/.claude/scripts/azure/us-status.js +0 -238
  198. package/autopm/.claude/scripts/azure/us-status.sh +0 -20
  199. package/autopm/.claude/scripts/azure/validate.js +0 -626
  200. package/autopm/.claude/scripts/azure/validate.sh +0 -20
  201. package/autopm/.claude/scripts/azure/wrapper-template.sh +0 -20
  202. package/autopm/.claude/scripts/github/dependency-tracker.js +0 -554
  203. package/autopm/.claude/scripts/github/dependency-validator.js +0 -545
  204. package/autopm/.claude/scripts/github/dependency-visualizer.js +0 -477
  205. package/autopm/.claude/scripts/pm/analytics.js +0 -425
  206. package/autopm/.claude/scripts/pm/blocked.js +0 -164
  207. package/autopm/.claude/scripts/pm/blocked.sh +0 -78
  208. package/autopm/.claude/scripts/pm/clean.js +0 -464
  209. package/autopm/.claude/scripts/pm/context-create.js +0 -216
  210. package/autopm/.claude/scripts/pm/context-prime.js +0 -335
  211. package/autopm/.claude/scripts/pm/context-update.js +0 -344
  212. package/autopm/.claude/scripts/pm/context.js +0 -338
  213. package/autopm/.claude/scripts/pm/epic-close.js +0 -347
  214. package/autopm/.claude/scripts/pm/epic-edit.js +0 -382
  215. package/autopm/.claude/scripts/pm/epic-list.js +0 -273
  216. package/autopm/.claude/scripts/pm/epic-list.sh +0 -109
  217. package/autopm/.claude/scripts/pm/epic-show.js +0 -291
  218. package/autopm/.claude/scripts/pm/epic-show.sh +0 -105
  219. package/autopm/.claude/scripts/pm/epic-split.js +0 -522
  220. package/autopm/.claude/scripts/pm/epic-start/epic-start.js +0 -183
  221. package/autopm/.claude/scripts/pm/epic-start/epic-start.sh +0 -94
  222. package/autopm/.claude/scripts/pm/epic-status.js +0 -291
  223. package/autopm/.claude/scripts/pm/epic-status.sh +0 -104
  224. package/autopm/.claude/scripts/pm/epic-sync/README.md +0 -208
  225. package/autopm/.claude/scripts/pm/epic-sync/create-epic-issue.sh +0 -77
  226. package/autopm/.claude/scripts/pm/epic-sync/create-task-issues.sh +0 -86
  227. package/autopm/.claude/scripts/pm/epic-sync/update-epic-file.sh +0 -79
  228. package/autopm/.claude/scripts/pm/epic-sync/update-references.sh +0 -89
  229. package/autopm/.claude/scripts/pm/epic-sync.sh +0 -137
  230. package/autopm/.claude/scripts/pm/help.js +0 -92
  231. package/autopm/.claude/scripts/pm/help.sh +0 -90
  232. package/autopm/.claude/scripts/pm/in-progress.js +0 -178
  233. package/autopm/.claude/scripts/pm/in-progress.sh +0 -93
  234. package/autopm/.claude/scripts/pm/init.js +0 -321
  235. package/autopm/.claude/scripts/pm/init.sh +0 -178
  236. package/autopm/.claude/scripts/pm/issue-close.js +0 -232
  237. package/autopm/.claude/scripts/pm/issue-edit.js +0 -310
  238. package/autopm/.claude/scripts/pm/issue-show.js +0 -272
  239. package/autopm/.claude/scripts/pm/issue-start.js +0 -181
  240. package/autopm/.claude/scripts/pm/issue-sync/format-comment.sh +0 -468
  241. package/autopm/.claude/scripts/pm/issue-sync/gather-updates.sh +0 -460
  242. package/autopm/.claude/scripts/pm/issue-sync/post-comment.sh +0 -330
  243. package/autopm/.claude/scripts/pm/issue-sync/preflight-validation.sh +0 -348
  244. package/autopm/.claude/scripts/pm/issue-sync/update-frontmatter.sh +0 -387
  245. package/autopm/.claude/scripts/pm/lib/README.md +0 -85
  246. package/autopm/.claude/scripts/pm/lib/epic-discovery.js +0 -119
  247. package/autopm/.claude/scripts/pm/lib/logger.js +0 -78
  248. package/autopm/.claude/scripts/pm/next.js +0 -189
  249. package/autopm/.claude/scripts/pm/next.sh +0 -72
  250. package/autopm/.claude/scripts/pm/optimize.js +0 -407
  251. package/autopm/.claude/scripts/pm/pr-create.js +0 -337
  252. package/autopm/.claude/scripts/pm/pr-list.js +0 -257
  253. package/autopm/.claude/scripts/pm/prd-list.js +0 -242
  254. package/autopm/.claude/scripts/pm/prd-list.sh +0 -103
  255. package/autopm/.claude/scripts/pm/prd-new.js +0 -684
  256. package/autopm/.claude/scripts/pm/prd-parse.js +0 -547
  257. package/autopm/.claude/scripts/pm/prd-status.js +0 -152
  258. package/autopm/.claude/scripts/pm/prd-status.sh +0 -63
  259. package/autopm/.claude/scripts/pm/release.js +0 -460
  260. package/autopm/.claude/scripts/pm/search.js +0 -192
  261. package/autopm/.claude/scripts/pm/search.sh +0 -89
  262. package/autopm/.claude/scripts/pm/standup.js +0 -362
  263. package/autopm/.claude/scripts/pm/standup.sh +0 -95
  264. package/autopm/.claude/scripts/pm/status.js +0 -148
  265. package/autopm/.claude/scripts/pm/status.sh +0 -59
  266. package/autopm/.claude/scripts/pm/sync-batch.js +0 -337
  267. package/autopm/.claude/scripts/pm/sync.js +0 -343
  268. package/autopm/.claude/scripts/pm/template-list.js +0 -141
  269. package/autopm/.claude/scripts/pm/template-new.js +0 -366
  270. package/autopm/.claude/scripts/pm/validate.js +0 -274
  271. package/autopm/.claude/scripts/pm/validate.sh +0 -106
  272. package/autopm/.claude/scripts/pm/what-next.js +0 -660
  273. package/bin/node/azure-feature-show.js +0 -7
@@ -1,684 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * PRD New - Launch brainstorming for new product requirement
4
- *
5
- * Supports:
6
- * - Template-based creation (--template flag)
7
- * - Interactive template selection
8
- * - Traditional brainstorming mode (backwards compatible)
9
- */
10
-
11
- const fs = require('fs');
12
- const path = require('path');
13
- const readline = require('readline');
14
-
15
- // Dynamically resolve template engine path
16
- // This works both in installed projects and during testing
17
- let TemplateEngine;
18
- try {
19
- // Try from project root (where lib/ is installed)
20
- TemplateEngine = require(path.join(process.cwd(), 'lib', 'template-engine'));
21
- } catch (err) {
22
- try {
23
- // Try relative path from .claude/scripts/pm/ (during development)
24
- TemplateEngine = require(path.join(__dirname, '..', '..', '..', '..', 'lib', 'template-engine'));
25
- } catch (err2) {
26
- // Fallback: try from AutoPM global installation
27
- try {
28
- const { execSync } = require('child_process');
29
- const os = require('os');
30
- // Check if npm is available
31
- let npmExists = false;
32
- try {
33
- if (os.platform() === 'win32') {
34
- execSync('where npm', { stdio: 'ignore' });
35
- } else {
36
- execSync('which npm', { stdio: 'ignore' });
37
- }
38
- npmExists = true;
39
- } catch (checkErr) {
40
- npmExists = false;
41
- }
42
- if (!npmExists) {
43
- throw new Error('npm is not installed or not found in PATH. Please install npm to use global template-engine.');
44
- }
45
- let npmRoot;
46
- try {
47
- npmRoot = execSync('npm root -g', { encoding: 'utf-8' }).trim();
48
- } catch (npmErr) {
49
- throw new Error('Failed to execute "npm root -g". Please check your npm installation.');
50
- }
51
- TemplateEngine = require(path.join(npmRoot, 'claude-autopm', 'lib', 'template-engine'));
52
- } catch (err3) {
53
- throw new Error('Cannot find template-engine module. Please ensure lib/ directory is installed. Details: ' + err3.message);
54
- }
55
- }
56
- }
57
-
58
- class PrdCreator {
59
- constructor() {
60
- this.prdsDir = path.join('.claude', 'prds');
61
- this.templatesDir = path.join(__dirname, '..', '..', 'templates');
62
- this.templateEngine = new TemplateEngine();
63
- }
64
-
65
- /**
66
- * Create PRD from template
67
- */
68
- async createPrdFromTemplate(prdName, templateName) {
69
- console.log(`\nšŸš€ Creating PRD from Template: ${templateName}`);
70
- console.log(`${'═'.repeat(50)}\n`);
71
-
72
- // Ensure PRDs directory exists
73
- if (!fs.existsSync(this.prdsDir)) {
74
- fs.mkdirSync(this.prdsDir, { recursive: true });
75
- }
76
-
77
- // Check if PRD already exists
78
- const prdFile = path.join(this.prdsDir, `${prdName}.md`);
79
- if (fs.existsSync(prdFile)) {
80
- console.error(`āŒ PRD already exists: ${prdName}`);
81
- console.log(`šŸ’” Edit file: .claude/prds/${prdName}.md`);
82
- return false;
83
- }
84
-
85
- // Find template
86
- const templatePath = this.templateEngine.findTemplate('prds', templateName);
87
- if (!templatePath) {
88
- console.error(`āŒ Template not found: ${templateName}`);
89
- console.log(`šŸ’” List available templates: autopm template:list`);
90
- return false;
91
- }
92
-
93
- // Read template to find required variables
94
- const templateContent = fs.readFileSync(templatePath, 'utf8');
95
- const requiredVars = this.extractTemplateVariables(templateContent);
96
-
97
- // Prompt for variables
98
- const rl = readline.createInterface({
99
- input: process.stdin,
100
- output: process.stdout
101
- });
102
-
103
- const prompt = (question) => new Promise((resolve) => {
104
- rl.question(question, resolve);
105
- });
106
-
107
- try {
108
- console.log(`šŸ“‹ Template: ${templateName}`);
109
- console.log(`Fill in the following details:\n`);
110
-
111
- const variables = {
112
- title: prdName.split('-').map(w => w.charAt(0).toUpperCase() + w.slice(1)).join(' '),
113
- type: 'prd'
114
- };
115
-
116
- // Prompt for common variables
117
- const title = await prompt(`Title [${variables.title}]: `);
118
- if (title) variables.title = title;
119
-
120
- const priority = await prompt('Priority (P0/P1/P2/P3) [P2]: ');
121
- variables.priority = priority || 'P2';
122
-
123
- const timeline = await prompt('Timeline [TBD]: ');
124
- variables.timeline = timeline || 'TBD';
125
-
126
- // Prompt for template-specific variables
127
- const templateSpecific = this.getTemplateSpecificPrompts(templateName);
128
- for (const varName of templateSpecific) {
129
- if (!variables[varName]) {
130
- const value = await prompt(`${varName.replace(/_/g, ' ')}: `);
131
- variables[varName] = value || '';
132
- }
133
- }
134
-
135
- // Render template
136
- const rendered = this.templateEngine.renderFile(templatePath, variables);
137
-
138
- // Write PRD file
139
- fs.writeFileSync(prdFile, rendered);
140
-
141
- console.log('\nāœ… PRD created successfully!');
142
- console.log(`šŸ“„ File: ${prdFile}`);
143
-
144
- // Show next steps
145
- this.showNextSteps(prdName);
146
-
147
- return true;
148
- } finally {
149
- rl.close();
150
- }
151
- }
152
-
153
- /**
154
- * Extract variables from template
155
- */
156
- extractTemplateVariables(template) {
157
- const varRegex = /\{\{(\w+)\}\}/g;
158
- const vars = new Set();
159
- let match;
160
-
161
- while ((match = varRegex.exec(template)) !== null) {
162
- vars.add(match[1]);
163
- }
164
-
165
- // Remove auto-generated variables
166
- vars.delete('id');
167
- vars.delete('timestamp');
168
- vars.delete('date');
169
- vars.delete('author');
170
-
171
- return Array.from(vars);
172
- }
173
-
174
- /**
175
- * Get template-specific prompts
176
- */
177
- getTemplateSpecificPrompts(templateName) {
178
- const prompts = {
179
- 'api-feature': [
180
- 'api_purpose',
181
- 'problem',
182
- 'business_value',
183
- 'http_method',
184
- 'api_endpoint',
185
- 'auth_method',
186
- 'rate_limit',
187
- 'user_role',
188
- 'api_action',
189
- 'user_benefit'
190
- ],
191
- 'ui-feature': [
192
- 'component_type',
193
- 'feature_purpose',
194
- 'problem',
195
- 'user_need',
196
- 'user_goal',
197
- 'user_role',
198
- 'user_action',
199
- 'user_benefit'
200
- ],
201
- 'bug-fix': [
202
- 'bug_summary',
203
- 'severity',
204
- 'user_impact',
205
- 'step_1',
206
- 'step_2',
207
- 'step_3',
208
- 'expected_behavior',
209
- 'actual_behavior',
210
- 'root_cause',
211
- 'solution_approach'
212
- ],
213
- 'data-migration': [
214
- 'migration_purpose',
215
- 'current_state',
216
- 'desired_state',
217
- 'affected_tables',
218
- 'data_volume',
219
- 'migration_strategy'
220
- ],
221
- 'documentation': [
222
- 'doc_type',
223
- 'target_audience',
224
- 'documentation_scope',
225
- 'current_gaps'
226
- ]
227
- };
228
-
229
- return prompts[templateName] || [];
230
- }
231
-
232
- /**
233
- * Show interactive template selection
234
- */
235
- async selectTemplate() {
236
- const templates = this.templateEngine.listTemplates('prds');
237
-
238
- if (templates.length === 0) {
239
- console.log('No templates available');
240
- return null;
241
- }
242
-
243
- console.log('\nšŸ“‹ Available Templates:');
244
-
245
- const builtIn = templates.filter(t => !t.custom);
246
- const custom = templates.filter(t => t.custom);
247
-
248
- let index = 1;
249
- const options = [];
250
-
251
- builtIn.forEach(t => {
252
- const description = this.getTemplateDescription(t.name);
253
- console.log(`${index}. ${t.name.padEnd(20)} - ${description}`);
254
- options.push(t.name);
255
- index++;
256
- });
257
-
258
- if (custom.length > 0) {
259
- console.log('\nCustom Templates:');
260
- custom.forEach(t => {
261
- console.log(`${index}. ${t.name.padEnd(20)} - [Custom]`);
262
- options.push(t.name);
263
- index++;
264
- });
265
- }
266
-
267
- console.log(`${index}. none${' '.repeat(20)} - Create empty PRD\n`);
268
- options.push('none');
269
-
270
- const rl = readline.createInterface({
271
- input: process.stdin,
272
- output: process.stdout
273
- });
274
-
275
- const prompt = (question) => new Promise((resolve) => {
276
- rl.question(question, resolve);
277
- });
278
-
279
- try {
280
- const selection = await prompt(`Select template (1-${options.length}): `);
281
- const selectionNum = parseInt(selection, 10);
282
-
283
- if (selectionNum < 1 || selectionNum > options.length) {
284
- console.error('Invalid selection');
285
- return null;
286
- }
287
-
288
- return options[selectionNum - 1];
289
- } finally {
290
- rl.close();
291
- }
292
- }
293
-
294
- /**
295
- * Get template description
296
- */
297
- getTemplateDescription(templateName) {
298
- const descriptions = {
299
- 'api-feature': 'REST/GraphQL API development',
300
- 'ui-feature': 'Frontend component/page',
301
- 'bug-fix': 'Bug resolution workflow',
302
- 'data-migration': 'Database schema changes',
303
- 'documentation': 'Documentation updates'
304
- };
305
-
306
- return descriptions[templateName] || 'Template';
307
- }
308
-
309
- async createPrd(prdName) {
310
- console.log(`\nšŸš€ Creating New PRD: ${prdName}`);
311
- console.log(`${'═'.repeat(50)}\n`);
312
-
313
- // Ensure PRDs directory exists
314
- if (!fs.existsSync(this.prdsDir)) {
315
- fs.mkdirSync(this.prdsDir, { recursive: true });
316
- }
317
-
318
- // Check if PRD already exists
319
- const prdFile = path.join(this.prdsDir, `${prdName}.md`);
320
- if (fs.existsSync(prdFile)) {
321
- console.error(`āŒ PRD already exists: ${prdName}`);
322
- console.log(`šŸ’” Edit file: .claude/prds/${prdName}.md`);
323
- return false;
324
- }
325
-
326
- // Create interface for brainstorming
327
- const rl = readline.createInterface({
328
- input: process.stdin,
329
- output: process.stdout
330
- });
331
-
332
- const prompt = (question) => new Promise((resolve) => {
333
- rl.question(question, resolve);
334
- });
335
-
336
- try {
337
- console.log('🧠 Let\'s brainstorm your product requirement!\n');
338
-
339
- // Gather information
340
- const prdData = {};
341
-
342
- // Product Vision
343
- console.log('šŸ“Œ Product Vision');
344
- console.log('What problem are you trying to solve? What\'s the vision?');
345
- prdData.vision = await prompt('Vision: ');
346
-
347
- // Target Users
348
- console.log('\nšŸ‘„ Target Users');
349
- console.log('Who will use this feature? What are their needs?');
350
- prdData.users = await prompt('Target users: ');
351
-
352
- // Key Features
353
- console.log('\n✨ Key Features');
354
- console.log('What are the main features? (enter one per line, empty line to finish)');
355
- prdData.features = [];
356
- let feature;
357
- while ((feature = await prompt('Feature: ')) !== '') {
358
- prdData.features.push(feature);
359
- }
360
-
361
- // Success Metrics
362
- console.log('\nšŸ“Š Success Metrics');
363
- console.log('How will you measure success?');
364
- prdData.metrics = await prompt('Success metrics: ');
365
-
366
- // Technical Considerations
367
- console.log('\nšŸ”§ Technical Considerations');
368
- console.log('Any technical constraints or requirements?');
369
- prdData.technical = await prompt('Technical notes: ');
370
-
371
- // Priority
372
- console.log('\nšŸŽÆ Priority');
373
- console.log('What\'s the priority? (P0=Critical, P1=High, P2=Medium, P3=Low)');
374
- prdData.priority = await prompt('Priority (P0/P1/P2/P3): ') || 'P2';
375
-
376
- // Timeline
377
- console.log('\nā° Timeline');
378
- console.log('When should this be delivered?');
379
- prdData.timeline = await prompt('Timeline: ');
380
-
381
- // Generate PRD
382
- const prdContent = this.generatePrdContent(prdName, prdData);
383
-
384
- // Write PRD file
385
- fs.writeFileSync(prdFile, prdContent);
386
-
387
- console.log('\nāœ… PRD created successfully!');
388
- console.log(`šŸ“„ File: ${prdFile}`);
389
-
390
- // Show comprehensive next steps
391
- this.showNextSteps(prdName);
392
-
393
- } finally {
394
- rl.close();
395
- }
396
-
397
- return true;
398
- }
399
-
400
- showNextSteps(prdName) {
401
- console.log('\n' + '═'.repeat(60));
402
- console.log('šŸ“‹ What You Can Do Next:');
403
- console.log('═'.repeat(60) + '\n');
404
-
405
- console.log('šŸŽÆ Option 1: Quick Start (Recommended for Simple Features)');
406
- console.log(' One command to parse, decompose, and sync to GitHub:');
407
- console.log(` /pm:epic-oneshot ${prdName}`);
408
- console.log(' ✨ This creates epic + tasks + GitHub issues automatically\n');
409
-
410
- console.log('šŸ”€ Option 2: Split into Multiple Epics (For Complex Features)');
411
- console.log(' Break down large PRD into focused sub-epics:');
412
- console.log(` /pm:prd-split ${prdName}`);
413
- console.log(' Example: payment-system → backend, frontend, security');
414
- console.log(' šŸ“š See README section "Splitting Large PRDs into Multiple Epics"\n');
415
-
416
- console.log('šŸ› ļø Option 3: Step-by-Step Workflow (Full Control)');
417
- console.log(' a) Convert PRD to epic:');
418
- console.log(` /pm:prd-parse ${prdName}`);
419
- console.log(' b) Break epic into tasks:');
420
- console.log(` /pm:epic-decompose ${prdName}`);
421
- console.log(' c) Push to GitHub/Azure:');
422
- console.log(` /pm:epic-sync ${prdName}\n`);
423
-
424
- console.log('šŸ“ Option 4: Review & Edit First');
425
- console.log(' Review and refine the PRD before processing:');
426
- console.log(` nano .claude/prds/${prdName}.md`);
427
- console.log(' Then use any option above\n');
428
-
429
- console.log('šŸ“Š Option 5: Check Status');
430
- console.log(' View PRD and track progress:');
431
- console.log(` /pm:prd-status ${prdName}\n`);
432
-
433
- console.log(`šŸ’” Don't know which to choose?`);
434
- console.log(' • Small feature (< 10 tasks)? → Use Option 1 (/pm:epic-oneshot)');
435
- console.log(' • Large feature (15+ tasks)? → Use Option 2 (/pm:prd-split)');
436
- console.log(' • Need full control? → Use Option 3 (step-by-step)');
437
- console.log('');
438
- }
439
-
440
- generatePrdContent(name, data) {
441
- const timestamp = new Date().toISOString();
442
- const author = process.env.USER || 'unknown';
443
-
444
- return `# PRD: ${name}
445
-
446
- ---
447
- status: draft
448
- priority: ${data.priority}
449
- created: ${timestamp}
450
- author: ${author}
451
- timeline: ${data.timeline || 'TBD'}
452
- ---
453
-
454
- ## Executive Summary
455
-
456
- ${data.vision || 'Product vision to be defined...'}
457
-
458
- ## Problem Statement
459
-
460
- ### Background
461
- ${data.vision ? `The need for this feature arises from: ${data.vision}` : 'Context and background to be added...'}
462
-
463
- ### Current State
464
- - Current limitations and pain points
465
- - Existing workarounds users employ
466
- - Impact on user experience
467
-
468
- ### Desired State
469
- - How the solution will address the problem
470
- - Expected improvements and benefits
471
- - Success criteria
472
-
473
- ## Target Users
474
-
475
- ${data.users || 'Target user segments to be defined...'}
476
-
477
- ### User Personas
478
- - **Primary Users**: Core user segment
479
- - **Secondary Users**: Additional beneficiaries
480
- - **Stakeholders**: Indirect beneficiaries
481
-
482
- ### User Stories
483
- ${data.features.length > 0 ? data.features.map(f => `- As a user, I want to ${f}`).join('\n') : '- User stories to be defined...'}
484
-
485
- ## Key Features
486
-
487
- ### Must Have (P0)
488
- ${data.features.length > 0 ? data.features.slice(0, 3).map(f => `- [ ] ${f}`).join('\n') : '- [ ] Core feature 1\n- [ ] Core feature 2'}
489
-
490
- ### Should Have (P1)
491
- ${data.features.length > 3 ? data.features.slice(3, 6).map(f => `- [ ] ${f}`).join('\n') : '- [ ] Additional feature 1\n- [ ] Additional feature 2'}
492
-
493
- ### Nice to Have (P2)
494
- ${data.features.length > 6 ? data.features.slice(6).map(f => `- [ ] ${f}`).join('\n') : '- [ ] Enhancement 1\n- [ ] Enhancement 2'}
495
-
496
- ## Success Metrics
497
-
498
- ${data.metrics || 'Success metrics to be defined...'}
499
-
500
- ### Key Performance Indicators (KPIs)
501
- - **Adoption Rate**: Target percentage of users adopting the feature
502
- - **User Satisfaction**: Target NPS or satisfaction score
503
- - **Performance**: Response time, throughput targets
504
- - **Quality**: Bug rate, error rate targets
505
-
506
- ### Measurement Plan
507
- - How metrics will be collected
508
- - Reporting frequency
509
- - Success thresholds
510
-
511
- ## Technical Requirements
512
-
513
- ${data.technical || 'Technical requirements to be specified...'}
514
-
515
- ### Architecture Considerations
516
- - System components affected
517
- - Integration points
518
- - Data flow and storage
519
-
520
- ### Non-Functional Requirements
521
- - **Performance**: Response time < 200ms
522
- - **Scalability**: Support for X concurrent users
523
- - **Security**: Authentication, authorization requirements
524
- - **Reliability**: 99.9% uptime target
525
-
526
- ### Dependencies
527
- - External services or APIs
528
- - Internal systems or components
529
- - Third-party libraries or tools
530
-
531
- ## Implementation Plan
532
-
533
- ### Phase 1: Foundation (Week 1-2)
534
- - [ ] Technical design review
535
- - [ ] Set up development environment
536
- - [ ] Create initial architecture
537
-
538
- ### Phase 2: Core Features (Week 3-4)
539
- - [ ] Implement must-have features
540
- - [ ] Initial testing
541
- - [ ] Code review
542
-
543
- ### Phase 3: Enhancement (Week 5-6)
544
- - [ ] Implement should-have features
545
- - [ ] Integration testing
546
- - [ ] Performance optimization
547
-
548
- ### Phase 4: Release (Week 7-8)
549
- - [ ] Final testing
550
- - [ ] Documentation
551
- - [ ] Deployment
552
-
553
- ## Risks and Mitigation
554
-
555
- ### Technical Risks
556
- - **Risk 1**: Description and mitigation strategy
557
- - **Risk 2**: Description and mitigation strategy
558
-
559
- ### Business Risks
560
- - **Risk 1**: Impact and contingency plan
561
- - **Risk 2**: Impact and contingency plan
562
-
563
- ## Open Questions
564
-
565
- - [ ] Question 1 requiring clarification
566
- - [ ] Question 2 needing stakeholder input
567
- - [ ] Question 3 for technical investigation
568
-
569
- ## Appendix
570
-
571
- ### References
572
- - Related documentation
573
- - Previous PRDs
574
- - Market research
575
-
576
- ### Glossary
577
- - Term definitions
578
- - Acronym explanations
579
-
580
- ### Changelog
581
- - ${timestamp}: Initial PRD created by ${author}
582
-
583
- ---
584
-
585
- *This PRD is a living document. Updates should be tracked in the changelog section.*
586
- `;
587
- }
588
-
589
- listExistingPrds() {
590
- if (fs.existsSync(this.prdsDir)) {
591
- const prds = fs.readdirSync(this.prdsDir)
592
- .filter(f => f.endsWith('.md'))
593
- .map(f => f.replace('.md', ''));
594
-
595
- if (prds.length > 0) {
596
- console.log('\nšŸ“‹ Existing PRDs:');
597
- prds.forEach(prd => {
598
- const prdFile = path.join(this.prdsDir, `${prd}.md`);
599
- const content = fs.readFileSync(prdFile, 'utf8');
600
- const priorityMatch = content.match(/priority: (P\d)/);
601
- const statusMatch = content.match(/status: (\w+)/);
602
-
603
- const priority = priorityMatch ? priorityMatch[1] : 'P2';
604
- const status = statusMatch ? statusMatch[1] : 'draft';
605
-
606
- console.log(` • ${prd} [${priority}] (${status})`);
607
- });
608
- } else {
609
- console.log(' No PRDs found');
610
- }
611
- }
612
- }
613
-
614
- async run(args) {
615
- // Parse arguments
616
- let prdName = null;
617
- let templateName = null;
618
-
619
- // Check for --template or -t flag
620
- for (let i = 0; i < args.length; i++) {
621
- if (args[i] === '--template' || args[i] === '-t') {
622
- templateName = args[i + 1];
623
- i++; // Skip next arg
624
- } else if (!prdName) {
625
- prdName = args[i];
626
- }
627
- }
628
-
629
- if (!prdName) {
630
- // Interactive mode
631
- const rl = readline.createInterface({
632
- input: process.stdin,
633
- output: process.stdout
634
- });
635
-
636
- const prompt = (question) => new Promise((resolve) => {
637
- rl.question(question, resolve);
638
- });
639
-
640
- console.log('\nšŸš€ PRD Creation Wizard');
641
- console.log(`${'═'.repeat(50)}`);
642
-
643
- this.listExistingPrds();
644
-
645
- console.log('\n');
646
- prdName = await prompt('Enter PRD name (use-kebab-case): ');
647
- rl.close();
648
-
649
- if (!prdName) {
650
- console.error('āŒ Error: PRD name required');
651
- process.exit(1);
652
- }
653
-
654
- // Ask for template if not provided
655
- if (!templateName) {
656
- templateName = await this.selectTemplate();
657
- }
658
- }
659
-
660
- // Sanitize PRD name
661
- prdName = prdName.toLowerCase().replace(/[^a-z0-9-]/g, '-');
662
-
663
- // Create PRD from template or traditional mode
664
- let success;
665
- if (templateName && templateName !== 'none') {
666
- success = await this.createPrdFromTemplate(prdName, templateName);
667
- } else {
668
- success = await this.createPrd(prdName);
669
- }
670
-
671
- process.exit(success ? 0 : 1);
672
- }
673
- }
674
-
675
- // Main execution
676
- if (require.main === module) {
677
- const creator = new PrdCreator();
678
- creator.run(process.argv.slice(2)).catch(error => {
679
- console.error('āŒ Error:', error.message);
680
- process.exit(1);
681
- });
682
- }
683
-
684
- module.exports = PrdCreator;