codex-genesis-harness 0.1.0 → 0.1.4

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 (328) hide show
  1. package/.codebase/API_CONTRACTS.md +12 -0
  2. package/.codebase/ARCHITECTURE.md +6 -0
  3. package/.codebase/ARCHITECTURE_REVIEW_COMPLETE.md +216 -0
  4. package/.codebase/CURRENT_STATE.md +8 -0
  5. package/.codebase/DEPENDENCY_GRAPH.md +14 -0
  6. package/.codebase/DOMAIN_MODELS.md +10 -0
  7. package/.codebase/EVOLUTION_PLAN.md +35 -0
  8. package/.codebase/FILE_NAMING_CLARIFICATION.md +161 -0
  9. package/.codebase/HARNESS_COMPLETENESS_AUDIT.md +613 -0
  10. package/.codebase/IMPLEMENTATION_COMPLETE.md +429 -0
  11. package/.codebase/IMPLEMENTATION_HANDOFF.md +351 -0
  12. package/.codebase/IMPROVEMENTS_SUMMARY.md +419 -0
  13. package/.codebase/KNOWN_PROBLEMS.md +6 -0
  14. package/.codebase/MODULE_INDEX.md +13 -0
  15. package/.codebase/PHASE3_SKILLS_NAMING_COMPLETE.md +292 -0
  16. package/.codebase/PHASE_DEPENDENCY_MAP.md +486 -0
  17. package/.codebase/PIPELINE_FLOW.md +14 -0
  18. package/.codebase/QUICK_START_SPEC_IMPACT.md +456 -0
  19. package/.codebase/README.md +139 -0
  20. package/.codebase/RECOVERY_POINTS.md +438 -0
  21. package/.codebase/TEST_MATRIX.md +11 -0
  22. package/.codebase/UI_ROUTES.md +4 -0
  23. package/.codebase/context/backend-summary.md +4 -0
  24. package/.codebase/context/frontend-summary.md +4 -0
  25. package/.codebase/context/pipeline-summary.md +4 -0
  26. package/.codebase/context/providers-summary.md +4 -0
  27. package/.codebase/context/render-summary.md +4 -0
  28. package/.codebase/context/tests-summary.md +4 -0
  29. package/.codex/skills/genesis-ai-provider/SKILL.md +46 -0
  30. package/.codex/skills/genesis-ai-provider/agents/openai.yaml +7 -0
  31. package/.codex/skills/genesis-ai-provider/checklists/checklist.md +9 -0
  32. package/.codex/skills/genesis-ai-provider/examples/example.md +4 -0
  33. package/.codex/skills/genesis-ai-provider/templates/provider-contract-template.md +9 -0
  34. package/.codex/skills/genesis-api-contract/SKILL.md +46 -0
  35. package/.codex/skills/genesis-api-contract/agents/openai.yaml +7 -0
  36. package/.codex/skills/genesis-api-contract/checklists/checklist.md +8 -0
  37. package/.codex/skills/genesis-api-contract/examples/example.md +4 -0
  38. package/.codex/skills/genesis-api-contract/templates/api-contract-template.md +4 -0
  39. package/.codex/skills/genesis-api-sync/SKILL.md +354 -0
  40. package/.codex/skills/genesis-api-sync/agents/openai.yaml +7 -0
  41. package/.codex/skills/genesis-api-sync/checklists/api-sync-checklist.md +101 -0
  42. package/.codex/skills/genesis-api-sync/examples/example.md +68 -0
  43. package/.codex/skills/genesis-api-sync/templates/api-change-template.md +257 -0
  44. package/.codex/skills/genesis-architecture/SKILL.md +46 -0
  45. package/.codex/skills/genesis-architecture/agents/openai.yaml +7 -0
  46. package/.codex/skills/genesis-architecture/checklists/checklist.md +8 -0
  47. package/.codex/skills/genesis-architecture/examples/example.md +4 -0
  48. package/.codex/skills/genesis-architecture/templates/architecture-decision-template.md +14 -0
  49. package/.codex/skills/genesis-codebase-map/SKILL.md +46 -0
  50. package/.codex/skills/genesis-codebase-map/agents/openai.yaml +7 -0
  51. package/.codex/skills/genesis-codebase-map/checklists/checklist.md +7 -0
  52. package/.codex/skills/genesis-codebase-map/examples/example.md +4 -0
  53. package/.codex/skills/genesis-codebase-map/templates/map-update-template.md +8 -0
  54. package/.codex/skills/genesis-debug-guide/SKILL.md +479 -0
  55. package/.codex/skills/genesis-debug-guide/agents/openai.yaml +7 -0
  56. package/.codex/skills/genesis-debug-guide/checklists/flaky-test-investigation.md +339 -0
  57. package/.codex/skills/genesis-debug-guide/checklists/production-bug-debug.md +210 -0
  58. package/.codex/skills/genesis-debug-guide/checklists/test-failure-debug.md +158 -0
  59. package/.codex/skills/genesis-debug-guide/examples/example.md +48 -0
  60. package/.codex/skills/genesis-debug-guide/observability/debug-commands.md +365 -0
  61. package/.codex/skills/genesis-debug-guide/playbooks/unit-test-failures.md +289 -0
  62. package/.codex/skills/genesis-debug-guide/templates/debug-investigation-log.md +288 -0
  63. package/.codex/skills/genesis-design-spec/SKILL.md +46 -0
  64. package/.codex/skills/genesis-design-spec/agents/openai.yaml +7 -0
  65. package/.codex/skills/genesis-design-spec/checklists/checklist.md +7 -0
  66. package/.codex/skills/genesis-design-spec/examples/example.md +4 -0
  67. package/.codex/skills/genesis-design-spec/templates/design-spec-template.md +9 -0
  68. package/.codex/skills/genesis-docs/SKILL.md +46 -0
  69. package/.codex/skills/genesis-docs/agents/openai.yaml +7 -0
  70. package/.codex/skills/genesis-docs/checklists/checklist.md +7 -0
  71. package/.codex/skills/genesis-docs/examples/example.md +4 -0
  72. package/.codex/skills/genesis-docs/templates/docs-update-template.md +8 -0
  73. package/.codex/skills/genesis-docs-automation/SKILL.md +1003 -0
  74. package/.codex/skills/genesis-docs-automation/agents/openai.yaml +7 -0
  75. package/.codex/skills/genesis-docs-automation/checklists/docs-validation.md +359 -0
  76. package/.codex/skills/genesis-docs-automation/checklists/spec-alignment.md +312 -0
  77. package/.codex/skills/genesis-docs-automation/examples/example.md +59 -0
  78. package/.codex/skills/genesis-docs-automation/observability/docs-tracking.md +382 -0
  79. package/.codex/skills/genesis-docs-automation/playbooks/auto-update-flow.md +851 -0
  80. package/.codex/skills/genesis-docs-automation/playbooks/changelog-generation.md +491 -0
  81. package/.codex/skills/genesis-docs-automation/templates/changelog-entry-template.md +187 -0
  82. package/.codex/skills/genesis-docs-automation/templates/handoff-template.md +297 -0
  83. package/.codex/skills/genesis-harness/SKILL.md +1418 -0
  84. package/.codex/skills/genesis-harness/agents/openai.yaml +9 -0
  85. package/.codex/skills/genesis-harness/checklists/bug-fix-qa.md +169 -0
  86. package/.codex/skills/genesis-harness/checklists/checklist.md +10 -0
  87. package/.codex/skills/genesis-harness/checklists/new-feature-qa.md +157 -0
  88. package/.codex/skills/genesis-harness/checklists/refactor-qa.md +216 -0
  89. package/.codex/skills/genesis-harness/checklists/requirements-validation.md +211 -0
  90. package/.codex/skills/genesis-harness/examples/example.md +4 -0
  91. package/.codex/skills/genesis-harness/resources/change-impact-matrix-template.md +204 -0
  92. package/.codex/skills/genesis-harness/resources/foundation-phase-template.md +131 -0
  93. package/.codex/skills/genesis-harness/resources/phase-00-foundation-template.md +76 -0
  94. package/.codex/skills/genesis-harness/resources/post-implementation-guide.md +347 -0
  95. package/.codex/skills/{project-genesis-harness → genesis-harness}/scripts/check-architecture-boundaries.sh +23 -23
  96. package/.codex/skills/{project-genesis-harness → genesis-harness}/scripts/check-docs-sync.sh +24 -24
  97. package/.codex/skills/{project-genesis-harness → genesis-harness}/scripts/check-no-debug-logs.sh +21 -21
  98. package/.codex/skills/{project-genesis-harness → genesis-harness}/scripts/check-required-planning-files.sh +46 -46
  99. package/.codex/skills/{project-genesis-harness → genesis-harness}/scripts/check-spec-changelog.sh +24 -24
  100. package/.codex/skills/{project-genesis-harness → genesis-harness}/scripts/check-task-tracking.sh +25 -25
  101. package/.codex/skills/genesis-harness/scripts/compact-context.sh +54 -0
  102. package/.codex/skills/{project-genesis-harness → genesis-harness}/scripts/create-adr.sh +74 -74
  103. package/.codex/skills/{project-genesis-harness → genesis-harness}/scripts/create-bug.sh +160 -160
  104. package/.codex/skills/{project-genesis-harness → genesis-harness}/scripts/create-feature.sh +217 -217
  105. package/.codex/skills/{project-genesis-harness → genesis-harness}/scripts/detect-stack.sh +26 -26
  106. package/.codex/skills/{project-genesis-harness → genesis-harness}/scripts/init-planning.sh +750 -719
  107. package/.codex/skills/{project-genesis-harness → genesis-harness}/scripts/list-changed-files.sh +12 -12
  108. package/.codex/skills/genesis-harness/scripts/offload-log.sh +72 -0
  109. package/.codex/skills/{project-genesis-harness → genesis-harness}/scripts/run-verification.sh +47 -47
  110. package/.codex/skills/genesis-harness/scripts/run-verify-loop.sh +75 -0
  111. package/.codex/skills/{project-genesis-harness → genesis-harness}/scripts/update-state.sh +33 -33
  112. package/.codex/skills/genesis-harness/templates/harness-workflow-template.md +10 -0
  113. package/.codex/skills/genesis-harness-engineering/SKILL.md +159 -0
  114. package/.codex/skills/genesis-harness-engineering/agents/openai.yaml +7 -0
  115. package/.codex/skills/genesis-harness-engineering/checklists/checklist.md +48 -0
  116. package/.codex/skills/genesis-harness-engineering/examples/example.md +57 -0
  117. package/.codex/skills/genesis-harness-engineering/playbooks/harness-evolution.md +99 -0
  118. package/.codex/skills/genesis-harness-engineering/templates/harness-change-template.md +37 -0
  119. package/.codex/skills/genesis-new-design/SKILL.md +95 -0
  120. package/.codex/skills/genesis-new-design/agents/openai.yaml +4 -0
  121. package/.codex/skills/genesis-new-design/checklists/checklist.md +8 -0
  122. package/.codex/skills/genesis-new-design/examples/example.md +4 -0
  123. package/.codex/skills/genesis-new-design/templates/new-design-template.md +9 -0
  124. package/.codex/skills/genesis-observability-automation/SKILL.md +382 -0
  125. package/.codex/skills/genesis-observability-automation/agents/openai.yaml +7 -0
  126. package/.codex/skills/genesis-observability-automation/examples/example.md +86 -0
  127. package/.codex/skills/genesis-performance-profiling/SKILL.md +510 -0
  128. package/.codex/skills/genesis-performance-profiling/agents/openai.yaml +6 -0
  129. package/.codex/skills/genesis-performance-profiling/checklists/optimization-verification.md +199 -0
  130. package/.codex/skills/genesis-performance-profiling/checklists/performance-baseline.md +183 -0
  131. package/.codex/skills/genesis-performance-profiling/examples/example.md +234 -0
  132. package/.codex/skills/genesis-performance-profiling/observability/performance-tracking.md +202 -0
  133. package/.codex/skills/genesis-performance-profiling/playbooks/load-testing-orchestration.md +593 -0
  134. package/.codex/skills/genesis-performance-profiling/playbooks/profiling-playbook.md +601 -0
  135. package/.codex/skills/genesis-performance-profiling/templates/load-test-config-template.md +428 -0
  136. package/.codex/skills/genesis-performance-profiling/templates/performance-report-template.md +238 -0
  137. package/.codex/skills/genesis-pipeline-orchestration/SKILL.md +46 -0
  138. package/.codex/skills/genesis-pipeline-orchestration/agents/openai.yaml +7 -0
  139. package/.codex/skills/genesis-pipeline-orchestration/checklists/checklist.md +12 -0
  140. package/.codex/skills/genesis-pipeline-orchestration/examples/example.md +4 -0
  141. package/.codex/skills/genesis-pipeline-orchestration/templates/orchestration-template.md +12 -0
  142. package/.codex/skills/genesis-planning/SKILL.md +46 -0
  143. package/.codex/skills/genesis-planning/agents/openai.yaml +7 -0
  144. package/.codex/skills/genesis-planning/checklists/checklist.md +8 -0
  145. package/.codex/skills/genesis-planning/examples/example.md +4 -0
  146. package/.codex/skills/genesis-planning/templates/plan-template.md +11 -0
  147. package/.codex/skills/genesis-release/SKILL.md +46 -0
  148. package/.codex/skills/genesis-release/agents/openai.yaml +7 -0
  149. package/.codex/skills/genesis-release/checklists/checklist.md +8 -0
  150. package/.codex/skills/genesis-release/examples/example.md +4 -0
  151. package/.codex/skills/genesis-release/templates/release-checklist-template.md +9 -0
  152. package/.codex/skills/genesis-release-orchestration/SKILL.md +653 -0
  153. package/.codex/skills/genesis-release-orchestration/agents/openai.yaml +7 -0
  154. package/.codex/skills/genesis-release-orchestration/checklists/post-deployment-verification.md +274 -0
  155. package/.codex/skills/genesis-release-orchestration/checklists/pre-release-validation.md +220 -0
  156. package/.codex/skills/genesis-release-orchestration/examples/example.md +78 -0
  157. package/.codex/skills/genesis-release-orchestration/observability/release-tracking.md +253 -0
  158. package/.codex/skills/genesis-release-orchestration/playbooks/canary-deployment-orchestration.md +472 -0
  159. package/.codex/skills/genesis-release-orchestration/playbooks/semantic-versioning-automation.md +494 -0
  160. package/.codex/skills/genesis-release-orchestration/templates/deployment-strategy-template.md +303 -0
  161. package/.codex/skills/genesis-release-orchestration/templates/release-runbook-template.md +420 -0
  162. package/.codex/skills/genesis-research/SKILL.md +46 -0
  163. package/.codex/skills/genesis-research/agents/openai.yaml +7 -0
  164. package/.codex/skills/genesis-research/checklists/checklist.md +7 -0
  165. package/.codex/skills/genesis-research/examples/example.md +4 -0
  166. package/.codex/skills/genesis-research/templates/research-note-template.md +9 -0
  167. package/.codex/skills/genesis-research-first/SKILL.md +237 -0
  168. package/.codex/skills/genesis-research-first/agents/openai.yaml +7 -0
  169. package/.codex/skills/genesis-research-first/examples/example.md +85 -0
  170. package/.codex/skills/genesis-spec-propagation/SKILL.md +534 -0
  171. package/.codex/skills/genesis-spec-propagation/agents/openai.yaml +7 -0
  172. package/.codex/skills/genesis-spec-propagation/checklists/phase-update-verification.md +384 -0
  173. package/.codex/skills/genesis-spec-propagation/checklists/spec-change-detection.md +257 -0
  174. package/.codex/skills/genesis-spec-propagation/examples/example.md +63 -0
  175. package/.codex/skills/genesis-spec-propagation/observability/propagation-tracking.md +373 -0
  176. package/.codex/skills/genesis-spec-propagation/playbooks/breaking-change-propagation.md +692 -0
  177. package/.codex/skills/genesis-spec-propagation/playbooks/feature-change-propagation.md +434 -0
  178. package/.codex/skills/genesis-spec-propagation/templates/migration-guide-template.md +407 -0
  179. package/.codex/skills/genesis-upgrade-design/SKILL.md +97 -0
  180. package/.codex/skills/genesis-upgrade-design/agents/openai.yaml +4 -0
  181. package/.codex/skills/genesis-upgrade-design/checklists/checklist.md +8 -0
  182. package/.codex/skills/genesis-upgrade-design/examples/example.md +4 -0
  183. package/.codex/skills/genesis-upgrade-design/templates/upgrade-design-template.md +9 -0
  184. package/.codex/skills/spec-impact-engine/SKILL.md +504 -0
  185. package/.codex/skills/spec-impact-engine/agents/openai.yaml +7 -0
  186. package/.codex/skills/spec-impact-engine/detect-spec-changes.sh +262 -0
  187. package/.codex/skills/spec-impact-engine/examples/example.md +98 -0
  188. package/.codex/skills/spec-impact-engine/templates/impact-report.md +248 -0
  189. package/.codex/skills/spec-impact-engine/templates/migration-guide.md +223 -0
  190. package/.codex/skills/ui-ux-test-skill/SKILL.md +46 -0
  191. package/.codex/skills/ui-ux-test-skill/agents/openai.yaml +7 -0
  192. package/.codex/skills/ui-ux-test-skill/checklists/checklist.md +8 -0
  193. package/.codex/skills/ui-ux-test-skill/examples/example.md +4 -0
  194. package/.codex/skills/ui-ux-test-skill/templates/playwright-test-template.md +4 -0
  195. package/.codex-plugin/plugin.json +13 -11
  196. package/README.EN.md +719 -0
  197. package/README.VI.md +712 -0
  198. package/README.md +318 -181
  199. package/VERSION +1 -1
  200. package/bin/genesis-harness.js +133 -79
  201. package/contracts/agents/CharacterBibleAgent/error.json +1 -0
  202. package/contracts/agents/CharacterBibleAgent/example.json +1 -0
  203. package/contracts/agents/CharacterBibleAgent/request.json +1 -0
  204. package/contracts/agents/CharacterBibleAgent/response.json +1 -0
  205. package/contracts/agents/CharacterBibleAgent/schema.json +1 -0
  206. package/contracts/agents/ImageGenerationAgent/error.json +1 -0
  207. package/contracts/agents/ImageGenerationAgent/example.json +1 -0
  208. package/contracts/agents/ImageGenerationAgent/request.json +1 -0
  209. package/contracts/agents/ImageGenerationAgent/response.json +1 -0
  210. package/contracts/agents/ImageGenerationAgent/schema.json +1 -0
  211. package/contracts/agents/PipelineOrchestrator/error.json +1 -0
  212. package/contracts/agents/PipelineOrchestrator/example.json +1 -0
  213. package/contracts/agents/PipelineOrchestrator/request.json +1 -0
  214. package/contracts/agents/PipelineOrchestrator/response.json +1 -0
  215. package/contracts/agents/PipelineOrchestrator/schema.json +1 -0
  216. package/contracts/agents/PromptGenerationAgent/error.json +1 -0
  217. package/contracts/agents/PromptGenerationAgent/example.json +1 -0
  218. package/contracts/agents/PromptGenerationAgent/request.json +1 -0
  219. package/contracts/agents/PromptGenerationAgent/response.json +1 -0
  220. package/contracts/agents/PromptGenerationAgent/schema.json +1 -0
  221. package/contracts/agents/RenderAgent/error.json +1 -0
  222. package/contracts/agents/RenderAgent/example.json +1 -0
  223. package/contracts/agents/RenderAgent/request.json +1 -0
  224. package/contracts/agents/RenderAgent/response.json +1 -0
  225. package/contracts/agents/RenderAgent/schema.json +1 -0
  226. package/contracts/agents/ScenePlanningAgent/error.json +1 -0
  227. package/contracts/agents/ScenePlanningAgent/example.json +1 -0
  228. package/contracts/agents/ScenePlanningAgent/request.json +1 -0
  229. package/contracts/agents/ScenePlanningAgent/response.json +1 -0
  230. package/contracts/agents/ScenePlanningAgent/schema.json +1 -0
  231. package/contracts/agents/ScreenplayAgent/error.json +1 -0
  232. package/contracts/agents/ScreenplayAgent/example.json +1 -0
  233. package/contracts/agents/ScreenplayAgent/request.json +1 -0
  234. package/contracts/agents/ScreenplayAgent/response.json +1 -0
  235. package/contracts/agents/ScreenplayAgent/schema.json +1 -0
  236. package/contracts/agents/StoryAnalysisAgent/error.json +1 -0
  237. package/contracts/agents/StoryAnalysisAgent/example.json +1 -0
  238. package/contracts/agents/StoryAnalysisAgent/request.json +1 -0
  239. package/contracts/agents/StoryAnalysisAgent/response.json +1 -0
  240. package/contracts/agents/StoryAnalysisAgent/schema.json +1 -0
  241. package/contracts/agents/SubtitleGenerationAgent/error.json +1 -0
  242. package/contracts/agents/SubtitleGenerationAgent/example.json +1 -0
  243. package/contracts/agents/SubtitleGenerationAgent/request.json +1 -0
  244. package/contracts/agents/SubtitleGenerationAgent/response.json +1 -0
  245. package/contracts/agents/SubtitleGenerationAgent/schema.json +1 -0
  246. package/contracts/agents/VoiceGenerationAgent/error.json +1 -0
  247. package/contracts/agents/VoiceGenerationAgent/example.json +1 -0
  248. package/contracts/agents/VoiceGenerationAgent/request.json +1 -0
  249. package/contracts/agents/VoiceGenerationAgent/response.json +1 -0
  250. package/contracts/agents/VoiceGenerationAgent/schema.json +1 -0
  251. package/contracts/api/README.md +4 -0
  252. package/contracts/api/endpoint-template/error.json +7 -0
  253. package/contracts/api/endpoint-template/example.json +11 -0
  254. package/contracts/api/endpoint-template/request.json +7 -0
  255. package/contracts/api/endpoint-template/response.json +6 -0
  256. package/contracts/api/endpoint-template/schema.json +9 -0
  257. package/contracts/events/README.md +4 -0
  258. package/contracts/events/event-template/error.json +4 -0
  259. package/contracts/events/event-template/example.json +6 -0
  260. package/contracts/events/event-template/request.json +6 -0
  261. package/contracts/events/event-template/response.json +3 -0
  262. package/contracts/events/event-template/schema.json +8 -0
  263. package/contracts/ui/README.md +4 -0
  264. package/contracts/ui/screen-template/error.json +4 -0
  265. package/contracts/ui/screen-template/example.json +7 -0
  266. package/contracts/ui/screen-template/request.json +4 -0
  267. package/contracts/ui/screen-template/response.json +4 -0
  268. package/contracts/ui/screen-template/schema.json +8 -0
  269. package/fixtures/agents/agent-fixture-template.md +14 -0
  270. package/fixtures/api/api-fixture-template.md +14 -0
  271. package/fixtures/images/image-fixture-template.md +14 -0
  272. package/fixtures/pipeline/pipeline-fixture-template.md +14 -0
  273. package/fixtures/render/render-fixture-template.md +14 -0
  274. package/fixtures/tts/tts-fixture-template.md +14 -0
  275. package/fixtures/videos/video-fixture-template.md +14 -0
  276. package/observability/agent-runs/agent-run-template.md +22 -0
  277. package/observability/decision-logs/decision-log-template.md +18 -0
  278. package/observability/failures/failure-template.md +18 -0
  279. package/package.json +8 -2
  280. package/playwright/e2e/e2e-template.md +4 -0
  281. package/playwright/fixtures/ui-fixture-template.md +4 -0
  282. package/playwright/smoke/smoke-template.md +4 -0
  283. package/playwright/visual/visual-regression-template.md +4 -0
  284. package/scripts/README.md +342 -0
  285. package/scripts/compact-context.sh +54 -0
  286. package/scripts/detect-changes.sh +152 -0
  287. package/scripts/install.sh +103 -69
  288. package/scripts/offload-log.sh +72 -0
  289. package/scripts/run-evals.sh +118 -52
  290. package/scripts/run-verify-loop.sh +75 -0
  291. package/scripts/uninstall.sh +81 -52
  292. package/scripts/verify.sh +380 -109
  293. package/tests/contracts/contract-template.test.md +10 -0
  294. package/tests/fixtures/fixture-index.md +4 -0
  295. package/tests/integration/integration-template.test.md +4 -0
  296. package/tests/unit/unit-template.test.md +4 -0
  297. package/.codex/skills/project-genesis-harness/SKILL.md +0 -727
  298. package/.codex/skills/project-genesis-harness/agents/openai.yaml +0 -9
  299. /package/.codex/skills/{project-genesis-harness → genesis-harness}/references/planning-schema.md +0 -0
  300. /package/.codex/skills/{project-genesis-harness → genesis-harness}/references/quality-rubric.md +0 -0
  301. /package/.codex/skills/{project-genesis-harness → genesis-harness}/references/research-rubric.md +0 -0
  302. /package/.codex/skills/{project-genesis-harness → genesis-harness}/references/workflows.md +0 -0
  303. /package/.codex/skills/{project-genesis-harness → genesis-harness}/resources/agents-template.md +0 -0
  304. /package/.codex/skills/{project-genesis-harness → genesis-harness}/resources/api-docs-template.md +0 -0
  305. /package/.codex/skills/{project-genesis-harness → genesis-harness}/resources/architecture-template.md +0 -0
  306. /package/.codex/skills/{project-genesis-harness → genesis-harness}/resources/audit-template.md +0 -0
  307. /package/.codex/skills/{project-genesis-harness → genesis-harness}/resources/bug-template.md +0 -0
  308. /package/.codex/skills/{project-genesis-harness → genesis-harness}/resources/check-template.md +0 -0
  309. /package/.codex/skills/{project-genesis-harness → genesis-harness}/resources/conventions-template.md +0 -0
  310. /package/.codex/skills/{project-genesis-harness → genesis-harness}/resources/decision-template.md +0 -0
  311. /package/.codex/skills/{project-genesis-harness → genesis-harness}/resources/design-template.md +0 -0
  312. /package/.codex/skills/{project-genesis-harness → genesis-harness}/resources/escalation-template.md +0 -0
  313. /package/.codex/skills/{project-genesis-harness → genesis-harness}/resources/feature-template.md +0 -0
  314. /package/.codex/skills/{project-genesis-harness → genesis-harness}/resources/integrations-template.md +0 -0
  315. /package/.codex/skills/{project-genesis-harness → genesis-harness}/resources/journeys-template.md +0 -0
  316. /package/.codex/skills/{project-genesis-harness → genesis-harness}/resources/lessons-learned-template.md +0 -0
  317. /package/.codex/skills/{project-genesis-harness → genesis-harness}/resources/observability-template.md +0 -0
  318. /package/.codex/skills/{project-genesis-harness → genesis-harness}/resources/phase-template.md +0 -0
  319. /package/.codex/skills/{project-genesis-harness → genesis-harness}/resources/pitfalls-template.md +0 -0
  320. /package/.codex/skills/{project-genesis-harness → genesis-harness}/resources/planning-tree-template.md +0 -0
  321. /package/.codex/skills/{project-genesis-harness → genesis-harness}/resources/project-template.md +0 -0
  322. /package/.codex/skills/{project-genesis-harness → genesis-harness}/resources/quality-score-template.md +0 -0
  323. /package/.codex/skills/{project-genesis-harness → genesis-harness}/resources/requirements-template.md +0 -0
  324. /package/.codex/skills/{project-genesis-harness → genesis-harness}/resources/research-template.md +0 -0
  325. /package/.codex/skills/{project-genesis-harness → genesis-harness}/resources/review-template.md +0 -0
  326. /package/.codex/skills/{project-genesis-harness → genesis-harness}/resources/spec-changelog-template.md +0 -0
  327. /package/.codex/skills/{project-genesis-harness → genesis-harness}/resources/stack-template.md +0 -0
  328. /package/.codex/skills/{project-genesis-harness → genesis-harness}/resources/verification-template.md +0 -0
@@ -0,0 +1,339 @@
1
+ # Flaky Test Investigation Checklist
2
+
3
+ **Purpose**: Systematic debugging for tests that fail intermittently. These are notoriously hard to fix but follow patterns.
4
+
5
+ **Status**: MANDATORY - Complete before attempting flaky test fix.
6
+
7
+ ## Characteristics: Is It Actually Flaky?
8
+
9
+ - [ ] **Fails inconsistently**:
10
+ - Run test 10 times: `for i in {1..10}; do npm test -- test.js; done`
11
+ - Fails ~X times out of 10
12
+ - Not always the same assertion fails
13
+ - Not 0% or 100% (if always fails, see test-failure-debug.md)
14
+
15
+ - [ ] **Failure pattern exists**:
16
+ - Fails more often under load?
17
+ - Fails in CI but not locally?
18
+ - Fails after other tests?
19
+ - Fails at specific time of day?
20
+
21
+ - [ ] **Previous attempts failed**:
22
+ - Simple retry didn't fix it
23
+ - Disabling parallelization didn't fix it
24
+ - Increasing timeout didn't fix it
25
+
26
+ ---
27
+
28
+ ## Root Cause Pattern Analysis
29
+
30
+ ### Pattern 1: Race Condition (Most Common)
31
+ ```javascript
32
+ // ❌ WRONG: Race condition
33
+ test('user updates profile', async () => {
34
+ updateUser({ name: 'New Name' }); // Async, not awaited!
35
+ expect(userName).toBe('New Name'); // Might run before update completes
36
+ });
37
+
38
+ // ✅ CORRECT: Wait for async operation
39
+ test('user updates profile', async () => {
40
+ await updateUser({ name: 'New Name' }); // Wait for it
41
+ expect(userName).toBe('New Name');
42
+ });
43
+ ```
44
+
45
+ **Signs**:
46
+ - [ ] Test has async operations
47
+ - [ ] Not all async operations awaited
48
+ - [ ] Uses `setTimeout` or `setInterval`
49
+ - [ ] Fails under high CPU load
50
+ - [ ] Fails more in CI (slower machines)
51
+
52
+ **Fix**:
53
+ ```javascript
54
+ // Add explicit waits
55
+ await waitFor(() => expect(element).toBeVisible());
56
+
57
+ // Use async/await properly
58
+ const result = await asyncFunction();
59
+
60
+ // Don't mix promises with callbacks
61
+ // Use either async/await OR .then(), not both
62
+ ```
63
+
64
+ ### Pattern 2: Test Order Dependency
65
+ ```javascript
66
+ // ❌ WRONG: Tests affect each other
67
+ let globalState = 0;
68
+ test('first test', () => { globalState = 1; });
69
+ test('second test', () => { expect(globalState).toBe(0); }); // Fails if first runs first!
70
+
71
+ // ✅ CORRECT: Each test is isolated
72
+ beforeEach(() => { state = 0; }); // Reset before each test
73
+ test('first test', () => { state = 1; });
74
+ test('second test', () => { expect(state).toBe(0); });
75
+ ```
76
+
77
+ **Signs**:
78
+ - [ ] Test passes when run alone
79
+ - [ ] Test fails when run with others
80
+ - [ ] Test fails when run in random order
81
+ - [ ] Global variables used
82
+ - [ ] Database not cleaned between tests
83
+
84
+ **Fix**:
85
+ ```javascript
86
+ beforeEach(() => {
87
+ // Reset all state
88
+ jest.clearAllMocks();
89
+ db.clear();
90
+ localStorage.clear();
91
+ });
92
+ ```
93
+
94
+ ### Pattern 3: Timing Issues
95
+ ```javascript
96
+ // ❌ WRONG: Fixed timeout too short
97
+ test('animation completes', async () => {
98
+ await new Promise(r => setTimeout(r, 50)); // Sometimes not enough time
99
+ expect(element.style.opacity).toBe(1);
100
+ });
101
+
102
+ // ✅ CORRECT: Wait for actual condition
103
+ test('animation completes', async () => {
104
+ await waitFor(() => expect(element).toHaveStyle('opacity: 1'), { timeout: 5000 });
105
+ });
106
+ ```
107
+
108
+ **Signs**:
109
+ - [ ] Uses `setTimeout` with fixed delays
110
+ - [ ] Fails randomly
111
+ - [ ] Fails when machine is busy
112
+ - [ ] Fails in CI (which is slower)
113
+ - [ ] Increasing timeout "fixes" it temporarily
114
+
115
+ **Fix**:
116
+ ```javascript
117
+ // Instead of sleep:
118
+ await new Promise(r => setTimeout(r, 100));
119
+
120
+ // Use condition-based waiting:
121
+ await waitFor(() => expect(element).toBeVisible());
122
+ ```
123
+
124
+ ### Pattern 4: External Service/Network
125
+ ```javascript
126
+ // ❌ WRONG: Calls actual API
127
+ test('fetch user', async () => {
128
+ const user = await fetchRealAPI('/users/1'); // Network unreliable!
129
+ expect(user.name).toBe('John');
130
+ });
131
+
132
+ // ✅ CORRECT: Mock external service
133
+ test('fetch user', async () => {
134
+ jest.mock('api', () => ({
135
+ fetch: jest.fn().mockResolvedValue({ name: 'John' })
136
+ }));
137
+ const user = await fetchUser(1);
138
+ expect(user.name).toBe('John');
139
+ });
140
+ ```
141
+
142
+ **Signs**:
143
+ - [ ] Test makes network requests
144
+ - [ ] Mock not configured properly
145
+ - [ ] Network-dependent test
146
+ - [ ] Fails in offline environment
147
+ - [ ] Fails randomly (network issues)
148
+
149
+ **Fix**:
150
+ ```javascript
151
+ // Mock all external APIs
152
+ jest.mock('node-fetch');
153
+ nodeFetch.mockResolvedValue({ json: () => ({ ... }) });
154
+ ```
155
+
156
+ ### Pattern 5: Randomness/Seeding
157
+ ```javascript
158
+ // ❌ WRONG: Random data without seed
159
+ test('shuffle array', () => {
160
+ const result = shuffle([1, 2, 3]);
161
+ expect(result).toEqual([2, 1, 3]); // Different order each time!
162
+ });
163
+
164
+ // ✅ CORRECT: Seed random for reproducible tests
165
+ test('shuffle array', () => {
166
+ Math.seedrandom = () => 0.5; // Set seed
167
+ const result = shuffle([1, 2, 3]);
168
+ expect(result).toEqual([3, 1, 2]); // Same every time with same seed
169
+ });
170
+ ```
171
+
172
+ **Signs**:
173
+ - [ ] Test uses `Math.random()`
174
+ - [ ] Test uses `Date.now()`
175
+ - [ ] Test uses `UUID.generate()`
176
+ - [ ] Different assertions fail each run
177
+ - [ ] Works locally but fails in CI
178
+
179
+ **Fix**:
180
+ ```javascript
181
+ // Seed random number generator
182
+ beforeEach(() => {
183
+ jest.spyOn(Math, 'random').mockReturnValue(0.5);
184
+ });
185
+
186
+ // Mock Date.now()
187
+ jest.spyOn(Date, 'now').mockReturnValue(1234567890);
188
+
189
+ // Generate UUIDs deterministically
190
+ jest.mock('uuid', () => ({ v4: () => 'test-uuid-123' }));
191
+ ```
192
+
193
+ ---
194
+
195
+ ## Investigation Checklist
196
+
197
+ ### Documentation
198
+ - [ ] When test was added
199
+ - [ ] When it started failing
200
+ - [ ] Failure frequency recorded
201
+ - [ ] Specific assertion that fails (changes?)
202
+
203
+ ### Reproduction
204
+ - [ ] Test fails when run 10 times in sequence
205
+ - [ ] Test fails when run in random order with others
206
+ - [ ] Test fails in CI but not locally (or vice versa)
207
+ - [ ] Test fails under high system load
208
+
209
+ ### Code Analysis
210
+ - [ ] All async operations have `await`
211
+ - [ ] No global state modifications
212
+ - [ ] All mocks are configured
213
+ - [ ] No `setTimeout` with fixed delays
214
+ - [ ] No external service calls
215
+ - [ ] No random values without seeding
216
+
217
+ ### Environment
218
+ - [ ] Node version documented (local vs CI)
219
+ - [ ] Operating system noted (different on CI?)
220
+ - [ ] CI environment variables checked
221
+ - [ ] Parallelization disabled for test
222
+ - [ ] Test isolation verified
223
+
224
+ ### Fix Validation
225
+ - [ ] Test passes 20 times consecutively
226
+ - [ ] Test passes in random order with other tests
227
+ - [ ] Test passes in CI
228
+ - [ ] Test passes under load
229
+ - [ ] No other tests broken
230
+
231
+ ---
232
+
233
+ ## Debugging Strategy
234
+
235
+ ### If Pattern 1: Race Condition
236
+ ```bash
237
+ # Add debug logging to see timing
238
+ npm test -- --verbose path/to/test.js
239
+
240
+ # Add explicit waits
241
+ await new Promise(r => setTimeout(r, 100));
242
+
243
+ # Use waitFor with debug
244
+ await waitFor(() => {
245
+ console.log('Checking condition...');
246
+ expect(element).toBeVisible();
247
+ });
248
+ ```
249
+
250
+ ### If Pattern 2: Test Order Dependency
251
+ ```bash
252
+ # Run tests in random order
253
+ npm test -- --randomize path/to/test.js
254
+
255
+ # Run test alone vs with others
256
+ npm test -- test1.js test2.js test3.js # Together
257
+ npm test -- test2.js # Alone
258
+
259
+ # Check beforeEach/afterEach setup
260
+ ```
261
+
262
+ ### If Pattern 3: Timing Issues
263
+ ```bash
264
+ # Check system load
265
+ # Monitor: CPU, Memory, Disk I/O during test run
266
+
267
+ # Increase timeouts
268
+ await waitFor(() => expect(...), { timeout: 10000 });
269
+
270
+ # Replace sleep with condition
271
+ // Instead of: await sleep(1000);
272
+ await waitFor(() => expect(element).toBeVisible());
273
+ ```
274
+
275
+ ### If Pattern 4: External Service
276
+ ```bash
277
+ # Verify all external calls are mocked
278
+ grep -r "fetch\|axios\|http" src/__tests__/
279
+
280
+ # Check mock setup
281
+ console.log(jest.mock(...));
282
+ ```
283
+
284
+ ### If Pattern 5: Randomness
285
+ ```bash
286
+ # Set seed for randomness
287
+ jest.spyOn(Math, 'random').mockReturnValue(0.5);
288
+
289
+ # Mock Date.now()
290
+ jest.spyOn(Date, 'now').mockReturnValue(1234567890);
291
+
292
+ # Use deterministic test data
293
+ const testUser = { id: '123', name: 'Test' }; // Same each time
294
+ ```
295
+
296
+ ---
297
+
298
+ ## Verification: Flaky Test Fixed
299
+
300
+ - [ ] Test passes 20 times consecutively
301
+ - [ ] Test passes 20 times in random order
302
+ - [ ] Test passes in CI environment
303
+ - [ ] Test passes under system load
304
+ - [ ] No debug code left
305
+ - [ ] Updated RECOVERY_POINTS.md with pattern
306
+ - [ ] Similar tests checked for same issue
307
+
308
+ ---
309
+
310
+ ## Recovery: Still Flaky?
311
+
312
+ If still failing after fixes:
313
+
314
+ 1. **Add extensive logging**:
315
+ ```javascript
316
+ test('flaky test', async () => {
317
+ console.log('Start:', Date.now());
318
+ const value = getSomeValue();
319
+ console.log('Value:', value);
320
+ await waitForCondition();
321
+ console.log('Condition met:', Date.now());
322
+ expect(...).toBe(...);
323
+ });
324
+ ```
325
+
326
+ 2. **Disable test temporarily**:
327
+ ```javascript
328
+ test.skip('flaky test', async () => { // Temporarily skip
329
+ // ...
330
+ });
331
+ ```
332
+
333
+ 3. **Escalate**: Mark test with TODO comment for team
334
+ ```javascript
335
+ // TODO: Fix flaky test - likely timing issue, investigate when time permits
336
+ test.skip('should handle concurrent updates', async () => {
337
+ ```
338
+
339
+ 4. **Create issue**: Document flaky test pattern for future fix
@@ -0,0 +1,210 @@
1
+ # Production Bug Debug Checklist
2
+
3
+ **Purpose**: Structured investigation for production bugs with data integrity and user impact focus.
4
+
5
+ **Status**: MANDATORY - Complete before `/fix-bug` for production issues.
6
+
7
+ ## Incident Assessment
8
+
9
+ - [ ] **Bug severity determined**:
10
+ - Critical (service down, data loss): Requires hotfix
11
+ - High (significant user impact): Next release or hotfix
12
+ - Medium (inconvenience, workaround exists): Next release
13
+ - Low (cosmetic, edge case): Backlog
14
+
15
+ - [ ] **User impact quantified**:
16
+ - How many users affected?
17
+ - What functionality broken?
18
+ - Workaround available?
19
+ - Revenue impact (if applicable)?
20
+
21
+ - [ ] **Reproducibility confirmed**:
22
+ - Reproduced in staging environment first
23
+ - Not reproduced in production → investigation in staging
24
+ - Confirmed with actual user data (if possible)
25
+ - Environment-specific or universal?
26
+
27
+ ## Data Integrity Assessment
28
+
29
+ - [ ] **Data corruption checked**:
30
+ - Database queried for anomalies
31
+ - No orphaned records found
32
+ - Foreign keys still valid
33
+ - Timestamps/sequences consistent
34
+
35
+ - [ ] **Rollback strategy documented**:
36
+ - Rollback steps written down
37
+ - Data recovery plan if needed
38
+ - Backup verified
39
+ - Estimated rollback time
40
+
41
+ - [ ] **Data migration planned** (if applicable):
42
+ - Affected data identified
43
+ - Migration strategy documented
44
+ - Backwards compatibility checked
45
+ - Dry run successful
46
+
47
+ ## Root Cause Investigation
48
+
49
+ - [ ] **Logs collected and analyzed**:
50
+ - Error logs reviewed
51
+ - Application logs checked
52
+ - System logs examined
53
+ - Timeline of events mapped
54
+
55
+ - [ ] **Recent changes identified**:
56
+ - Last deployment time noted
57
+ - Code changes reviewed (git log)
58
+ - Configuration changes checked
59
+ - Infrastructure changes noted
60
+
61
+ - [ ] **Affected versions identified**:
62
+ - Bug introduced in version X
63
+ - Affects which current versions?
64
+ - Oldest affected version?
65
+ - Fixed in which version?
66
+
67
+ - [ ] **Root cause identified** (or hypothesis):
68
+ - Specific code/config location
69
+ - Why was it missed in testing?
70
+ - Dependency issue or implementation?
71
+ - Environment-specific factor?
72
+
73
+ ## Fix Strategy
74
+
75
+ - [ ] **Fix approach decided**:
76
+ - Minimal fix vs architectural refactor?
77
+ - Hotfix vs next release?
78
+ - Backwards compatibility needed?
79
+ - Breaking change implications?
80
+
81
+ - [ ] **Risk assessment completed**:
82
+ - Could fix introduce new bugs?
83
+ - Dependencies to check?
84
+ - Side effects analyzed?
85
+ - Test coverage adequate?
86
+
87
+ - [ ] **Verification plan documented**:
88
+ - Metrics to monitor after fix
89
+ - Rollback criteria defined
90
+ - Health checks configured
91
+ - Alert thresholds set
92
+
93
+ ## Testing & Validation
94
+
95
+ - [ ] **Test created** (reproduces bug):
96
+ - Failing test demonstrates bug
97
+ - Test passes without bug (would fail)
98
+ - Test with production-like data
99
+ - Edge cases included
100
+
101
+ - [ ] **Fix validated** (in staging):
102
+ - Test passes with fix
103
+ - All related tests pass
104
+ - No new test failures
105
+ - Performance not degraded
106
+
107
+ - [ ] **Regression testing completed**:
108
+ - Full test suite passes
109
+ - Related features tested
110
+ - Integration scenarios verified
111
+ - Similar bugs searched for
112
+
113
+ ## Deployment Planning
114
+
115
+ - [ ] **Deployment strategy determined**:
116
+ - Staged rollout or immediate?
117
+ - Feature flags needed?
118
+ - Canary deployment approach?
119
+ - Rollback testing done?
120
+
121
+ - [ ] **Communication planned**:
122
+ - User notification (if applicable)
123
+ - Workaround documented
124
+ - ETA for fix communicated
125
+ - Post-fix status update planned
126
+
127
+ - [ ] **Monitoring configured**:
128
+ - Key metrics identified
129
+ - Alerts set for regression
130
+ - Dashboard created for tracking
131
+ - On-call rotation aware
132
+
133
+ ## Release & Monitoring
134
+
135
+ - [ ] **Release documentation complete**:
136
+ - Fix summary written
137
+ - User-friendly description
138
+ - Migration steps (if needed)
139
+ - Known issues documented
140
+
141
+ - [ ] **Rollback plan tested**:
142
+ - Rollback procedure practiced
143
+ - Time to rollback estimated
144
+ - Backup verified
145
+ - Stakeholders notified
146
+
147
+ - [ ] **Post-deployment monitoring** (first 24h):
148
+ - Error rate watched
149
+ - Performance metrics checked
150
+ - User reports monitored
151
+ - Rollback executed if issues
152
+
153
+ ## Prevention & Lessons
154
+
155
+ - [ ] **Prevention documented**:
156
+ - Better test coverage needed?
157
+ - Contract/spec gap?
158
+ - Monitoring enhancement?
159
+ - Process improvement?
160
+
161
+ - [ ] **Similar bugs searched**:
162
+ - Code pattern scanned
163
+ - Similar issues found and tracked
164
+ - Prevention applied broadly
165
+ - Team notified
166
+
167
+ - [ ] **Documentation updated**:
168
+ - Behavior change documented
169
+ - Workaround removed (if applicable)
170
+ - System documentation updated
171
+ - Known issues list maintained
172
+
173
+ ---
174
+
175
+ ## Usage
176
+
177
+ When debugging production bug:
178
+
179
+ ```bash
180
+ # 1. Assess severity
181
+ # - Critical: Hotfix needed
182
+ # - High: Plan for next release + hotfix consideration
183
+ # - Medium/Low: Standard fix process
184
+
185
+ # 2. Complete this checklist
186
+ cat .codex/skills/genesis-debug-guide/checklists/production-bug-debug.md
187
+
188
+ # 3. Proceed with /fix-bug
189
+ /fix-bug "Production issue: [description]"
190
+
191
+ # 4. After fix: genesis-debug-guide auto-triggers verification
192
+ ```
193
+
194
+ ## Hotfix vs Regular Release Decision
195
+
196
+ **Hotfix** (immediate deployment):
197
+ - ✅ Service down or data loss risk
198
+ - ✅ Critical user impact
199
+ - ✅ Can be isolated fix
200
+ - ✅ Adequate testing done
201
+ - ✅ Rollback strategy documented
202
+
203
+ **Regular Release** (next scheduled):
204
+ - ✅ Medium/Low severity
205
+ - ✅ Workaround available
206
+ - ✅ Can wait for next release
207
+ - ✅ No data integrity risk
208
+ - ✅ More complex fix with side effects
209
+
210
+ **Default**: Regular release unless severity assessment says otherwise.
@@ -0,0 +1,158 @@
1
+ # Test Failure Debug Checklist
2
+
3
+ **Purpose**: Systematic verification before debugging test failures. Ensures test environment is clean and failure is reproducible.
4
+
5
+ **Status**: MANDATORY - Complete before starting test failure investigation.
6
+
7
+ ## Environment Verification
8
+
9
+ - [ ] **Test runs in isolation**:
10
+ - Run only the failing test: `npm test -- test-name.test.js`
11
+ - Not running entire suite (could be interference)
12
+ - Confirm single test failure is reproducible
13
+
14
+ - [ ] **No environment contamination**:
15
+ - Git status clean (`git status` shows no uncommitted changes)
16
+ - No stale debug code or console.log statements
17
+ - Dependencies up to date (`npm install` recent)
18
+ - Node version correct (check `.nvmrc` or `package.json`)
19
+
20
+ - [ ] **Test environment isolated**:
21
+ - No other tests running in parallel
22
+ - No file system state from previous tests
23
+ - Database fixtures clean
24
+ - Cache cleared if applicable
25
+
26
+ ## Test Fundamentals
27
+
28
+ - [ ] **Test is deterministic** (not flaky):
29
+ - Run test 5 times consecutively
30
+ - Fails same way every time
31
+ - If fails inconsistently → switch to flaky-test-investigation.md
32
+
33
+ - [ ] **Error message is clear**:
34
+ - Full error read (including stack trace)
35
+ - Assertion message understood
36
+ - Expected vs actual values noted
37
+
38
+ - [ ] **Reproduction steps documented**:
39
+ - Steps to run failing test written down
40
+ - Any preconditions noted
41
+ - Environment variables documented
42
+
43
+ ## Test Code Analysis
44
+
45
+ - [ ] **Test structure is correct**:
46
+ - Setup (arrange): Test data initialized
47
+ - Execution (act): Function called with test data
48
+ - Assertion (assert): Result verified
49
+ - Teardown: Resources cleaned up
50
+
51
+ - [ ] **Mocks are properly configured**:
52
+ - All external dependencies mocked
53
+ - Mock return values match expectations
54
+ - Mock call counts/arguments verified
55
+ - Mocks reset between tests
56
+
57
+ - [ ] **Test data is valid**:
58
+ - Test fixtures exist
59
+ - Data types correct (number, string, array, object)
60
+ - Null/undefined not unexpected
61
+ - Edge cases considered
62
+
63
+ ## Implementation Analysis
64
+
65
+ - [ ] **Code under test identified**:
66
+ - Exact function/method being tested known
67
+ - File location noted
68
+ - Recent changes reviewed (git blame)
69
+
70
+ - [ ] **Code logic reviewed**:
71
+ - Function parameters match test call
72
+ - Return type matches assertion
73
+ - No type mismatches
74
+ - Null checks in place
75
+
76
+ - [ ] **Dependency chain checked**:
77
+ - All imported modules exist
78
+ - No circular dependencies
79
+ - Versions compatible
80
+ - Initialization order correct
81
+
82
+ ## Debug Information Gathering
83
+
84
+ - [ ] **Error output analyzed**:
85
+ - Stack trace followed to root
86
+ - Line number in error matches code
87
+ - Message matches code (not outdated?)
88
+ - All context (variables, state) logged
89
+
90
+ - [ ] **Variable values inspected**:
91
+ - Expected value printed
92
+ - Actual value printed
93
+ - Types match
94
+ - Data structure as expected
95
+
96
+ - [ ] **Scope issues checked**:
97
+ - Variable in correct scope
98
+ - Not undefined when used
99
+ - Reference vs value semantics correct
100
+ - Closure capturing right variables
101
+
102
+ ## Common Issues Ruled Out
103
+
104
+ - [ ] **Not a typo**:
105
+ - Function name spelled correctly
106
+ - Variable name matches
107
+ - No case sensitivity issues
108
+ - Import path correct
109
+
110
+ - [ ] **Not an import issue**:
111
+ - Module imported correctly
112
+ - Correct export used (default vs named)
113
+ - Path relative or absolute correct
114
+ - No circular imports
115
+
116
+ - [ ] **Not a timing issue** (for async):
117
+ - Promises/callbacks not mixed
118
+ - Async/await used correctly
119
+ - Test waits for async operations
120
+ - No race conditions
121
+
122
+ ## Ready to Debug
123
+
124
+ - [ ] All checks above passed
125
+ - [ ] Investigation log created (templates/debug-investigation-log.md)
126
+ - [ ] Ready to proceed with playbook:
127
+ - Unit tests → playbooks/unit-test-failures.md
128
+ - Integration tests → playbooks/integration-test-failures.md
129
+ - E2E tests → playbooks/e2e-test-failures.md
130
+
131
+ ---
132
+
133
+ ## Usage
134
+
135
+ Before investigating test failure:
136
+
137
+ ```bash
138
+ # 1. Run test in isolation
139
+ npm test -- NameOfTest.test.js
140
+
141
+ # 2. Complete this checklist
142
+ cat .codex/skills/genesis-debug-guide/checklists/test-failure-debug.md
143
+
144
+ # 3. Select appropriate playbook
145
+ # - Unit: playbooks/unit-test-failures.md
146
+ # - Integration: playbooks/integration-test-failures.md
147
+ # - E2E: playbooks/e2e-test-failures.md
148
+
149
+ # 4. Create investigation log
150
+ # cp templates/debug-investigation-log.md observability/failures/investigation-$(date +%s).md
151
+ ```
152
+
153
+ ## Notes
154
+
155
+ - Don't skip environment verification - most failures are environmental
156
+ - If test fails intermittently → See flaky-test-investigation.md
157
+ - If multiple tests fail → Check test isolation first
158
+ - If all tests fail → Check environment/dependencies