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,387 +0,0 @@
1
- #!/bin/bash
2
- # Update Frontmatter Script for Issue Sync
3
- # Updates progress.md frontmatter after successful sync
4
-
5
- set -euo pipefail
6
-
7
- # Load libraries
8
- SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
9
- source "${SCRIPT_DIR}/../../lib/logging-utils.sh"
10
- source "${SCRIPT_DIR}/../../lib/frontmatter-utils.sh"
11
- source "${SCRIPT_DIR}/../../lib/datetime-utils.sh"
12
- source "${SCRIPT_DIR}/../../lib/validation-utils.sh"
13
-
14
- # Script configuration
15
- readonly ISSUE_NUMBER="${1:-}"
16
- readonly PROGRESS_FILE="${2:-}"
17
- readonly COMMENT_URL="${3:-}"
18
- readonly IS_COMPLETION="${4:-false}"
19
-
20
- # Global variables
21
- declare -g backup_file=""
22
- declare -g updated_fields=0
23
-
24
- # Main function
25
- main() {
26
- print_banner "Frontmatter Updater" "1.0.0"
27
-
28
- # Validate inputs
29
- log_info "Updating frontmatter for issue #$ISSUE_NUMBER"
30
- validate_inputs || exit 1
31
-
32
- # Create backup
33
- with_error_handling "Create backup" \
34
- create_backup
35
-
36
- # Update sync timestamp
37
- with_error_handling "Update sync timestamp" \
38
- update_sync_timestamp
39
-
40
- # Update comment URL
41
- with_error_handling "Update comment URL" \
42
- update_comment_url
43
-
44
- # Update completion status if needed
45
- if [[ "$IS_COMPLETION" == "true" ]]; then
46
- with_error_handling "Update completion status" \
47
- update_completion_status
48
- fi
49
-
50
- # Update issue state if changed
51
- with_error_handling "Update issue state" \
52
- update_issue_state
53
-
54
- # Verify updates
55
- with_error_handling "Verify frontmatter updates" \
56
- verify_updates
57
-
58
- # Display results
59
- display_results
60
-
61
- log_success "Frontmatter updated successfully"
62
- }
63
-
64
- # Validate script inputs
65
- validate_inputs() {
66
- log_function_entry "validate_inputs"
67
-
68
- if [[ -z "$ISSUE_NUMBER" ]]; then
69
- log_error "Issue number is required"
70
- return 1
71
- fi
72
-
73
- if [[ ! -f "$PROGRESS_FILE" ]]; then
74
- log_error "Progress file not found: $PROGRESS_FILE"
75
- return 1
76
- fi
77
-
78
- # Validate progress file has frontmatter
79
- if ! has_frontmatter "$PROGRESS_FILE"; then
80
- log_error "Progress file does not have valid frontmatter"
81
- return 1
82
- fi
83
-
84
- log_function_exit "validate_inputs"
85
- return 0
86
- }
87
-
88
- # Create backup of progress file
89
- create_backup() {
90
- log_function_entry "create_backup"
91
-
92
- backup_file="${PROGRESS_FILE}.backup.$(date +%Y%m%d_%H%M%S)"
93
-
94
- log_info "Creating backup: $backup_file"
95
- cp "$PROGRESS_FILE" "$backup_file"
96
-
97
- if [[ ! -f "$backup_file" ]]; then
98
- log_error "Failed to create backup"
99
- return 1
100
- fi
101
-
102
- log_success "Backup created"
103
- log_function_exit "create_backup"
104
- return 0
105
- }
106
-
107
- # Update last sync timestamp
108
- update_sync_timestamp() {
109
- log_function_entry "update_sync_timestamp"
110
-
111
- local current_time
112
- current_time=$(get_current_datetime)
113
-
114
- log_info "Updating last_sync to: $current_time"
115
-
116
- if update_frontmatter_field "$PROGRESS_FILE" "last_sync" "$current_time"; then
117
- ((updated_fields++))
118
- log_success "Sync timestamp updated"
119
- else
120
- log_warning "Failed to update sync timestamp"
121
- fi
122
-
123
- log_function_exit "update_sync_timestamp"
124
- return 0
125
- }
126
-
127
- # Update last comment URL
128
- update_comment_url() {
129
- log_function_entry "update_comment_url"
130
-
131
- if [[ -z "$COMMENT_URL" ]] || [[ "$COMMENT_URL" == "null" ]]; then
132
- log_debug "No comment URL to update"
133
- log_function_exit "update_comment_url"
134
- return 0
135
- fi
136
-
137
- log_info "Updating last_comment_url to: $COMMENT_URL"
138
-
139
- if update_frontmatter_field "$PROGRESS_FILE" "last_comment_url" "$COMMENT_URL"; then
140
- ((updated_fields++))
141
- log_success "Comment URL updated"
142
- else
143
- log_warning "Failed to update comment URL"
144
- fi
145
-
146
- log_function_exit "update_comment_url"
147
- return 0
148
- }
149
-
150
- # Update completion status
151
- update_completion_status() {
152
- log_function_entry "update_completion_status"
153
-
154
- log_info "Updating completion status to 100%"
155
-
156
- # Update completion percentage
157
- if update_frontmatter_field "$PROGRESS_FILE" "completion" "100"; then
158
- ((updated_fields++))
159
- log_success "Completion percentage updated"
160
- fi
161
-
162
- # Update status field
163
- if update_frontmatter_field "$PROGRESS_FILE" "status" "completed"; then
164
- ((updated_fields++))
165
- log_success "Status updated to completed"
166
- fi
167
-
168
- # Add completion timestamp
169
- local completion_time
170
- completion_time=$(get_current_datetime)
171
-
172
- if update_frontmatter_field "$PROGRESS_FILE" "completed_at" "$completion_time"; then
173
- ((updated_fields++))
174
- log_success "Completion timestamp added"
175
- fi
176
-
177
- log_function_exit "update_completion_status"
178
- return 0
179
- }
180
-
181
- # Update issue state from GitHub
182
- update_issue_state() {
183
- log_function_entry "update_issue_state"
184
-
185
- # Check if GitHub CLI is available
186
- if ! command -v gh >/dev/null 2>&1; then
187
- log_debug "GitHub CLI not available, skipping state update"
188
- log_function_exit "update_issue_state"
189
- return 0
190
- fi
191
-
192
- log_info "Checking current issue state"
193
-
194
- # Get current issue state from GitHub
195
- local issue_state
196
- issue_state=$(gh issue view "$ISSUE_NUMBER" \
197
- --json state -q .state 2>/dev/null || echo "")
198
-
199
- if [[ -z "$issue_state" ]]; then
200
- log_warning "Could not retrieve issue state"
201
- log_function_exit "update_issue_state"
202
- return 0
203
- fi
204
-
205
- # Get current state from frontmatter
206
- local current_state
207
- current_state=$(get_frontmatter_field "$PROGRESS_FILE" "issue_state" 2>/dev/null || echo "")
208
-
209
- if [[ "$issue_state" != "$current_state" ]]; then
210
- log_info "Updating issue_state from '$current_state' to '$issue_state'"
211
-
212
- if update_frontmatter_field "$PROGRESS_FILE" "issue_state" "$issue_state"; then
213
- ((updated_fields++))
214
- log_success "Issue state updated"
215
- fi
216
- else
217
- log_debug "Issue state unchanged: $issue_state"
218
- fi
219
-
220
- log_function_exit "update_issue_state"
221
- return 0
222
- }
223
-
224
- # Verify frontmatter updates
225
- verify_updates() {
226
- log_function_entry "verify_updates"
227
-
228
- log_info "Verifying frontmatter updates"
229
-
230
- # Check that last_sync was updated
231
- local last_sync
232
- last_sync=$(get_frontmatter_field "$PROGRESS_FILE" "last_sync" 2>/dev/null || echo "")
233
-
234
- if [[ -z "$last_sync" ]]; then
235
- log_warning "last_sync field not found after update"
236
- else
237
- log_success "last_sync verified: $last_sync"
238
- fi
239
-
240
- # Check completion if it was a completion sync
241
- if [[ "$IS_COMPLETION" == "true" ]]; then
242
- local completion
243
- completion=$(get_frontmatter_field "$PROGRESS_FILE" "completion" 2>/dev/null || echo "0")
244
-
245
- if [[ "$completion" == "100" ]]; then
246
- log_success "Completion verified: 100%"
247
- else
248
- log_warning "Completion not set to 100%: $completion"
249
- fi
250
- fi
251
-
252
- # Verify file integrity
253
- if ! has_frontmatter "$PROGRESS_FILE"; then
254
- log_error "Frontmatter corrupted after update"
255
-
256
- # Restore from backup
257
- log_warning "Restoring from backup"
258
- cp "$backup_file" "$PROGRESS_FILE"
259
- return 1
260
- fi
261
-
262
- log_success "All updates verified"
263
- log_function_exit "verify_updates"
264
- return 0
265
- }
266
-
267
- # Display update results
268
- display_results() {
269
- print_section "✅ Frontmatter Update Results"
270
-
271
- echo "Issue: #$ISSUE_NUMBER"
272
- echo "Progress File: $PROGRESS_FILE"
273
- echo "Fields Updated: $updated_fields"
274
-
275
- echo ""
276
- echo "Updated Fields:"
277
-
278
- # Show current values of key fields
279
- local last_sync
280
- last_sync=$(get_frontmatter_field "$PROGRESS_FILE" "last_sync" 2>/dev/null || echo "Not set")
281
- echo " - last_sync: $last_sync"
282
-
283
- if [[ -n "$COMMENT_URL" ]] && [[ "$COMMENT_URL" != "null" ]]; then
284
- echo " - last_comment_url: $COMMENT_URL"
285
- fi
286
-
287
- if [[ "$IS_COMPLETION" == "true" ]]; then
288
- local completion
289
- completion=$(get_frontmatter_field "$PROGRESS_FILE" "completion" 2>/dev/null || echo "Unknown")
290
- echo " - completion: ${completion}%"
291
-
292
- local status
293
- status=$(get_frontmatter_field "$PROGRESS_FILE" "status" 2>/dev/null || echo "Unknown")
294
- echo " - status: $status"
295
- fi
296
-
297
- local issue_state
298
- issue_state=$(get_frontmatter_field "$PROGRESS_FILE" "issue_state" 2>/dev/null || echo "Unknown")
299
- echo " - issue_state: $issue_state"
300
-
301
- echo ""
302
- echo "✅ Frontmatter updated successfully"
303
-
304
- if [[ -n "$backup_file" ]]; then
305
- echo "📄 Backup saved: $backup_file"
306
- fi
307
- }
308
-
309
- # Cleanup function
310
- cleanup() {
311
- # Remove old backup files (keep last 5)
312
- if [[ -n "$PROGRESS_FILE" ]]; then
313
- local backup_dir
314
- backup_dir=$(dirname "$PROGRESS_FILE")
315
-
316
- log_debug "Cleaning old backups in: $backup_dir"
317
-
318
- # Find and remove old backups, keeping the 5 most recent
319
- find "$backup_dir" -name "$(basename "$PROGRESS_FILE").backup.*" -type f 2>/dev/null | \
320
- sort -r | \
321
- tail -n +6 | \
322
- while read -r old_backup; do
323
- log_debug "Removing old backup: $old_backup"
324
- rm -f "$old_backup"
325
- done
326
- fi
327
- }
328
-
329
- # Error handling
330
- handle_error() {
331
- local exit_code=$?
332
- log_error "Frontmatter update failed with exit code: $exit_code"
333
- log_error "Failed to update frontmatter for issue: #$ISSUE_NUMBER"
334
-
335
- # Restore from backup if available
336
- if [[ -n "$backup_file" ]] && [[ -f "$backup_file" ]]; then
337
- echo "⚠️ Restoring from backup: $backup_file"
338
- cp "$backup_file" "$PROGRESS_FILE"
339
- echo "✅ Backup restored"
340
- fi
341
-
342
- exit "$exit_code"
343
- }
344
-
345
- # Set up error handling and cleanup
346
- trap handle_error ERR
347
- trap cleanup EXIT
348
-
349
- # Validate arguments
350
- if [[ $# -lt 2 ]]; then
351
- echo "Usage: $0 <issue_number> <progress_file> [comment_url] [is_completion]"
352
- echo ""
353
- echo "Updates progress.md frontmatter after successful issue sync."
354
- echo ""
355
- echo "Arguments:"
356
- echo " issue_number GitHub issue number"
357
- echo " progress_file Path to progress.md file"
358
- echo " comment_url Optional: URL of posted comment"
359
- echo " is_completion Optional: 'true' if task is complete (default: false)"
360
- echo ""
361
- echo "Updates the following frontmatter fields:"
362
- echo " - last_sync: Current timestamp"
363
- echo " - last_comment_url: URL of the posted comment"
364
- echo " - issue_state: Current state from GitHub (open/closed)"
365
- echo " - completion: Set to 100 if is_completion=true"
366
- echo " - status: Set to 'completed' if is_completion=true"
367
- echo " - completed_at: Timestamp if is_completion=true"
368
- echo ""
369
- echo "Environment Variables:"
370
- echo " AUTOPM_LOG_LEVEL=0 Enable debug logging"
371
- echo ""
372
- echo "Features:"
373
- echo " - Automatic backup before modification"
374
- echo " - Verification of updates"
375
- echo " - Rollback on failure"
376
- echo " - Old backup cleanup (keeps last 5)"
377
- echo ""
378
- echo "Examples:"
379
- echo " $0 123 .claude/epics/auth/updates/123/progress.md"
380
- echo " $0 456 ./progress.md https://github.com/owner/repo/issues/456#issuecomment-123"
381
- echo " $0 789 ./progress.md \"\" true"
382
- echo ""
383
- exit 1
384
- fi
385
-
386
- # Run main function
387
- main "$@"
@@ -1,85 +0,0 @@
1
- # PM Scripts Library
2
-
3
- This directory contains shared utilities for PM command scripts.
4
-
5
- ## Logger
6
-
7
- The `logger.js` module provides consistent, colored logging across all PM commands.
8
-
9
- ### Usage
10
-
11
- ```javascript
12
- const { logInfo, logSuccess, logWarning, logError, logDebug } = require('./lib/logger');
13
-
14
- // Info message (blue ℹ icon)
15
- logInfo('Processing task...');
16
-
17
- // Success message (green ✓ icon)
18
- logSuccess('Task completed successfully');
19
-
20
- // Warning message (yellow ⚠ icon)
21
- logWarning('Task may require attention');
22
-
23
- // Error message (red ❌ icon)
24
- logError('Failed to process task', error);
25
- // The error parameter is optional and will display error.message and stack (if DEBUG=1)
26
-
27
- // Debug message (only shown if DEBUG=1)
28
- logDebug('Detailed debug information');
29
- ```
30
-
31
- ### Environment Variables
32
-
33
- - `DEBUG=1` - Enable debug logging and full error stack traces
34
-
35
- ### Color Constants
36
-
37
- If you need custom formatting, you can import the colors:
38
-
39
- ```javascript
40
- const { colors } = require('./lib/logger');
41
-
42
- console.log(`${colors.blue}Custom message${colors.reset}`);
43
- ```
44
-
45
- Available colors:
46
- - `colors.red`
47
- - `colors.green`
48
- - `colors.yellow`
49
- - `colors.blue`
50
- - `colors.cyan`
51
- - `colors.gray`
52
- - `colors.reset`
53
-
54
- ## Migration Guide
55
-
56
- To migrate existing PM scripts to use the logger:
57
-
58
- 1. Import the logger at the top of your file:
59
- ```javascript
60
- const { logError, logWarning, logInfo, logSuccess } = require('./lib/logger');
61
- ```
62
-
63
- 2. Replace `console.error()` calls:
64
- ```javascript
65
- // Before
66
- console.error('Error:', err.message);
67
-
68
- // After
69
- logError('Error description', err);
70
- ```
71
-
72
- 3. Add error handling to promise chains:
73
- ```javascript
74
- // Before
75
- const results = await Promise.all(promises);
76
-
77
- // After
78
- const promises = items.map(item =>
79
- processItem(item).catch(err => {
80
- logWarning(`Failed to process ${item.name}`, err);
81
- return defaultValue;
82
- })
83
- );
84
- const results = await Promise.all(promises);
85
- ```
@@ -1,119 +0,0 @@
1
- const fs = require('fs');
2
- const path = require('path');
3
-
4
- /**
5
- * Epic Discovery Utilities
6
- * Shared utilities for discovering epic directories in both flat and nested structures
7
- */
8
-
9
- /**
10
- * Helper function to check if directory contains epic.md
11
- * @param {string} dirPath - Path to check
12
- * @returns {boolean} - True if directory contains epic.md
13
- */
14
- function isEpicDir(dirPath) {
15
- return fs.existsSync(path.join(dirPath, 'epic.md'));
16
- }
17
-
18
- /**
19
- * Recursive function to find all epic directories
20
- * Supports both flat and nested multi-epic structures
21
- * @param {string} basePath - Base path to search from
22
- * @param {number} depth - Current recursion depth (max 3 levels)
23
- * @returns {Array<{name: string, path: string}>} - Array of epic directories
24
- */
25
- function findEpicDirs(basePath, depth = 0) {
26
- if (depth >= 3) {
27
- if (process.env.DEBUG) {
28
- console.error(`Maximum recursion depth reached at ${basePath}`);
29
- }
30
- return [];
31
- }
32
-
33
- const epicDirs = [];
34
-
35
- try {
36
- const entries = fs.readdirSync(basePath, { withFileTypes: true });
37
-
38
- for (const entry of entries) {
39
- if (!entry.isDirectory()) continue;
40
-
41
- const fullPath = path.join(basePath, entry.name);
42
-
43
- if (isEpicDir(fullPath)) {
44
- // This is an epic directory
45
- const relativePath = path.relative('.claude/epics', fullPath);
46
- epicDirs.push({ name: relativePath, path: fullPath });
47
- } else {
48
- // Check subdirectories (multi-epic structure)
49
- epicDirs.push(...findEpicDirs(fullPath, depth + 1));
50
- }
51
- }
52
- } catch (err) {
53
- // Log but don't fail
54
- if (process.env.DEBUG) {
55
- console.error(`Error reading directory ${basePath}:`, err.message);
56
- }
57
- }
58
-
59
- return epicDirs;
60
- }
61
-
62
- /**
63
- * Find all epic directories supporting both flat and nested structures
64
- * @returns {Array<{name: string, path: string}>} - Array of epic directories
65
- */
66
- function findAllEpicDirs() {
67
- const epicsPath = '.claude/epics';
68
-
69
- if (!fs.existsSync(epicsPath)) {
70
- return [];
71
- }
72
-
73
- const epicDirs = [];
74
-
75
- try {
76
- // First check if top-level directories are epic dirs (flat structure)
77
- // or if we need to search recursively (nested structure)
78
- const topLevelEntries = fs.readdirSync(epicsPath, { withFileTypes: true })
79
- .filter(dirent => dirent.isDirectory());
80
-
81
- for (const entry of topLevelEntries) {
82
- const fullPath = path.join(epicsPath, entry.name);
83
-
84
- try {
85
- // Check if this directory has task files (flat epic) or subdirectories (nested structure)
86
- const hasTaskFiles = fs.readdirSync(fullPath)
87
- .some(file => /^\d+.*\.md$/.test(file));
88
-
89
- const hasEpicMd = isEpicDir(fullPath);
90
-
91
- if (hasTaskFiles || hasEpicMd) {
92
- // This is a flat epic directory (backward compatible with epics without epic.md)
93
- epicDirs.push({ name: entry.name, path: fullPath });
94
- } else {
95
- // This might be a parent directory for nested epics
96
- epicDirs.push(...findEpicDirs(fullPath, 0));
97
- }
98
- } catch (err) {
99
- // Log but don't fail for unreadable directories
100
- if (process.env.DEBUG) {
101
- console.error(`Error checking directory ${fullPath}:`, err.message);
102
- }
103
- }
104
- }
105
- } catch (err) {
106
- // Log top-level errors in DEBUG mode
107
- if (process.env.DEBUG) {
108
- console.error(`Error in findAllEpicDirs:`, err.message);
109
- }
110
- }
111
-
112
- return epicDirs;
113
- }
114
-
115
- module.exports = {
116
- isEpicDir,
117
- findEpicDirs,
118
- findAllEpicDirs
119
- };
@@ -1,78 +0,0 @@
1
- /**
2
- * Logging utility for PM scripts
3
- * Provides consistent colored output across all PM commands
4
- */
5
-
6
- // ANSI color codes
7
- const colors = {
8
- reset: '\x1b[0m',
9
- red: '\x1b[31m',
10
- green: '\x1b[32m',
11
- yellow: '\x1b[33m',
12
- blue: '\x1b[34m',
13
- gray: '\x1b[90m',
14
- cyan: '\x1b[36m'
15
- };
16
-
17
- /**
18
- * Log an info message
19
- * @param {string} message - The message to log
20
- */
21
- function logInfo(message) {
22
- console.log(`${colors.blue}ℹ${colors.reset} ${message}`);
23
- }
24
-
25
- /**
26
- * Log a success message
27
- * @param {string} message - The message to log
28
- */
29
- function logSuccess(message) {
30
- console.log(`${colors.green}✓${colors.reset} ${message}`);
31
- }
32
-
33
- /**
34
- * Log a warning message
35
- * @param {string} message - The message to log
36
- */
37
- function logWarning(message) {
38
- console.warn(`${colors.yellow}⚠${colors.reset} ${message}`);
39
- }
40
-
41
- /**
42
- * Log an error message
43
- * @param {string} message - The message to log
44
- * @param {Error} [error] - Optional error object for details
45
- */
46
- function logError(message, error) {
47
- console.error(`${colors.red}❌${colors.reset} ${message}`);
48
- if (error && error.message) {
49
- console.error(`${colors.gray} ${error.message}${colors.reset}`);
50
- }
51
- if (error && error.stack && process.env.DEBUG) {
52
- console.error(`${colors.gray}${error.stack}${colors.reset}`);
53
- }
54
- }
55
-
56
- /**
57
- * Log a debug message (only shown if DEBUG env var is set)
58
- * @param {string} message - The message to log
59
- */
60
- function logDebug(message) {
61
- if (process.env.DEBUG) {
62
- console.log(`${colors.gray}[DEBUG]${colors.reset} ${message}`);
63
- }
64
- }
65
-
66
- /**
67
- * Export colors for custom formatting
68
- */
69
- const logColors = colors;
70
-
71
- module.exports = {
72
- logInfo,
73
- logSuccess,
74
- logWarning,
75
- logError,
76
- logDebug,
77
- colors: logColors
78
- };