claude-flow-novice 2.15.4 → 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 (456) 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 +44 -14
  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 +147 -16
  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/invoke-waiting-mode.sh +3 -2
  138. package/.claude/skills/cfn-redis-coordination/jest.config.js +23 -0
  139. package/.claude/skills/cfn-redis-coordination/package-lock.json +5272 -0
  140. package/.claude/skills/cfn-redis-coordination/package.json +45 -0
  141. package/.claude/skills/cfn-redis-coordination/redis-cli-wrapper.sh +21 -8
  142. package/.claude/skills/cfn-redis-coordination/redis-functions.sh +3 -2
  143. package/.claude/skills/cfn-redis-coordination/src/agent-logger.ts +446 -0
  144. package/.claude/skills/cfn-redis-coordination/src/agent-recovery.ts +454 -0
  145. package/.claude/skills/cfn-redis-coordination/src/completion-reporter.ts +396 -0
  146. package/.claude/skills/cfn-redis-coordination/src/context-manager.ts +327 -0
  147. package/.claude/skills/cfn-redis-coordination/src/index.ts +82 -0
  148. package/.claude/skills/cfn-redis-coordination/src/mode-detector.ts +155 -0
  149. package/.claude/skills/cfn-redis-coordination/src/redis/redis-client.ts +305 -0
  150. package/.claude/skills/cfn-redis-coordination/src/redis/redis-functions.ts +283 -0
  151. package/.claude/skills/cfn-redis-coordination/src/redis-client.ts +654 -0
  152. package/.claude/skills/cfn-redis-coordination/src/result-collector.ts +437 -0
  153. package/.claude/skills/cfn-redis-coordination/src/swarm-manager.ts +494 -0
  154. package/.claude/skills/cfn-redis-coordination/src/task-analyzer.ts +404 -0
  155. package/.claude/skills/cfn-redis-coordination/src/task-executor.ts +423 -0
  156. package/.claude/skills/cfn-redis-coordination/src/types.ts +235 -0
  157. package/.claude/skills/cfn-redis-coordination/src/waiting-coordinator.ts +587 -0
  158. package/.claude/skills/cfn-redis-coordination/test-connection-attempts.js +70 -0
  159. package/.claude/skills/cfn-redis-coordination/test-mode-simple.js +121 -0
  160. package/.claude/skills/cfn-redis-coordination/test-redis-check.js +84 -0
  161. package/.claude/skills/cfn-redis-coordination/test-task-mode-redis.cjs +391 -0
  162. package/.claude/skills/cfn-redis-coordination/tests/coordination.test.ts +779 -0
  163. package/.claude/skills/cfn-redis-coordination/tsconfig.json +31 -0
  164. package/claude-assets/agents/cfn-dev-team/coordinators/cfn-v3-coordinator.md +172 -2
  165. package/claude-assets/agents/cfn-dev-team/testers/api-testing-specialist.md +1 -1
  166. package/claude-assets/agents/custom/cfn-redis-operations.md +530 -0
  167. package/claude-assets/agents/custom/cfn-system-expert.md +77 -0
  168. package/claude-assets/cfn-extras/.gs-api-quota.json +16 -0
  169. package/claude-assets/cfn-extras/.gs-progress-state.json +22 -0
  170. package/claude-assets/cfn-extras/GOOGLE_SHEETS_IMPLEMENTATION_SUMMARY.md +414 -0
  171. package/claude-assets/cfn-extras/agents/google-sheets/README.md +114 -0
  172. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-advanced-analytics-specialist.md +288 -0
  173. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-api-integrator.md +127 -0
  174. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-automation-scripting-specialist.md +195 -0
  175. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-business-validator.md +179 -0
  176. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-collaboration-security-specialist.md +240 -0
  177. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-coordinator.md +214 -0
  178. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-data-transformer.md +127 -0
  179. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-data-validation-quality-specialist.md +177 -0
  180. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-data-validator.md +119 -0
  181. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-data-visualization-specialist.md +135 -0
  182. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-design-layout-specialist.md +109 -0
  183. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-formula-engineer.md +127 -0
  184. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-formula-engineering-specialist.md +138 -0
  185. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-formula-validator.md +128 -0
  186. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-generalist.md +645 -0
  187. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-integration-api-specialist.md +258 -0
  188. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-performance-analyst.md +125 -0
  189. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-performance-optimization-specialist.md +211 -0
  190. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-schema-designer.md +130 -0
  191. package/claude-assets/cfn-extras/agents/google-sheets/google-sheets-template-architecture-specialist.md +259 -0
  192. package/claude-assets/cfn-extras/docs/GOOGLE_SHEETS_CFN_LOOP.md +617 -0
  193. package/claude-assets/cfn-extras/skills/GOOGLE_SHEETS_SKILLS_README.md +453 -0
  194. package/claude-assets/cfn-extras/skills/google-sheets-api-coordinator/SKILL.md +272 -0
  195. package/claude-assets/cfn-extras/skills/google-sheets-api-coordinator/api-call.sh +254 -0
  196. package/claude-assets/cfn-extras/skills/google-sheets-api-coordinator/test.sh +174 -0
  197. package/claude-assets/cfn-extras/skills/google-sheets-api-coordinator/validate.sh +98 -0
  198. package/claude-assets/cfn-extras/skills/google-sheets-decomposition/SKILL.md +269 -0
  199. package/claude-assets/cfn-extras/skills/google-sheets-decomposition/decompose.sh +313 -0
  200. package/claude-assets/cfn-extras/skills/google-sheets-formula-builder/SKILL.md +237 -0
  201. package/claude-assets/cfn-extras/skills/google-sheets-formula-builder/build-formula.sh +220 -0
  202. package/claude-assets/cfn-extras/skills/google-sheets-formula-builder/test.sh +172 -0
  203. package/claude-assets/cfn-extras/skills/google-sheets-formula-builder/validate.sh +98 -0
  204. package/claude-assets/cfn-extras/skills/google-sheets-progress/SKILL.md +287 -0
  205. package/claude-assets/cfn-extras/skills/google-sheets-progress/test.sh +385 -0
  206. package/claude-assets/cfn-extras/skills/google-sheets-progress/track-progress.sh +516 -0
  207. package/claude-assets/cfn-extras/skills/google-sheets-progress/validate.sh +119 -0
  208. package/claude-assets/cfn-extras/skills/google-sheets-sprint-order/SKILL.md +277 -0
  209. package/claude-assets/cfn-extras/skills/google-sheets-sprint-order/order-sprints.sh +233 -0
  210. package/claude-assets/cfn-extras/skills/google-sheets-validation/SKILL.md +352 -0
  211. package/claude-assets/cfn-extras/skills/google-sheets-validation/test.sh +355 -0
  212. package/claude-assets/cfn-extras/skills/google-sheets-validation/validate-state.sh +374 -0
  213. package/claude-assets/cfn-extras/skills/google-sheets-validation/validate.sh +128 -0
  214. package/claude-assets/commands/cfn-context.md +10 -0
  215. package/claude-assets/commands/cfn-loop-cli.md +44 -14
  216. package/claude-assets/commands/google-sheets/google-sheets-loop.md +289 -0
  217. package/claude-assets/hooks/cfn-pre-execution/SESSION_START_README.md +87 -0
  218. package/claude-assets/hooks/cfn-pre-execution/TEST_SESSION_START.md +128 -0
  219. package/claude-assets/hooks/cfn-pre-execution/session-start-context.sh +111 -0
  220. package/claude-assets/skills/cfn-agent-selection-with-fallback/INTEGRATION_EXAMPLE.md +209 -0
  221. package/claude-assets/skills/cfn-agent-selection-with-fallback/README.md +130 -0
  222. package/claude-assets/skills/cfn-agent-selection-with-fallback/SKILL.md +243 -0
  223. package/claude-assets/skills/cfn-agent-selection-with-fallback/agent-mappings.json +142 -0
  224. package/claude-assets/skills/cfn-agent-selection-with-fallback/select-agents.sh +173 -0
  225. package/claude-assets/skills/cfn-agent-selection-with-fallback/task-classifier.sh +71 -0
  226. package/claude-assets/skills/cfn-agent-selection-with-fallback/test-agent-selection.sh +282 -0
  227. package/claude-assets/skills/cfn-agent-selector/SKILL.md +143 -0
  228. package/claude-assets/skills/cfn-agent-selector/select-agents.sh +94 -0
  229. package/claude-assets/skills/cfn-agent-spawning/get-agent-provider-env.sh +22 -2
  230. package/claude-assets/skills/cfn-docker-agent-spawning/spawn-agent.sh +21 -2
  231. package/claude-assets/skills/cfn-docker-coordination/.eslintrc.json +33 -0
  232. package/claude-assets/skills/cfn-docker-coordination/README.md +349 -0
  233. package/claude-assets/skills/cfn-docker-coordination/docker-helpers.sh +433 -0
  234. package/claude-assets/skills/cfn-docker-coordination/jest.config.js +25 -0
  235. package/claude-assets/skills/cfn-docker-coordination/package-lock.json +6827 -0
  236. package/claude-assets/skills/cfn-docker-coordination/package.json +38 -0
  237. package/claude-assets/skills/cfn-docker-coordination/src/agent-container.ts +471 -0
  238. package/claude-assets/skills/cfn-docker-coordination/src/docker-client.ts +483 -0
  239. package/claude-assets/skills/cfn-docker-coordination/src/health-checker.ts +418 -0
  240. package/claude-assets/skills/cfn-docker-coordination/src/index.ts +45 -0
  241. package/claude-assets/skills/cfn-docker-coordination/src/network-manager.ts +377 -0
  242. package/claude-assets/skills/cfn-docker-coordination/src/types.ts +412 -0
  243. package/claude-assets/skills/cfn-docker-coordination/src/volume-manager.ts +389 -0
  244. package/claude-assets/skills/cfn-docker-coordination/tests/agent-container.test.ts +379 -0
  245. package/claude-assets/skills/cfn-docker-coordination/tests/docker-client.test.ts +345 -0
  246. package/claude-assets/skills/cfn-docker-coordination/tests/health-checker.test.ts +535 -0
  247. package/claude-assets/skills/cfn-docker-coordination/tests/integration.test.ts +193 -0
  248. package/claude-assets/skills/cfn-docker-coordination/tests/network-manager.test.ts +352 -0
  249. package/claude-assets/skills/cfn-docker-coordination/tests/setup.ts +36 -0
  250. package/claude-assets/skills/cfn-docker-coordination/tsconfig.json +29 -0
  251. package/claude-assets/skills/cfn-docker-logging/INTEGRATION.md +268 -0
  252. package/claude-assets/skills/cfn-docker-logging/SAMPLE_OUTPUTS.md +237 -0
  253. package/claude-assets/skills/cfn-docker-logging/SKILL.md +442 -0
  254. package/claude-assets/skills/cfn-docker-logging/capture-container-logs.sh +120 -0
  255. package/claude-assets/skills/cfn-docker-logging/enable-logging.sh +430 -0
  256. package/claude-assets/skills/cfn-docker-logging/init-hybrid-logging.sh +210 -0
  257. package/claude-assets/skills/cfn-docker-logging/queries/analytics-summary.sh +87 -0
  258. package/claude-assets/skills/cfn-docker-logging/queries/query-agent-timeline.sh +51 -0
  259. package/claude-assets/skills/cfn-docker-logging/queries/query-consensus-history.sh +56 -0
  260. package/claude-assets/skills/cfn-docker-logging/queries/query-coordination-timeline.sh +39 -0
  261. package/claude-assets/skills/cfn-docker-logging/queries/query-failed-containers.sh +40 -0
  262. package/claude-assets/skills/cfn-docker-logging/queries/query-gate-checks.sh +39 -0
  263. package/claude-assets/skills/cfn-docker-logging/schema.sql +111 -0
  264. package/claude-assets/skills/cfn-docker-logging/sqlite-helpers.sh +240 -0
  265. package/claude-assets/skills/cfn-docker-logging/test-hybrid-logging.sh +331 -0
  266. package/claude-assets/skills/cfn-docker-loop-orchestration/orchestrate.sh +11 -5
  267. package/claude-assets/skills/cfn-docker-redis-coordination/MIGRATION_SUMMARY.md +348 -0
  268. package/claude-assets/skills/cfn-docker-redis-coordination/README.md +294 -0
  269. package/claude-assets/skills/cfn-docker-redis-coordination/jest.config.js +37 -0
  270. package/claude-assets/skills/cfn-docker-redis-coordination/package-lock.json +5259 -0
  271. package/claude-assets/skills/cfn-docker-redis-coordination/package.json +40 -0
  272. package/claude-assets/skills/cfn-docker-redis-coordination/src/coordinator.ts +801 -0
  273. package/claude-assets/skills/cfn-docker-redis-coordination/src/index.ts +42 -0
  274. package/claude-assets/skills/cfn-docker-redis-coordination/src/types.ts +351 -0
  275. package/claude-assets/skills/cfn-docker-redis-coordination/tests/coordinator.test.ts +1464 -0
  276. package/claude-assets/skills/cfn-docker-redis-coordination/tsconfig.json +30 -0
  277. package/claude-assets/skills/cfn-error-logging/.eslintrc.json +57 -0
  278. package/claude-assets/skills/cfn-error-logging/.prettierrc.json +10 -0
  279. package/claude-assets/skills/cfn-error-logging/MIGRATION_SUMMARY.md +485 -0
  280. package/claude-assets/skills/cfn-error-logging/package.json +47 -0
  281. package/claude-assets/skills/cfn-error-logging/src/error-logger.ts +1042 -0
  282. package/claude-assets/skills/cfn-error-logging/src/index.ts +12 -0
  283. package/claude-assets/skills/cfn-error-logging/src/types.ts +456 -0
  284. package/claude-assets/skills/cfn-error-logging/tests/error-logger.test.ts +1302 -0
  285. package/claude-assets/skills/cfn-error-logging/tsconfig.json +38 -0
  286. package/claude-assets/skills/cfn-loop-orchestration/.eslintrc.js +56 -0
  287. package/claude-assets/skills/cfn-loop-orchestration/.prettierrc.json +18 -0
  288. package/claude-assets/skills/cfn-loop-orchestration/README.md +149 -41
  289. package/claude-assets/skills/cfn-loop-orchestration/jest.config.js +67 -0
  290. package/claude-assets/skills/cfn-loop-orchestration/orchestrate-wrapper.sh +268 -0
  291. package/claude-assets/skills/cfn-loop-orchestration/orchestrate.sh +147 -16
  292. package/claude-assets/skills/cfn-loop-orchestration/package-lock.json +5470 -0
  293. package/claude-assets/skills/cfn-loop-orchestration/package.json +49 -0
  294. package/claude-assets/skills/cfn-loop-orchestration/src/agent-spawner/agent-spawner.ts +34 -0
  295. package/claude-assets/skills/cfn-loop-orchestration/src/gate-checker/gate-checker.ts +36 -0
  296. package/claude-assets/skills/cfn-loop-orchestration/src/index.ts +14 -0
  297. package/claude-assets/skills/cfn-loop-orchestration/src/orchestrator/orchestrator.ts +31 -0
  298. package/claude-assets/skills/cfn-loop-orchestration/src/redis/redis-coordinator.ts +72 -0
  299. package/claude-assets/skills/cfn-loop-orchestration/src/types.ts +188 -0
  300. package/claude-assets/skills/cfn-loop-orchestration/src/utils/logger.ts +32 -0
  301. package/claude-assets/skills/cfn-loop-orchestration/tests/setup.ts +22 -0
  302. package/claude-assets/skills/cfn-loop-orchestration/tests/types.test.ts +132 -0
  303. package/claude-assets/skills/cfn-loop-orchestration/tsconfig.json +54 -0
  304. package/claude-assets/skills/cfn-redis-coordination/bash-wrappers/store-context.sh +23 -0
  305. package/claude-assets/skills/cfn-redis-coordination/dist/agent-logger.d.ts +92 -0
  306. package/claude-assets/skills/cfn-redis-coordination/dist/agent-logger.d.ts.map +1 -0
  307. package/claude-assets/skills/cfn-redis-coordination/dist/agent-logger.js +329 -0
  308. package/claude-assets/skills/cfn-redis-coordination/dist/agent-logger.js.map +1 -0
  309. package/claude-assets/skills/cfn-redis-coordination/dist/agent-recovery.d.ts +75 -0
  310. package/claude-assets/skills/cfn-redis-coordination/dist/agent-recovery.d.ts.map +1 -0
  311. package/claude-assets/skills/cfn-redis-coordination/dist/agent-recovery.js +302 -0
  312. package/claude-assets/skills/cfn-redis-coordination/dist/agent-recovery.js.map +1 -0
  313. package/claude-assets/skills/cfn-redis-coordination/dist/completion-reporter.d.ts +58 -0
  314. package/claude-assets/skills/cfn-redis-coordination/dist/completion-reporter.d.ts.map +1 -0
  315. package/claude-assets/skills/cfn-redis-coordination/dist/completion-reporter.js +237 -0
  316. package/claude-assets/skills/cfn-redis-coordination/dist/completion-reporter.js.map +1 -0
  317. package/claude-assets/skills/cfn-redis-coordination/dist/context-manager.d.ts +63 -0
  318. package/claude-assets/skills/cfn-redis-coordination/dist/context-manager.d.ts.map +1 -0
  319. package/claude-assets/skills/cfn-redis-coordination/dist/context-manager.js +230 -0
  320. package/claude-assets/skills/cfn-redis-coordination/dist/context-manager.js.map +1 -0
  321. package/claude-assets/skills/cfn-redis-coordination/dist/index.d.ts +45 -0
  322. package/claude-assets/skills/cfn-redis-coordination/dist/index.d.ts.map +1 -0
  323. package/claude-assets/skills/cfn-redis-coordination/dist/index.js +114 -0
  324. package/claude-assets/skills/cfn-redis-coordination/dist/index.js.map +1 -0
  325. package/claude-assets/skills/cfn-redis-coordination/dist/mode-detector.d.ts +31 -0
  326. package/claude-assets/skills/cfn-redis-coordination/dist/mode-detector.d.ts.map +1 -0
  327. package/claude-assets/skills/cfn-redis-coordination/dist/mode-detector.js +185 -0
  328. package/claude-assets/skills/cfn-redis-coordination/dist/mode-detector.js.map +1 -0
  329. package/claude-assets/skills/cfn-redis-coordination/dist/redis-client.d.ts +191 -0
  330. package/claude-assets/skills/cfn-redis-coordination/dist/redis-client.d.ts.map +1 -0
  331. package/claude-assets/skills/cfn-redis-coordination/dist/redis-client.js +509 -0
  332. package/claude-assets/skills/cfn-redis-coordination/dist/redis-client.js.map +1 -0
  333. package/claude-assets/skills/cfn-redis-coordination/dist/result-collector.d.ts +75 -0
  334. package/claude-assets/skills/cfn-redis-coordination/dist/result-collector.d.ts.map +1 -0
  335. package/claude-assets/skills/cfn-redis-coordination/dist/result-collector.js +281 -0
  336. package/claude-assets/skills/cfn-redis-coordination/dist/result-collector.js.map +1 -0
  337. package/claude-assets/skills/cfn-redis-coordination/dist/swarm-manager.d.ts +75 -0
  338. package/claude-assets/skills/cfn-redis-coordination/dist/swarm-manager.d.ts.map +1 -0
  339. package/claude-assets/skills/cfn-redis-coordination/dist/swarm-manager.js +354 -0
  340. package/claude-assets/skills/cfn-redis-coordination/dist/swarm-manager.js.map +1 -0
  341. package/claude-assets/skills/cfn-redis-coordination/dist/task-analyzer.d.ts +62 -0
  342. package/claude-assets/skills/cfn-redis-coordination/dist/task-analyzer.d.ts.map +1 -0
  343. package/claude-assets/skills/cfn-redis-coordination/dist/task-analyzer.js +305 -0
  344. package/claude-assets/skills/cfn-redis-coordination/dist/task-analyzer.js.map +1 -0
  345. package/claude-assets/skills/cfn-redis-coordination/dist/task-executor.d.ts +97 -0
  346. package/claude-assets/skills/cfn-redis-coordination/dist/task-executor.d.ts.map +1 -0
  347. package/claude-assets/skills/cfn-redis-coordination/dist/task-executor.js +283 -0
  348. package/claude-assets/skills/cfn-redis-coordination/dist/task-executor.js.map +1 -0
  349. package/claude-assets/skills/cfn-redis-coordination/dist/types.d.ts +176 -0
  350. package/claude-assets/skills/cfn-redis-coordination/dist/types.d.ts.map +1 -0
  351. package/claude-assets/skills/cfn-redis-coordination/dist/types.js +81 -0
  352. package/claude-assets/skills/cfn-redis-coordination/dist/types.js.map +1 -0
  353. package/claude-assets/skills/cfn-redis-coordination/dist/waiting-coordinator.d.ts +86 -0
  354. package/claude-assets/skills/cfn-redis-coordination/dist/waiting-coordinator.d.ts.map +1 -0
  355. package/claude-assets/skills/cfn-redis-coordination/dist/waiting-coordinator.js +419 -0
  356. package/claude-assets/skills/cfn-redis-coordination/dist/waiting-coordinator.js.map +1 -0
  357. package/claude-assets/skills/cfn-redis-coordination/docs/migration/PHASE_3_REDIS_COORDINATION_COMPLETION_REPORT.md +553 -0
  358. package/claude-assets/skills/cfn-redis-coordination/invoke-waiting-mode.sh +3 -2
  359. package/claude-assets/skills/cfn-redis-coordination/jest.config.js +23 -0
  360. package/claude-assets/skills/cfn-redis-coordination/package-lock.json +5272 -0
  361. package/claude-assets/skills/cfn-redis-coordination/package.json +45 -0
  362. package/claude-assets/skills/cfn-redis-coordination/redis-cli-wrapper.sh +21 -8
  363. package/claude-assets/skills/cfn-redis-coordination/redis-functions.sh +3 -2
  364. package/claude-assets/skills/cfn-redis-coordination/src/agent-logger.ts +446 -0
  365. package/claude-assets/skills/cfn-redis-coordination/src/agent-recovery.ts +454 -0
  366. package/claude-assets/skills/cfn-redis-coordination/src/completion-reporter.ts +396 -0
  367. package/claude-assets/skills/cfn-redis-coordination/src/context-manager.ts +327 -0
  368. package/claude-assets/skills/cfn-redis-coordination/src/index.ts +82 -0
  369. package/claude-assets/skills/cfn-redis-coordination/src/mode-detector.ts +155 -0
  370. package/claude-assets/skills/cfn-redis-coordination/src/redis/redis-client.ts +305 -0
  371. package/claude-assets/skills/cfn-redis-coordination/src/redis/redis-functions.ts +283 -0
  372. package/claude-assets/skills/cfn-redis-coordination/src/redis-client.ts +654 -0
  373. package/claude-assets/skills/cfn-redis-coordination/src/result-collector.ts +437 -0
  374. package/claude-assets/skills/cfn-redis-coordination/src/swarm-manager.ts +494 -0
  375. package/claude-assets/skills/cfn-redis-coordination/src/task-analyzer.ts +404 -0
  376. package/claude-assets/skills/cfn-redis-coordination/src/task-executor.ts +423 -0
  377. package/claude-assets/skills/cfn-redis-coordination/src/types.ts +235 -0
  378. package/claude-assets/skills/cfn-redis-coordination/src/waiting-coordinator.ts +587 -0
  379. package/claude-assets/skills/cfn-redis-coordination/test-connection-attempts.js +70 -0
  380. package/claude-assets/skills/cfn-redis-coordination/test-mode-simple.js +121 -0
  381. package/claude-assets/skills/cfn-redis-coordination/test-redis-check.js +84 -0
  382. package/claude-assets/skills/cfn-redis-coordination/test-task-mode-redis.cjs +391 -0
  383. package/claude-assets/skills/cfn-redis-coordination/tests/coordination.test.ts +779 -0
  384. package/claude-assets/skills/cfn-redis-coordination/tsconfig.json +31 -0
  385. package/claude-assets/skills/cfn-skill-propagation/README.md +233 -0
  386. package/claude-assets/skills/cfn-skill-propagation/package-lock.json +5174 -0
  387. package/claude-assets/skills/cfn-skill-propagation/package.json +52 -0
  388. package/claude-assets/skills/cfn-skill-propagation/propagate-skill-update.sh +32 -0
  389. package/claude-assets/skills/cfn-skill-propagation/src/cli.ts +75 -0
  390. package/claude-assets/skills/cfn-skill-propagation/src/database-adapter.ts +239 -0
  391. package/claude-assets/skills/cfn-skill-propagation/src/file-system-adapter.ts +113 -0
  392. package/claude-assets/skills/cfn-skill-propagation/src/index.ts +72 -0
  393. package/claude-assets/skills/cfn-skill-propagation/src/logger.ts +43 -0
  394. package/claude-assets/skills/cfn-skill-propagation/src/metadata-parser.ts +154 -0
  395. package/claude-assets/skills/cfn-skill-propagation/src/skill-propagator.ts +274 -0
  396. package/claude-assets/skills/cfn-skill-propagation/src/skill-validator.ts +179 -0
  397. package/claude-assets/skills/cfn-skill-propagation/src/types.ts +143 -0
  398. package/claude-assets/skills/cfn-skill-propagation/src/version-manager.ts +118 -0
  399. package/claude-assets/skills/cfn-skill-propagation/tests/file-system-adapter.test.ts +91 -0
  400. package/claude-assets/skills/cfn-skill-propagation/tests/metadata-parser.test.ts +176 -0
  401. package/claude-assets/skills/cfn-skill-propagation/tests/skill-propagator.test.ts +209 -0
  402. package/claude-assets/skills/cfn-skill-propagation/tests/skill-validator.test.ts +203 -0
  403. package/claude-assets/skills/cfn-skill-propagation/tests/version-manager.test.ts +115 -0
  404. package/claude-assets/skills/cfn-skill-propagation/tsconfig.json +34 -0
  405. package/claude-assets/skills/task-classifier/SKILL.md +81 -0
  406. package/claude-assets/skills/task-classifier/classify-task.sh +62 -0
  407. package/claude-assets/skills/workflow-codification/package-lock.json +5170 -0
  408. package/claude-assets/skills/workflow-codification/package.json +30 -0
  409. package/claude-assets/skills/workflow-codification/src/index.ts +24 -0
  410. package/claude-assets/skills/workflow-codification/src/pattern-analyzer.ts +537 -0
  411. package/claude-assets/skills/workflow-codification/src/types.ts +180 -0
  412. package/claude-assets/skills/workflow-codification/tests/pattern-analyzer.test.ts +960 -0
  413. package/claude-assets/skills/workflow-codification/tsconfig.json +34 -0
  414. package/claude-assets/skills/workflow-codification/workflow-codification.db +0 -0
  415. package/dist/agent-spawner/agent-spawner.js +448 -0
  416. package/dist/agent-spawner/agent-spawner.js.map +1 -0
  417. package/dist/agent-spawner/index.js +10 -0
  418. package/dist/agent-spawner/index.js.map +1 -0
  419. package/dist/agent-spawner/types.js +14 -0
  420. package/dist/agent-spawner/types.js.map +1 -0
  421. package/dist/cli/agent-executor.js +47 -1
  422. package/dist/cli/agent-executor.js.map +1 -1
  423. package/dist/cli/agent-spawn.js +4 -1
  424. package/dist/cli/agent-spawn.js.map +1 -1
  425. package/dist/cli/config-manager.js +109 -91
  426. package/dist/cli/config-manager.js.map +1 -1
  427. package/dist/cli/conversation-fork-cleanup.js +201 -0
  428. package/dist/cli/conversation-fork-cleanup.js.map +1 -0
  429. package/dist/cli/conversation-fork.js +16 -3
  430. package/dist/cli/conversation-fork.js.map +1 -1
  431. package/dist/cli/tool-executor.js +3 -1
  432. package/dist/cli/tool-executor.js.map +1 -1
  433. package/dist/gate-checker/gate-checker.js +292 -0
  434. package/dist/gate-checker/gate-checker.js.map +1 -0
  435. package/dist/gate-checker/types.js +94 -0
  436. package/dist/gate-checker/types.js.map +1 -0
  437. package/dist/lib/database-service/connection-pool-manager.js +2 -1
  438. package/dist/lib/database-service/connection-pool-manager.js.map +1 -1
  439. package/dist/orchestrator/index.js +10 -0
  440. package/dist/orchestrator/index.js.map +1 -0
  441. package/dist/orchestrator/orchestrate.js +496 -0
  442. package/dist/orchestrator/orchestrate.js.map +1 -0
  443. package/dist/orchestrator/types.js +58 -0
  444. package/dist/orchestrator/types.js.map +1 -0
  445. package/docs/BUG_19_MEMORY_LEAK_TASK_MODE.md +405 -0
  446. package/docs/MEMORY_CLEANUP_GUIDE.md +358 -0
  447. package/docs/MEMORY_LEAK_FIX_SUMMARY.md +322 -0
  448. package/docs/REDIS_CLEANUP_EXECUTIVE_SUMMARY.md +319 -0
  449. package/docs/REDIS_CLEANUP_VERIFICATION_REPORT.md +574 -0
  450. package/package.json +208 -201
  451. package/readme/README.md +34 -1
  452. package/scripts/switch-api.sh +142 -4
  453. package/scripts/verify-no-secrets.sh +6 -13
  454. package/scripts/verify-redis-cleanup.sh +173 -0
  455. package/tests/README.md +201 -0
  456. package/tests/test-memory-leak-task-mode.sh +435 -0
@@ -0,0 +1,385 @@
1
+ #!/bin/bash
2
+ set -eu
3
+
4
+ # google-sheets-progress/test.sh
5
+ # Comprehensive test suite for progress tracking
6
+ # Version: 1.0.0
7
+
8
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
9
+ TEST_STATE_FILE=$(mktemp)
10
+ TESTS_PASSED=0
11
+ TESTS_FAILED=0
12
+ TESTS_TOTAL=0
13
+
14
+ # Colors
15
+ RED='\033[0;31m'
16
+ GREEN='\033[0;32m'
17
+ YELLOW='\033[1;33m'
18
+ NC='\033[0m'
19
+
20
+ # Cleanup
21
+ cleanup() {
22
+ rm -f "$TEST_STATE_FILE" "$TEST_STATE_FILE.lock" 2>/dev/null || true
23
+ }
24
+ trap cleanup EXIT
25
+
26
+ # Test helpers
27
+ assert_success() {
28
+ local result="$1"
29
+ local message="${2:-Command should succeed}"
30
+
31
+ ((TESTS_TOTAL++))
32
+
33
+ if echo "$result" | jq -e '.success == true' >/dev/null 2>&1; then
34
+ ((TESTS_PASSED++))
35
+ echo -e "${GREEN}✓${NC} $message"
36
+ return 0
37
+ else
38
+ ((TESTS_FAILED++))
39
+ echo -e "${RED}✗${NC} $message"
40
+ echo " Result: $result"
41
+ return 1
42
+ fi
43
+ }
44
+
45
+ assert_field_equals() {
46
+ local result="$1"
47
+ local field="$2"
48
+ local expected="$3"
49
+ local message="${4:-Field $field should equal $expected}"
50
+
51
+ ((TESTS_TOTAL++))
52
+
53
+ local actual
54
+ actual=$(echo "$result" | jq -r "$field" 2>/dev/null || echo "PARSE_ERROR")
55
+
56
+ if [ "$actual" = "$expected" ]; then
57
+ ((TESTS_PASSED++))
58
+ echo -e "${GREEN}✓${NC} $message"
59
+ return 0
60
+ else
61
+ ((TESTS_FAILED++))
62
+ echo -e "${RED}✗${NC} $message"
63
+ echo " Expected: $expected"
64
+ echo " Actual: $actual"
65
+ return 1
66
+ fi
67
+ }
68
+
69
+ assert_file_exists() {
70
+ local file="$1"
71
+ local message="${2:-File should exist}"
72
+
73
+ ((TESTS_TOTAL++))
74
+
75
+ if [ -f "$file" ]; then
76
+ ((TESTS_PASSED++))
77
+ echo -e "${GREEN}✓${NC} $message"
78
+ return 0
79
+ else
80
+ ((TESTS_FAILED++))
81
+ echo -e "${RED}✗${NC} $message"
82
+ echo " File not found: $file"
83
+ return 1
84
+ fi
85
+ }
86
+
87
+ # Test: Read from non-existent file initializes default state
88
+ test_read_initializes_default() {
89
+ echo ""
90
+ echo "Testing read action initialization..."
91
+
92
+ local result
93
+ result=$("$SCRIPT_DIR/track-progress.sh" --action read --state-file "$TEST_STATE_FILE")
94
+
95
+ assert_success "$result" "Read should initialize default state"
96
+ assert_field_equals "$result" ".state.completed | length" "0" "Default completed array should be empty"
97
+ assert_field_equals "$result" ".state.status" "pending" "Default status should be pending"
98
+ }
99
+
100
+ # Test: Write action creates valid state
101
+ test_write_creates_state() {
102
+ echo ""
103
+ echo "Testing write action..."
104
+
105
+ local result
106
+ result=$("$SCRIPT_DIR/track-progress.sh" \
107
+ --action write \
108
+ --state-file "$TEST_STATE_FILE" \
109
+ --completed '[]' \
110
+ --current schema_001 \
111
+ --remaining '["data_001","formula_001"]' \
112
+ --status in_progress)
113
+
114
+ assert_success "$result" "Write should succeed"
115
+ assert_field_equals "$result" ".state.current" "schema_001" "Current should be schema_001"
116
+ assert_field_equals "$result" ".state.status" "in_progress" "Status should be in_progress"
117
+ assert_file_exists "$TEST_STATE_FILE" "State file should be created"
118
+ }
119
+
120
+ # Test: Update action modifies state
121
+ test_update_modifies_state() {
122
+ echo ""
123
+ echo "Testing update action..."
124
+
125
+ # Initialize state first
126
+ "$SCRIPT_DIR/track-progress.sh" \
127
+ --action write \
128
+ --state-file "$TEST_STATE_FILE" \
129
+ --completed '[]' \
130
+ --current schema_001 \
131
+ --remaining '["data_001","formula_001"]' \
132
+ --status in_progress >/dev/null
133
+
134
+ # Update state
135
+ local result
136
+ result=$("$SCRIPT_DIR/track-progress.sh" \
137
+ --action update \
138
+ --state-file "$TEST_STATE_FILE" \
139
+ --completed '["schema_001"]' \
140
+ --current data_001 \
141
+ --remaining '["formula_001"]')
142
+
143
+ assert_success "$result" "Update should succeed"
144
+ assert_field_equals "$result" ".state.current" "data_001" "Current should be updated to data_001"
145
+ assert_field_equals "$result" ".state.completed | length" "1" "Completed array length should be 1"
146
+ }
147
+
148
+ # Test: Reset action clears state
149
+ test_reset_clears_state() {
150
+ echo ""
151
+ echo "Testing reset action..."
152
+
153
+ # Initialize state first
154
+ "$SCRIPT_DIR/track-progress.sh" \
155
+ --action write \
156
+ --state-file "$TEST_STATE_FILE" \
157
+ --completed '[]' \
158
+ --current schema_001 \
159
+ --remaining '["data_001"]' \
160
+ --status in_progress >/dev/null
161
+
162
+ # Reset state
163
+ local result
164
+ result=$("$SCRIPT_DIR/track-progress.sh" \
165
+ --action reset \
166
+ --state-file "$TEST_STATE_FILE")
167
+
168
+ assert_success "$result" "Reset should succeed"
169
+ # Verify state file is removed
170
+ if [ -f "$TEST_STATE_FILE" ]; then
171
+ ((TESTS_FAILED++))
172
+ echo -e "${RED}✗${NC} State file should be removed after reset"
173
+ ((TESTS_TOTAL++))
174
+ else
175
+ ((TESTS_PASSED++))
176
+ echo -e "${GREEN}✓${NC} State file should be removed after reset"
177
+ ((TESTS_TOTAL++))
178
+ fi
179
+ }
180
+
181
+ # Test: Metrics calculation
182
+ test_metrics_calculation() {
183
+ echo ""
184
+ echo "Testing metrics calculation..."
185
+
186
+ local result
187
+ result=$("$SCRIPT_DIR/track-progress.sh" \
188
+ --action write \
189
+ --state-file "$TEST_STATE_FILE" \
190
+ --completed '[]' \
191
+ --current schema_001 \
192
+ --remaining '["data_001","formula_001"]' \
193
+ --status in_progress)
194
+
195
+ assert_success "$result" "Metrics calculation should succeed"
196
+
197
+ # Check metrics
198
+ local total_sprints
199
+ total_sprints=$(echo "$result" | jq '.state.metrics.total_sprints')
200
+ assert_field_equals "$result" ".state.metrics.total_sprints" "3" "Total sprints should be 3"
201
+
202
+ local progress
203
+ progress=$(echo "$result" | jq '.state.metrics.progress_percentage')
204
+ if [ "$progress" = "0" ] || [ "$progress" = "0.0" ]; then
205
+ ((TESTS_PASSED++))
206
+ echo -e "${GREEN}✓${NC} Progress percentage should be 0 initially"
207
+ else
208
+ ((TESTS_FAILED++))
209
+ echo -e "${RED}✗${NC} Progress percentage should be 0 initially (got $progress)"
210
+ fi
211
+ ((TESTS_TOTAL++))
212
+ }
213
+
214
+ # Test: Timestamp tracking
215
+ test_timestamp_tracking() {
216
+ echo ""
217
+ echo "Testing timestamp tracking..."
218
+
219
+ local result
220
+ result=$("$SCRIPT_DIR/track-progress.sh" \
221
+ --action write \
222
+ --state-file "$TEST_STATE_FILE" \
223
+ --completed '[]' \
224
+ --current schema_001 \
225
+ --remaining '["data_001"]' \
226
+ --status in_progress)
227
+
228
+ assert_success "$result" "Timestamp tracking should succeed"
229
+
230
+ # Check that timestamps are set
231
+ local created
232
+ created=$(echo "$result" | jq -r '.state.timestamps.created')
233
+
234
+ if [ -n "$created" ] && [ "$created" != "null" ]; then
235
+ ((TESTS_PASSED++))
236
+ echo -e "${GREEN}✓${NC} Timestamp 'created' should be set"
237
+ else
238
+ ((TESTS_FAILED++))
239
+ echo -e "${RED}✗${NC} Timestamp 'created' should be set"
240
+ fi
241
+ ((TESTS_TOTAL++))
242
+ }
243
+
244
+ # Test: Invalid sprint identifier rejected
245
+ test_invalid_sprint_id() {
246
+ echo ""
247
+ echo "Testing sprint ID validation..."
248
+
249
+ local result
250
+ result=$("$SCRIPT_DIR/track-progress.sh" \
251
+ --action write \
252
+ --state-file "$TEST_STATE_FILE" \
253
+ --completed '[]' \
254
+ --current invalid_sprint \
255
+ --remaining '[]' \
256
+ --status in_progress 2>&1 || true)
257
+
258
+ if echo "$result" | grep -q "Invalid sprint identifier"; then
259
+ ((TESTS_PASSED++))
260
+ echo -e "${GREEN}✓${NC} Invalid sprint ID should be rejected"
261
+ else
262
+ ((TESTS_FAILED++))
263
+ echo -e "${RED}✗${NC} Invalid sprint ID should be rejected"
264
+ fi
265
+ ((TESTS_TOTAL++))
266
+ }
267
+
268
+ # Test: Invalid status rejected
269
+ test_invalid_status() {
270
+ echo ""
271
+ echo "Testing status validation..."
272
+
273
+ local result
274
+ result=$("$SCRIPT_DIR/track-progress.sh" \
275
+ --action write \
276
+ --state-file "$TEST_STATE_FILE" \
277
+ --completed '[]' \
278
+ --current schema_001 \
279
+ --remaining '[]' \
280
+ --status invalid_status 2>&1 || true)
281
+
282
+ if echo "$result" | grep -q "Invalid status"; then
283
+ ((TESTS_PASSED++))
284
+ echo -e "${GREEN}✓${NC} Invalid status should be rejected"
285
+ else
286
+ ((TESTS_FAILED++))
287
+ echo -e "${RED}✗${NC} Invalid status should be rejected"
288
+ fi
289
+ ((TESTS_TOTAL++))
290
+ }
291
+
292
+ # Test: Metadata persistence
293
+ test_metadata_persistence() {
294
+ echo ""
295
+ echo "Testing metadata persistence..."
296
+
297
+ local metadata='{"spreadsheet_id":"abc123","sheet_name":"Operations"}'
298
+
299
+ local result
300
+ result=$("$SCRIPT_DIR/track-progress.sh" \
301
+ --action write \
302
+ --state-file "$TEST_STATE_FILE" \
303
+ --completed '[]' \
304
+ --current schema_001 \
305
+ --remaining '[]' \
306
+ --status in_progress \
307
+ --metadata "$metadata")
308
+
309
+ assert_success "$result" "Metadata should be persisted"
310
+
311
+ local sheet_name
312
+ sheet_name=$(echo "$result" | jq -r '.state.metadata.sheet_name')
313
+ assert_field_equals "$result" ".state.metadata.sheet_name" "Operations" "Metadata should be preserved"
314
+ }
315
+
316
+ # Test: Concurrent access handling
317
+ test_concurrent_access() {
318
+ echo ""
319
+ echo "Testing concurrent access handling..."
320
+
321
+ # Initialize state
322
+ "$SCRIPT_DIR/track-progress.sh" \
323
+ --action write \
324
+ --state-file "$TEST_STATE_FILE" \
325
+ --completed '[]' \
326
+ --current schema_001 \
327
+ --remaining '[]' \
328
+ --status in_progress >/dev/null
329
+
330
+ # Simulate concurrent updates
331
+ local result1
332
+ result1=$("$SCRIPT_DIR/track-progress.sh" \
333
+ --action update \
334
+ --state-file "$TEST_STATE_FILE" \
335
+ --status blocked 2>&1 || true)
336
+
337
+ if echo "$result1" | jq -e '.success' >/dev/null 2>&1; then
338
+ ((TESTS_PASSED++))
339
+ echo -e "${GREEN}✓${NC} Concurrent access should be handled gracefully"
340
+ else
341
+ ((TESTS_FAILED++))
342
+ echo -e "${RED}✗${NC} Concurrent access should be handled gracefully"
343
+ fi
344
+ ((TESTS_TOTAL++))
345
+ }
346
+
347
+ # Run all tests
348
+ run_tests() {
349
+ echo "========================================"
350
+ echo "Running tests for google-sheets-progress"
351
+ echo "========================================"
352
+
353
+ test_read_initializes_default
354
+ test_write_creates_state
355
+ test_update_modifies_state
356
+ test_reset_clears_state
357
+ test_metrics_calculation
358
+ test_timestamp_tracking
359
+ test_invalid_sprint_id
360
+ test_invalid_status
361
+ test_metadata_persistence
362
+ test_concurrent_access
363
+
364
+ echo ""
365
+ echo "========================================"
366
+ echo "Test Results"
367
+ echo "========================================"
368
+ echo "Total: ${TESTS_TOTAL}"
369
+ echo -e "Passed: ${GREEN}${TESTS_PASSED}${NC}"
370
+
371
+ if [ $TESTS_FAILED -gt 0 ]; then
372
+ echo -e "Failed: ${RED}${TESTS_FAILED}${NC}"
373
+ local pass_rate
374
+ pass_rate=$(echo "scale=3; $TESTS_PASSED / $TESTS_TOTAL" | bc)
375
+ echo "Pass Rate: $pass_rate"
376
+ exit 1
377
+ else
378
+ echo -e "Failed: ${TESTS_FAILED}"
379
+ echo ""
380
+ echo -e "${GREEN}All tests passed! Pass rate: 1.000${NC}"
381
+ exit 0
382
+ fi
383
+ }
384
+
385
+ run_tests