claude-autopm 2.7.0 → 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 (281) hide show
  1. package/README.md +307 -56
  2. package/autopm/.claude/.env +158 -0
  3. package/autopm/.claude/settings.local.json +9 -0
  4. package/bin/autopm.js +11 -2
  5. package/bin/commands/epic.js +23 -3
  6. package/bin/commands/plugin.js +395 -0
  7. package/bin/commands/team.js +184 -10
  8. package/install/install.js +223 -4
  9. package/lib/cli/commands/issue.js +360 -20
  10. package/lib/plugins/PluginManager.js +1328 -0
  11. package/lib/plugins/PluginManager.old.js +400 -0
  12. package/lib/providers/AzureDevOpsProvider.js +575 -0
  13. package/lib/providers/GitHubProvider.js +475 -0
  14. package/lib/services/EpicService.js +1092 -3
  15. package/lib/services/IssueService.js +991 -0
  16. package/package.json +9 -1
  17. package/scripts/publish-plugins.sh +166 -0
  18. package/autopm/.claude/agents/cloud/README.md +0 -55
  19. package/autopm/.claude/agents/cloud/aws-cloud-architect.md +0 -521
  20. package/autopm/.claude/agents/cloud/azure-cloud-architect.md +0 -436
  21. package/autopm/.claude/agents/cloud/gcp-cloud-architect.md +0 -385
  22. package/autopm/.claude/agents/cloud/gcp-cloud-functions-engineer.md +0 -306
  23. package/autopm/.claude/agents/cloud/gemini-api-expert.md +0 -880
  24. package/autopm/.claude/agents/cloud/kubernetes-orchestrator.md +0 -566
  25. package/autopm/.claude/agents/cloud/openai-python-expert.md +0 -1087
  26. package/autopm/.claude/agents/cloud/terraform-infrastructure-expert.md +0 -454
  27. package/autopm/.claude/agents/core/agent-manager.md +0 -296
  28. package/autopm/.claude/agents/core/code-analyzer.md +0 -131
  29. package/autopm/.claude/agents/core/file-analyzer.md +0 -162
  30. package/autopm/.claude/agents/core/test-runner.md +0 -200
  31. package/autopm/.claude/agents/data/airflow-orchestration-expert.md +0 -52
  32. package/autopm/.claude/agents/data/kedro-pipeline-expert.md +0 -50
  33. package/autopm/.claude/agents/data/langgraph-workflow-expert.md +0 -520
  34. package/autopm/.claude/agents/databases/README.md +0 -50
  35. package/autopm/.claude/agents/databases/bigquery-expert.md +0 -392
  36. package/autopm/.claude/agents/databases/cosmosdb-expert.md +0 -368
  37. package/autopm/.claude/agents/databases/mongodb-expert.md +0 -398
  38. package/autopm/.claude/agents/databases/postgresql-expert.md +0 -321
  39. package/autopm/.claude/agents/databases/redis-expert.md +0 -52
  40. package/autopm/.claude/agents/devops/README.md +0 -52
  41. package/autopm/.claude/agents/devops/azure-devops-specialist.md +0 -308
  42. package/autopm/.claude/agents/devops/docker-containerization-expert.md +0 -298
  43. package/autopm/.claude/agents/devops/github-operations-specialist.md +0 -335
  44. package/autopm/.claude/agents/devops/mcp-context-manager.md +0 -319
  45. package/autopm/.claude/agents/devops/observability-engineer.md +0 -574
  46. package/autopm/.claude/agents/devops/ssh-operations-expert.md +0 -1093
  47. package/autopm/.claude/agents/devops/traefik-proxy-expert.md +0 -444
  48. package/autopm/.claude/agents/frameworks/README.md +0 -64
  49. package/autopm/.claude/agents/frameworks/e2e-test-engineer.md +0 -360
  50. package/autopm/.claude/agents/frameworks/nats-messaging-expert.md +0 -254
  51. package/autopm/.claude/agents/frameworks/react-frontend-engineer.md +0 -217
  52. package/autopm/.claude/agents/frameworks/react-ui-expert.md +0 -226
  53. package/autopm/.claude/agents/frameworks/tailwindcss-expert.md +0 -770
  54. package/autopm/.claude/agents/frameworks/ux-design-expert.md +0 -244
  55. package/autopm/.claude/agents/integration/message-queue-engineer.md +0 -794
  56. package/autopm/.claude/agents/languages/README.md +0 -50
  57. package/autopm/.claude/agents/languages/bash-scripting-expert.md +0 -541
  58. package/autopm/.claude/agents/languages/javascript-frontend-engineer.md +0 -197
  59. package/autopm/.claude/agents/languages/nodejs-backend-engineer.md +0 -226
  60. package/autopm/.claude/agents/languages/python-backend-engineer.md +0 -214
  61. package/autopm/.claude/agents/languages/python-backend-expert.md +0 -289
  62. package/autopm/.claude/agents/testing/frontend-testing-engineer.md +0 -395
  63. package/autopm/.claude/commands/ai/langgraph-workflow.md +0 -65
  64. package/autopm/.claude/commands/ai/openai-chat.md +0 -65
  65. package/autopm/.claude/commands/azure/COMMANDS.md +0 -107
  66. package/autopm/.claude/commands/azure/COMMAND_MAPPING.md +0 -252
  67. package/autopm/.claude/commands/azure/INTEGRATION_FIX.md +0 -103
  68. package/autopm/.claude/commands/azure/README.md +0 -246
  69. package/autopm/.claude/commands/azure/active-work.md +0 -198
  70. package/autopm/.claude/commands/azure/aliases.md +0 -143
  71. package/autopm/.claude/commands/azure/blocked-items.md +0 -287
  72. package/autopm/.claude/commands/azure/clean.md +0 -93
  73. package/autopm/.claude/commands/azure/docs-query.md +0 -48
  74. package/autopm/.claude/commands/azure/feature-decompose.md +0 -380
  75. package/autopm/.claude/commands/azure/feature-list.md +0 -61
  76. package/autopm/.claude/commands/azure/feature-new.md +0 -115
  77. package/autopm/.claude/commands/azure/feature-show.md +0 -205
  78. package/autopm/.claude/commands/azure/feature-start.md +0 -130
  79. package/autopm/.claude/commands/azure/fix-integration-example.md +0 -93
  80. package/autopm/.claude/commands/azure/help.md +0 -150
  81. package/autopm/.claude/commands/azure/import-us.md +0 -269
  82. package/autopm/.claude/commands/azure/init.md +0 -211
  83. package/autopm/.claude/commands/azure/next-task.md +0 -262
  84. package/autopm/.claude/commands/azure/search.md +0 -160
  85. package/autopm/.claude/commands/azure/sprint-status.md +0 -235
  86. package/autopm/.claude/commands/azure/standup.md +0 -260
  87. package/autopm/.claude/commands/azure/sync-all.md +0 -99
  88. package/autopm/.claude/commands/azure/task-analyze.md +0 -186
  89. package/autopm/.claude/commands/azure/task-close.md +0 -329
  90. package/autopm/.claude/commands/azure/task-edit.md +0 -145
  91. package/autopm/.claude/commands/azure/task-list.md +0 -263
  92. package/autopm/.claude/commands/azure/task-new.md +0 -84
  93. package/autopm/.claude/commands/azure/task-reopen.md +0 -79
  94. package/autopm/.claude/commands/azure/task-show.md +0 -126
  95. package/autopm/.claude/commands/azure/task-start.md +0 -301
  96. package/autopm/.claude/commands/azure/task-status.md +0 -65
  97. package/autopm/.claude/commands/azure/task-sync.md +0 -67
  98. package/autopm/.claude/commands/azure/us-edit.md +0 -164
  99. package/autopm/.claude/commands/azure/us-list.md +0 -202
  100. package/autopm/.claude/commands/azure/us-new.md +0 -265
  101. package/autopm/.claude/commands/azure/us-parse.md +0 -253
  102. package/autopm/.claude/commands/azure/us-show.md +0 -188
  103. package/autopm/.claude/commands/azure/us-status.md +0 -320
  104. package/autopm/.claude/commands/azure/validate.md +0 -86
  105. package/autopm/.claude/commands/azure/work-item-sync.md +0 -47
  106. package/autopm/.claude/commands/cloud/infra-deploy.md +0 -38
  107. package/autopm/.claude/commands/github/workflow-create.md +0 -42
  108. package/autopm/.claude/commands/infrastructure/ssh-security.md +0 -65
  109. package/autopm/.claude/commands/infrastructure/traefik-setup.md +0 -65
  110. package/autopm/.claude/commands/kubernetes/deploy.md +0 -37
  111. package/autopm/.claude/commands/playwright/test-scaffold.md +0 -38
  112. package/autopm/.claude/commands/pm/blocked.md +0 -28
  113. package/autopm/.claude/commands/pm/clean.md +0 -119
  114. package/autopm/.claude/commands/pm/context-create.md +0 -136
  115. package/autopm/.claude/commands/pm/context-prime.md +0 -170
  116. package/autopm/.claude/commands/pm/context-update.md +0 -292
  117. package/autopm/.claude/commands/pm/context.md +0 -28
  118. package/autopm/.claude/commands/pm/epic-close.md +0 -86
  119. package/autopm/.claude/commands/pm/epic-decompose.md +0 -370
  120. package/autopm/.claude/commands/pm/epic-edit.md +0 -83
  121. package/autopm/.claude/commands/pm/epic-list.md +0 -30
  122. package/autopm/.claude/commands/pm/epic-merge.md +0 -222
  123. package/autopm/.claude/commands/pm/epic-oneshot.md +0 -119
  124. package/autopm/.claude/commands/pm/epic-refresh.md +0 -119
  125. package/autopm/.claude/commands/pm/epic-show.md +0 -28
  126. package/autopm/.claude/commands/pm/epic-split.md +0 -120
  127. package/autopm/.claude/commands/pm/epic-start.md +0 -195
  128. package/autopm/.claude/commands/pm/epic-status.md +0 -28
  129. package/autopm/.claude/commands/pm/epic-sync-modular.md +0 -338
  130. package/autopm/.claude/commands/pm/epic-sync-original.md +0 -473
  131. package/autopm/.claude/commands/pm/epic-sync.md +0 -486
  132. package/autopm/.claude/commands/pm/help.md +0 -28
  133. package/autopm/.claude/commands/pm/import.md +0 -115
  134. package/autopm/.claude/commands/pm/in-progress.md +0 -28
  135. package/autopm/.claude/commands/pm/init.md +0 -28
  136. package/autopm/.claude/commands/pm/issue-analyze.md +0 -202
  137. package/autopm/.claude/commands/pm/issue-close.md +0 -119
  138. package/autopm/.claude/commands/pm/issue-edit.md +0 -93
  139. package/autopm/.claude/commands/pm/issue-reopen.md +0 -87
  140. package/autopm/.claude/commands/pm/issue-show.md +0 -41
  141. package/autopm/.claude/commands/pm/issue-start.md +0 -234
  142. package/autopm/.claude/commands/pm/issue-status.md +0 -95
  143. package/autopm/.claude/commands/pm/issue-sync.md +0 -411
  144. package/autopm/.claude/commands/pm/next.md +0 -28
  145. package/autopm/.claude/commands/pm/prd-edit.md +0 -82
  146. package/autopm/.claude/commands/pm/prd-list.md +0 -28
  147. package/autopm/.claude/commands/pm/prd-new.md +0 -55
  148. package/autopm/.claude/commands/pm/prd-parse.md +0 -42
  149. package/autopm/.claude/commands/pm/prd-status.md +0 -28
  150. package/autopm/.claude/commands/pm/search.md +0 -28
  151. package/autopm/.claude/commands/pm/standup.md +0 -28
  152. package/autopm/.claude/commands/pm/status.md +0 -28
  153. package/autopm/.claude/commands/pm/sync.md +0 -99
  154. package/autopm/.claude/commands/pm/test-reference-update.md +0 -151
  155. package/autopm/.claude/commands/pm/validate.md +0 -28
  156. package/autopm/.claude/commands/pm/what-next.md +0 -28
  157. package/autopm/.claude/commands/python/api-scaffold.md +0 -50
  158. package/autopm/.claude/commands/python/docs-query.md +0 -48
  159. package/autopm/.claude/commands/react/app-scaffold.md +0 -50
  160. package/autopm/.claude/commands/testing/prime.md +0 -314
  161. package/autopm/.claude/commands/testing/run.md +0 -125
  162. package/autopm/.claude/commands/ui/bootstrap-scaffold.md +0 -65
  163. package/autopm/.claude/commands/ui/tailwind-system.md +0 -64
  164. package/autopm/.claude/rules/ai-integration-patterns.md +0 -219
  165. package/autopm/.claude/rules/ci-cd-kubernetes-strategy.md +0 -25
  166. package/autopm/.claude/rules/database-management-strategy.md +0 -17
  167. package/autopm/.claude/rules/database-pipeline.md +0 -94
  168. package/autopm/.claude/rules/devops-troubleshooting-playbook.md +0 -450
  169. package/autopm/.claude/rules/docker-first-development.md +0 -404
  170. package/autopm/.claude/rules/infrastructure-pipeline.md +0 -128
  171. package/autopm/.claude/rules/performance-guidelines.md +0 -403
  172. package/autopm/.claude/rules/ui-development-standards.md +0 -281
  173. package/autopm/.claude/rules/ui-framework-rules.md +0 -151
  174. package/autopm/.claude/rules/ux-design-rules.md +0 -209
  175. package/autopm/.claude/rules/visual-testing.md +0 -223
  176. package/autopm/.claude/scripts/azure/README.md +0 -192
  177. package/autopm/.claude/scripts/azure/active-work.js +0 -524
  178. package/autopm/.claude/scripts/azure/active-work.sh +0 -20
  179. package/autopm/.claude/scripts/azure/blocked.js +0 -520
  180. package/autopm/.claude/scripts/azure/blocked.sh +0 -20
  181. package/autopm/.claude/scripts/azure/daily.js +0 -533
  182. package/autopm/.claude/scripts/azure/daily.sh +0 -20
  183. package/autopm/.claude/scripts/azure/dashboard.js +0 -970
  184. package/autopm/.claude/scripts/azure/dashboard.sh +0 -20
  185. package/autopm/.claude/scripts/azure/feature-list.js +0 -254
  186. package/autopm/.claude/scripts/azure/feature-list.sh +0 -20
  187. package/autopm/.claude/scripts/azure/feature-show.js +0 -7
  188. package/autopm/.claude/scripts/azure/feature-show.sh +0 -20
  189. package/autopm/.claude/scripts/azure/feature-status.js +0 -604
  190. package/autopm/.claude/scripts/azure/feature-status.sh +0 -20
  191. package/autopm/.claude/scripts/azure/help.js +0 -342
  192. package/autopm/.claude/scripts/azure/help.sh +0 -20
  193. package/autopm/.claude/scripts/azure/next-task.js +0 -508
  194. package/autopm/.claude/scripts/azure/next-task.sh +0 -20
  195. package/autopm/.claude/scripts/azure/search.js +0 -469
  196. package/autopm/.claude/scripts/azure/search.sh +0 -20
  197. package/autopm/.claude/scripts/azure/setup.js +0 -745
  198. package/autopm/.claude/scripts/azure/setup.sh +0 -20
  199. package/autopm/.claude/scripts/azure/sprint-report.js +0 -1012
  200. package/autopm/.claude/scripts/azure/sprint-report.sh +0 -20
  201. package/autopm/.claude/scripts/azure/sync.js +0 -563
  202. package/autopm/.claude/scripts/azure/sync.sh +0 -20
  203. package/autopm/.claude/scripts/azure/us-list.js +0 -210
  204. package/autopm/.claude/scripts/azure/us-list.sh +0 -20
  205. package/autopm/.claude/scripts/azure/us-status.js +0 -238
  206. package/autopm/.claude/scripts/azure/us-status.sh +0 -20
  207. package/autopm/.claude/scripts/azure/validate.js +0 -626
  208. package/autopm/.claude/scripts/azure/validate.sh +0 -20
  209. package/autopm/.claude/scripts/azure/wrapper-template.sh +0 -20
  210. package/autopm/.claude/scripts/github/dependency-tracker.js +0 -554
  211. package/autopm/.claude/scripts/github/dependency-validator.js +0 -545
  212. package/autopm/.claude/scripts/github/dependency-visualizer.js +0 -477
  213. package/autopm/.claude/scripts/pm/analytics.js +0 -425
  214. package/autopm/.claude/scripts/pm/blocked.js +0 -164
  215. package/autopm/.claude/scripts/pm/blocked.sh +0 -78
  216. package/autopm/.claude/scripts/pm/clean.js +0 -464
  217. package/autopm/.claude/scripts/pm/context-create.js +0 -216
  218. package/autopm/.claude/scripts/pm/context-prime.js +0 -335
  219. package/autopm/.claude/scripts/pm/context-update.js +0 -344
  220. package/autopm/.claude/scripts/pm/context.js +0 -338
  221. package/autopm/.claude/scripts/pm/epic-close.js +0 -347
  222. package/autopm/.claude/scripts/pm/epic-edit.js +0 -382
  223. package/autopm/.claude/scripts/pm/epic-list.js +0 -273
  224. package/autopm/.claude/scripts/pm/epic-list.sh +0 -109
  225. package/autopm/.claude/scripts/pm/epic-show.js +0 -291
  226. package/autopm/.claude/scripts/pm/epic-show.sh +0 -105
  227. package/autopm/.claude/scripts/pm/epic-split.js +0 -522
  228. package/autopm/.claude/scripts/pm/epic-start/epic-start.js +0 -183
  229. package/autopm/.claude/scripts/pm/epic-start/epic-start.sh +0 -94
  230. package/autopm/.claude/scripts/pm/epic-status.js +0 -291
  231. package/autopm/.claude/scripts/pm/epic-status.sh +0 -104
  232. package/autopm/.claude/scripts/pm/epic-sync/README.md +0 -208
  233. package/autopm/.claude/scripts/pm/epic-sync/create-epic-issue.sh +0 -77
  234. package/autopm/.claude/scripts/pm/epic-sync/create-task-issues.sh +0 -86
  235. package/autopm/.claude/scripts/pm/epic-sync/update-epic-file.sh +0 -79
  236. package/autopm/.claude/scripts/pm/epic-sync/update-references.sh +0 -89
  237. package/autopm/.claude/scripts/pm/epic-sync.sh +0 -137
  238. package/autopm/.claude/scripts/pm/help.js +0 -92
  239. package/autopm/.claude/scripts/pm/help.sh +0 -90
  240. package/autopm/.claude/scripts/pm/in-progress.js +0 -178
  241. package/autopm/.claude/scripts/pm/in-progress.sh +0 -93
  242. package/autopm/.claude/scripts/pm/init.js +0 -321
  243. package/autopm/.claude/scripts/pm/init.sh +0 -178
  244. package/autopm/.claude/scripts/pm/issue-close.js +0 -232
  245. package/autopm/.claude/scripts/pm/issue-edit.js +0 -310
  246. package/autopm/.claude/scripts/pm/issue-show.js +0 -272
  247. package/autopm/.claude/scripts/pm/issue-start.js +0 -181
  248. package/autopm/.claude/scripts/pm/issue-sync/format-comment.sh +0 -468
  249. package/autopm/.claude/scripts/pm/issue-sync/gather-updates.sh +0 -460
  250. package/autopm/.claude/scripts/pm/issue-sync/post-comment.sh +0 -330
  251. package/autopm/.claude/scripts/pm/issue-sync/preflight-validation.sh +0 -348
  252. package/autopm/.claude/scripts/pm/issue-sync/update-frontmatter.sh +0 -387
  253. package/autopm/.claude/scripts/pm/lib/README.md +0 -85
  254. package/autopm/.claude/scripts/pm/lib/epic-discovery.js +0 -119
  255. package/autopm/.claude/scripts/pm/lib/logger.js +0 -78
  256. package/autopm/.claude/scripts/pm/next.js +0 -189
  257. package/autopm/.claude/scripts/pm/next.sh +0 -72
  258. package/autopm/.claude/scripts/pm/optimize.js +0 -407
  259. package/autopm/.claude/scripts/pm/pr-create.js +0 -337
  260. package/autopm/.claude/scripts/pm/pr-list.js +0 -257
  261. package/autopm/.claude/scripts/pm/prd-list.js +0 -242
  262. package/autopm/.claude/scripts/pm/prd-list.sh +0 -103
  263. package/autopm/.claude/scripts/pm/prd-new.js +0 -684
  264. package/autopm/.claude/scripts/pm/prd-parse.js +0 -547
  265. package/autopm/.claude/scripts/pm/prd-status.js +0 -152
  266. package/autopm/.claude/scripts/pm/prd-status.sh +0 -63
  267. package/autopm/.claude/scripts/pm/release.js +0 -460
  268. package/autopm/.claude/scripts/pm/search.js +0 -192
  269. package/autopm/.claude/scripts/pm/search.sh +0 -89
  270. package/autopm/.claude/scripts/pm/standup.js +0 -362
  271. package/autopm/.claude/scripts/pm/standup.sh +0 -95
  272. package/autopm/.claude/scripts/pm/status.js +0 -148
  273. package/autopm/.claude/scripts/pm/status.sh +0 -59
  274. package/autopm/.claude/scripts/pm/sync-batch.js +0 -337
  275. package/autopm/.claude/scripts/pm/sync.js +0 -343
  276. package/autopm/.claude/scripts/pm/template-list.js +0 -141
  277. package/autopm/.claude/scripts/pm/template-new.js +0 -366
  278. package/autopm/.claude/scripts/pm/validate.js +0 -274
  279. package/autopm/.claude/scripts/pm/validate.sh +0 -106
  280. package/autopm/.claude/scripts/pm/what-next.js +0 -660
  281. package/bin/node/azure-feature-show.js +0 -7
@@ -1,660 +0,0 @@
1
- const fs = require('fs');
2
- const fsPromises = require('fs').promises;
3
- const path = require('path');
4
- const { logError, logWarning, logDebug } = require('./lib/logger');
5
-
6
- /**
7
- * PM What-Next Script
8
- * Intelligent context-aware suggestions for next steps
9
- */
10
-
11
- // ============================================================================
12
- // Configuration Constants
13
- // ============================================================================
14
-
15
- // Task file naming pattern (e.g., 001.md, 002.md)
16
- const TASK_FILE_PATTERN = /^\d{3}\.md$/;
17
-
18
- // Epic complexity detection thresholds
19
- const COMPLEXITY_THRESHOLDS = {
20
- // Content length threshold (characters)
21
- LARGE_EPIC_SIZE: parseInt(process.env.PM_LARGE_EPIC_SIZE) || 5000,
22
-
23
- // Task count thresholds
24
- MANY_TASKS: parseInt(process.env.PM_MANY_TASKS) || 20,
25
-
26
- // Keywords indicating multi-layer architecture
27
- ARCHITECTURE_KEYWORDS: {
28
- frontend: ['frontend', 'ui', 'client', 'react', 'vue', 'angular'],
29
- backend: ['backend', 'api', 'server', 'service'],
30
- database: ['database', 'db', 'postgres', 'mysql', 'mongodb'],
31
- infrastructure: ['infrastructure', 'deploy', 'k8s', 'kubernetes', 'docker', 'ci/cd'],
32
- integration: ['integration', 'third-party', 'external api', 'webhook']
33
- }
34
- };
35
-
36
- async function whatNext() {
37
- console.log('');
38
- console.log('🎯 What Should I Do Next?');
39
- console.log('='.repeat(60));
40
- console.log('');
41
-
42
- // Analyze current project state
43
- const state = await analyzeProjectState();
44
-
45
- // Generate contextual suggestions
46
- const suggestions = generateSuggestions(state);
47
-
48
- // Display project status
49
- displayProjectStatus(state);
50
- console.log('');
51
-
52
- // Display suggestions
53
- displaySuggestions(suggestions, state);
54
-
55
- console.log('');
56
- console.log('💡 Tip: Run /pm:context to see detailed project status');
57
- console.log('');
58
- }
59
-
60
- // Analyze current project state
61
- async function analyzeProjectState() {
62
- const state = {
63
- hasPRDs: false,
64
- prdCount: 0,
65
- prds: [],
66
- hasEpics: false,
67
- epicCount: 0,
68
- epics: [],
69
- hasConfig: false,
70
- provider: null,
71
- hasActiveTasks: false,
72
- activeTaskCount: 0,
73
- completedTaskCount: 0,
74
- totalTaskCount: 0,
75
- inProgressTasks: [],
76
- openTasks: []
77
- };
78
-
79
- // Check for PRDs
80
- if (fs.existsSync('.claude/prds')) {
81
- const prdFiles = fs.readdirSync('.claude/prds')
82
- .filter(f => f.endsWith('.md') && !f.startsWith('.'));
83
- state.hasPRDs = prdFiles.length > 0;
84
- state.prdCount = prdFiles.length;
85
- state.prds = prdFiles.map(f => f.replace('.md', ''));
86
- }
87
-
88
- // Check for epics
89
- if (fs.existsSync('.claude/epics')) {
90
- const epicDirs = fs.readdirSync('.claude/epics', { withFileTypes: true })
91
- .filter(d => d.isDirectory())
92
- .map(d => d.name);
93
-
94
- state.hasEpics = epicDirs.length > 0;
95
- state.epicCount = epicDirs.length;
96
-
97
- // Analyze all epics in parallel for better performance
98
- // This prevents blocking when projects have many epics/tasks
99
- // Example: 10 epics × 50 tasks = 500 files processed in parallel
100
- const epicAnalysisPromises = epicDirs.map(epicName => {
101
- const epicPath = path.join('.claude/epics', epicName);
102
- return analyzeEpicAsync(epicPath, epicName)
103
- .catch(err => {
104
- logWarning(`Failed to analyze epic "${epicName}": ${err.message}`);
105
- logDebug(err.stack);
106
- // Return a minimal fallback object to prevent Promise.all from failing
107
- return {
108
- name: epicName,
109
- path: epicPath,
110
- hasTasks: false,
111
- taskCount: 0,
112
- completedCount: 0,
113
- inProgressCount: 0,
114
- openCount: 0,
115
- inProgressTasks: [],
116
- openTasks: [],
117
- isComplex: false,
118
- hasArchitecture: false,
119
- analysisFailed: true
120
- };
121
- });
122
- });
123
-
124
- const epicInfos = await Promise.all(epicAnalysisPromises);
125
-
126
- // Aggregate results
127
- for (const epicInfo of epicInfos) {
128
- state.epics.push(epicInfo);
129
-
130
- // Count tasks
131
- state.totalTaskCount += epicInfo.taskCount;
132
- state.completedTaskCount += epicInfo.completedCount;
133
- state.activeTaskCount += epicInfo.inProgressCount;
134
-
135
- // Collect tasks
136
- state.inProgressTasks.push(...epicInfo.inProgressTasks);
137
- state.openTasks.push(...epicInfo.openTasks);
138
- }
139
-
140
- state.hasActiveTasks = state.activeTaskCount > 0;
141
- }
142
-
143
- // Check configuration
144
- if (fs.existsSync('.claude/config.json')) {
145
- try {
146
- const config = JSON.parse(fs.readFileSync('.claude/config.json', 'utf8'));
147
- state.hasConfig = true;
148
- state.provider = config.provider || null;
149
- } catch (err) {
150
- // Ignore config errors
151
- }
152
- }
153
-
154
- return state;
155
- }
156
-
157
- // Analyze single epic (async version for parallel processing)
158
- async function analyzeEpicAsync(epicPath, epicName) {
159
- const info = {
160
- name: epicName,
161
- hasEpicFile: false,
162
- hasTasks: false,
163
- taskCount: 0,
164
- completedCount: 0,
165
- inProgressCount: 0,
166
- openCount: 0,
167
- syncedToGitHub: false,
168
- inProgressTasks: [],
169
- openTasks: []
170
- };
171
-
172
- // Check for epic.md
173
- const epicFile = path.join(epicPath, 'epic.md');
174
- try {
175
- await fsPromises.access(epicFile);
176
- info.hasEpicFile = true;
177
-
178
- const content = await fsPromises.readFile(epicFile, 'utf8');
179
- info.syncedToGitHub = /^github:/m.test(content);
180
- } catch (err) {
181
- // File doesn't exist or can't be read
182
- }
183
-
184
- // Check for task files
185
- try {
186
- const files = await fsPromises.readdir(epicPath);
187
- const taskFiles = files.filter(f => TASK_FILE_PATTERN.test(f));
188
-
189
- info.hasTasks = taskFiles.length > 0;
190
- info.taskCount = taskFiles.length;
191
-
192
- // Analyze all tasks in parallel
193
- const taskAnalysisPromises = taskFiles.map(async (taskFile) => {
194
- const taskPath = path.join(epicPath, taskFile);
195
- try {
196
- const content = await fsPromises.readFile(taskPath, 'utf8');
197
- const statusMatch = content.match(/^status:\s*(.+)$/m);
198
- const status = statusMatch ? statusMatch[1].trim().toLowerCase() : 'open';
199
-
200
- const nameMatch = content.match(/^name:\s*(.+)$/m);
201
- const taskName = nameMatch ? nameMatch[1].trim() : taskFile;
202
-
203
- const taskNum = taskFile.replace('.md', '');
204
-
205
- return { status, taskName, taskNum };
206
- } catch (err) {
207
- // Ignore task read errors
208
- return null;
209
- }
210
- });
211
-
212
- const taskResults = await Promise.all(taskAnalysisPromises);
213
-
214
- // Aggregate task results
215
- for (const result of taskResults) {
216
- if (!result) continue;
217
-
218
- const { status, taskName, taskNum } = result;
219
-
220
- if (status === 'completed' || status === 'done' || status === 'closed') {
221
- info.completedCount++;
222
- } else if (status === 'in-progress' || status === 'in_progress') {
223
- info.inProgressCount++;
224
- info.inProgressTasks.push({ epicName, taskNum, name: taskName });
225
- } else {
226
- info.openCount++;
227
- info.openTasks.push({ epicName, taskNum, name: taskName });
228
- }
229
- }
230
- } catch (err) {
231
- // Ignore directory read errors
232
- }
233
-
234
- return info;
235
- }
236
-
237
- // Analyze single epic (synchronous - kept for backward compatibility)
238
- function analyzeEpic(epicPath, epicName) {
239
- const info = {
240
- name: epicName,
241
- hasEpicFile: false,
242
- hasTasks: false,
243
- taskCount: 0,
244
- completedCount: 0,
245
- inProgressCount: 0,
246
- openCount: 0,
247
- syncedToGitHub: false,
248
- inProgressTasks: [],
249
- openTasks: []
250
- };
251
-
252
- // Check for epic.md
253
- const epicFile = path.join(epicPath, 'epic.md');
254
- info.hasEpicFile = fs.existsSync(epicFile);
255
-
256
- if (info.hasEpicFile) {
257
- try {
258
- const content = fs.readFileSync(epicFile, 'utf8');
259
- info.syncedToGitHub = /^github:/m.test(content);
260
- } catch (err) {
261
- // Ignore read errors
262
- }
263
- }
264
-
265
- // Check for task files
266
- try {
267
- const taskFiles = fs.readdirSync(epicPath)
268
- .filter(f => TASK_FILE_PATTERN.test(f));
269
-
270
- info.hasTasks = taskFiles.length > 0;
271
- info.taskCount = taskFiles.length;
272
-
273
- // Analyze each task
274
- for (const taskFile of taskFiles) {
275
- const taskPath = path.join(epicPath, taskFile);
276
- try {
277
- const content = fs.readFileSync(taskPath, 'utf8');
278
- const statusMatch = content.match(/^status:\s*(.+)$/m);
279
- const status = statusMatch ? statusMatch[1].trim().toLowerCase() : 'open';
280
-
281
- const nameMatch = content.match(/^name:\s*(.+)$/m);
282
- const taskName = nameMatch ? nameMatch[1].trim() : taskFile;
283
-
284
- const taskNum = taskFile.replace('.md', '');
285
-
286
- if (status === 'completed' || status === 'done' || status === 'closed') {
287
- info.completedCount++;
288
- } else if (status === 'in-progress' || status === 'in_progress') {
289
- info.inProgressCount++;
290
- info.inProgressTasks.push({ epicName, taskNum, name: taskName });
291
- } else {
292
- info.openCount++;
293
- info.openTasks.push({ epicName, taskNum, name: taskName });
294
- }
295
- } catch (err) {
296
- // Ignore task read errors
297
- }
298
- }
299
- } catch (err) {
300
- // Ignore directory read errors
301
- }
302
-
303
- return info;
304
- }
305
-
306
- // ============================================================================
307
- // Epic Complexity Detection
308
- // ============================================================================
309
-
310
- /**
311
- * Detect if an epic is complex enough to warrant splitting into sub-epics
312
- *
313
- * @param {string} epicContent - Content of the epic.md file
314
- * @param {object} epicInfo - Epic metadata (taskCount, etc.)
315
- * @returns {object} { isComplex: boolean, reasons: string[] }
316
- */
317
- function detectEpicComplexity(epicContent, epicInfo = {}) {
318
- const reasons = [];
319
-
320
- if (!epicContent) {
321
- return { isComplex: false, reasons: [] };
322
- }
323
-
324
- const contentLower = epicContent.toLowerCase();
325
-
326
- // 1. Check for multi-layer architecture (frontend + backend)
327
- const hasMultipleLayers = detectMultipleArchitectureLayers(contentLower);
328
- if (hasMultipleLayers.detected) {
329
- reasons.push(`Multiple architecture layers: ${hasMultipleLayers.layers.join(', ')}`);
330
- }
331
-
332
- // 2. Check for large content size
333
- if (epicContent.length > COMPLEXITY_THRESHOLDS.LARGE_EPIC_SIZE) {
334
- reasons.push(`Large epic size: ${epicContent.length} characters (threshold: ${COMPLEXITY_THRESHOLDS.LARGE_EPIC_SIZE})`);
335
- }
336
-
337
- // 3. Check for high estimated task count (if available)
338
- if (epicInfo.taskCount && epicInfo.taskCount > COMPLEXITY_THRESHOLDS.MANY_TASKS) {
339
- reasons.push(`Many tasks: ${epicInfo.taskCount} (threshold: ${COMPLEXITY_THRESHOLDS.MANY_TASKS})`);
340
- }
341
-
342
- // 4. Check for infrastructure/deployment complexity
343
- const hasInfrastructure = COMPLEXITY_THRESHOLDS.ARCHITECTURE_KEYWORDS.infrastructure
344
- .some(keyword => contentLower.includes(keyword));
345
- if (hasInfrastructure) {
346
- reasons.push('Contains infrastructure/deployment components');
347
- }
348
-
349
- // 5. Check for external integrations
350
- const hasIntegrations = COMPLEXITY_THRESHOLDS.ARCHITECTURE_KEYWORDS.integration
351
- .some(keyword => contentLower.includes(keyword));
352
- if (hasIntegrations) {
353
- reasons.push('Contains external service integrations');
354
- }
355
-
356
- return {
357
- isComplex: reasons.length >= 2, // At least 2 complexity indicators
358
- reasons
359
- };
360
- }
361
-
362
- /**
363
- * Detect multiple architecture layers in epic content
364
- *
365
- * @param {string} contentLower - Lowercase epic content
366
- * @returns {object} { detected: boolean, layers: string[] }
367
- */
368
- function detectMultipleArchitectureLayers(contentLower) {
369
- const layers = [];
370
- const keywords = COMPLEXITY_THRESHOLDS.ARCHITECTURE_KEYWORDS;
371
-
372
- // Check each layer
373
- for (const [layerName, layerKeywords] of Object.entries(keywords)) {
374
- if (layerName === 'integration') continue; // Skip integration layer
375
-
376
- const hasLayer = layerKeywords.some(keyword => contentLower.includes(keyword));
377
- if (hasLayer) {
378
- layers.push(layerName);
379
- }
380
- }
381
-
382
- // Complex if has 2+ distinct layers (e.g., frontend + backend)
383
- return {
384
- detected: layers.length >= 2,
385
- layers
386
- };
387
- }
388
-
389
- // Generate suggestions based on state
390
- function generateSuggestions(state) {
391
- const suggestions = [];
392
-
393
- // Scenario 1: No PRDs yet
394
- if (!state.hasPRDs) {
395
- suggestions.push({
396
- priority: 'high',
397
- recommended: true,
398
- title: 'Create Your First PRD',
399
- description: 'Start by defining what you want to build',
400
- commands: [
401
- { cmd: '/pm:prd-new my-feature', note: 'Replace "my-feature" with your feature name' }
402
- ],
403
- why: 'PRDs define requirements and guide the entire development process'
404
- });
405
- return suggestions; // Stop here, nothing else makes sense yet
406
- }
407
-
408
- // Scenario 2: Have PRDs but no epics
409
- if (state.hasPRDs && !state.hasEpics) {
410
- for (const prd of state.prds) {
411
- suggestions.push({
412
- priority: 'high',
413
- recommended: true,
414
- title: `Parse PRD: "${prd}"`,
415
- description: 'Convert your requirements into an executable epic',
416
- commands: [
417
- { cmd: `/pm:prd-parse ${prd}`, note: 'Analyzes PRD and creates epic structure' }
418
- ],
419
- why: 'This creates the epic structure needed for task breakdown'
420
- });
421
- }
422
- return suggestions;
423
- }
424
-
425
- // Scenario 3: Have epics that need decomposition
426
- const epicsNeedingDecomposition = state.epics.filter(e => e.hasEpicFile && !e.hasTasks);
427
- if (epicsNeedingDecomposition.length > 0) {
428
- for (const epic of epicsNeedingDecomposition) {
429
- // Check if this is a complex epic that should be split
430
- const epicContent = tryReadFile(path.join('.claude/epics', epic.name, 'epic.md'));
431
- const complexityResult = detectEpicComplexity(epicContent, epic);
432
- const isComplex = complexityResult.isComplex;
433
-
434
- if (isComplex) {
435
- suggestions.push({
436
- priority: 'high',
437
- recommended: true,
438
- title: `Split Epic: "${epic.name}" (Complex Project)`,
439
- description: 'Break into multiple sub-epics for parallel work',
440
- commands: [
441
- { cmd: `/pm:epic-split ${epic.name}`, note: 'Creates multiple sub-epics (frontend, backend, etc.)' },
442
- { cmd: `# Then decompose each sub-epic:`, note: '' },
443
- { cmd: `/pm:epic-decompose ${epic.name}/01-*`, note: 'Repeat for each sub-epic' }
444
- ],
445
- why: 'Large projects work better when split into focused components'
446
- });
447
- } else {
448
- suggestions.push({
449
- priority: 'high',
450
- recommended: true,
451
- title: `Decompose Epic: "${epic.name}"`,
452
- description: 'Break epic into actionable tasks',
453
- commands: [
454
- { cmd: `/pm:epic-decompose ${epic.name}`, note: 'Creates numbered task files' }
455
- ],
456
- why: 'Tasks are the actual work items that get implemented'
457
- });
458
- }
459
- }
460
- return suggestions;
461
- }
462
-
463
- // Scenario 4: Have tasks but not synced to GitHub
464
- const epicsNeedingSync = state.epics.filter(e => e.hasTasks && !e.syncedToGitHub);
465
- if (epicsNeedingSync.length > 0) {
466
- for (const epic of epicsNeedingSync) {
467
- suggestions.push({
468
- priority: 'high',
469
- recommended: true,
470
- title: `Sync Epic: "${epic.name}" to GitHub`,
471
- description: 'Create GitHub issues for tracking',
472
- commands: [
473
- { cmd: `/pm:epic-sync ${epic.name}`, note: 'Creates epic + task issues on GitHub' }
474
- ],
475
- why: 'GitHub issues enable team collaboration and progress tracking'
476
- });
477
- }
478
- return suggestions;
479
- }
480
-
481
- // Scenario 5: Have synced tasks - ready to work
482
- if (state.openTasks.length > 0) {
483
- suggestions.push({
484
- priority: 'high',
485
- recommended: true,
486
- title: 'Start Working on Tasks',
487
- description: `You have ${state.openTasks.length} tasks ready to work on`,
488
- commands: [
489
- { cmd: '/pm:next', note: 'Shows highest priority available tasks' },
490
- { cmd: `/pm:issue-start ${state.openTasks[0].taskNum}`, note: `Start: "${state.openTasks[0].name}"` }
491
- ],
492
- why: 'Begin implementation with TDD approach'
493
- });
494
- }
495
-
496
- // Scenario 6: Have tasks in progress
497
- if (state.inProgressTasks.length > 0) {
498
- suggestions.push({
499
- priority: 'medium',
500
- recommended: state.openTasks.length === 0,
501
- title: 'Continue In-Progress Work',
502
- description: `You have ${state.inProgressTasks.length} tasks currently in progress`,
503
- commands: state.inProgressTasks.slice(0, 3).map(t => ({
504
- cmd: `/pm:issue-show ${t.taskNum}`,
505
- note: `"${t.name}"`
506
- })),
507
- why: 'Finish what you started before starting new work'
508
- });
509
- }
510
-
511
- // Scenario 7: Everything done, suggest new features
512
- if (state.completedTaskCount === state.totalTaskCount && state.totalTaskCount > 0) {
513
- suggestions.push({
514
- priority: 'medium',
515
- recommended: true,
516
- title: 'All Tasks Complete! 🎉',
517
- description: 'Time to plan your next feature',
518
- commands: [
519
- { cmd: '/pm:prd-new next-feature', note: 'Start a new PRD for your next feature' },
520
- { cmd: '/pm:standup', note: 'Generate summary of completed work' }
521
- ],
522
- why: 'Document achievements and plan ahead'
523
- });
524
- }
525
-
526
- // Always available: Check status and context
527
- suggestions.push({
528
- priority: 'low',
529
- recommended: false,
530
- title: 'Check Project Status',
531
- description: 'View detailed project information',
532
- commands: [
533
- { cmd: '/pm:context', note: 'Full project context and progress' },
534
- { cmd: '/pm:status', note: 'Project health and configuration' },
535
- { cmd: '/pm:standup', note: 'Daily standup summary' }
536
- ],
537
- why: 'Stay informed about project state'
538
- });
539
-
540
- return suggestions;
541
- }
542
-
543
- // Display project status summary
544
- function displayProjectStatus(state) {
545
- console.log('📊 Current Project Status:');
546
- console.log('');
547
-
548
- if (!state.hasPRDs && !state.hasEpics) {
549
- console.log(' 🆕 New project - Ready to start!');
550
- return;
551
- }
552
-
553
- if (state.hasPRDs) {
554
- console.log(` 📄 PRDs: ${state.prdCount} (${state.prds.join(', ')})`);
555
- }
556
-
557
- if (state.hasEpics) {
558
- console.log(` 📚 Epics: ${state.epicCount}`);
559
- console.log(` ✅ Tasks: ${state.completedTaskCount} / ${state.totalTaskCount} completed`);
560
-
561
- if (state.activeTaskCount > 0) {
562
- console.log(` 🔄 In Progress: ${state.activeTaskCount} tasks`);
563
- }
564
-
565
- if (state.openTasks.length > 0) {
566
- console.log(` 📋 Ready: ${state.openTasks.length} tasks waiting`);
567
- }
568
- }
569
-
570
- if (state.hasConfig && state.provider) {
571
- console.log(` ⚙️ Provider: ${state.provider.charAt(0).toUpperCase() + state.provider.slice(1)}`);
572
- }
573
- }
574
-
575
- // Display suggestions
576
- function displaySuggestions(suggestions, state) {
577
- console.log('💡 Suggested Next Steps:');
578
- console.log('');
579
-
580
- const highPriority = suggestions.filter(s => s.priority === 'high');
581
- const mediumPriority = suggestions.filter(s => s.priority === 'medium');
582
- const lowPriority = suggestions.filter(s => s.priority === 'low');
583
-
584
- let stepNum = 1;
585
-
586
- // High priority suggestions
587
- for (const suggestion of highPriority) {
588
- displaySuggestion(suggestion, stepNum++);
589
- }
590
-
591
- // Medium priority suggestions
592
- if (mediumPriority.length > 0) {
593
- console.log('');
594
- console.log(' Also Available:');
595
- console.log(' ' + '-'.repeat(56));
596
- console.log('');
597
- for (const suggestion of mediumPriority) {
598
- displaySuggestion(suggestion, stepNum++, ' ');
599
- }
600
- }
601
-
602
- // Low priority suggestions (info only)
603
- if (lowPriority.length > 0 && highPriority.length === 0) {
604
- console.log('');
605
- console.log(' Information Commands:');
606
- console.log(' ' + '-'.repeat(56));
607
- console.log('');
608
- for (const suggestion of lowPriority) {
609
- displaySuggestion(suggestion, stepNum++, ' ');
610
- }
611
- }
612
- }
613
-
614
- // Display single suggestion
615
- function displaySuggestion(suggestion, stepNum, indent = '') {
616
- const marker = suggestion.recommended ? '⭐' : '○';
617
-
618
- console.log(`${indent}${stepNum}. ${marker} ${suggestion.title}`);
619
- console.log(`${indent} ${suggestion.description}`);
620
- console.log('');
621
-
622
- for (const cmd of suggestion.commands) {
623
- if (cmd.cmd.startsWith('#')) {
624
- console.log(`${indent} ${cmd.cmd}`);
625
- } else {
626
- console.log(`${indent} ${cmd.cmd}`);
627
- if (cmd.note) {
628
- console.log(`${indent} → ${cmd.note}`);
629
- }
630
- }
631
- }
632
-
633
- if (suggestion.why) {
634
- console.log(`${indent} 💭 ${suggestion.why}`);
635
- }
636
-
637
- console.log('');
638
- }
639
-
640
- // Helper: Try to read file, return null on error
641
- function tryReadFile(filePath) {
642
- try {
643
- return fs.readFileSync(filePath, 'utf8');
644
- } catch (err) {
645
- if (err.code !== 'ENOENT') {
646
- console.error(`Error reading file "${filePath}":`, err.message);
647
- }
648
- return null;
649
- }
650
- }
651
-
652
- // Run if called directly
653
- if (require.main === module) {
654
- whatNext().catch(err => {
655
- logError('Error executing what-next command', err);
656
- process.exit(1);
657
- });
658
- }
659
-
660
- module.exports = whatNext;
@@ -1,7 +0,0 @@
1
- #!/usr/bin/env node
2
- const featureId = process.argv[2];
3
- if (!featureId) {
4
- console.log('Usage: azure-feature-show <feature-id>');
5
- process.exit(1);
6
- }
7
- console.log('Feature ID:', featureId);