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,352 @@
1
+ ---
2
+ name: google-sheets-validation
3
+ version: 1.0.0
4
+ category: coordination
5
+ tags: [google-sheets, validation, data-integrity, quality-assurance]
6
+ status: approved
7
+ author: CFN Team
8
+ description: Validates data integrity and state consistency between Google Sheets operation sprints
9
+ dependencies: [jq, bash, curl]
10
+ created: 2025-11-18
11
+ updated: 2025-11-18
12
+ complexity: Medium
13
+ keywords: [validation, data-integrity, sheets-api, state-verification]
14
+ triggers: [loop-2-validation, sprint-completion-check, data-integrity-audit]
15
+ performance_targets:
16
+ execution_time_ms: 2000
17
+ success_rate: 0.98
18
+ ---
19
+
20
+ # Google Sheets Validation Skill
21
+
22
+ ## Purpose
23
+
24
+ Validates data integrity and state consistency across Google Sheets operations during CFN Loop execution. Provides objective verification that schema exists, data is properly populated, formulas are correct, and no errors exist in the spreadsheet.
25
+
26
+ ## Problem Solved
27
+
28
+ Google Sheets operations fail silently when data is malformed, formulas contain errors, or API calls return unexpected results. Without validation, invalid intermediate states propagate to subsequent phases, causing cascading failures. This skill provides comprehensive validation gates preventing invalid state progression.
29
+
30
+ ## When to Use
31
+
32
+ - After schema creation phase completes (verify structure)
33
+ - After data population phase completes (verify data consistency)
34
+ - After formula application phase completes (verify calculation correctness)
35
+ - During Loop 2 validation (verify overall integrity)
36
+ - For audit trails and compliance reporting
37
+ - Before proceeding to next sprint phase
38
+
39
+ ## Interface
40
+
41
+ ### Primary Script: `validate-state.sh`
42
+
43
+ **Required Parameters:**
44
+ - `--spreadsheet-id`: Google Sheets spreadsheet ID
45
+ - `--sheet-name`: Name of sheet to validate
46
+
47
+ **Optional Parameters:**
48
+ - `--check`: Specific validation check to run: schema, data, formulas, all (default: all)
49
+ - `--api-key`: Google Sheets API key (or use GOOGLE_API_KEY env var)
50
+ - `--verbose`: Enable detailed validation reporting
51
+ - `--output-format`: json, report, brief (default: json)
52
+
53
+ **Usage:**
54
+
55
+ ```bash
56
+ # Validate all aspects of sheet
57
+ ./.claude/cfn-extras/skills/google-sheets-validation/validate-state.sh \
58
+ --spreadsheet-id "abc123def456" \
59
+ --sheet-name "Operations"
60
+
61
+ # Validate schema only
62
+ ./.claude/cfn-extras/skills/google-sheets-validation/validate-state.sh \
63
+ --spreadsheet-id "abc123def456" \
64
+ --sheet-name "Operations" \
65
+ --check schema
66
+
67
+ # Validate with detailed reporting
68
+ ./.claude/cfn-extras/skills/google-sheets-validation/validate-state.sh \
69
+ --spreadsheet-id "abc123def456" \
70
+ --sheet-name "Operations" \
71
+ --verbose \
72
+ --output-format report
73
+ ```
74
+
75
+ ## Validation Rules
76
+
77
+ ### Schema Validation
78
+
79
+ Checks:
80
+ 1. **Sheet exists** - Named sheet is present in spreadsheet
81
+ 2. **Header row present** - First row contains column headers
82
+ 3. **Column count consistent** - All rows have same number of columns
83
+ 4. **Header uniqueness** - No duplicate column names
84
+ 5. **Data types correct** - Columns match expected types
85
+
86
+ ```json
87
+ {
88
+ "check": "schema",
89
+ "passed": true,
90
+ "details": {
91
+ "sheet_exists": true,
92
+ "header_row_present": true,
93
+ "column_count": 5,
94
+ "columns": ["id", "name", "value", "status", "timestamp"],
95
+ "data_type_matches": true
96
+ }
97
+ }
98
+ ```
99
+
100
+ ### Data Validation
101
+
102
+ Checks:
103
+ 1. **Data present** - Sheet contains at least 1 data row
104
+ 2. **No empty required fields** - Required columns have values
105
+ 3. **Data format correctness** - Values match expected formats
106
+ 4. **Row count within limits** - Sheet hasn't exceeded size limits
107
+ 5. **Uniqueness constraints** - No duplicate primary keys
108
+ 6. **Referential integrity** - Foreign keys reference valid rows
109
+
110
+ ```json
111
+ {
112
+ "check": "data",
113
+ "passed": true,
114
+ "details": {
115
+ "row_count": 100,
116
+ "rows_with_errors": 0,
117
+ "empty_fields_found": 0,
118
+ "format_errors": 0,
119
+ "referential_integrity_errors": 0,
120
+ "sample_rows": [{...}]
121
+ }
122
+ }
123
+ ```
124
+
125
+ ### Formula Validation
126
+
127
+ Checks:
128
+ 1. **Formula syntax correct** - All formulas parse without errors
129
+ 2. **Cell references valid** - Formulas reference existing cells
130
+ 3. **No circular references** - Formulas don't create loops
131
+ 4. **Calculations accurate** - Results match expected calculations
132
+ 5. **Error cells** - No #ERROR, #REF!, #DIV/0! values
133
+ 6. **Range references valid** - Array formulas reference correct ranges
134
+
135
+ ```json
136
+ {
137
+ "check": "formulas",
138
+ "passed": true,
139
+ "details": {
140
+ "formula_count": 12,
141
+ "syntax_errors": 0,
142
+ "reference_errors": 0,
143
+ "circular_references": 0,
144
+ "error_cells": [],
145
+ "formulas": [{"cell": "D2", "formula": "=SUM(A2:C2)", "valid": true}]
146
+ }
147
+ }
148
+ ```
149
+
150
+ ## Output Format
151
+
152
+ JSON structure for validation results:
153
+
154
+ ```json
155
+ {
156
+ "success": true,
157
+ "confidence": 0.96,
158
+ "validation_timestamp": "2025-11-18T10:30:00Z",
159
+ "spreadsheet_id": "abc123def456",
160
+ "sheet_name": "Operations",
161
+ "validations": {
162
+ "schema": {
163
+ "passed": true,
164
+ "errors": [],
165
+ "warnings": []
166
+ },
167
+ "data": {
168
+ "passed": true,
169
+ "errors": [],
170
+ "warnings": []
171
+ },
172
+ "formulas": {
173
+ "passed": true,
174
+ "errors": [],
175
+ "warnings": []
176
+ }
177
+ },
178
+ "overall_status": "valid",
179
+ "error_count": 0,
180
+ "warning_count": 0,
181
+ "deliverables": ["validation_report.json"],
182
+ "errors": []
183
+ }
184
+ ```
185
+
186
+ ## Error Messages
187
+
188
+ ### Schema Errors
189
+
190
+ ```
191
+ ERROR: Sheet 'Operations' not found in spreadsheet
192
+ ERROR: Header row missing in sheet
193
+ ERROR: Column count mismatch: row 5 has 4 columns, expected 5
194
+ ERROR: Duplicate column name 'status' found
195
+ ERROR: Data type mismatch in column 'timestamp': expected date, got text
196
+ ```
197
+
198
+ ### Data Errors
199
+
200
+ ```
201
+ ERROR: No data rows found in sheet
202
+ ERROR: Empty required field in column 'id', row 5
203
+ ERROR: Date format error in column 'created_at', row 12: "invalid-date"
204
+ ERROR: Duplicate primary key value '42' in rows 5 and 12
205
+ ERROR: Foreign key reference invalid: row 8 references non-existent user_id '999'
206
+ ```
207
+
208
+ ### Formula Errors
209
+
210
+ ```
211
+ ERROR: Syntax error in cell D2: "=SUM(A2:C2" missing closing parenthesis
212
+ ERROR: Cell reference error in E5: references deleted column 'old_column'
213
+ ERROR: Circular reference detected: C2 → D2 → C2
214
+ ERROR: Error value in cell F3: #DIV/0! (division by zero)
215
+ ERROR: Invalid range in array formula L2: "={A1:B}" malformed range
216
+ ```
217
+
218
+ ## Integration with CFN Loop
219
+
220
+ ### Loop 3 Agents (Implementers)
221
+
222
+ After each operation phase completes:
223
+
224
+ ```bash
225
+ # Validate schema after creation
226
+ VALIDATION=$(./.claude/cfn-extras/skills/google-sheets-validation/validate-state.sh \
227
+ --spreadsheet-id "$SHEET_ID" \
228
+ --sheet-name "Operations" \
229
+ --check schema)
230
+
231
+ PASSED=$(echo "$VALIDATION" | jq -r '.validations.schema.passed')
232
+ if [ "$PASSED" = "true" ]; then
233
+ echo "Schema validation passed, proceeding to data population"
234
+ else
235
+ ERRORS=$(echo "$VALIDATION" | jq -r '.validations.schema.errors[]')
236
+ echo "Schema validation failed: $ERRORS"
237
+ exit 1
238
+ fi
239
+ ```
240
+
241
+ ### Loop 2 Validators
242
+
243
+ Comprehensive validation of completed work:
244
+
245
+ ```bash
246
+ # Run full validation on agent deliverables
247
+ VALIDATION=$(./.claude/cfn-extras/skills/google-sheets-validation/validate-state.sh \
248
+ --spreadsheet-id "$SHEET_ID" \
249
+ --sheet-name "Operations" \
250
+ --verbose \
251
+ --output-format report)
252
+
253
+ OVERALL_STATUS=$(echo "$VALIDATION" | jq -r '.overall_status')
254
+ ERROR_COUNT=$(echo "$VALIDATION" | jq -r '.error_count')
255
+
256
+ if [ "$OVERALL_STATUS" = "valid" ] && [ "$ERROR_COUNT" -eq 0 ]; then
257
+ echo "Validation passed with 0.96 confidence"
258
+ else
259
+ echo "Validation failed: $ERROR_COUNT errors found"
260
+ fi
261
+ ```
262
+
263
+ ### Product Owner Decision
264
+
265
+ Use validation results to inform go/no-go decision:
266
+
267
+ ```bash
268
+ # Get validation results
269
+ VALIDATION=$(./.claude/cfn-extras/skills/google-sheets-validation/validate-state.sh \
270
+ --spreadsheet-id "$SHEET_ID" \
271
+ --sheet-name "Operations")
272
+
273
+ if [ "$(echo "$VALIDATION" | jq -r '.success')" = "true" ]; then
274
+ echo "PROCEED - All validations passed"
275
+ else
276
+ echo "ITERATE - Validation failures require fixes"
277
+ fi
278
+ ```
279
+
280
+ ## Success Criteria
281
+
282
+ - **Pass rate**: ≥0.95 (standard mode)
283
+ - **Validation time**: <2000ms for typical spreadsheets
284
+ - **Error detection**: 0 false negatives (catches all real issues)
285
+ - **False positive rate**: <0.05 (max 5% of validation failures invalid)
286
+ - **API reliability**: 0 timeouts, graceful rate limit handling
287
+
288
+ ## Configuration
289
+
290
+ ### Environment Variables
291
+
292
+ ```bash
293
+ export GOOGLE_API_KEY="your-api-key-here"
294
+ export GOOGLE_SHEETS_QUOTA_LIMIT=100 # Requests per minute
295
+ export VALIDATION_TIMEOUT_MS=5000 # Max validation time
296
+ ```
297
+
298
+ ### Rate Limiting
299
+
300
+ The skill implements rate limiting to respect Google Sheets API quotas:
301
+
302
+ ```bash
303
+ # Automatic rate limiting with exponential backoff
304
+ # Quota: 60 requests per minute per user
305
+ # Delays: 100ms initial, doubles on quota exceed (max 5s)
306
+ ```
307
+
308
+ ## Best Practices
309
+
310
+ 1. **Validate early**: Run validation after each phase completes
311
+ 2. **Use specific checks**: Run only needed validations (--check schema)
312
+ 3. **Capture results**: Store validation JSON for audit trails
313
+ 4. **Handle errors gracefully**: Use validation errors to inform retry logic
314
+ 5. **Log everything**: Enable --verbose for troubleshooting
315
+
316
+ ## Anti-Patterns
317
+
318
+ ❌ **Skipping validation** - Assuming upstream operations are correct
319
+ ❌ **Ignoring warnings** - Warnings often indicate data quality issues
320
+ ❌ **One-time validation** - Validate after each phase, not just at end
321
+ ❌ **No error context** - Implement proper error handling and logging
322
+ ❌ **API quota ignorance** - Don't exceed Google Sheets API limits
323
+
324
+ ## Testing
325
+
326
+ Comprehensive test suite included:
327
+
328
+ ```bash
329
+ # Run all validation tests
330
+ ./.claude/cfn-extras/skills/google-sheets-validation/test.sh
331
+
332
+ # Run specific test category
333
+ ./.claude/cfn-extras/skills/google-sheets-validation/test.sh --category schema
334
+
335
+ # Validate skill itself
336
+ ./.claude/cfn-extras/skills/google-sheets-validation/validate.sh
337
+ ```
338
+
339
+ ### Test Categories
340
+
341
+ 1. **Schema validation tests** - Header presence, column consistency
342
+ 2. **Data validation tests** - Format correctness, referential integrity
343
+ 3. **Formula validation tests** - Syntax, circular references, calculations
344
+ 4. **Error handling tests** - Missing sheets, malformed data, API errors
345
+ 5. **Performance tests** - Execution time under load
346
+
347
+ ## References
348
+
349
+ - **Google Sheets API**: https://developers.google.com/sheets/api
350
+ - **Data Integrity Patterns**: `.claude/skills/cfn-defense-in-depth/SKILL.md`
351
+ - **CFN Loop Validation**: `.claude/skills/cfn-loop-validation/SKILL.md`
352
+ - **Agent Output Standards**: `docs/AGENT_OUTPUT_STANDARDS.md`
@@ -0,0 +1,355 @@
1
+ #!/bin/bash
2
+ set -eu
3
+
4
+ # google-sheets-validation/test.sh
5
+ # Comprehensive test suite for validation
6
+ # Version: 1.0.0
7
+
8
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
9
+ TESTS_PASSED=0
10
+ TESTS_FAILED=0
11
+ TESTS_TOTAL=0
12
+
13
+ # Colors
14
+ RED='\033[0;31m'
15
+ GREEN='\033[0;32m'
16
+ YELLOW='\033[1;33m'
17
+ NC='\033[0m'
18
+
19
+ # Test helpers
20
+ assert_success() {
21
+ local result="$1"
22
+ local message="${2:-Command should succeed}"
23
+
24
+ ((TESTS_TOTAL++))
25
+
26
+ if echo "$result" | jq -e '.success == true' >/dev/null 2>&1; then
27
+ ((TESTS_PASSED++))
28
+ echo -e "${GREEN}✓${NC} $message"
29
+ return 0
30
+ else
31
+ ((TESTS_FAILED++))
32
+ echo -e "${RED}✗${NC} $message"
33
+ return 1
34
+ fi
35
+ }
36
+
37
+ assert_field_equals() {
38
+ local result="$1"
39
+ local field="$2"
40
+ local expected="$3"
41
+ local message="${4:-Field should equal expected}"
42
+
43
+ ((TESTS_TOTAL++))
44
+
45
+ local actual
46
+ actual=$(echo "$result" | jq -r "$field" 2>/dev/null || echo "PARSE_ERROR")
47
+
48
+ if [ "$actual" = "$expected" ]; then
49
+ ((TESTS_PASSED++))
50
+ echo -e "${GREEN}✓${NC} $message"
51
+ return 0
52
+ else
53
+ ((TESTS_FAILED++))
54
+ echo -e "${RED}✗${NC} $message"
55
+ echo " Expected: $expected"
56
+ echo " Actual: $actual"
57
+ return 1
58
+ fi
59
+ }
60
+
61
+ # Test: Help flag works
62
+ test_help_flag() {
63
+ echo ""
64
+ echo "Testing help flag..."
65
+
66
+ if "$SCRIPT_DIR/validate-state.sh" --help >/dev/null 2>&1; then
67
+ ((TESTS_PASSED++))
68
+ echo -e "${GREEN}✓${NC} Help flag should work"
69
+ else
70
+ ((TESTS_FAILED++))
71
+ echo -e "${RED}✗${NC} Help flag should work"
72
+ fi
73
+ ((TESTS_TOTAL++))
74
+ }
75
+
76
+ # Test: Missing required parameters rejected
77
+ test_missing_parameters() {
78
+ echo ""
79
+ echo "Testing missing parameter validation..."
80
+
81
+ local result
82
+ result=$("$SCRIPT_DIR/validate-state.sh" 2>&1 || true)
83
+
84
+ if echo "$result" | grep -q "required"; then
85
+ ((TESTS_PASSED++))
86
+ echo -e "${GREEN}✓${NC} Missing parameters should be rejected"
87
+ else
88
+ ((TESTS_FAILED++))
89
+ echo -e "${RED}✗${NC} Missing parameters should be rejected"
90
+ fi
91
+ ((TESTS_TOTAL++))
92
+ }
93
+
94
+ # Test: Schema validation with mock data
95
+ test_schema_validation() {
96
+ echo ""
97
+ echo "Testing schema validation..."
98
+
99
+ local result
100
+ result=$("$SCRIPT_DIR/validate-state.sh" \
101
+ --spreadsheet-id "test123" \
102
+ --sheet-name "TestSheet" \
103
+ --check schema 2>&1 || true)
104
+
105
+ if echo "$result" | jq -e '.validations.schema.passed' >/dev/null 2>&1; then
106
+ ((TESTS_PASSED++))
107
+ echo -e "${GREEN}✓${NC} Schema validation should return structure"
108
+ else
109
+ ((TESTS_FAILED++))
110
+ echo -e "${RED}✗${NC} Schema validation should return structure"
111
+ fi
112
+ ((TESTS_TOTAL++))
113
+ }
114
+
115
+ # Test: Data validation with mock data
116
+ test_data_validation() {
117
+ echo ""
118
+ echo "Testing data validation..."
119
+
120
+ local result
121
+ result=$("$SCRIPT_DIR/validate-state.sh" \
122
+ --spreadsheet-id "test123" \
123
+ --sheet-name "TestSheet" \
124
+ --check data 2>&1 || true)
125
+
126
+ if echo "$result" | jq -e '.validations.data.passed' >/dev/null 2>&1; then
127
+ ((TESTS_PASSED++))
128
+ echo -e "${GREEN}✓${NC} Data validation should return structure"
129
+ else
130
+ ((TESTS_FAILED++))
131
+ echo -e "${RED}✗${NC} Data validation should return structure"
132
+ fi
133
+ ((TESTS_TOTAL++))
134
+ }
135
+
136
+ # Test: Formula validation with mock data
137
+ test_formula_validation() {
138
+ echo ""
139
+ echo "Testing formula validation..."
140
+
141
+ local result
142
+ result=$("$SCRIPT_DIR/validate-state.sh" \
143
+ --spreadsheet-id "test123" \
144
+ --sheet-name "TestSheet" \
145
+ --check formulas 2>&1 || true)
146
+
147
+ if echo "$result" | jq -e '.validations.formulas.passed' >/dev/null 2>&1; then
148
+ ((TESTS_PASSED++))
149
+ echo -e "${GREEN}✓${NC} Formula validation should return structure"
150
+ else
151
+ ((TESTS_FAILED++))
152
+ echo -e "${RED}✗${NC} Formula validation should return structure"
153
+ fi
154
+ ((TESTS_TOTAL++))
155
+ }
156
+
157
+ # Test: All validation checks
158
+ test_all_validation() {
159
+ echo ""
160
+ echo "Testing all validation checks..."
161
+
162
+ local result
163
+ result=$("$SCRIPT_DIR/validate-state.sh" \
164
+ --spreadsheet-id "test123" \
165
+ --sheet-name "TestSheet" \
166
+ --check all 2>&1)
167
+
168
+ if echo "$result" | jq -e '.overall_status' >/dev/null 2>&1; then
169
+ ((TESTS_PASSED++))
170
+ echo -e "${GREEN}✓${NC} All checks should include overall_status"
171
+ else
172
+ ((TESTS_FAILED++))
173
+ echo -e "${RED}✗${NC} All checks should include overall_status"
174
+ fi
175
+ ((TESTS_TOTAL++))
176
+ }
177
+
178
+ # Test: JSON output format
179
+ test_json_output_format() {
180
+ echo ""
181
+ echo "Testing JSON output format..."
182
+
183
+ local result
184
+ result=$("$SCRIPT_DIR/validate-state.sh" \
185
+ --spreadsheet-id "test123" \
186
+ --sheet-name "TestSheet" \
187
+ --output-format json 2>&1)
188
+
189
+ if echo "$result" | jq empty 2>/dev/null; then
190
+ ((TESTS_PASSED++))
191
+ echo -e "${GREEN}✓${NC} JSON output should be valid"
192
+ else
193
+ ((TESTS_FAILED++))
194
+ echo -e "${RED}✗${NC} JSON output should be valid"
195
+ fi
196
+ ((TESTS_TOTAL++))
197
+ }
198
+
199
+ # Test: Report output format
200
+ test_report_output_format() {
201
+ echo ""
202
+ echo "Testing report output format..."
203
+
204
+ local result
205
+ result=$("$SCRIPT_DIR/validate-state.sh" \
206
+ --spreadsheet-id "test123" \
207
+ --sheet-name "TestSheet" \
208
+ --output-format report 2>&1)
209
+
210
+ if echo "$result" | grep -q "Validation Report"; then
211
+ ((TESTS_PASSED++))
212
+ echo -e "${GREEN}✓${NC} Report output should contain header"
213
+ else
214
+ ((TESTS_FAILED++))
215
+ echo -e "${RED}✗${NC} Report output should contain header"
216
+ fi
217
+ ((TESTS_TOTAL++))
218
+ }
219
+
220
+ # Test: Brief output format
221
+ test_brief_output_format() {
222
+ echo ""
223
+ echo "Testing brief output format..."
224
+
225
+ local result
226
+ result=$("$SCRIPT_DIR/validate-state.sh" \
227
+ --spreadsheet-id "test123" \
228
+ --sheet-name "TestSheet" \
229
+ --output-format brief 2>&1)
230
+
231
+ if echo "$result" | grep -q "Schema:"; then
232
+ ((TESTS_PASSED++))
233
+ echo -e "${GREEN}✓${NC} Brief output should contain Schema line"
234
+ else
235
+ ((TESTS_FAILED++))
236
+ echo -e "${RED}✗${NC} Brief output should contain Schema line"
237
+ fi
238
+ ((TESTS_TOTAL++))
239
+ }
240
+
241
+ # Test: Verbose flag
242
+ test_verbose_flag() {
243
+ echo ""
244
+ echo "Testing verbose flag..."
245
+
246
+ # Verbose outputs to stderr, so we capture both
247
+ local result
248
+ result=$("$SCRIPT_DIR/validate-state.sh" \
249
+ --spreadsheet-id "test123" \
250
+ --sheet-name "TestSheet" \
251
+ --verbose 2>&1)
252
+
253
+ if echo "$result" | grep -q "VERBOSE" || echo "$result" | jq -e '.success' >/dev/null 2>&1; then
254
+ ((TESTS_PASSED++))
255
+ echo -e "${GREEN}✓${NC} Verbose flag should work"
256
+ else
257
+ ((TESTS_FAILED++))
258
+ echo -e "${RED}✗${NC} Verbose flag should work"
259
+ fi
260
+ ((TESTS_TOTAL++))
261
+ }
262
+
263
+ # Test: Invalid check type rejected
264
+ test_invalid_check_type() {
265
+ echo ""
266
+ echo "Testing invalid check type..."
267
+
268
+ local result
269
+ result=$("$SCRIPT_DIR/validate-state.sh" \
270
+ --spreadsheet-id "test123" \
271
+ --sheet-name "TestSheet" \
272
+ --check invalid 2>&1 || true)
273
+
274
+ if echo "$result" | grep -qi "unknown\|invalid"; then
275
+ ((TESTS_PASSED++))
276
+ echo -e "${GREEN}✓${NC} Invalid check type should be rejected"
277
+ else
278
+ ((TESTS_FAILED++))
279
+ echo -e "${RED}✗${NC} Invalid check type should be rejected"
280
+ fi
281
+ ((TESTS_TOTAL++))
282
+ }
283
+
284
+ # Test: Output structure has required fields
285
+ test_output_structure() {
286
+ echo ""
287
+ echo "Testing output structure..."
288
+
289
+ local result
290
+ result=$("$SCRIPT_DIR/validate-state.sh" \
291
+ --spreadsheet-id "test123" \
292
+ --sheet-name "TestSheet" \
293
+ --check all 2>&1)
294
+
295
+ local required_fields=("success" "confidence" "validation_timestamp" "spreadsheet_id" "overall_status" "error_count" "deliverables")
296
+ local missing_fields=0
297
+
298
+ for field in "${required_fields[@]}"; do
299
+ if ! echo "$result" | jq -e ".$field" >/dev/null 2>&1; then
300
+ echo " Missing field: $field"
301
+ ((missing_fields++))
302
+ fi
303
+ done
304
+
305
+ ((TESTS_TOTAL++))
306
+ if [ $missing_fields -eq 0 ]; then
307
+ ((TESTS_PASSED++))
308
+ echo -e "${GREEN}✓${NC} Output should contain all required fields"
309
+ else
310
+ ((TESTS_FAILED++))
311
+ echo -e "${RED}✗${NC} Output should contain all required fields ($missing_fields missing)"
312
+ fi
313
+ }
314
+
315
+ # Run all tests
316
+ run_tests() {
317
+ echo "========================================"
318
+ echo "Running tests for google-sheets-validation"
319
+ echo "========================================"
320
+
321
+ test_help_flag
322
+ test_missing_parameters
323
+ test_schema_validation
324
+ test_data_validation
325
+ test_formula_validation
326
+ test_all_validation
327
+ test_json_output_format
328
+ test_report_output_format
329
+ test_brief_output_format
330
+ test_verbose_flag
331
+ test_invalid_check_type
332
+ test_output_structure
333
+
334
+ echo ""
335
+ echo "========================================"
336
+ echo "Test Results"
337
+ echo "========================================"
338
+ echo "Total: ${TESTS_TOTAL}"
339
+ echo -e "Passed: ${GREEN}${TESTS_PASSED}${NC}"
340
+
341
+ if [ $TESTS_FAILED -gt 0 ]; then
342
+ echo -e "Failed: ${RED}${TESTS_FAILED}${NC}"
343
+ local pass_rate
344
+ pass_rate=$(echo "scale=3; $TESTS_PASSED / $TESTS_TOTAL" | bc)
345
+ echo "Pass Rate: $pass_rate"
346
+ exit 1
347
+ else
348
+ echo -e "Failed: ${TESTS_FAILED}"
349
+ echo ""
350
+ echo -e "${GREEN}All tests passed! Pass rate: 1.000${NC}"
351
+ exit 0
352
+ fi
353
+ }
354
+
355
+ run_tests