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,189 +0,0 @@
1
- const fs = require('fs');
2
- const path = require('path');
3
- const { logError } = require('./lib/logger');
4
- const { findAllEpicDirs } = require('./lib/epic-discovery');
5
-
6
- /**
7
- * PM Next Script (Node.js version)
8
- * Migrated from bash script with 100% backward compatibility
9
- */
10
-
11
- async function next() {
12
- const result = {
13
- availableTasks: [],
14
- found: 0,
15
- suggestions: [],
16
- messages: []
17
- };
18
-
19
- // Helper function to add messages
20
- function addMessage(message) {
21
- result.messages.push(message);
22
- // Only log if running as CLI
23
- if (require.main === module) {
24
- console.log(message);
25
- }
26
- }
27
-
28
- // Header messages to match bash output exactly
29
- addMessage('Getting status...');
30
- addMessage('');
31
- addMessage('');
32
-
33
- addMessage('šŸ“‹ Next Available Tasks');
34
- addMessage('=======================');
35
- addMessage('');
36
-
37
- // Find tasks that are open and have no dependencies or whose dependencies are closed
38
- try {
39
- const availableTasks = await findAvailableTasks();
40
- result.availableTasks = availableTasks;
41
- result.found = availableTasks.length;
42
-
43
- if (availableTasks.length > 0) {
44
- for (const task of availableTasks) {
45
- addMessage(`āœ… Ready: #${task.taskNum} - ${task.name}`);
46
- addMessage(` Epic: ${task.epicName}`);
47
- if (task.parallel) {
48
- addMessage(' šŸ”„ Can run in parallel');
49
- }
50
- addMessage('');
51
- }
52
- } else {
53
- addMessage('No available tasks found.');
54
- addMessage('');
55
-
56
- // Add suggestions
57
- const suggestions = [
58
- 'Check blocked tasks: /pm:blocked',
59
- 'View all tasks: /pm:epic-list'
60
- ];
61
-
62
- result.suggestions = suggestions;
63
-
64
- addMessage('šŸ’” Suggestions:');
65
- for (const suggestion of suggestions) {
66
- addMessage(` • ${suggestion}`);
67
- }
68
- }
69
- } catch (err) {
70
- addMessage('No available tasks found.');
71
- addMessage('');
72
- addMessage('šŸ’” Suggestions:');
73
- addMessage(' • Check blocked tasks: /pm:blocked');
74
- addMessage(' • View all tasks: /pm:epic-list');
75
- }
76
-
77
- addMessage('');
78
-
79
- // Display TDD reminder if tasks are available
80
- if (result.found > 0) {
81
- displayTddReminder(addMessage);
82
- }
83
-
84
- addMessage(`šŸ“Š Summary: ${result.found} tasks ready to start`);
85
-
86
- return result;
87
- }
88
-
89
- /**
90
- * Display TDD reminder to ensure test-driven development practices
91
- * Extracted to maintain single responsibility and improve testability
92
- * @param {Function} addMessage - Function to add messages to the output
93
- */
94
- function displayTddReminder(addMessage) {
95
- addMessage('āš ļø TDD REMINDER - Before starting work:');
96
- addMessage('');
97
- addMessage(' 🚨 ALWAYS follow Test-Driven Development:');
98
- addMessage(' 1. RED: Write failing test first');
99
- addMessage(' 2. GREEN: Write minimal code to pass');
100
- addMessage(' 3. REFACTOR: Clean up while keeping tests green');
101
- addMessage('');
102
- addMessage(' See .claude/rules/tdd.enforcement.md for details');
103
- addMessage('');
104
- }
105
-
106
- // Helper function to find available tasks
107
- async function findAvailableTasks() {
108
- const availableTasks = [];
109
-
110
- // Use shared epic discovery utility
111
- const epicDirs = findAllEpicDirs();
112
-
113
- for (const epicDir of epicDirs) {
114
- const { name: epicName, path: epicPath } = epicDir;
115
-
116
- try {
117
- const taskFiles = fs.readdirSync(epicPath)
118
- .filter(file => /^\d+.*\.md$/.test(file))
119
- .sort();
120
-
121
- for (const taskFile of taskFiles) {
122
- const taskPath = path.join(epicPath, taskFile);
123
-
124
- try {
125
- const content = fs.readFileSync(taskPath, 'utf8');
126
-
127
- // Check if task is open (case-insensitive)
128
- const statusMatch = content.match(/^status:\s*(.+)$/m);
129
- const status = statusMatch ? statusMatch[1].trim().toLowerCase() : '';
130
-
131
- // Skip non-open tasks (only open tasks or tasks without status are available)
132
- if (status !== 'open' && status !== '') {
133
- continue;
134
- }
135
-
136
- // Check dependencies
137
- const depsMatch = content.match(/^depends_on:\s*\[(.*?)\]/m);
138
- const depsStr = depsMatch ? depsMatch[1].trim() : '';
139
-
140
- // If no dependencies or empty dependencies, task is available
141
- if (!depsStr || depsStr === '') {
142
- const nameMatch = content.match(/^name:\s*(.+)$/m);
143
- const name = nameMatch ? nameMatch[1].trim() : 'Unnamed Task';
144
-
145
- const parallelMatch = content.match(/^parallel:\s*(.+)$/m);
146
- const parallel = parallelMatch ? parallelMatch[1].trim() === 'true' : false;
147
-
148
- const taskNum = path.basename(taskFile, '.md');
149
-
150
- availableTasks.push({
151
- taskNum,
152
- name,
153
- epicName,
154
- parallel
155
- });
156
- }
157
- } catch (err) {
158
- // Log file read errors in DEBUG mode
159
- if (process.env.DEBUG) {
160
- console.error(`Error reading task file ${taskPath}:`, err.message);
161
- }
162
- }
163
- }
164
- } catch (err) {
165
- // Log directory read errors in DEBUG mode
166
- if (process.env.DEBUG) {
167
- console.error(`Error reading epic directory ${epicPath}:`, err.message);
168
- }
169
- }
170
- }
171
-
172
- return availableTasks;
173
- }
174
-
175
- // Export for use as module
176
- module.exports = {
177
- next,
178
- findAvailableTasks
179
- };
180
-
181
- // CLI execution
182
- if (require.main === module) {
183
- module.exports.next().then(() => {
184
- process.exit(0);
185
- }).catch(err => {
186
- logError('Next tasks command failed', err);
187
- process.exit(1);
188
- });
189
- }
@@ -1,72 +0,0 @@
1
- #!/bin/bash
2
-
3
- # PM Next Script - Wrapper for Node.js implementation
4
- # This wrapper maintains backward compatibility while delegating to the Node.js version
5
-
6
- # Get the directory of this script
7
- SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
8
-
9
- # Check if Node.js is available
10
- if command -v node >/dev/null 2>&1; then
11
- # Use the Node.js implementation
12
- node "$SCRIPT_DIR/next.js"
13
- exit $?
14
- else
15
- # Fallback to the original bash implementation if Node.js is not available
16
- echo "āš ļø Node.js not found, falling back to bash implementation"
17
- echo ""
18
-
19
- # Original bash implementation (preserved for fallback)
20
- echo "Getting status..."
21
- echo ""
22
- echo ""
23
-
24
- echo "šŸ“‹ Next Available Tasks"
25
- echo "======================="
26
- echo ""
27
-
28
- # Find tasks that are open and have no dependencies or whose dependencies are closed
29
- found=0
30
-
31
- for epic_dir in .claude/epics/*/; do
32
- [ -d "$epic_dir" ] || continue
33
- epic_name=$(basename "$epic_dir")
34
-
35
- for task_file in "$epic_dir"[0-9]*.md; do
36
- [ -f "$task_file" ] || continue
37
-
38
- # Check if task is open
39
- status=$(grep "^status:" "$task_file" | head -1 | sed 's/^status: *//')
40
- [ "$status" != "open" ] && [ -n "$status" ] && continue
41
-
42
- # Check dependencies
43
- deps=$(grep "^depends_on:" "$task_file" | head -1 | sed 's/^depends_on: *\[//' | sed 's/\]//')
44
-
45
- # If no dependencies or empty, task is available
46
- if [ -z "$deps" ] || [ "$deps" = "depends_on:" ]; then
47
- task_name=$(grep "^name:" "$task_file" | head -1 | sed 's/^name: *//')
48
- task_num=$(basename "$task_file" .md)
49
- parallel=$(grep "^parallel:" "$task_file" | head -1 | sed 's/^parallel: *//')
50
-
51
- echo "āœ… Ready: #$task_num - $task_name"
52
- echo " Epic: $epic_name"
53
- [ "$parallel" = "true" ] && echo " šŸ”„ Can run in parallel"
54
- echo ""
55
- ((found++))
56
- fi
57
- done
58
- done
59
-
60
- if [ $found -eq 0 ]; then
61
- echo "No available tasks found."
62
- echo ""
63
- echo "šŸ’” Suggestions:"
64
- echo " • Check blocked tasks: /pm:blocked"
65
- echo " • View all tasks: /pm:epic-list"
66
- fi
67
-
68
- echo ""
69
- echo "šŸ“Š Summary: $found tasks ready to start"
70
-
71
- exit 0
72
- fi
@@ -1,407 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * Optimize - Analyze and optimize project for better performance
4
- */
5
-
6
- const fs = require('fs');
7
- const path = require('path');
8
- const { execSync } = require('child_process');
9
-
10
- class ProjectOptimizer {
11
- constructor() {
12
- this.claudeDir = '.claude';
13
- this.stats = {
14
- contextFiles: 0,
15
- agentFiles: 0,
16
- issueFiles: 0,
17
- epicFiles: 0,
18
- totalSize: 0,
19
- duplicates: [],
20
- largeFiles: [],
21
- oldFiles: [],
22
- suggestions: []
23
- };
24
- }
25
-
26
- execCommand(command, options = {}) {
27
- try {
28
- return execSync(command, { encoding: 'utf8', ...options }).trim();
29
- } catch (error) {
30
- if (!options.ignoreError) {
31
- throw error;
32
- }
33
- return null;
34
- }
35
- }
36
-
37
- formatBytes(bytes) {
38
- if (bytes < 1024) return `${bytes}B`;
39
- if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)}KB`;
40
- return `${(bytes / (1024 * 1024)).toFixed(1)}MB`;
41
- }
42
-
43
- analyzeDirectory(dir, type) {
44
- if (!fs.existsSync(dir)) return;
45
-
46
- const files = fs.readdirSync(dir);
47
- let count = 0;
48
- let totalSize = 0;
49
-
50
- files.forEach(file => {
51
- const filePath = path.join(dir, file);
52
- const stats = fs.statSync(filePath);
53
-
54
- if (stats.isFile()) {
55
- count++;
56
- totalSize += stats.size;
57
-
58
- // Check for large files (>100KB)
59
- if (stats.size > 100 * 1024) {
60
- this.stats.largeFiles.push({
61
- path: filePath,
62
- size: stats.size
63
- });
64
- }
65
-
66
- // Check for old files (>30 days)
67
- const ageInDays = (Date.now() - stats.mtime) / (1000 * 60 * 60 * 24);
68
- if (ageInDays > 30) {
69
- this.stats.oldFiles.push({
70
- path: filePath,
71
- age: Math.floor(ageInDays)
72
- });
73
- }
74
- }
75
- });
76
-
77
- return { count, totalSize };
78
- }
79
-
80
- findDuplicates() {
81
- const fileHashes = new Map();
82
- const duplicates = [];
83
-
84
- const processDir = (dir) => {
85
- if (!fs.existsSync(dir)) return;
86
-
87
- const files = fs.readdirSync(dir);
88
- files.forEach(file => {
89
- const filePath = path.join(dir, file);
90
- const stats = fs.statSync(filePath);
91
-
92
- if (stats.isDirectory() && !filePath.includes('node_modules')) {
93
- processDir(filePath);
94
- } else if (stats.isFile()) {
95
- // Simple duplicate detection based on size and name
96
- const key = `${file}-${stats.size}`;
97
- if (fileHashes.has(key)) {
98
- duplicates.push({
99
- original: fileHashes.get(key),
100
- duplicate: filePath,
101
- size: stats.size
102
- });
103
- } else {
104
- fileHashes.set(key, filePath);
105
- }
106
- }
107
- });
108
- };
109
-
110
- processDir(this.claudeDir);
111
- return duplicates;
112
- }
113
-
114
- analyzeContextOptimization() {
115
- const suggestions = [];
116
- const contextDir = path.join(this.claudeDir, 'contexts');
117
-
118
- if (fs.existsSync(contextDir)) {
119
- const files = fs.readdirSync(contextDir);
120
-
121
- // Check for redundant contexts
122
- const contextTypes = new Map();
123
- files.forEach(file => {
124
- const match = file.match(/^(.+?)-/);
125
- if (match) {
126
- const type = match[1];
127
- if (!contextTypes.has(type)) {
128
- contextTypes.set(type, []);
129
- }
130
- contextTypes.get(type).push(file);
131
- }
132
- });
133
-
134
- contextTypes.forEach((files, type) => {
135
- if (files.length > 3) {
136
- suggestions.push({
137
- type: 'consolidation',
138
- message: `Consider consolidating ${files.length} ${type} contexts`,
139
- impact: 'high',
140
- files: files
141
- });
142
- }
143
- });
144
- }
145
-
146
- return suggestions;
147
- }
148
-
149
- analyzeAgentUsage() {
150
- const suggestions = [];
151
- const agentsDir = path.join(this.claudeDir, 'agents');
152
-
153
- if (fs.existsSync(agentsDir)) {
154
- // Check for unused agents (no recent modifications)
155
- const analyzeAgentDir = (dir) => {
156
- const files = fs.readdirSync(dir);
157
-
158
- files.forEach(file => {
159
- const filePath = path.join(dir, file);
160
- const stats = fs.statSync(filePath);
161
-
162
- if (stats.isFile() && file.endsWith('.md')) {
163
- const ageInDays = (Date.now() - stats.atime) / (1000 * 60 * 60 * 24);
164
- if (ageInDays > 60) {
165
- suggestions.push({
166
- type: 'unused',
167
- message: `Agent not used in ${Math.floor(ageInDays)} days: ${file}`,
168
- impact: 'low',
169
- path: filePath
170
- });
171
- }
172
- } else if (stats.isDirectory()) {
173
- analyzeAgentDir(filePath);
174
- }
175
- });
176
- };
177
-
178
- analyzeAgentDir(agentsDir);
179
- }
180
-
181
- return suggestions;
182
- }
183
-
184
- analyzeGitOptimization() {
185
- const suggestions = [];
186
-
187
- // Check git repo size
188
- try {
189
- const repoSize = this.execCommand('du -sh .git', { ignoreError: true });
190
- if (repoSize) {
191
- const sizeMatch = repoSize.match(/(\d+)([MG])/);
192
- if (sizeMatch) {
193
- const size = parseInt(sizeMatch[1]);
194
- const unit = sizeMatch[2];
195
-
196
- if ((unit === 'G') || (unit === 'M' && size > 100)) {
197
- suggestions.push({
198
- type: 'git',
199
- message: `Large git repository (${repoSize}). Consider running 'git gc --aggressive'`,
200
- impact: 'high',
201
- command: 'git gc --aggressive'
202
- });
203
- }
204
- }
205
- }
206
- } catch {}
207
-
208
- // Check for large files in git history
209
- try {
210
- const largeFiles = this.execCommand(
211
- 'git rev-list --all --objects | git cat-file --batch-check="%(objecttype) %(objectname) %(objectsize) %(rest)" | awk \'$1=="blob" && $3>1000000 {print $4, $3}\' | head -5',
212
- { ignoreError: true }
213
- );
214
-
215
- if (largeFiles) {
216
- suggestions.push({
217
- type: 'git',
218
- message: 'Large files found in git history',
219
- impact: 'medium',
220
- details: largeFiles
221
- });
222
- }
223
- } catch {}
224
-
225
- return suggestions;
226
- }
227
-
228
- async optimize(options = {}) {
229
- console.log(`\nšŸ”§ Project Optimization Analysis`);
230
- console.log(`${'═'.repeat(50)}\n`);
231
-
232
- // 1. Analyze directories
233
- console.log('šŸ“Š Analyzing project structure...');
234
-
235
- const contexts = this.analyzeDirectory(path.join(this.claudeDir, 'contexts'), 'context');
236
- const issues = this.analyzeDirectory(path.join(this.claudeDir, 'issues'), 'issue');
237
- const epics = this.analyzeDirectory(path.join(this.claudeDir, 'epics'), 'epic');
238
- const prds = this.analyzeDirectory(path.join(this.claudeDir, 'prds'), 'prd');
239
-
240
- // 2. Find duplicates
241
- if (!options.skipDuplicates) {
242
- console.log('šŸ” Checking for duplicates...');
243
- this.stats.duplicates = this.findDuplicates();
244
- }
245
-
246
- // 3. Analyze optimizations
247
- console.log('šŸ’” Generating optimization suggestions...');
248
- const contextSuggestions = this.analyzeContextOptimization();
249
- const agentSuggestions = this.analyzeAgentUsage();
250
- const gitSuggestions = this.analyzeGitOptimization();
251
-
252
- this.stats.suggestions = [
253
- ...contextSuggestions,
254
- ...agentSuggestions,
255
- ...gitSuggestions
256
- ];
257
-
258
- // 4. Display results
259
- console.log(`\n${'─'.repeat(50)}`);
260
- console.log('šŸ“ˆ Analysis Results:');
261
- console.log(`${'─'.repeat(50)}\n`);
262
-
263
- // File counts
264
- console.log('šŸ“ File Statistics:');
265
- if (contexts) console.log(` • Contexts: ${contexts.count} files (${this.formatBytes(contexts.totalSize)})`);
266
- if (issues) console.log(` • Issues: ${issues.count} files (${this.formatBytes(issues.totalSize)})`);
267
- if (epics) console.log(` • Epics: ${epics.count} files (${this.formatBytes(epics.totalSize)})`);
268
- if (prds) console.log(` • PRDs: ${prds.count} files (${this.formatBytes(prds.totalSize)})`);
269
-
270
- // Large files
271
- if (this.stats.largeFiles.length > 0) {
272
- console.log('\nšŸ“¦ Large Files (>100KB):');
273
- this.stats.largeFiles.slice(0, 5).forEach(file => {
274
- console.log(` • ${path.relative('.', file.path)}: ${this.formatBytes(file.size)}`);
275
- });
276
- }
277
-
278
- // Old files
279
- if (this.stats.oldFiles.length > 0) {
280
- console.log('\nšŸ“… Old Files (>30 days):');
281
- this.stats.oldFiles.slice(0, 5).forEach(file => {
282
- console.log(` • ${path.relative('.', file.path)}: ${file.age} days old`);
283
- });
284
- if (this.stats.oldFiles.length > 5) {
285
- console.log(` ... and ${this.stats.oldFiles.length - 5} more`);
286
- }
287
- }
288
-
289
- // Duplicates
290
- if (this.stats.duplicates.length > 0) {
291
- console.log('\nšŸ” Duplicate Files:');
292
- this.stats.duplicates.slice(0, 5).forEach(dup => {
293
- console.log(` • ${path.basename(dup.duplicate)}`);
294
- console.log(` Original: ${path.relative('.', dup.original)}`);
295
- console.log(` Duplicate: ${path.relative('.', dup.duplicate)}`);
296
- });
297
- }
298
-
299
- // Optimization suggestions
300
- if (this.stats.suggestions.length > 0) {
301
- console.log('\nšŸ’” Optimization Suggestions:');
302
- console.log(`${'─'.repeat(50)}`);
303
-
304
- // Group by impact
305
- const highImpact = this.stats.suggestions.filter(s => s.impact === 'high');
306
- const mediumImpact = this.stats.suggestions.filter(s => s.impact === 'medium');
307
- const lowImpact = this.stats.suggestions.filter(s => s.impact === 'low');
308
-
309
- if (highImpact.length > 0) {
310
- console.log('\nšŸ”“ High Impact:');
311
- highImpact.forEach(s => {
312
- console.log(` • ${s.message}`);
313
- if (s.command) console.log(` Run: ${s.command}`);
314
- });
315
- }
316
-
317
- if (mediumImpact.length > 0) {
318
- console.log('\n🟔 Medium Impact:');
319
- mediumImpact.forEach(s => {
320
- console.log(` • ${s.message}`);
321
- });
322
- }
323
-
324
- if (lowImpact.length > 0) {
325
- console.log('\n🟢 Low Impact:');
326
- lowImpact.slice(0, 3).forEach(s => {
327
- console.log(` • ${s.message}`);
328
- });
329
- }
330
- } else {
331
- console.log('\nāœ… No optimization issues found!');
332
- }
333
-
334
- // Actions
335
- if (this.stats.oldFiles.length > 0 || this.stats.duplicates.length > 0) {
336
- console.log(`\n${'─'.repeat(50)}`);
337
- console.log('šŸŽÆ Recommended Actions:');
338
- console.log(' 1. Run: pm clean # Archive old files');
339
- console.log(' 2. Run: pm validate # Check system integrity');
340
- console.log(' 3. Run: git gc --aggressive # Optimize git repository');
341
- }
342
-
343
- // Apply optimizations if requested
344
- if (options.apply) {
345
- console.log('\nšŸ”§ Applying optimizations...');
346
- await this.applyOptimizations();
347
- }
348
-
349
- return true;
350
- }
351
-
352
- async applyOptimizations() {
353
- let applied = 0;
354
-
355
- // Clean old files
356
- if (this.stats.oldFiles.length > 10) {
357
- console.log(' • Archiving old files...');
358
- this.execCommand('pm clean --days=30', { ignoreError: true });
359
- applied++;
360
- }
361
-
362
- // Run git gc if needed
363
- const gitOptimization = this.stats.suggestions.find(s => s.command === 'git gc --aggressive');
364
- if (gitOptimization) {
365
- console.log(' • Optimizing git repository...');
366
- this.execCommand('git gc', { ignoreError: true });
367
- applied++;
368
- }
369
-
370
- console.log(`\nāœ… Applied ${applied} optimization${applied !== 1 ? 's' : ''}`);
371
- }
372
-
373
- async run(args) {
374
- const options = {};
375
-
376
- // Parse arguments
377
- args.forEach(arg => {
378
- if (arg === '--apply' || arg === '-a') {
379
- options.apply = true;
380
- } else if (arg === '--skip-duplicates') {
381
- options.skipDuplicates = true;
382
- } else if (arg === '--help' || arg === '-h') {
383
- console.log('Usage: pm optimize [options]');
384
- console.log('\nOptions:');
385
- console.log(' -a, --apply Apply recommended optimizations');
386
- console.log(' --skip-duplicates Skip duplicate file detection');
387
- console.log('\nExamples:');
388
- console.log(' pm optimize # Analyze project');
389
- console.log(' pm optimize --apply # Analyze and apply optimizations');
390
- process.exit(0);
391
- }
392
- });
393
-
394
- await this.optimize(options);
395
- }
396
- }
397
-
398
- // Main execution
399
- if (require.main === module) {
400
- const optimizer = new ProjectOptimizer();
401
- optimizer.run(process.argv.slice(2)).catch(error => {
402
- console.error('āŒ Error:', error.message);
403
- process.exit(1);
404
- });
405
- }
406
-
407
- module.exports = ProjectOptimizer;