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,337 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * PR Create - Create a pull request from current branch
4
- */
5
-
6
- const { execSync } = require('child_process');
7
- const fs = require('fs');
8
- const path = require('path');
9
-
10
- class PrCreator {
11
- constructor() {
12
- this.activeWorkFile = path.join('.claude', 'active-work.json');
13
- this.completedWorkFile = path.join('.claude', 'completed-work.json');
14
- }
15
-
16
- execCommand(command, options = {}) {
17
- try {
18
- return execSync(command, { encoding: 'utf8', ...options }).trim();
19
- } catch (error) {
20
- if (!options.ignoreError) {
21
- throw error;
22
- }
23
- return null;
24
- }
25
- }
26
-
27
- checkGitHub() {
28
- // Check if gh CLI is installed
29
- try {
30
- this.execCommand('which gh', { ignoreError: false });
31
- return true;
32
- } catch {
33
- console.error('āŒ GitHub CLI (gh) is not installed');
34
- console.log('šŸ’” Install it with: brew install gh');
35
- console.log('šŸ’” Or visit: https://cli.github.com/');
36
- return false;
37
- }
38
- }
39
-
40
- checkAuth() {
41
- try {
42
- this.execCommand('gh auth status');
43
- return true;
44
- } catch {
45
- console.error('āŒ Not authenticated with GitHub');
46
- console.log('šŸ’” Run: gh auth login');
47
- return false;
48
- }
49
- }
50
-
51
- getCurrentBranch() {
52
- return this.execCommand('git branch --show-current');
53
- }
54
-
55
- getDefaultBranch() {
56
- try {
57
- // Try to get default branch from GitHub
58
- const defaultBranch = this.execCommand('gh repo view --json defaultBranchRef -q .defaultBranchRef.name');
59
- return defaultBranch || 'main';
60
- } catch {
61
- // Fallback to common defaults
62
- const branches = this.execCommand('git branch -r').split('\n');
63
- if (branches.some(b => b.includes('main'))) return 'main';
64
- if (branches.some(b => b.includes('master'))) return 'master';
65
- return 'main';
66
- }
67
- }
68
-
69
- getRecentCommits(limit = 10) {
70
- return this.execCommand(`git log --oneline -${limit}`).split('\n');
71
- }
72
-
73
- getDiffSummary(baseBranch) {
74
- try {
75
- return this.execCommand(`git diff ${baseBranch}...HEAD --stat`);
76
- } catch {
77
- return 'Unable to generate diff summary';
78
- }
79
- }
80
-
81
- loadWorkItems() {
82
- const items = {
83
- issues: [],
84
- epics: []
85
- };
86
-
87
- // Load active work
88
- if (fs.existsSync(this.activeWorkFile)) {
89
- try {
90
- const activeWork = JSON.parse(fs.readFileSync(this.activeWorkFile, 'utf8'));
91
- items.issues = items.issues.concat(activeWork.issues || []);
92
- items.epics = items.epics.concat(activeWork.epics || []);
93
- } catch {}
94
- }
95
-
96
- // Load recent completed work
97
- if (fs.existsSync(this.completedWorkFile)) {
98
- try {
99
- const completedWork = JSON.parse(fs.readFileSync(this.completedWorkFile, 'utf8'));
100
- const recentCompleted = (completedWork.issues || [])
101
- .filter(i => {
102
- const completedDate = new Date(i.completedAt);
103
- const daysSince = (Date.now() - completedDate) / (1000 * 60 * 60 * 24);
104
- return daysSince < 7; // Last 7 days
105
- });
106
- items.issues = items.issues.concat(recentCompleted);
107
- } catch {}
108
- }
109
-
110
- return items;
111
- }
112
-
113
- generatePrBody(options = {}) {
114
- const workItems = this.loadWorkItems();
115
- const currentBranch = this.getCurrentBranch();
116
- const baseBranch = options.base || this.getDefaultBranch();
117
- const diffSummary = this.getDiffSummary(baseBranch);
118
-
119
- let body = '';
120
-
121
- // Description
122
- if (options.description) {
123
- body += `## Description\n${options.description}\n\n`;
124
- } else {
125
- body += `## Description\n[Please provide a brief description of the changes]\n\n`;
126
- }
127
-
128
- // Related Issues
129
- if (workItems.issues.length > 0) {
130
- body += `## Related Issues\n`;
131
- workItems.issues.forEach(issue => {
132
- body += `- ${issue.id}: ${issue.status}\n`;
133
- });
134
- body += '\n';
135
- }
136
-
137
- // Related Epics
138
- if (workItems.epics.length > 0) {
139
- body += `## Related Epics\n`;
140
- workItems.epics.forEach(epic => {
141
- body += `- ${epic.name}\n`;
142
- });
143
- body += '\n';
144
- }
145
-
146
- // Changes Summary
147
- body += `## Changes Summary\n\`\`\`\n${diffSummary}\n\`\`\`\n\n`;
148
-
149
- // Testing
150
- body += `## Testing\n`;
151
- body += `- [ ] Tests pass locally\n`;
152
- body += `- [ ] New tests added for new features\n`;
153
- body += `- [ ] Existing tests updated as needed\n\n`;
154
-
155
- // Checklist
156
- body += `## Checklist\n`;
157
- body += `- [ ] Code follows project style guidelines\n`;
158
- body += `- [ ] Self-review completed\n`;
159
- body += `- [ ] Documentation updated\n`;
160
- body += `- [ ] No console.log or debug statements\n`;
161
- body += `- [ ] No sensitive information exposed\n\n`;
162
-
163
- // Footer
164
- body += `---\n`;
165
- body += `*Created with PM System*\n`;
166
- body += `*Branch: ${currentBranch} → ${baseBranch}*`;
167
-
168
- return body;
169
- }
170
-
171
- async createPr(title, options = {}) {
172
- console.log(`\nšŸš€ Creating Pull Request`);
173
- console.log(`${'═'.repeat(50)}\n`);
174
-
175
- // Check prerequisites
176
- if (!this.checkGitHub()) return false;
177
- if (!this.checkAuth()) return false;
178
-
179
- const currentBranch = this.getCurrentBranch();
180
- const baseBranch = options.base || this.getDefaultBranch();
181
-
182
- // Check if on default branch
183
- if (currentBranch === baseBranch) {
184
- console.error(`āŒ Cannot create PR from ${baseBranch} to itself`);
185
- console.log(`šŸ’” Create a feature branch first`);
186
- return false;
187
- }
188
-
189
- // Check for uncommitted changes
190
- const status = this.execCommand('git status --short');
191
- if (status) {
192
- console.log('āš ļø You have uncommitted changes:');
193
- console.log(status);
194
- console.log('\nšŸ’” Commit your changes first');
195
- return false;
196
- }
197
-
198
- // Push branch to remote
199
- console.log(`šŸ“¤ Pushing branch '${currentBranch}' to remote...`);
200
- try {
201
- this.execCommand(`git push -u origin ${currentBranch}`);
202
- } catch (error) {
203
- console.error('āŒ Failed to push branch');
204
- console.log('šŸ’” Check your remote configuration');
205
- return false;
206
- }
207
-
208
- // Generate PR body
209
- const body = options.body || this.generatePrBody(options);
210
-
211
- // Create PR using gh CLI
212
- console.log('\nšŸ“ Creating pull request...');
213
-
214
- let command = `gh pr create --title "${title}" --body "${body.replace(/"/g, '\\"')}" --base ${baseBranch}`;
215
-
216
- if (options.draft) {
217
- command += ' --draft';
218
- }
219
-
220
- if (options.assignee) {
221
- command += ` --assignee ${options.assignee}`;
222
- }
223
-
224
- if (options.reviewer) {
225
- command += ` --reviewer ${options.reviewer}`;
226
- }
227
-
228
- if (options.label) {
229
- command += ` --label "${options.label}"`;
230
- }
231
-
232
- try {
233
- const prUrl = this.execCommand(command);
234
- console.log('\nāœ… Pull request created successfully!');
235
- console.log(`\nšŸ”— PR URL: ${prUrl}`);
236
-
237
- // Show next steps
238
- console.log('\nšŸ’” Next Steps:');
239
- console.log(' • Review the PR in browser');
240
- console.log(' • Request reviews from team members');
241
- console.log(' • Monitor CI/CD checks');
242
- console.log(' • Address any feedback');
243
-
244
- return true;
245
- } catch (error) {
246
- console.error('āŒ Failed to create pull request');
247
- console.error(error.message);
248
-
249
- // Check if PR already exists
250
- if (error.message.includes('already exists')) {
251
- console.log('\nšŸ’” A PR already exists for this branch');
252
- console.log(' View it with: gh pr view');
253
- console.log(' Or create with a different branch');
254
- }
255
-
256
- return false;
257
- }
258
- }
259
-
260
- async run(args) {
261
- let title = '';
262
- const options = {};
263
-
264
- // Parse arguments
265
- let i = 0;
266
- while (i < args.length) {
267
- const arg = args[i];
268
-
269
- if (arg === '--base' || arg === '-b') {
270
- options.base = args[++i];
271
- } else if (arg === '--draft' || arg === '-d') {
272
- options.draft = true;
273
- } else if (arg === '--assignee' || arg === '-a') {
274
- options.assignee = args[++i];
275
- } else if (arg === '--reviewer' || arg === '-r') {
276
- options.reviewer = args[++i];
277
- } else if (arg === '--label' || arg === '-l') {
278
- options.label = args[++i];
279
- } else if (arg === '--description' || arg === '-m') {
280
- options.description = args[++i];
281
- } else if (arg === '--help' || arg === '-h') {
282
- console.log('Usage: pm pr-create "<title>" [options]');
283
- console.log('\nOptions:');
284
- console.log(' -b, --base <branch> Base branch (default: main)');
285
- console.log(' -d, --draft Create as draft PR');
286
- console.log(' -a, --assignee <user> Assign to user');
287
- console.log(' -r, --reviewer <user> Request review from user');
288
- console.log(' -l, --label <label> Add label to PR');
289
- console.log(' -m, --description <text> PR description');
290
- console.log('\nExamples:');
291
- console.log(' pm pr-create "Add new feature"');
292
- console.log(' pm pr-create "Fix bug" --draft');
293
- console.log(' pm pr-create "Update docs" --base develop --reviewer teammate');
294
- process.exit(0);
295
- } else if (!title) {
296
- title = arg;
297
- }
298
-
299
- i++;
300
- }
301
-
302
- if (!title) {
303
- // Interactive mode
304
- const readline = require('readline');
305
- const rl = readline.createInterface({
306
- input: process.stdin,
307
- output: process.stdout
308
- });
309
-
310
- title = await new Promise(resolve => {
311
- rl.question('Enter PR title: ', answer => {
312
- rl.close();
313
- resolve(answer);
314
- });
315
- });
316
-
317
- if (!title) {
318
- console.error('āŒ PR title is required');
319
- process.exit(1);
320
- }
321
- }
322
-
323
- const success = await this.createPr(title, options);
324
- process.exit(success ? 0 : 1);
325
- }
326
- }
327
-
328
- // Main execution
329
- if (require.main === module) {
330
- const creator = new PrCreator();
331
- creator.run(process.argv.slice(2)).catch(error => {
332
- console.error('āŒ Error:', error.message);
333
- process.exit(1);
334
- });
335
- }
336
-
337
- module.exports = PrCreator;
@@ -1,257 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * PR List - List pull requests
4
- */
5
-
6
- const { execSync } = require('child_process');
7
-
8
- class PrLister {
9
- constructor() {
10
- this.colors = {
11
- reset: '\x1b[0m',
12
- bright: '\x1b[1m',
13
- dim: '\x1b[2m',
14
- green: '\x1b[32m',
15
- yellow: '\x1b[33m',
16
- blue: '\x1b[34m',
17
- magenta: '\x1b[35m',
18
- cyan: '\x1b[36m',
19
- red: '\x1b[31m'
20
- };
21
- }
22
-
23
- execCommand(command, options = {}) {
24
- try {
25
- return execSync(command, { encoding: 'utf8', ...options }).trim();
26
- } catch (error) {
27
- if (!options.ignoreError) {
28
- throw error;
29
- }
30
- return null;
31
- }
32
- }
33
-
34
- checkGitHub() {
35
- try {
36
- this.execCommand('which gh', { ignoreError: false });
37
- return true;
38
- } catch {
39
- console.error('āŒ GitHub CLI (gh) is not installed');
40
- console.log('šŸ’” Install it with: brew install gh');
41
- console.log('šŸ’” Or visit: https://cli.github.com/');
42
- return false;
43
- }
44
- }
45
-
46
- formatState(state) {
47
- const states = {
48
- 'OPEN': `${this.colors.green}ā— OPEN${this.colors.reset}`,
49
- 'CLOSED': `${this.colors.red}ā— CLOSED${this.colors.reset}`,
50
- 'MERGED': `${this.colors.magenta}āœ“ MERGED${this.colors.reset}`
51
- };
52
- return states[state] || state;
53
- }
54
-
55
- formatDate(dateStr) {
56
- const date = new Date(dateStr);
57
- const now = new Date();
58
- const diff = now - date;
59
- const days = Math.floor(diff / (1000 * 60 * 60 * 24));
60
- const hours = Math.floor(diff / (1000 * 60 * 60));
61
- const minutes = Math.floor(diff / (1000 * 60));
62
-
63
- if (days > 30) {
64
- return date.toLocaleDateString();
65
- } else if (days > 0) {
66
- return `${days} day${days > 1 ? 's' : ''} ago`;
67
- } else if (hours > 0) {
68
- return `${hours} hour${hours > 1 ? 's' : ''} ago`;
69
- } else {
70
- return `${minutes} minute${minutes > 1 ? 's' : ''} ago`;
71
- }
72
- }
73
-
74
- async listPrs(options = {}) {
75
- console.log(`\nšŸ“‹ Pull Requests`);
76
- console.log(`${'═'.repeat(50)}\n`);
77
-
78
- // Check prerequisites
79
- if (!this.checkGitHub()) return false;
80
-
81
- // Build gh pr list command
82
- let command = 'gh pr list --json number,title,state,author,createdAt,headRefName,isDraft,url';
83
-
84
- if (options.state) {
85
- command += ` --state ${options.state}`;
86
- } else {
87
- command += ' --state all';
88
- }
89
-
90
- if (options.limit) {
91
- command += ` --limit ${options.limit}`;
92
- } else {
93
- command += ' --limit 20';
94
- }
95
-
96
- if (options.author) {
97
- command += ` --author ${options.author}`;
98
- }
99
-
100
- if (options.label) {
101
- command += ` --label "${options.label}"`;
102
- }
103
-
104
- if (options.assignee) {
105
- command += ` --assignee ${options.assignee}`;
106
- }
107
-
108
- try {
109
- const output = this.execCommand(command);
110
- const prs = JSON.parse(output);
111
-
112
- if (prs.length === 0) {
113
- console.log('No pull requests found');
114
- if (options.state) {
115
- console.log(`šŸ’” Try removing --state ${options.state} filter`);
116
- }
117
- return true;
118
- }
119
-
120
- // Group by state if showing all
121
- if (!options.state || options.state === 'all') {
122
- const grouped = {
123
- open: [],
124
- merged: [],
125
- closed: []
126
- };
127
-
128
- prs.forEach(pr => {
129
- if (pr.state === 'OPEN') {
130
- grouped.open.push(pr);
131
- } else if (pr.state === 'MERGED') {
132
- grouped.merged.push(pr);
133
- } else {
134
- grouped.closed.push(pr);
135
- }
136
- });
137
-
138
- // Display open PRs
139
- if (grouped.open.length > 0) {
140
- console.log(`${this.colors.green}Open Pull Requests (${grouped.open.length})${this.colors.reset}`);
141
- console.log(`${'─'.repeat(50)}`);
142
- this.displayPrs(grouped.open);
143
- console.log('');
144
- }
145
-
146
- // Display merged PRs
147
- if (grouped.merged.length > 0) {
148
- console.log(`${this.colors.magenta}Merged Pull Requests (${grouped.merged.length})${this.colors.reset}`);
149
- console.log(`${'─'.repeat(50)}`);
150
- this.displayPrs(grouped.merged);
151
- console.log('');
152
- }
153
-
154
- // Display closed PRs
155
- if (grouped.closed.length > 0) {
156
- console.log(`${this.colors.red}Closed Pull Requests (${grouped.closed.length})${this.colors.reset}`);
157
- console.log(`${'─'.repeat(50)}`);
158
- this.displayPrs(grouped.closed);
159
- }
160
- } else {
161
- // Display all in one list
162
- this.displayPrs(prs);
163
- }
164
-
165
- // Show summary
166
- console.log(`\n${'─'.repeat(50)}`);
167
- console.log(`Total: ${prs.length} pull request${prs.length > 1 ? 's' : ''}`);
168
-
169
- // Show commands
170
- console.log('\nšŸ’” Commands:');
171
- console.log(' • View PR: gh pr view <number>');
172
- console.log(' • Checkout PR: gh pr checkout <number>');
173
- console.log(' • Review PR: gh pr review <number>');
174
- console.log(' • Merge PR: gh pr merge <number>');
175
-
176
- return true;
177
- } catch (error) {
178
- console.error('āŒ Failed to list pull requests');
179
- console.error(error.message);
180
-
181
- if (error.message.includes('auth')) {
182
- console.log('\nšŸ’” Authenticate with: gh auth login');
183
- }
184
-
185
- return false;
186
- }
187
- }
188
-
189
- displayPrs(prs) {
190
- prs.forEach((pr, index) => {
191
- const isDraft = pr.isDraft ? '[DRAFT] ' : '';
192
- const number = `#${pr.number}`.padEnd(6);
193
- const author = `@${pr.author.login}`.padEnd(15);
194
- const branch = pr.headRefName.substring(0, 25).padEnd(25);
195
- const age = this.formatDate(pr.createdAt);
196
-
197
- console.log(`${this.colors.bright}${number}${this.colors.reset} ${isDraft}${pr.title}`);
198
- console.log(` ${this.colors.dim}${author} | ${branch} | ${age}${this.colors.reset}`);
199
-
200
- if (index < prs.length - 1) {
201
- console.log('');
202
- }
203
- });
204
- }
205
-
206
- async run(args) {
207
- const options = {};
208
-
209
- // Parse arguments
210
- for (let i = 0; i < args.length; i++) {
211
- const arg = args[i];
212
-
213
- if (arg === '--state' || arg === '-s') {
214
- options.state = args[++i];
215
- } else if (arg === '--author' || arg === '-a') {
216
- options.author = args[++i];
217
- } else if (arg === '--assignee') {
218
- options.assignee = args[++i];
219
- } else if (arg === '--label' || arg === '-l') {
220
- options.label = args[++i];
221
- } else if (arg === '--limit' || arg === '-n') {
222
- options.limit = parseInt(args[++i]);
223
- } else if (arg === '--mine' || arg === '-m') {
224
- options.author = '@me';
225
- } else if (arg === '--help' || arg === '-h') {
226
- console.log('Usage: pm pr-list [options]');
227
- console.log('\nOptions:');
228
- console.log(' -s, --state <state> Filter by state (open|closed|merged|all)');
229
- console.log(' -a, --author <user> Filter by author');
230
- console.log(' -m, --mine Show only your PRs');
231
- console.log(' --assignee <user> Filter by assignee');
232
- console.log(' -l, --label <label> Filter by label');
233
- console.log(' -n, --limit <number> Limit number of results (default: 20)');
234
- console.log('\nExamples:');
235
- console.log(' pm pr-list # List all PRs');
236
- console.log(' pm pr-list --state open # List open PRs');
237
- console.log(' pm pr-list --mine # List your PRs');
238
- console.log(' pm pr-list --label bug # List PRs with bug label');
239
- process.exit(0);
240
- }
241
- }
242
-
243
- const success = await this.listPrs(options);
244
- process.exit(success ? 0 : 1);
245
- }
246
- }
247
-
248
- // Main execution
249
- if (require.main === module) {
250
- const lister = new PrLister();
251
- lister.run(process.argv.slice(2)).catch(error => {
252
- console.error('āŒ Error:', error.message);
253
- process.exit(1);
254
- });
255
- }
256
-
257
- module.exports = PrLister;