claude-flow-novice 2.15.5 → 2.15.6

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 (440) hide show
  1. package/.claude/cfn-extras/.gs-api-quota.json +16 -0
  2. package/.claude/cfn-extras/.gs-progress-state.json +22 -0
  3. package/.claude/cfn-extras/GOOGLE_SHEETS_IMPLEMENTATION_SUMMARY.md +414 -0
  4. package/.claude/cfn-extras/agents/google-sheets/README.md +114 -0
  5. package/.claude/cfn-extras/agents/google-sheets/google-sheets-advanced-analytics-specialist.md +288 -0
  6. package/.claude/cfn-extras/agents/google-sheets/google-sheets-api-integrator.md +127 -0
  7. package/.claude/cfn-extras/agents/google-sheets/google-sheets-automation-scripting-specialist.md +195 -0
  8. package/.claude/cfn-extras/agents/google-sheets/google-sheets-business-validator.md +179 -0
  9. package/.claude/cfn-extras/agents/google-sheets/google-sheets-collaboration-security-specialist.md +240 -0
  10. package/.claude/cfn-extras/agents/google-sheets/google-sheets-coordinator.md +214 -0
  11. package/.claude/cfn-extras/agents/google-sheets/google-sheets-data-transformer.md +127 -0
  12. package/.claude/cfn-extras/agents/google-sheets/google-sheets-data-validation-quality-specialist.md +177 -0
  13. package/.claude/cfn-extras/agents/google-sheets/google-sheets-data-validator.md +119 -0
  14. package/.claude/cfn-extras/agents/google-sheets/google-sheets-data-visualization-specialist.md +135 -0
  15. package/.claude/cfn-extras/agents/google-sheets/google-sheets-design-layout-specialist.md +109 -0
  16. package/.claude/cfn-extras/agents/google-sheets/google-sheets-formula-engineer.md +127 -0
  17. package/.claude/cfn-extras/agents/google-sheets/google-sheets-formula-engineering-specialist.md +138 -0
  18. package/.claude/cfn-extras/agents/google-sheets/google-sheets-formula-validator.md +128 -0
  19. package/.claude/cfn-extras/agents/google-sheets/google-sheets-generalist.md +645 -0
  20. package/.claude/cfn-extras/agents/google-sheets/google-sheets-integration-api-specialist.md +258 -0
  21. package/.claude/cfn-extras/agents/google-sheets/google-sheets-performance-analyst.md +125 -0
  22. package/.claude/cfn-extras/agents/google-sheets/google-sheets-performance-optimization-specialist.md +211 -0
  23. package/.claude/cfn-extras/agents/google-sheets/google-sheets-schema-designer.md +130 -0
  24. package/.claude/cfn-extras/agents/google-sheets/google-sheets-template-architecture-specialist.md +259 -0
  25. package/.claude/cfn-extras/docs/GOOGLE_SHEETS_CFN_LOOP.md +617 -0
  26. package/.claude/cfn-extras/skills/GOOGLE_SHEETS_SKILLS_README.md +453 -0
  27. package/.claude/cfn-extras/skills/google-sheets-api-coordinator/SKILL.md +272 -0
  28. package/.claude/cfn-extras/skills/google-sheets-api-coordinator/api-call.sh +254 -0
  29. package/.claude/cfn-extras/skills/google-sheets-api-coordinator/test.sh +174 -0
  30. package/.claude/cfn-extras/skills/google-sheets-api-coordinator/validate.sh +98 -0
  31. package/.claude/cfn-extras/skills/google-sheets-decomposition/SKILL.md +269 -0
  32. package/.claude/cfn-extras/skills/google-sheets-decomposition/decompose.sh +313 -0
  33. package/.claude/cfn-extras/skills/google-sheets-formula-builder/SKILL.md +237 -0
  34. package/.claude/cfn-extras/skills/google-sheets-formula-builder/build-formula.sh +220 -0
  35. package/.claude/cfn-extras/skills/google-sheets-formula-builder/test.sh +172 -0
  36. package/.claude/cfn-extras/skills/google-sheets-formula-builder/validate.sh +98 -0
  37. package/.claude/cfn-extras/skills/google-sheets-progress/SKILL.md +287 -0
  38. package/.claude/cfn-extras/skills/google-sheets-progress/test.sh +385 -0
  39. package/.claude/cfn-extras/skills/google-sheets-progress/track-progress.sh +516 -0
  40. package/.claude/cfn-extras/skills/google-sheets-progress/validate.sh +119 -0
  41. package/.claude/cfn-extras/skills/google-sheets-sprint-order/SKILL.md +277 -0
  42. package/.claude/cfn-extras/skills/google-sheets-sprint-order/order-sprints.sh +233 -0
  43. package/.claude/cfn-extras/skills/google-sheets-validation/SKILL.md +352 -0
  44. package/.claude/cfn-extras/skills/google-sheets-validation/test.sh +355 -0
  45. package/.claude/cfn-extras/skills/google-sheets-validation/validate-state.sh +374 -0
  46. package/.claude/cfn-extras/skills/google-sheets-validation/validate.sh +128 -0
  47. package/.claude/commands/cfn-context.md +10 -0
  48. package/.claude/commands/cfn-loop-cli.md +36 -15
  49. package/.claude/commands/google-sheets/google-sheets-loop.md +289 -0
  50. package/.claude/skills/cfn-agent-selector/SKILL.md +143 -0
  51. package/.claude/skills/cfn-agent-selector/select-agents.sh +94 -0
  52. package/.claude/skills/cfn-agent-spawning/get-agent-provider-env.sh +22 -2
  53. package/.claude/skills/cfn-docker-agent-spawning/spawn-agent.sh +21 -2
  54. package/.claude/skills/cfn-docker-loop-orchestration/orchestrate.sh +11 -5
  55. package/.claude/skills/cfn-docker-redis-coordination/MIGRATION_SUMMARY.md +348 -0
  56. package/.claude/skills/cfn-docker-redis-coordination/README.md +294 -0
  57. package/.claude/skills/cfn-docker-redis-coordination/jest.config.js +37 -0
  58. package/.claude/skills/cfn-docker-redis-coordination/package-lock.json +5259 -0
  59. package/.claude/skills/cfn-docker-redis-coordination/package.json +40 -0
  60. package/.claude/skills/cfn-docker-redis-coordination/src/coordinator.ts +801 -0
  61. package/.claude/skills/cfn-docker-redis-coordination/src/index.ts +42 -0
  62. package/.claude/skills/cfn-docker-redis-coordination/src/types.ts +351 -0
  63. package/.claude/skills/cfn-docker-redis-coordination/tests/coordinator.test.ts +1464 -0
  64. package/.claude/skills/cfn-docker-redis-coordination/tsconfig.json +30 -0
  65. package/.claude/skills/cfn-loop-orchestration/.eslintrc.js +56 -0
  66. package/.claude/skills/cfn-loop-orchestration/.prettierrc.json +18 -0
  67. package/.claude/skills/cfn-loop-orchestration/README.md +149 -41
  68. package/.claude/skills/cfn-loop-orchestration/jest.config.js +67 -0
  69. package/.claude/skills/cfn-loop-orchestration/orchestrate-wrapper.sh +268 -0
  70. package/.claude/skills/cfn-loop-orchestration/orchestrate.sh +91 -8
  71. package/.claude/skills/cfn-loop-orchestration/package-lock.json +5470 -0
  72. package/.claude/skills/cfn-loop-orchestration/package.json +49 -0
  73. package/.claude/skills/cfn-loop-orchestration/src/agent-spawner/agent-spawner.ts +34 -0
  74. package/.claude/skills/cfn-loop-orchestration/src/gate-checker/gate-checker.ts +36 -0
  75. package/.claude/skills/cfn-loop-orchestration/src/index.ts +14 -0
  76. package/.claude/skills/cfn-loop-orchestration/src/orchestrator/orchestrator.ts +31 -0
  77. package/.claude/skills/cfn-loop-orchestration/src/redis/redis-coordinator.ts +72 -0
  78. package/.claude/skills/cfn-loop-orchestration/src/types.ts +188 -0
  79. package/.claude/skills/cfn-loop-orchestration/src/utils/logger.ts +32 -0
  80. package/.claude/skills/cfn-loop-orchestration/tests/setup.ts +22 -0
  81. package/.claude/skills/cfn-loop-orchestration/tests/types.test.ts +132 -0
  82. package/.claude/skills/cfn-loop-orchestration/tsconfig.json +54 -0
  83. package/.claude/skills/cfn-redis-coordination/bash-wrappers/store-context.sh +23 -0
  84. package/.claude/skills/cfn-redis-coordination/dist/agent-logger.d.ts +92 -0
  85. package/.claude/skills/cfn-redis-coordination/dist/agent-logger.d.ts.map +1 -0
  86. package/.claude/skills/cfn-redis-coordination/dist/agent-logger.js +329 -0
  87. package/.claude/skills/cfn-redis-coordination/dist/agent-logger.js.map +1 -0
  88. package/.claude/skills/cfn-redis-coordination/dist/agent-recovery.d.ts +75 -0
  89. package/.claude/skills/cfn-redis-coordination/dist/agent-recovery.d.ts.map +1 -0
  90. package/.claude/skills/cfn-redis-coordination/dist/agent-recovery.js +302 -0
  91. package/.claude/skills/cfn-redis-coordination/dist/agent-recovery.js.map +1 -0
  92. package/.claude/skills/cfn-redis-coordination/dist/completion-reporter.d.ts +58 -0
  93. package/.claude/skills/cfn-redis-coordination/dist/completion-reporter.d.ts.map +1 -0
  94. package/.claude/skills/cfn-redis-coordination/dist/completion-reporter.js +237 -0
  95. package/.claude/skills/cfn-redis-coordination/dist/completion-reporter.js.map +1 -0
  96. package/.claude/skills/cfn-redis-coordination/dist/context-manager.d.ts +63 -0
  97. package/.claude/skills/cfn-redis-coordination/dist/context-manager.d.ts.map +1 -0
  98. package/.claude/skills/cfn-redis-coordination/dist/context-manager.js +230 -0
  99. package/.claude/skills/cfn-redis-coordination/dist/context-manager.js.map +1 -0
  100. package/.claude/skills/cfn-redis-coordination/dist/index.d.ts +45 -0
  101. package/.claude/skills/cfn-redis-coordination/dist/index.d.ts.map +1 -0
  102. package/.claude/skills/cfn-redis-coordination/dist/index.js +114 -0
  103. package/.claude/skills/cfn-redis-coordination/dist/index.js.map +1 -0
  104. package/.claude/skills/cfn-redis-coordination/dist/mode-detector.d.ts +31 -0
  105. package/.claude/skills/cfn-redis-coordination/dist/mode-detector.d.ts.map +1 -0
  106. package/.claude/skills/cfn-redis-coordination/dist/mode-detector.js +185 -0
  107. package/.claude/skills/cfn-redis-coordination/dist/mode-detector.js.map +1 -0
  108. package/.claude/skills/cfn-redis-coordination/dist/redis-client.d.ts +191 -0
  109. package/.claude/skills/cfn-redis-coordination/dist/redis-client.d.ts.map +1 -0
  110. package/.claude/skills/cfn-redis-coordination/dist/redis-client.js +509 -0
  111. package/.claude/skills/cfn-redis-coordination/dist/redis-client.js.map +1 -0
  112. package/.claude/skills/cfn-redis-coordination/dist/result-collector.d.ts +75 -0
  113. package/.claude/skills/cfn-redis-coordination/dist/result-collector.d.ts.map +1 -0
  114. package/.claude/skills/cfn-redis-coordination/dist/result-collector.js +281 -0
  115. package/.claude/skills/cfn-redis-coordination/dist/result-collector.js.map +1 -0
  116. package/.claude/skills/cfn-redis-coordination/dist/swarm-manager.d.ts +75 -0
  117. package/.claude/skills/cfn-redis-coordination/dist/swarm-manager.d.ts.map +1 -0
  118. package/.claude/skills/cfn-redis-coordination/dist/swarm-manager.js +354 -0
  119. package/.claude/skills/cfn-redis-coordination/dist/swarm-manager.js.map +1 -0
  120. package/.claude/skills/cfn-redis-coordination/dist/task-analyzer.d.ts +62 -0
  121. package/.claude/skills/cfn-redis-coordination/dist/task-analyzer.d.ts.map +1 -0
  122. package/.claude/skills/cfn-redis-coordination/dist/task-analyzer.js +305 -0
  123. package/.claude/skills/cfn-redis-coordination/dist/task-analyzer.js.map +1 -0
  124. package/.claude/skills/cfn-redis-coordination/dist/task-executor.d.ts +97 -0
  125. package/.claude/skills/cfn-redis-coordination/dist/task-executor.d.ts.map +1 -0
  126. package/.claude/skills/cfn-redis-coordination/dist/task-executor.js +283 -0
  127. package/.claude/skills/cfn-redis-coordination/dist/task-executor.js.map +1 -0
  128. package/.claude/skills/cfn-redis-coordination/dist/types.d.ts +176 -0
  129. package/.claude/skills/cfn-redis-coordination/dist/types.d.ts.map +1 -0
  130. package/.claude/skills/cfn-redis-coordination/dist/types.js +81 -0
  131. package/.claude/skills/cfn-redis-coordination/dist/types.js.map +1 -0
  132. package/.claude/skills/cfn-redis-coordination/dist/waiting-coordinator.d.ts +86 -0
  133. package/.claude/skills/cfn-redis-coordination/dist/waiting-coordinator.d.ts.map +1 -0
  134. package/.claude/skills/cfn-redis-coordination/dist/waiting-coordinator.js +419 -0
  135. package/.claude/skills/cfn-redis-coordination/dist/waiting-coordinator.js.map +1 -0
  136. package/.claude/skills/cfn-redis-coordination/docs/migration/PHASE_3_REDIS_COORDINATION_COMPLETION_REPORT.md +553 -0
  137. package/.claude/skills/cfn-redis-coordination/jest.config.js +23 -0
  138. package/.claude/skills/cfn-redis-coordination/package-lock.json +5272 -0
  139. package/.claude/skills/cfn-redis-coordination/package.json +45 -0
  140. package/.claude/skills/cfn-redis-coordination/redis-cli-wrapper.sh +21 -8
  141. package/.claude/skills/cfn-redis-coordination/src/agent-logger.ts +446 -0
  142. package/.claude/skills/cfn-redis-coordination/src/agent-recovery.ts +454 -0
  143. package/.claude/skills/cfn-redis-coordination/src/completion-reporter.ts +396 -0
  144. package/.claude/skills/cfn-redis-coordination/src/context-manager.ts +327 -0
  145. package/.claude/skills/cfn-redis-coordination/src/index.ts +82 -0
  146. package/.claude/skills/cfn-redis-coordination/src/mode-detector.ts +155 -0
  147. package/.claude/skills/cfn-redis-coordination/src/redis/redis-client.ts +305 -0
  148. package/.claude/skills/cfn-redis-coordination/src/redis/redis-functions.ts +283 -0
  149. package/.claude/skills/cfn-redis-coordination/src/redis-client.ts +654 -0
  150. package/.claude/skills/cfn-redis-coordination/src/result-collector.ts +437 -0
  151. package/.claude/skills/cfn-redis-coordination/src/swarm-manager.ts +494 -0
  152. package/.claude/skills/cfn-redis-coordination/src/task-analyzer.ts +404 -0
  153. package/.claude/skills/cfn-redis-coordination/src/task-executor.ts +423 -0
  154. package/.claude/skills/cfn-redis-coordination/src/types.ts +235 -0
  155. package/.claude/skills/cfn-redis-coordination/src/waiting-coordinator.ts +587 -0
  156. package/.claude/skills/cfn-redis-coordination/test-connection-attempts.js +70 -0
  157. package/.claude/skills/cfn-redis-coordination/test-mode-simple.js +121 -0
  158. package/.claude/skills/cfn-redis-coordination/test-redis-check.js +84 -0
  159. package/.claude/skills/cfn-redis-coordination/test-task-mode-redis.cjs +391 -0
  160. package/.claude/skills/cfn-redis-coordination/tests/coordination.test.ts +779 -0
  161. package/.claude/skills/cfn-redis-coordination/tsconfig.json +31 -0
  162. package/claude-assets/agents/cfn-dev-team/coordinators/cfn-v3-coordinator.md +172 -2
  163. package/claude-assets/agents/cfn-dev-team/testers/api-testing-specialist.md +1 -1
  164. package/claude-assets/agents/custom/cfn-redis-operations.md +530 -0
  165. package/claude-assets/agents/custom/cfn-system-expert.md +77 -0
  166. package/claude-assets/cfn-extras/.gs-api-quota.json +16 -0
  167. package/claude-assets/cfn-extras/.gs-progress-state.json +22 -0
  168. package/claude-assets/cfn-extras/GOOGLE_SHEETS_IMPLEMENTATION_SUMMARY.md +414 -0
  169. package/claude-assets/cfn-extras/agents/google-sheets/README.md +114 -0
  170. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-advanced-analytics-specialist.md +288 -0
  171. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-api-integrator.md +127 -0
  172. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-automation-scripting-specialist.md +195 -0
  173. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-business-validator.md +179 -0
  174. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-collaboration-security-specialist.md +240 -0
  175. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-coordinator.md +214 -0
  176. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-data-transformer.md +127 -0
  177. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-data-validation-quality-specialist.md +177 -0
  178. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-data-validator.md +119 -0
  179. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-data-visualization-specialist.md +135 -0
  180. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-design-layout-specialist.md +109 -0
  181. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-formula-engineer.md +127 -0
  182. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-formula-engineering-specialist.md +138 -0
  183. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-formula-validator.md +128 -0
  184. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-generalist.md +645 -0
  185. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-integration-api-specialist.md +258 -0
  186. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-performance-analyst.md +125 -0
  187. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-performance-optimization-specialist.md +211 -0
  188. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-schema-designer.md +130 -0
  189. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-template-architecture-specialist.md +259 -0
  190. package/claude-assets/cfn-extras/docs/GOOGLE_SHEETS_CFN_LOOP.md +617 -0
  191. package/claude-assets/cfn-extras/skills/GOOGLE_SHEETS_SKILLS_README.md +453 -0
  192. package/claude-assets/cfn-extras/skills/google-sheets-api-coordinator/SKILL.md +272 -0
  193. package/claude-assets/cfn-extras/skills/google-sheets-api-coordinator/api-call.sh +254 -0
  194. package/claude-assets/cfn-extras/skills/google-sheets-api-coordinator/test.sh +174 -0
  195. package/claude-assets/cfn-extras/skills/google-sheets-api-coordinator/validate.sh +98 -0
  196. package/claude-assets/cfn-extras/skills/google-sheets-decomposition/SKILL.md +269 -0
  197. package/claude-assets/cfn-extras/skills/google-sheets-decomposition/decompose.sh +313 -0
  198. package/claude-assets/cfn-extras/skills/google-sheets-formula-builder/SKILL.md +237 -0
  199. package/claude-assets/cfn-extras/skills/google-sheets-formula-builder/build-formula.sh +220 -0
  200. package/claude-assets/cfn-extras/skills/google-sheets-formula-builder/test.sh +172 -0
  201. package/claude-assets/cfn-extras/skills/google-sheets-formula-builder/validate.sh +98 -0
  202. package/claude-assets/cfn-extras/skills/google-sheets-progress/SKILL.md +287 -0
  203. package/claude-assets/cfn-extras/skills/google-sheets-progress/test.sh +385 -0
  204. package/claude-assets/cfn-extras/skills/google-sheets-progress/track-progress.sh +516 -0
  205. package/claude-assets/cfn-extras/skills/google-sheets-progress/validate.sh +119 -0
  206. package/claude-assets/cfn-extras/skills/google-sheets-sprint-order/SKILL.md +277 -0
  207. package/claude-assets/cfn-extras/skills/google-sheets-sprint-order/order-sprints.sh +233 -0
  208. package/claude-assets/cfn-extras/skills/google-sheets-validation/SKILL.md +352 -0
  209. package/claude-assets/cfn-extras/skills/google-sheets-validation/test.sh +355 -0
  210. package/claude-assets/cfn-extras/skills/google-sheets-validation/validate-state.sh +374 -0
  211. package/claude-assets/cfn-extras/skills/google-sheets-validation/validate.sh +128 -0
  212. package/claude-assets/commands/cfn-context.md +10 -0
  213. package/claude-assets/commands/cfn-loop-cli.md +36 -15
  214. package/claude-assets/commands/google-sheets/google-sheets-loop.md +289 -0
  215. package/claude-assets/hooks/cfn-pre-execution/SESSION_START_README.md +87 -0
  216. package/claude-assets/hooks/cfn-pre-execution/TEST_SESSION_START.md +128 -0
  217. package/claude-assets/hooks/cfn-pre-execution/session-start-context.sh +111 -0
  218. package/claude-assets/skills/cfn-agent-selection-with-fallback/INTEGRATION_EXAMPLE.md +209 -0
  219. package/claude-assets/skills/cfn-agent-selection-with-fallback/README.md +130 -0
  220. package/claude-assets/skills/cfn-agent-selection-with-fallback/SKILL.md +243 -0
  221. package/claude-assets/skills/cfn-agent-selection-with-fallback/agent-mappings.json +142 -0
  222. package/claude-assets/skills/cfn-agent-selection-with-fallback/select-agents.sh +173 -0
  223. package/claude-assets/skills/cfn-agent-selection-with-fallback/task-classifier.sh +71 -0
  224. package/claude-assets/skills/cfn-agent-selection-with-fallback/test-agent-selection.sh +282 -0
  225. package/claude-assets/skills/cfn-agent-selector/SKILL.md +143 -0
  226. package/claude-assets/skills/cfn-agent-selector/select-agents.sh +94 -0
  227. package/claude-assets/skills/cfn-agent-spawning/get-agent-provider-env.sh +22 -2
  228. package/claude-assets/skills/cfn-docker-agent-spawning/spawn-agent.sh +21 -2
  229. package/claude-assets/skills/cfn-docker-coordination/.eslintrc.json +33 -0
  230. package/claude-assets/skills/cfn-docker-coordination/README.md +349 -0
  231. package/claude-assets/skills/cfn-docker-coordination/docker-helpers.sh +433 -0
  232. package/claude-assets/skills/cfn-docker-coordination/jest.config.js +25 -0
  233. package/claude-assets/skills/cfn-docker-coordination/package-lock.json +6827 -0
  234. package/claude-assets/skills/cfn-docker-coordination/package.json +38 -0
  235. package/claude-assets/skills/cfn-docker-coordination/src/agent-container.ts +471 -0
  236. package/claude-assets/skills/cfn-docker-coordination/src/docker-client.ts +483 -0
  237. package/claude-assets/skills/cfn-docker-coordination/src/health-checker.ts +418 -0
  238. package/claude-assets/skills/cfn-docker-coordination/src/index.ts +45 -0
  239. package/claude-assets/skills/cfn-docker-coordination/src/network-manager.ts +377 -0
  240. package/claude-assets/skills/cfn-docker-coordination/src/types.ts +412 -0
  241. package/claude-assets/skills/cfn-docker-coordination/src/volume-manager.ts +389 -0
  242. package/claude-assets/skills/cfn-docker-coordination/tests/agent-container.test.ts +379 -0
  243. package/claude-assets/skills/cfn-docker-coordination/tests/docker-client.test.ts +345 -0
  244. package/claude-assets/skills/cfn-docker-coordination/tests/health-checker.test.ts +535 -0
  245. package/claude-assets/skills/cfn-docker-coordination/tests/integration.test.ts +193 -0
  246. package/claude-assets/skills/cfn-docker-coordination/tests/network-manager.test.ts +352 -0
  247. package/claude-assets/skills/cfn-docker-coordination/tests/setup.ts +36 -0
  248. package/claude-assets/skills/cfn-docker-coordination/tsconfig.json +29 -0
  249. package/claude-assets/skills/cfn-docker-logging/INTEGRATION.md +268 -0
  250. package/claude-assets/skills/cfn-docker-logging/SAMPLE_OUTPUTS.md +237 -0
  251. package/claude-assets/skills/cfn-docker-logging/SKILL.md +442 -0
  252. package/claude-assets/skills/cfn-docker-logging/capture-container-logs.sh +120 -0
  253. package/claude-assets/skills/cfn-docker-logging/enable-logging.sh +430 -0
  254. package/claude-assets/skills/cfn-docker-logging/init-hybrid-logging.sh +210 -0
  255. package/claude-assets/skills/cfn-docker-logging/queries/analytics-summary.sh +87 -0
  256. package/claude-assets/skills/cfn-docker-logging/queries/query-agent-timeline.sh +51 -0
  257. package/claude-assets/skills/cfn-docker-logging/queries/query-consensus-history.sh +56 -0
  258. package/claude-assets/skills/cfn-docker-logging/queries/query-coordination-timeline.sh +39 -0
  259. package/claude-assets/skills/cfn-docker-logging/queries/query-failed-containers.sh +40 -0
  260. package/claude-assets/skills/cfn-docker-logging/queries/query-gate-checks.sh +39 -0
  261. package/claude-assets/skills/cfn-docker-logging/schema.sql +111 -0
  262. package/claude-assets/skills/cfn-docker-logging/sqlite-helpers.sh +240 -0
  263. package/claude-assets/skills/cfn-docker-logging/test-hybrid-logging.sh +331 -0
  264. package/claude-assets/skills/cfn-docker-loop-orchestration/orchestrate.sh +11 -5
  265. package/claude-assets/skills/cfn-docker-redis-coordination/MIGRATION_SUMMARY.md +348 -0
  266. package/claude-assets/skills/cfn-docker-redis-coordination/README.md +294 -0
  267. package/claude-assets/skills/cfn-docker-redis-coordination/jest.config.js +37 -0
  268. package/claude-assets/skills/cfn-docker-redis-coordination/package-lock.json +5259 -0
  269. package/claude-assets/skills/cfn-docker-redis-coordination/package.json +40 -0
  270. package/claude-assets/skills/cfn-docker-redis-coordination/src/coordinator.ts +801 -0
  271. package/claude-assets/skills/cfn-docker-redis-coordination/src/index.ts +42 -0
  272. package/claude-assets/skills/cfn-docker-redis-coordination/src/types.ts +351 -0
  273. package/claude-assets/skills/cfn-docker-redis-coordination/tests/coordinator.test.ts +1464 -0
  274. package/claude-assets/skills/cfn-docker-redis-coordination/tsconfig.json +30 -0
  275. package/claude-assets/skills/cfn-error-logging/.eslintrc.json +57 -0
  276. package/claude-assets/skills/cfn-error-logging/.prettierrc.json +10 -0
  277. package/claude-assets/skills/cfn-error-logging/MIGRATION_SUMMARY.md +485 -0
  278. package/claude-assets/skills/cfn-error-logging/package.json +47 -0
  279. package/claude-assets/skills/cfn-error-logging/src/error-logger.ts +1042 -0
  280. package/claude-assets/skills/cfn-error-logging/src/index.ts +12 -0
  281. package/claude-assets/skills/cfn-error-logging/src/types.ts +456 -0
  282. package/claude-assets/skills/cfn-error-logging/tests/error-logger.test.ts +1302 -0
  283. package/claude-assets/skills/cfn-error-logging/tsconfig.json +38 -0
  284. package/claude-assets/skills/cfn-loop-orchestration/.eslintrc.js +56 -0
  285. package/claude-assets/skills/cfn-loop-orchestration/.prettierrc.json +18 -0
  286. package/claude-assets/skills/cfn-loop-orchestration/README.md +149 -41
  287. package/claude-assets/skills/cfn-loop-orchestration/jest.config.js +67 -0
  288. package/claude-assets/skills/cfn-loop-orchestration/orchestrate-wrapper.sh +268 -0
  289. package/claude-assets/skills/cfn-loop-orchestration/orchestrate.sh +91 -8
  290. package/claude-assets/skills/cfn-loop-orchestration/package-lock.json +5470 -0
  291. package/claude-assets/skills/cfn-loop-orchestration/package.json +49 -0
  292. package/claude-assets/skills/cfn-loop-orchestration/src/agent-spawner/agent-spawner.ts +34 -0
  293. package/claude-assets/skills/cfn-loop-orchestration/src/gate-checker/gate-checker.ts +36 -0
  294. package/claude-assets/skills/cfn-loop-orchestration/src/index.ts +14 -0
  295. package/claude-assets/skills/cfn-loop-orchestration/src/orchestrator/orchestrator.ts +31 -0
  296. package/claude-assets/skills/cfn-loop-orchestration/src/redis/redis-coordinator.ts +72 -0
  297. package/claude-assets/skills/cfn-loop-orchestration/src/types.ts +188 -0
  298. package/claude-assets/skills/cfn-loop-orchestration/src/utils/logger.ts +32 -0
  299. package/claude-assets/skills/cfn-loop-orchestration/tests/setup.ts +22 -0
  300. package/claude-assets/skills/cfn-loop-orchestration/tests/types.test.ts +132 -0
  301. package/claude-assets/skills/cfn-loop-orchestration/tsconfig.json +54 -0
  302. package/claude-assets/skills/cfn-redis-coordination/bash-wrappers/store-context.sh +23 -0
  303. package/claude-assets/skills/cfn-redis-coordination/dist/agent-logger.d.ts +92 -0
  304. package/claude-assets/skills/cfn-redis-coordination/dist/agent-logger.d.ts.map +1 -0
  305. package/claude-assets/skills/cfn-redis-coordination/dist/agent-logger.js +329 -0
  306. package/claude-assets/skills/cfn-redis-coordination/dist/agent-logger.js.map +1 -0
  307. package/claude-assets/skills/cfn-redis-coordination/dist/agent-recovery.d.ts +75 -0
  308. package/claude-assets/skills/cfn-redis-coordination/dist/agent-recovery.d.ts.map +1 -0
  309. package/claude-assets/skills/cfn-redis-coordination/dist/agent-recovery.js +302 -0
  310. package/claude-assets/skills/cfn-redis-coordination/dist/agent-recovery.js.map +1 -0
  311. package/claude-assets/skills/cfn-redis-coordination/dist/completion-reporter.d.ts +58 -0
  312. package/claude-assets/skills/cfn-redis-coordination/dist/completion-reporter.d.ts.map +1 -0
  313. package/claude-assets/skills/cfn-redis-coordination/dist/completion-reporter.js +237 -0
  314. package/claude-assets/skills/cfn-redis-coordination/dist/completion-reporter.js.map +1 -0
  315. package/claude-assets/skills/cfn-redis-coordination/dist/context-manager.d.ts +63 -0
  316. package/claude-assets/skills/cfn-redis-coordination/dist/context-manager.d.ts.map +1 -0
  317. package/claude-assets/skills/cfn-redis-coordination/dist/context-manager.js +230 -0
  318. package/claude-assets/skills/cfn-redis-coordination/dist/context-manager.js.map +1 -0
  319. package/claude-assets/skills/cfn-redis-coordination/dist/index.d.ts +45 -0
  320. package/claude-assets/skills/cfn-redis-coordination/dist/index.d.ts.map +1 -0
  321. package/claude-assets/skills/cfn-redis-coordination/dist/index.js +114 -0
  322. package/claude-assets/skills/cfn-redis-coordination/dist/index.js.map +1 -0
  323. package/claude-assets/skills/cfn-redis-coordination/dist/mode-detector.d.ts +31 -0
  324. package/claude-assets/skills/cfn-redis-coordination/dist/mode-detector.d.ts.map +1 -0
  325. package/claude-assets/skills/cfn-redis-coordination/dist/mode-detector.js +185 -0
  326. package/claude-assets/skills/cfn-redis-coordination/dist/mode-detector.js.map +1 -0
  327. package/claude-assets/skills/cfn-redis-coordination/dist/redis-client.d.ts +191 -0
  328. package/claude-assets/skills/cfn-redis-coordination/dist/redis-client.d.ts.map +1 -0
  329. package/claude-assets/skills/cfn-redis-coordination/dist/redis-client.js +509 -0
  330. package/claude-assets/skills/cfn-redis-coordination/dist/redis-client.js.map +1 -0
  331. package/claude-assets/skills/cfn-redis-coordination/dist/result-collector.d.ts +75 -0
  332. package/claude-assets/skills/cfn-redis-coordination/dist/result-collector.d.ts.map +1 -0
  333. package/claude-assets/skills/cfn-redis-coordination/dist/result-collector.js +281 -0
  334. package/claude-assets/skills/cfn-redis-coordination/dist/result-collector.js.map +1 -0
  335. package/claude-assets/skills/cfn-redis-coordination/dist/swarm-manager.d.ts +75 -0
  336. package/claude-assets/skills/cfn-redis-coordination/dist/swarm-manager.d.ts.map +1 -0
  337. package/claude-assets/skills/cfn-redis-coordination/dist/swarm-manager.js +354 -0
  338. package/claude-assets/skills/cfn-redis-coordination/dist/swarm-manager.js.map +1 -0
  339. package/claude-assets/skills/cfn-redis-coordination/dist/task-analyzer.d.ts +62 -0
  340. package/claude-assets/skills/cfn-redis-coordination/dist/task-analyzer.d.ts.map +1 -0
  341. package/claude-assets/skills/cfn-redis-coordination/dist/task-analyzer.js +305 -0
  342. package/claude-assets/skills/cfn-redis-coordination/dist/task-analyzer.js.map +1 -0
  343. package/claude-assets/skills/cfn-redis-coordination/dist/task-executor.d.ts +97 -0
  344. package/claude-assets/skills/cfn-redis-coordination/dist/task-executor.d.ts.map +1 -0
  345. package/claude-assets/skills/cfn-redis-coordination/dist/task-executor.js +283 -0
  346. package/claude-assets/skills/cfn-redis-coordination/dist/task-executor.js.map +1 -0
  347. package/claude-assets/skills/cfn-redis-coordination/dist/types.d.ts +176 -0
  348. package/claude-assets/skills/cfn-redis-coordination/dist/types.d.ts.map +1 -0
  349. package/claude-assets/skills/cfn-redis-coordination/dist/types.js +81 -0
  350. package/claude-assets/skills/cfn-redis-coordination/dist/types.js.map +1 -0
  351. package/claude-assets/skills/cfn-redis-coordination/dist/waiting-coordinator.d.ts +86 -0
  352. package/claude-assets/skills/cfn-redis-coordination/dist/waiting-coordinator.d.ts.map +1 -0
  353. package/claude-assets/skills/cfn-redis-coordination/dist/waiting-coordinator.js +419 -0
  354. package/claude-assets/skills/cfn-redis-coordination/dist/waiting-coordinator.js.map +1 -0
  355. package/claude-assets/skills/cfn-redis-coordination/docs/migration/PHASE_3_REDIS_COORDINATION_COMPLETION_REPORT.md +553 -0
  356. package/claude-assets/skills/cfn-redis-coordination/jest.config.js +23 -0
  357. package/claude-assets/skills/cfn-redis-coordination/package-lock.json +5272 -0
  358. package/claude-assets/skills/cfn-redis-coordination/package.json +45 -0
  359. package/claude-assets/skills/cfn-redis-coordination/redis-cli-wrapper.sh +21 -8
  360. package/claude-assets/skills/cfn-redis-coordination/src/agent-logger.ts +446 -0
  361. package/claude-assets/skills/cfn-redis-coordination/src/agent-recovery.ts +454 -0
  362. package/claude-assets/skills/cfn-redis-coordination/src/completion-reporter.ts +396 -0
  363. package/claude-assets/skills/cfn-redis-coordination/src/context-manager.ts +327 -0
  364. package/claude-assets/skills/cfn-redis-coordination/src/index.ts +82 -0
  365. package/claude-assets/skills/cfn-redis-coordination/src/mode-detector.ts +155 -0
  366. package/claude-assets/skills/cfn-redis-coordination/src/redis/redis-client.ts +305 -0
  367. package/claude-assets/skills/cfn-redis-coordination/src/redis/redis-functions.ts +283 -0
  368. package/claude-assets/skills/cfn-redis-coordination/src/redis-client.ts +654 -0
  369. package/claude-assets/skills/cfn-redis-coordination/src/result-collector.ts +437 -0
  370. package/claude-assets/skills/cfn-redis-coordination/src/swarm-manager.ts +494 -0
  371. package/claude-assets/skills/cfn-redis-coordination/src/task-analyzer.ts +404 -0
  372. package/claude-assets/skills/cfn-redis-coordination/src/task-executor.ts +423 -0
  373. package/claude-assets/skills/cfn-redis-coordination/src/types.ts +235 -0
  374. package/claude-assets/skills/cfn-redis-coordination/src/waiting-coordinator.ts +587 -0
  375. package/claude-assets/skills/cfn-redis-coordination/test-connection-attempts.js +70 -0
  376. package/claude-assets/skills/cfn-redis-coordination/test-mode-simple.js +121 -0
  377. package/claude-assets/skills/cfn-redis-coordination/test-redis-check.js +84 -0
  378. package/claude-assets/skills/cfn-redis-coordination/test-task-mode-redis.cjs +391 -0
  379. package/claude-assets/skills/cfn-redis-coordination/tests/coordination.test.ts +779 -0
  380. package/claude-assets/skills/cfn-redis-coordination/tsconfig.json +31 -0
  381. package/claude-assets/skills/cfn-skill-propagation/README.md +233 -0
  382. package/claude-assets/skills/cfn-skill-propagation/package-lock.json +5174 -0
  383. package/claude-assets/skills/cfn-skill-propagation/package.json +52 -0
  384. package/claude-assets/skills/cfn-skill-propagation/propagate-skill-update.sh +32 -0
  385. package/claude-assets/skills/cfn-skill-propagation/src/cli.ts +75 -0
  386. package/claude-assets/skills/cfn-skill-propagation/src/database-adapter.ts +239 -0
  387. package/claude-assets/skills/cfn-skill-propagation/src/file-system-adapter.ts +113 -0
  388. package/claude-assets/skills/cfn-skill-propagation/src/index.ts +72 -0
  389. package/claude-assets/skills/cfn-skill-propagation/src/logger.ts +43 -0
  390. package/claude-assets/skills/cfn-skill-propagation/src/metadata-parser.ts +154 -0
  391. package/claude-assets/skills/cfn-skill-propagation/src/skill-propagator.ts +274 -0
  392. package/claude-assets/skills/cfn-skill-propagation/src/skill-validator.ts +179 -0
  393. package/claude-assets/skills/cfn-skill-propagation/src/types.ts +143 -0
  394. package/claude-assets/skills/cfn-skill-propagation/src/version-manager.ts +118 -0
  395. package/claude-assets/skills/cfn-skill-propagation/tests/file-system-adapter.test.ts +91 -0
  396. package/claude-assets/skills/cfn-skill-propagation/tests/metadata-parser.test.ts +176 -0
  397. package/claude-assets/skills/cfn-skill-propagation/tests/skill-propagator.test.ts +209 -0
  398. package/claude-assets/skills/cfn-skill-propagation/tests/skill-validator.test.ts +203 -0
  399. package/claude-assets/skills/cfn-skill-propagation/tests/version-manager.test.ts +115 -0
  400. package/claude-assets/skills/cfn-skill-propagation/tsconfig.json +34 -0
  401. package/claude-assets/skills/task-classifier/SKILL.md +81 -0
  402. package/claude-assets/skills/task-classifier/classify-task.sh +62 -0
  403. package/claude-assets/skills/workflow-codification/package-lock.json +5170 -0
  404. package/claude-assets/skills/workflow-codification/package.json +30 -0
  405. package/claude-assets/skills/workflow-codification/src/index.ts +24 -0
  406. package/claude-assets/skills/workflow-codification/src/pattern-analyzer.ts +537 -0
  407. package/claude-assets/skills/workflow-codification/src/types.ts +180 -0
  408. package/claude-assets/skills/workflow-codification/tests/pattern-analyzer.test.ts +960 -0
  409. package/claude-assets/skills/workflow-codification/tsconfig.json +34 -0
  410. package/claude-assets/skills/workflow-codification/workflow-codification.db +0 -0
  411. package/dist/agent-spawner/agent-spawner.js +448 -0
  412. package/dist/agent-spawner/agent-spawner.js.map +1 -0
  413. package/dist/agent-spawner/index.js +10 -0
  414. package/dist/agent-spawner/index.js.map +1 -0
  415. package/dist/agent-spawner/types.js +14 -0
  416. package/dist/agent-spawner/types.js.map +1 -0
  417. package/dist/agents/agent-loader.js +146 -165
  418. package/dist/agents/agent-loader.js.map +1 -1
  419. package/dist/cli/agent-executor.js +47 -1
  420. package/dist/cli/agent-executor.js.map +1 -1
  421. package/dist/cli/agent-spawn.js +4 -1
  422. package/dist/cli/agent-spawn.js.map +1 -1
  423. package/dist/cli/tool-executor.js +3 -1
  424. package/dist/cli/tool-executor.js.map +1 -1
  425. package/dist/gate-checker/gate-checker.js +292 -0
  426. package/dist/gate-checker/gate-checker.js.map +1 -0
  427. package/dist/gate-checker/types.js +94 -0
  428. package/dist/gate-checker/types.js.map +1 -0
  429. package/dist/lib/database-service/connection-pool-manager.js +2 -1
  430. package/dist/lib/database-service/connection-pool-manager.js.map +1 -1
  431. package/dist/orchestrator/index.js +10 -0
  432. package/dist/orchestrator/index.js.map +1 -0
  433. package/dist/orchestrator/orchestrate.js +496 -0
  434. package/dist/orchestrator/orchestrate.js.map +1 -0
  435. package/dist/orchestrator/types.js +58 -0
  436. package/dist/orchestrator/types.js.map +1 -0
  437. package/package.json +1 -1
  438. package/scripts/switch-api.sh +142 -4
  439. package/scripts/verify-no-secrets.sh +6 -13
  440. package/tests/README.md +175 -58
@@ -0,0 +1,516 @@
1
+ #!/bin/bash
2
+ set -eu
3
+
4
+ # google-sheets-progress/track-progress.sh
5
+ # Tracks micro-sprint completion state for Google Sheets operations
6
+ # Version: 1.0.0
7
+
8
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
9
+ SCRIPT_NAME="track-progress.sh"
10
+
11
+ # Configuration
12
+ STATE_FILE="${STATE_FILE:-./.claude/cfn-extras/.gs-progress-state.json}"
13
+ TASK_ID="${TASK_ID:-}"
14
+ ACTION="read"
15
+ LOCK_TIMEOUT=5
16
+ MAX_RETRIES=3
17
+
18
+ # Colors for output
19
+ RED='\033[0;31m'
20
+ GREEN='\033[0;32m'
21
+ YELLOW='\033[1;33m'
22
+ NC='\033[0m'
23
+
24
+ # Trap for cleanup
25
+ cleanup() {
26
+ if [ -f "${STATE_FILE}.lock" ]; then
27
+ rm -f "${STATE_FILE}.lock" 2>/dev/null || true
28
+ fi
29
+ }
30
+ trap cleanup EXIT
31
+
32
+ # Usage information
33
+ usage() {
34
+ cat <<EOF
35
+ Usage: $0 [OPTIONS]
36
+
37
+ Options:
38
+ --action ACTION Action to perform: read, write, update, reset (default: read)
39
+ --state-file FILE Path to progress state file (default: .claude/cfn-extras/.gs-progress-state.json)
40
+ --task-id ID Task ID for coordination context
41
+ --completed ARRAY JSON array of completed sprints: ["schema_001","data_001"]
42
+ --current SPRINT Current active sprint identifier: schema_001
43
+ --remaining ARRAY JSON array of remaining sprints: ["formula_001"]
44
+ --status STATUS State status: in_progress, completed, blocked, paused
45
+ --metadata JSON Additional JSON metadata to track
46
+ -h, --help Show this help message
47
+ -v, --verbose Enable verbose output
48
+
49
+ Examples:
50
+ # Read current progress state
51
+ $0 --action read
52
+
53
+ # Initialize new sprint tracking
54
+ $0 --action write \\
55
+ --completed '[]' \\
56
+ --current schema_001 \\
57
+ --remaining '["data_001","formula_001"]' \\
58
+ --status in_progress
59
+
60
+ # Update after completing a sprint
61
+ $0 --action update \\
62
+ --completed '["schema_001"]' \\
63
+ --current data_001 \\
64
+ --remaining '["formula_001"]'
65
+
66
+ # Reset state for retry
67
+ $0 --action reset
68
+ EOF
69
+ }
70
+
71
+ # Parse arguments
72
+ VERBOSE=false
73
+ COMPLETED=""
74
+ CURRENT=""
75
+ REMAINING=""
76
+ STATUS=""
77
+ METADATA=""
78
+
79
+ while [[ $# -gt 0 ]]; do
80
+ case $1 in
81
+ --action)
82
+ ACTION="$2"
83
+ shift 2
84
+ ;;
85
+ --state-file)
86
+ STATE_FILE="$2"
87
+ shift 2
88
+ ;;
89
+ --task-id)
90
+ TASK_ID="$2"
91
+ shift 2
92
+ ;;
93
+ --completed)
94
+ COMPLETED="$2"
95
+ shift 2
96
+ ;;
97
+ --current)
98
+ CURRENT="$2"
99
+ shift 2
100
+ ;;
101
+ --remaining)
102
+ REMAINING="$2"
103
+ shift 2
104
+ ;;
105
+ --status)
106
+ STATUS="$2"
107
+ shift 2
108
+ ;;
109
+ --metadata)
110
+ METADATA="$2"
111
+ shift 2
112
+ ;;
113
+ -v|--verbose)
114
+ VERBOSE=true
115
+ shift
116
+ ;;
117
+ -h|--help)
118
+ usage
119
+ exit 0
120
+ ;;
121
+ *)
122
+ echo "Unknown option: $1" >&2
123
+ usage
124
+ exit 1
125
+ ;;
126
+ esac
127
+ done
128
+
129
+ # Logging helper
130
+ log_verbose() {
131
+ if [ "$VERBOSE" = true ]; then
132
+ echo "[VERBOSE] $*" >&2
133
+ fi
134
+ }
135
+
136
+ # Error handling
137
+ error_exit() {
138
+ local message="$1"
139
+ local code="${2:-1}"
140
+ echo "ERROR: $message" >&2
141
+ exit "$code"
142
+ }
143
+
144
+ # Validate enum values
145
+ validate_enum() {
146
+ local value="$1"
147
+ local field="$2"
148
+ local allowed="$3"
149
+
150
+ if ! [[ "$allowed" =~ $value ]]; then
151
+ error_exit "Invalid $field value: $value. Allowed: $allowed"
152
+ fi
153
+ }
154
+
155
+ # Validate sprint identifier format
156
+ validate_sprint_id() {
157
+ local sprint="$1"
158
+ if ! [[ "$sprint" =~ ^[a-z]+_[0-9]{3}$ ]]; then
159
+ error_exit "Invalid sprint identifier format: $sprint (expected: pattern_###)"
160
+ fi
161
+ }
162
+
163
+ # Validate JSON format
164
+ validate_json() {
165
+ local json_str="$1"
166
+ local field="$2"
167
+
168
+ if ! jq empty <<<"$json_str" 2>/dev/null; then
169
+ error_exit "Invalid JSON in $field: $json_str"
170
+ fi
171
+ }
172
+
173
+ # Acquire lock with exponential backoff
174
+ acquire_lock() {
175
+ local attempt=0
176
+ local wait_time=100
177
+
178
+ while [ $attempt -lt $MAX_RETRIES ]; do
179
+ if mkdir "${STATE_FILE}.lock" 2>/dev/null; then
180
+ log_verbose "Lock acquired on attempt $((attempt + 1))"
181
+ return 0
182
+ fi
183
+
184
+ attempt=$((attempt + 1))
185
+ if [ $attempt -lt $MAX_RETRIES ]; then
186
+ log_verbose "Lock contention, waiting ${wait_time}ms..."
187
+ sleep 0.$((wait_time))
188
+ wait_time=$((wait_time * 2))
189
+ fi
190
+ done
191
+
192
+ error_exit "Failed to acquire lock after $MAX_RETRIES attempts"
193
+ }
194
+
195
+ # Create directory for state file
196
+ ensure_state_dir() {
197
+ local dir
198
+ dir=$(dirname "$STATE_FILE")
199
+ if [ ! -d "$dir" ]; then
200
+ mkdir -p "$dir"
201
+ fi
202
+ }
203
+
204
+ # Initialize default state
205
+ init_default_state() {
206
+ local task_id="${1:-unknown}"
207
+ cat <<EOF
208
+ {
209
+ "task_id": "$task_id",
210
+ "sprint_sequence": [],
211
+ "completed": [],
212
+ "current": "",
213
+ "remaining": [],
214
+ "status": "pending",
215
+ "timestamps": {
216
+ "created": "$(date -u +%Y-%m-%dT%H:%M:%SZ)",
217
+ "last_updated": "$(date -u +%Y-%m-%dT%H:%M:%SZ)",
218
+ "started": null,
219
+ "completed": null
220
+ },
221
+ "metrics": {
222
+ "total_sprints": 0,
223
+ "completed_count": 0,
224
+ "remaining_count": 0,
225
+ "progress_percentage": 0.0,
226
+ "estimated_completion": null
227
+ },
228
+ "metadata": {}
229
+ }
230
+ EOF
231
+ }
232
+
233
+ # Validate state structure
234
+ validate_state_structure() {
235
+ local state="$1"
236
+
237
+ # Check required fields
238
+ if ! echo "$state" | jq -e '.completed and .current and .remaining and .status' >/dev/null 2>&1; then
239
+ error_exit "State missing required fields (completed, current, remaining, status)"
240
+ fi
241
+
242
+ # Validate status enum
243
+ local status
244
+ status=$(echo "$state" | jq -r '.status')
245
+ validate_enum "$status" "status" "in_progress|completed|blocked|paused"
246
+
247
+ log_verbose "State structure validation passed"
248
+ }
249
+
250
+ # Calculate metrics
251
+ calculate_metrics() {
252
+ local state="$1"
253
+ local completed_count
254
+ local total_sprints
255
+
256
+ completed_count=$(echo "$state" | jq '.completed | length')
257
+ total_sprints=$(echo "$state" | jq '.metrics.total_sprints')
258
+
259
+ local progress_percentage
260
+ if [ "$total_sprints" -gt 0 ]; then
261
+ progress_percentage=$(echo "scale=2; $completed_count * 100 / $total_sprints" | bc)
262
+ else
263
+ progress_percentage=0
264
+ fi
265
+
266
+ echo "$state" | jq \
267
+ --arg progress "$progress_percentage" \
268
+ '.metrics.progress_percentage = ($progress | tonumber)'
269
+ }
270
+
271
+ # Action: read state
272
+ action_read() {
273
+ log_verbose "Reading state from: $STATE_FILE"
274
+
275
+ if [ ! -f "$STATE_FILE" ]; then
276
+ log_verbose "State file not found, initializing default state"
277
+ ensure_state_dir
278
+ init_default_state "$TASK_ID" > "$STATE_FILE"
279
+ fi
280
+
281
+ # Validate and read state
282
+ local state
283
+ state=$(cat "$STATE_FILE")
284
+
285
+ if ! validate_json "$state" "state file"; then
286
+ error_exit "Failed to parse state file as JSON"
287
+ fi
288
+
289
+ validate_state_structure "$state"
290
+
291
+ # Output state in JSON format
292
+ local now
293
+ now=$(date -u +%Y-%m-%dT%H:%M:%SZ)
294
+
295
+ jq \
296
+ --arg now "$now" \
297
+ '.action = "read" | .success = true | .confidence = 0.98 | .execution_timestamp = $now' \
298
+ <<<"$state"
299
+ }
300
+
301
+ # Action: write state (initialize)
302
+ action_write() {
303
+ log_verbose "Writing new state"
304
+
305
+ if [ -z "$CURRENT" ] || [ -z "$STATUS" ]; then
306
+ error_exit "Write action requires --current and --status arguments"
307
+ fi
308
+
309
+ # Validate inputs
310
+ validate_sprint_id "$CURRENT"
311
+ validate_enum "$STATUS" "status" "in_progress|completed|blocked|paused"
312
+
313
+ if [ -n "$COMPLETED" ]; then
314
+ validate_json "$COMPLETED" "completed"
315
+ fi
316
+ if [ -n "$REMAINING" ]; then
317
+ validate_json "$REMAINING" "remaining"
318
+ fi
319
+
320
+ local completed_array="${COMPLETED:-[]}"
321
+ local remaining_array="${REMAINING:-[]}"
322
+
323
+ # Build sprint sequence
324
+ local sprint_sequence
325
+ sprint_sequence=$(jq -n \
326
+ --argjson completed "$completed_array" \
327
+ --arg current "$CURRENT" \
328
+ --argjson remaining "$remaining_array" \
329
+ '($completed + [$current] + $remaining) | unique')
330
+
331
+ # Create new state
332
+ local state
333
+ state=$(jq -n \
334
+ --arg task_id "$TASK_ID" \
335
+ --argjson sprint_sequence "$sprint_sequence" \
336
+ --argjson completed "$completed_array" \
337
+ --arg current "$CURRENT" \
338
+ --argjson remaining "$remaining_array" \
339
+ --arg status "$STATUS" \
340
+ --arg now "$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
341
+ '{
342
+ task_id: $task_id,
343
+ sprint_sequence: $sprint_sequence,
344
+ completed: $completed,
345
+ current: $current,
346
+ remaining: $remaining,
347
+ status: $status,
348
+ timestamps: {
349
+ created: $now,
350
+ last_updated: $now,
351
+ started: $now,
352
+ completed: null
353
+ },
354
+ metrics: {
355
+ total_sprints: ($sprint_sequence | length),
356
+ completed_count: ($completed | length),
357
+ remaining_count: ($remaining | length),
358
+ progress_percentage: 0.0,
359
+ estimated_completion: null
360
+ },
361
+ metadata: {}
362
+ }')
363
+
364
+ # Add user metadata if provided
365
+ if [ -n "$METADATA" ]; then
366
+ validate_json "$METADATA" "metadata"
367
+ state=$(jq --argjson meta "$METADATA" '.metadata = $meta' <<<"$state")
368
+ fi
369
+
370
+ # Calculate metrics
371
+ state=$(calculate_metrics "$state")
372
+
373
+ # Write state atomically
374
+ ensure_state_dir
375
+ acquire_lock
376
+ echo "$state" > "${STATE_FILE}.tmp"
377
+ mv "${STATE_FILE}.tmp" "$STATE_FILE"
378
+
379
+ log_verbose "State written successfully"
380
+
381
+ # Output result
382
+ local now
383
+ now=$(date -u +%Y-%m-%dT%H:%M:%SZ)
384
+
385
+ jq \
386
+ --arg now "$now" \
387
+ '.action = "write" | .success = true | .confidence = 0.99 | .execution_timestamp = $now | .deliverables = [env.STATE_FILE] | .errors = []' \
388
+ --arg STATE_FILE "$STATE_FILE" \
389
+ <<<"$state"
390
+ }
391
+
392
+ # Action: update state
393
+ action_update() {
394
+ log_verbose "Updating state"
395
+
396
+ # Read current state
397
+ local current_state
398
+ if [ ! -f "$STATE_FILE" ]; then
399
+ error_exit "State file does not exist. Use --action write to initialize."
400
+ fi
401
+
402
+ current_state=$(cat "$STATE_FILE")
403
+ validate_json "$current_state" "state file"
404
+ validate_state_structure "$current_state"
405
+
406
+ # Apply updates if provided
407
+ local updated_state="$current_state"
408
+
409
+ if [ -n "$COMPLETED" ]; then
410
+ validate_json "$COMPLETED" "completed"
411
+ updated_state=$(jq --argjson completed "$COMPLETED" '.completed = $completed' <<<"$updated_state")
412
+ fi
413
+
414
+ if [ -n "$CURRENT" ]; then
415
+ validate_sprint_id "$CURRENT"
416
+ updated_state=$(jq --arg current "$CURRENT" '.current = $current' <<<"$updated_state")
417
+ fi
418
+
419
+ if [ -n "$REMAINING" ]; then
420
+ validate_json "$REMAINING" "remaining"
421
+ updated_state=$(jq --argjson remaining "$REMAINING" '.remaining = $remaining' <<<"$updated_state")
422
+ fi
423
+
424
+ if [ -n "$STATUS" ]; then
425
+ validate_enum "$STATUS" "status" "in_progress|completed|blocked|paused"
426
+ updated_state=$(jq --arg status "$STATUS" '.status = $status' <<<"$updated_state")
427
+ fi
428
+
429
+ if [ -n "$METADATA" ]; then
430
+ validate_json "$METADATA" "metadata"
431
+ updated_state=$(jq --argjson meta "$METADATA" '.metadata = $meta' <<<"$updated_state")
432
+ fi
433
+
434
+ # Update timestamps and metrics
435
+ local now
436
+ now=$(date -u +%Y-%m-%dT%H:%M:%SZ)
437
+
438
+ updated_state=$(jq --arg now "$now" '.timestamps.last_updated = $now' <<<"$updated_state")
439
+
440
+ # Update completion timestamp if status is completed
441
+ local status
442
+ status=$(echo "$updated_state" | jq -r '.status')
443
+ if [ "$status" = "completed" ]; then
444
+ updated_state=$(jq --arg now "$now" '.timestamps.completed = $now' <<<"$updated_state")
445
+ fi
446
+
447
+ # Recalculate metrics
448
+ updated_state=$(calculate_metrics "$updated_state")
449
+
450
+ # Write state atomically
451
+ acquire_lock
452
+ echo "$updated_state" > "${STATE_FILE}.tmp"
453
+ mv "${STATE_FILE}.tmp" "$STATE_FILE"
454
+
455
+ log_verbose "State updated successfully"
456
+
457
+ # Output result
458
+ jq \
459
+ --arg now "$now" \
460
+ '.action = "update" | .success = true | .confidence = 0.98 | .execution_timestamp = $now | .deliverables = [env.STATE_FILE] | .errors = []' \
461
+ --arg STATE_FILE "$STATE_FILE" \
462
+ <<<"$updated_state"
463
+ }
464
+
465
+ # Action: reset state
466
+ action_reset() {
467
+ log_verbose "Resetting state"
468
+
469
+ if [ -f "$STATE_FILE" ]; then
470
+ # Create backup
471
+ local backup_dir=".backups/gs-progress"
472
+ mkdir -p "$backup_dir"
473
+ local backup_file="$backup_dir/$(date +%s)_backup.json"
474
+ cp "$STATE_FILE" "$backup_file"
475
+ log_verbose "Backup created: $backup_file"
476
+
477
+ # Remove state file
478
+ rm -f "$STATE_FILE"
479
+ fi
480
+
481
+ log_verbose "State reset successfully"
482
+
483
+ # Output result
484
+ cat <<EOF
485
+ {
486
+ "success": true,
487
+ "action": "reset",
488
+ "confidence": 0.99,
489
+ "message": "State reset successfully",
490
+ "deliverables": [],
491
+ "errors": []
492
+ }
493
+ EOF
494
+ }
495
+
496
+ # Validate action parameter
497
+ validate_enum "$ACTION" "action" "read|write|update|reset"
498
+
499
+ # Execute action
500
+ case "$ACTION" in
501
+ read)
502
+ action_read
503
+ ;;
504
+ write)
505
+ action_write
506
+ ;;
507
+ update)
508
+ action_update
509
+ ;;
510
+ reset)
511
+ action_reset
512
+ ;;
513
+ *)
514
+ error_exit "Unknown action: $ACTION"
515
+ ;;
516
+ esac
@@ -0,0 +1,119 @@
1
+ #!/bin/bash
2
+ set -eu
3
+
4
+ # google-sheets-progress/validate.sh
5
+ # Validates dependencies and configuration
6
+ # Version: 1.0.0
7
+
8
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
9
+ VALIDATION_ERRORS=0
10
+ VALIDATION_WARNINGS=0
11
+
12
+ # Colors
13
+ RED='\033[0;31m'
14
+ GREEN='\033[0;32m'
15
+ YELLOW='\033[1;33m'
16
+ NC='\033[0m'
17
+
18
+ # Validation helpers
19
+ validate_command() {
20
+ local cmd="$1"
21
+ local message="${2:-Command '$cmd' not found}"
22
+
23
+ if command -v "$cmd" &>/dev/null; then
24
+ echo -e "${GREEN}✓${NC} $cmd available"
25
+ return 0
26
+ else
27
+ echo -e "${RED}✗${NC} $message"
28
+ ((VALIDATION_ERRORS++))
29
+ return 1
30
+ fi
31
+ }
32
+
33
+ validate_file() {
34
+ local file="$1"
35
+ local message="${2:-File '$file' not found}"
36
+
37
+ if [ -f "$file" ]; then
38
+ echo -e "${GREEN}✓${NC} $file exists"
39
+ return 0
40
+ else
41
+ echo -e "${RED}✗${NC} $message"
42
+ ((VALIDATION_ERRORS++))
43
+ return 1
44
+ fi
45
+ }
46
+
47
+ validate_executable() {
48
+ local file="$1"
49
+ local message="${2:-File '$file' is not executable}"
50
+
51
+ if [ -x "$file" ]; then
52
+ echo -e "${GREEN}✓${NC} $file is executable"
53
+ return 0
54
+ else
55
+ echo -e "${RED}✗${NC} $message"
56
+ ((VALIDATION_ERRORS++))
57
+ return 1
58
+ fi
59
+ }
60
+
61
+ # Main validation
62
+ main() {
63
+ echo "========================================"
64
+ echo "Validating google-sheets-progress"
65
+ echo "========================================"
66
+ echo ""
67
+
68
+ echo "Checking dependencies..."
69
+ validate_command "bash" "Bash shell required"
70
+ validate_command "jq" "jq (JSON processor) required for JSON parsing"
71
+ validate_command "mkdir" "mkdir command required for directory creation"
72
+ validate_command "date" "date command required for timestamp generation"
73
+
74
+ echo ""
75
+ echo "Checking skill files..."
76
+ validate_file "$SCRIPT_DIR/SKILL.md" "SKILL.md documentation file required"
77
+ validate_executable "$SCRIPT_DIR/track-progress.sh" "track-progress.sh must be executable"
78
+ validate_executable "$SCRIPT_DIR/test.sh" "test.sh must be executable"
79
+
80
+ echo ""
81
+ echo "Checking directory structure..."
82
+ if [ -d "$SCRIPT_DIR" ]; then
83
+ echo -e "${GREEN}✓${NC} Skill directory exists"
84
+ else
85
+ echo -e "${RED}✗${NC} Skill directory missing"
86
+ ((VALIDATION_ERRORS++))
87
+ fi
88
+
89
+ echo ""
90
+ echo "Testing basic functionality..."
91
+ if "$SCRIPT_DIR/track-progress.sh" --help >/dev/null 2>&1; then
92
+ echo -e "${GREEN}✓${NC} track-progress.sh responds to --help"
93
+ else
94
+ echo -e "${RED}✗${NC} track-progress.sh help command failed"
95
+ ((VALIDATION_ERRORS++))
96
+ fi
97
+
98
+ echo ""
99
+ echo "========================================"
100
+ echo "Validation Results"
101
+ echo "========================================"
102
+
103
+ if [ $VALIDATION_ERRORS -eq 0 ] && [ $VALIDATION_WARNINGS -eq 0 ]; then
104
+ echo -e "${GREEN}✓ All validations passed${NC}"
105
+ exit 0
106
+ elif [ $VALIDATION_ERRORS -eq 0 ]; then
107
+ echo -e "${YELLOW}! ${VALIDATION_WARNINGS} warnings found${NC}"
108
+ echo "Skill may have configuration issues"
109
+ exit 0
110
+ else
111
+ echo -e "${RED}✗ ${VALIDATION_ERRORS} validation errors found${NC}"
112
+ if [ $VALIDATION_WARNINGS -gt 0 ]; then
113
+ echo -e "${YELLOW}! ${VALIDATION_WARNINGS} warnings found${NC}"
114
+ fi
115
+ exit 1
116
+ fi
117
+ }
118
+
119
+ main "$@"