@trieungoctam/vibekit 1.0.0

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 (352) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +85 -0
  3. package/agents/debugger.md +158 -0
  4. package/agents/docs-manager.md +220 -0
  5. package/agents/planner.md +129 -0
  6. package/agents/researcher.md +58 -0
  7. package/agents/reviewer.md +152 -0
  8. package/agents/tester.md +126 -0
  9. package/bin/vibekit.js +18 -0
  10. package/hooks/lib/ck-config-utils.cjs +831 -0
  11. package/hooks/lib/colors.cjs +95 -0
  12. package/hooks/lib/config-counter.cjs +103 -0
  13. package/hooks/lib/context-builder.cjs +616 -0
  14. package/hooks/lib/git-info-cache.cjs +143 -0
  15. package/hooks/lib/hook-logger.cjs +92 -0
  16. package/hooks/lib/privacy-checker.cjs +297 -0
  17. package/hooks/lib/project-detector.cjs +474 -0
  18. package/hooks/lib/scout-checker.cjs +263 -0
  19. package/hooks/lib/transcript-parser.cjs +181 -0
  20. package/hooks/post-edit-simplify-reminder.cjs +156 -0
  21. package/hooks/privacy-block.cjs +166 -0
  22. package/hooks/scout-block.cjs +147 -0
  23. package/hooks/session-init.cjs +360 -0
  24. package/package.json +41 -0
  25. package/rules/development-rules.md +52 -0
  26. package/rules/documentation-management.md +121 -0
  27. package/rules/orchestration-protocol.md +43 -0
  28. package/rules/primary-workflow.md +57 -0
  29. package/rules/team-coordination-rules.md +90 -0
  30. package/skills/ai/agent-browser/SKILL.md +294 -0
  31. package/skills/ai/agent-browser/references/.gitkeep +0 -0
  32. package/skills/ai/agent-browser/references/agent-browser-vs-chrome-devtools.md +112 -0
  33. package/skills/ai/agent-browser/references/browserbase-cloud-setup.md +161 -0
  34. package/skills/ai/ai-artist/SKILL.md +122 -0
  35. package/skills/ai/ai-artist/data/awesome-prompts.csv +3592 -0
  36. package/skills/ai/ai-artist/data/lighting.csv +19 -0
  37. package/skills/ai/ai-artist/data/nano-banana-templates.csv +17 -0
  38. package/skills/ai/ai-artist/data/platforms.csv +11 -0
  39. package/skills/ai/ai-artist/data/styles.csv +26 -0
  40. package/skills/ai/ai-artist/data/techniques.csv +19 -0
  41. package/skills/ai/ai-artist/data/use-cases.csv +16 -0
  42. package/skills/ai/ai-artist/references/advanced-techniques.md +184 -0
  43. package/skills/ai/ai-artist/references/awesome-nano-banana-pro-prompts.md +8575 -0
  44. package/skills/ai/ai-artist/references/domain-code.md +66 -0
  45. package/skills/ai/ai-artist/references/domain-data.md +72 -0
  46. package/skills/ai/ai-artist/references/domain-marketing.md +66 -0
  47. package/skills/ai/ai-artist/references/domain-patterns.md +33 -0
  48. package/skills/ai/ai-artist/references/domain-writing.md +68 -0
  49. package/skills/ai/ai-artist/references/image-prompting.md +141 -0
  50. package/skills/ai/ai-artist/references/llm-prompting.md +165 -0
  51. package/skills/ai/ai-artist/references/nano-banana.md +136 -0
  52. package/skills/ai/ai-artist/references/reasoning-techniques.md +201 -0
  53. package/skills/ai/ai-artist/references/validation-workflow.md +117 -0
  54. package/skills/ai/ai-artist/scripts/core.py +197 -0
  55. package/skills/ai/ai-artist/scripts/extract_prompts.py +102 -0
  56. package/skills/ai/ai-artist/scripts/generate.py +370 -0
  57. package/skills/ai/ai-artist/scripts/search.py +147 -0
  58. package/skills/ai/ai-multimodal/.env.example +204 -0
  59. package/skills/ai/ai-multimodal/SKILL.md +110 -0
  60. package/skills/ai/ai-multimodal/references/audio-processing.md +387 -0
  61. package/skills/ai/ai-multimodal/references/image-generation.md +939 -0
  62. package/skills/ai/ai-multimodal/references/music-generation.md +311 -0
  63. package/skills/ai/ai-multimodal/references/video-analysis.md +515 -0
  64. package/skills/ai/ai-multimodal/references/video-generation.md +457 -0
  65. package/skills/ai/ai-multimodal/references/vision-understanding.md +492 -0
  66. package/skills/ai/ai-multimodal/scripts/.coverage +0 -0
  67. package/skills/ai/ai-multimodal/scripts/check_setup.py +315 -0
  68. package/skills/ai/ai-multimodal/scripts/document_converter.py +395 -0
  69. package/skills/ai/ai-multimodal/scripts/gemini_batch_process.py +1185 -0
  70. package/skills/ai/ai-multimodal/scripts/media_optimizer.py +506 -0
  71. package/skills/ai/ai-multimodal/scripts/requirements.txt +26 -0
  72. package/skills/ai/ai-multimodal/scripts/tests/.coverage +0 -0
  73. package/skills/ai/ai-multimodal/scripts/tests/requirements.txt +20 -0
  74. package/skills/ai/ai-multimodal/scripts/tests/test_document_converter.py +74 -0
  75. package/skills/ai/ai-multimodal/scripts/tests/test_gemini_batch_process.py +362 -0
  76. package/skills/ai/ai-multimodal/scripts/tests/test_media_optimizer.py +373 -0
  77. package/skills/ai/mcp-management/README.md +219 -0
  78. package/skills/ai/mcp-management/SKILL.md +210 -0
  79. package/skills/ai/mcp-management/assets/tools.json +3146 -0
  80. package/skills/ai/mcp-management/references/configuration.md +114 -0
  81. package/skills/ai/mcp-management/references/gemini-cli-integration.md +221 -0
  82. package/skills/ai/mcp-management/references/mcp-protocol.md +116 -0
  83. package/skills/ai/mcp-management/scripts/.env.example +10 -0
  84. package/skills/ai/mcp-management/scripts/cli.ts +195 -0
  85. package/skills/ai/mcp-management/scripts/dist/analyze-tools.js +70 -0
  86. package/skills/ai/mcp-management/scripts/dist/cli.js +160 -0
  87. package/skills/ai/mcp-management/scripts/dist/mcp-client.js +183 -0
  88. package/skills/ai/mcp-management/scripts/mcp-client.ts +230 -0
  89. package/skills/ai/mcp-management/scripts/package.json +20 -0
  90. package/skills/ai/mcp-management/scripts/tsconfig.json +15 -0
  91. package/skills/core/brainstorm/SKILL.md +164 -0
  92. package/skills/core/brainstorm/scripts/frame-template.html +214 -0
  93. package/skills/core/brainstorm/scripts/helper.js +88 -0
  94. package/skills/core/brainstorm/scripts/server.cjs +338 -0
  95. package/skills/core/brainstorm/scripts/start-server.sh +153 -0
  96. package/skills/core/brainstorm/scripts/stop-server.sh +55 -0
  97. package/skills/core/brainstorm/spec-document-reviewer-prompt.md +49 -0
  98. package/skills/core/brainstorm/visual-companion.md +286 -0
  99. package/skills/core/code-review/SKILL.md +147 -0
  100. package/skills/core/code-review/references/code-review-reception.md +113 -0
  101. package/skills/core/code-review/references/codebase-scan-workflow.md +29 -0
  102. package/skills/core/code-review/references/edge-case-scouting.md +119 -0
  103. package/skills/core/code-review/references/parallel-review-workflow.md +69 -0
  104. package/skills/core/code-review/references/requesting-code-review.md +116 -0
  105. package/skills/core/code-review/references/task-management-reviews.md +140 -0
  106. package/skills/core/code-review/references/verification-before-completion.md +139 -0
  107. package/skills/core/cook/README.md +86 -0
  108. package/skills/core/cook/SKILL.md +113 -0
  109. package/skills/core/cook/references/intent-detection.md +101 -0
  110. package/skills/core/cook/references/review-cycle.md +75 -0
  111. package/skills/core/cook/references/subagent-patterns.md +75 -0
  112. package/skills/core/cook/references/workflow-steps.md +172 -0
  113. package/skills/core/debug/SKILL.md +121 -0
  114. package/skills/core/debug/references/defense-in-depth.md +124 -0
  115. package/skills/core/debug/references/frontend-verification.md +103 -0
  116. package/skills/core/debug/references/investigation-methodology.md +101 -0
  117. package/skills/core/debug/references/log-and-ci-analysis.md +97 -0
  118. package/skills/core/debug/references/performance-diagnostics.md +113 -0
  119. package/skills/core/debug/references/reporting-standards.md +122 -0
  120. package/skills/core/debug/references/root-cause-tracing.md +122 -0
  121. package/skills/core/debug/references/systematic-debugging.md +102 -0
  122. package/skills/core/debug/references/task-management-debugging.md +155 -0
  123. package/skills/core/debug/references/verification.md +123 -0
  124. package/skills/core/debug/scripts/find-polluter.sh +63 -0
  125. package/skills/core/debug/scripts/find-polluter.test.md +102 -0
  126. package/skills/core/execute/SKILL.md +70 -0
  127. package/skills/core/fix/SKILL.md +111 -0
  128. package/skills/core/fix/references/complexity-assessment.md +72 -0
  129. package/skills/core/fix/references/mode-selection.md +46 -0
  130. package/skills/core/fix/references/parallel-exploration.md +100 -0
  131. package/skills/core/fix/references/review-cycle.md +77 -0
  132. package/skills/core/fix/references/skill-activation-matrix.md +78 -0
  133. package/skills/core/fix/references/task-orchestration.md +103 -0
  134. package/skills/core/fix/references/workflow-ci.md +28 -0
  135. package/skills/core/fix/references/workflow-deep.md +122 -0
  136. package/skills/core/fix/references/workflow-logs.md +72 -0
  137. package/skills/core/fix/references/workflow-quick.md +59 -0
  138. package/skills/core/fix/references/workflow-standard.md +111 -0
  139. package/skills/core/fix/references/workflow-test.md +75 -0
  140. package/skills/core/fix/references/workflow-types.md +33 -0
  141. package/skills/core/fix/references/workflow-ui.md +75 -0
  142. package/skills/core/plan/SKILL.md +145 -0
  143. package/skills/core/plan/plan-document-reviewer-prompt.md +49 -0
  144. package/skills/core/subagent-dev/SKILL.md +277 -0
  145. package/skills/core/subagent-dev/code-quality-reviewer-prompt.md +26 -0
  146. package/skills/core/subagent-dev/implementer-prompt.md +113 -0
  147. package/skills/core/subagent-dev/spec-reviewer-prompt.md +61 -0
  148. package/skills/core/tdd/SKILL.md +371 -0
  149. package/skills/core/tdd/testing-anti-patterns.md +299 -0
  150. package/skills/core/test/SKILL.md +109 -0
  151. package/skills/core/test/references/report-format.md +58 -0
  152. package/skills/core/test/references/test-execution-workflow.md +103 -0
  153. package/skills/core/test/references/ui-testing-workflow.md +65 -0
  154. package/skills/core/verify/SKILL.md +139 -0
  155. package/skills/dev/backend-dev/SKILL.md +96 -0
  156. package/skills/dev/backend-dev/references/backend-api-design.md +495 -0
  157. package/skills/dev/backend-dev/references/backend-architecture.md +454 -0
  158. package/skills/dev/backend-dev/references/backend-authentication.md +338 -0
  159. package/skills/dev/backend-dev/references/backend-code-quality.md +659 -0
  160. package/skills/dev/backend-dev/references/backend-debugging.md +904 -0
  161. package/skills/dev/backend-dev/references/backend-devops.md +494 -0
  162. package/skills/dev/backend-dev/references/backend-mindset.md +387 -0
  163. package/skills/dev/backend-dev/references/backend-performance.md +397 -0
  164. package/skills/dev/backend-dev/references/backend-security.md +290 -0
  165. package/skills/dev/backend-dev/references/backend-technologies.md +256 -0
  166. package/skills/dev/backend-dev/references/backend-testing.md +429 -0
  167. package/skills/dev/context-engineering/SKILL.md +108 -0
  168. package/skills/dev/context-engineering/references/context-compression.md +84 -0
  169. package/skills/dev/context-engineering/references/context-degradation.md +93 -0
  170. package/skills/dev/context-engineering/references/context-fundamentals.md +75 -0
  171. package/skills/dev/context-engineering/references/context-optimization.md +82 -0
  172. package/skills/dev/context-engineering/references/evaluation.md +89 -0
  173. package/skills/dev/context-engineering/references/memory-systems.md +88 -0
  174. package/skills/dev/context-engineering/references/multi-agent-patterns.md +90 -0
  175. package/skills/dev/context-engineering/references/project-development.md +97 -0
  176. package/skills/dev/context-engineering/references/runtime-awareness.md +202 -0
  177. package/skills/dev/context-engineering/references/tool-design.md +86 -0
  178. package/skills/dev/context-engineering/scripts/compression_evaluator.py +349 -0
  179. package/skills/dev/context-engineering/scripts/context_analyzer.py +317 -0
  180. package/skills/dev/context-engineering/scripts/tests/test_edge_cases.py +246 -0
  181. package/skills/dev/databases/SKILL.md +84 -0
  182. package/skills/dev/databases/analytics.md +198 -0
  183. package/skills/dev/databases/db-design.md +188 -0
  184. package/skills/dev/databases/incremental-etl.md +213 -0
  185. package/skills/dev/databases/references/mongodb-aggregation.md +447 -0
  186. package/skills/dev/databases/references/mongodb-atlas.md +465 -0
  187. package/skills/dev/databases/references/mongodb-crud.md +408 -0
  188. package/skills/dev/databases/references/mongodb-indexing.md +442 -0
  189. package/skills/dev/databases/references/postgresql-administration.md +594 -0
  190. package/skills/dev/databases/references/postgresql-performance.md +527 -0
  191. package/skills/dev/databases/references/postgresql-psql-cli.md +467 -0
  192. package/skills/dev/databases/references/postgresql-queries.md +475 -0
  193. package/skills/dev/databases/scripts/.coverage +0 -0
  194. package/skills/dev/databases/scripts/db_backup.py +502 -0
  195. package/skills/dev/databases/scripts/db_migrate.py +426 -0
  196. package/skills/dev/databases/scripts/db_performance_check.py +457 -0
  197. package/skills/dev/databases/scripts/requirements.txt +20 -0
  198. package/skills/dev/databases/scripts/tests/coverage-db.json +1 -0
  199. package/skills/dev/databases/scripts/tests/requirements.txt +4 -0
  200. package/skills/dev/databases/scripts/tests/test_db_backup.py +340 -0
  201. package/skills/dev/databases/scripts/tests/test_db_migrate.py +277 -0
  202. package/skills/dev/databases/scripts/tests/test_db_performance_check.py +370 -0
  203. package/skills/dev/databases/stacks/bigquery.md +231 -0
  204. package/skills/dev/databases/stacks/d1_cloudflare.md +137 -0
  205. package/skills/dev/databases/stacks/mysql.md +216 -0
  206. package/skills/dev/databases/stacks/postgres.md +235 -0
  207. package/skills/dev/databases/stacks/sqlite.md +244 -0
  208. package/skills/dev/databases/transactional.md +176 -0
  209. package/skills/dev/devops/.env.example +76 -0
  210. package/skills/dev/devops/SKILL.md +97 -0
  211. package/skills/dev/devops/references/browser-rendering.md +305 -0
  212. package/skills/dev/devops/references/cloudflare-d1-kv.md +123 -0
  213. package/skills/dev/devops/references/cloudflare-platform.md +271 -0
  214. package/skills/dev/devops/references/cloudflare-r2-storage.md +280 -0
  215. package/skills/dev/devops/references/cloudflare-workers-advanced.md +312 -0
  216. package/skills/dev/devops/references/cloudflare-workers-apis.md +309 -0
  217. package/skills/dev/devops/references/cloudflare-workers-basics.md +418 -0
  218. package/skills/dev/devops/references/docker-basics.md +297 -0
  219. package/skills/dev/devops/references/docker-compose.md +292 -0
  220. package/skills/dev/devops/references/gcloud-platform.md +297 -0
  221. package/skills/dev/devops/references/gcloud-services.md +304 -0
  222. package/skills/dev/devops/references/kubernetes-basics.md +99 -0
  223. package/skills/dev/devops/references/kubernetes-helm-advanced.md +75 -0
  224. package/skills/dev/devops/references/kubernetes-helm.md +81 -0
  225. package/skills/dev/devops/references/kubernetes-kubectl.md +74 -0
  226. package/skills/dev/devops/references/kubernetes-security-advanced.md +98 -0
  227. package/skills/dev/devops/references/kubernetes-security.md +95 -0
  228. package/skills/dev/devops/references/kubernetes-troubleshooting-advanced.md +74 -0
  229. package/skills/dev/devops/references/kubernetes-troubleshooting.md +49 -0
  230. package/skills/dev/devops/references/kubernetes-workflows-advanced.md +75 -0
  231. package/skills/dev/devops/references/kubernetes-workflows.md +78 -0
  232. package/skills/dev/devops/scripts/cloudflare_deploy.py +269 -0
  233. package/skills/dev/devops/scripts/docker_optimize.py +332 -0
  234. package/skills/dev/devops/scripts/requirements.txt +20 -0
  235. package/skills/dev/devops/scripts/tests/requirements.txt +3 -0
  236. package/skills/dev/devops/scripts/tests/test_cloudflare_deploy.py +285 -0
  237. package/skills/dev/devops/scripts/tests/test_docker_optimize.py +436 -0
  238. package/skills/dev/frontend-design/SKILL.md +78 -0
  239. package/skills/dev/frontend-design/references/ai-multimodal-overview.md +165 -0
  240. package/skills/dev/frontend-design/references/analysis-best-practices.md +80 -0
  241. package/skills/dev/frontend-design/references/analysis-prompts.md +141 -0
  242. package/skills/dev/frontend-design/references/analysis-techniques.md +118 -0
  243. package/skills/dev/frontend-design/references/animejs.md +396 -0
  244. package/skills/dev/frontend-design/references/asset-generation.md +337 -0
  245. package/skills/dev/frontend-design/references/design-extraction-overview.md +71 -0
  246. package/skills/dev/frontend-design/references/extraction-best-practices.md +141 -0
  247. package/skills/dev/frontend-design/references/extraction-output-templates.md +162 -0
  248. package/skills/dev/frontend-design/references/extraction-prompts.md +127 -0
  249. package/skills/dev/frontend-design/references/technical-accessibility.md +119 -0
  250. package/skills/dev/frontend-design/references/technical-best-practices.md +97 -0
  251. package/skills/dev/frontend-design/references/technical-optimization.md +44 -0
  252. package/skills/dev/frontend-design/references/technical-overview.md +90 -0
  253. package/skills/dev/frontend-design/references/technical-workflows.md +150 -0
  254. package/skills/dev/frontend-design/references/visual-analysis-overview.md +95 -0
  255. package/skills/dev/frontend-design/references/workflow-3d.md +102 -0
  256. package/skills/dev/frontend-design/references/workflow-describe.md +87 -0
  257. package/skills/dev/frontend-design/references/workflow-immersive.md +87 -0
  258. package/skills/dev/frontend-design/references/workflow-quick.md +57 -0
  259. package/skills/dev/frontend-design/references/workflow-screenshot.md +63 -0
  260. package/skills/dev/frontend-design/references/workflow-video.md +74 -0
  261. package/skills/dev/frontend-dev/SKILL.md +400 -0
  262. package/skills/dev/frontend-dev/resources/common-patterns.md +331 -0
  263. package/skills/dev/frontend-dev/resources/complete-examples.md +872 -0
  264. package/skills/dev/frontend-dev/resources/component-patterns.md +502 -0
  265. package/skills/dev/frontend-dev/resources/data-fetching.md +767 -0
  266. package/skills/dev/frontend-dev/resources/file-organization.md +502 -0
  267. package/skills/dev/frontend-dev/resources/loading-and-error-states.md +501 -0
  268. package/skills/dev/frontend-dev/resources/performance.md +406 -0
  269. package/skills/dev/frontend-dev/resources/routing-guide.md +364 -0
  270. package/skills/dev/frontend-dev/resources/styling-guide.md +428 -0
  271. package/skills/dev/frontend-dev/resources/typescript-standards.md +418 -0
  272. package/skills/dev/git/SKILL.md +114 -0
  273. package/skills/dev/git/references/branch-management.md +88 -0
  274. package/skills/dev/git/references/commit-standards.md +46 -0
  275. package/skills/dev/git/references/gh-cli-guide.md +109 -0
  276. package/skills/dev/git/references/safety-protocols.md +69 -0
  277. package/skills/dev/git/references/workflow-commit.md +58 -0
  278. package/skills/dev/git/references/workflow-merge.md +48 -0
  279. package/skills/dev/git/references/workflow-pr.md +58 -0
  280. package/skills/dev/git/references/workflow-push.md +52 -0
  281. package/skills/dev/git-worktree/SKILL.md +218 -0
  282. package/skills/utils/ask/SKILL.md +58 -0
  283. package/skills/utils/bootstrap/SKILL.md +101 -0
  284. package/skills/utils/bootstrap/references/shared-phases.md +59 -0
  285. package/skills/utils/bootstrap/references/workflow-auto.md +52 -0
  286. package/skills/utils/bootstrap/references/workflow-fast.md +50 -0
  287. package/skills/utils/bootstrap/references/workflow-full.md +60 -0
  288. package/skills/utils/bootstrap/references/workflow-parallel.md +59 -0
  289. package/skills/utils/ck-help/SKILL.md +102 -0
  290. package/skills/utils/ck-help/scripts/ck-help.py +1321 -0
  291. package/skills/utils/ck-help/scripts/commands_data.yaml +3 -0
  292. package/skills/utils/ck-help/scripts/skills_data.yaml +593 -0
  293. package/skills/utils/copywriting/SKILL.md +94 -0
  294. package/skills/utils/copywriting/references/copy-formulas.md +150 -0
  295. package/skills/utils/copywriting/references/cta-patterns.md +168 -0
  296. package/skills/utils/copywriting/references/email-copy.md +193 -0
  297. package/skills/utils/copywriting/references/headline-templates.md +140 -0
  298. package/skills/utils/copywriting/references/landing-page-copy.md +175 -0
  299. package/skills/utils/copywriting/references/power-words.md +189 -0
  300. package/skills/utils/copywriting/references/social-media-copy.md +222 -0
  301. package/skills/utils/copywriting/references/workflow-cro.md +83 -0
  302. package/skills/utils/copywriting/references/workflow-enhance.md +32 -0
  303. package/skills/utils/copywriting/references/workflow-fast.md +29 -0
  304. package/skills/utils/copywriting/references/workflow-good.md +39 -0
  305. package/skills/utils/copywriting/references/writing-styles.md +247 -0
  306. package/skills/utils/copywriting/scripts/extract-writing-styles.py +308 -0
  307. package/skills/utils/copywriting/templates/copy-brief.md +49 -0
  308. package/skills/utils/docs/SKILL.md +55 -0
  309. package/skills/utils/docs/references/init-workflow.md +32 -0
  310. package/skills/utils/docs/references/summarize-workflow.md +18 -0
  311. package/skills/utils/docs/references/update-workflow.md +59 -0
  312. package/skills/utils/journal/SKILL.md +11 -0
  313. package/skills/utils/kanban/SKILL.md +99 -0
  314. package/skills/utils/preview/SKILL.md +75 -0
  315. package/skills/utils/preview/references/generation-modes.md +95 -0
  316. package/skills/utils/preview/references/view-mode.md +42 -0
  317. package/skills/utils/repomix/SKILL.md +248 -0
  318. package/skills/utils/repomix/references/configuration.md +211 -0
  319. package/skills/utils/repomix/references/usage-patterns.md +232 -0
  320. package/skills/utils/repomix/scripts/.coverage +0 -0
  321. package/skills/utils/repomix/scripts/README.md +179 -0
  322. package/skills/utils/repomix/scripts/repomix_batch.py +455 -0
  323. package/skills/utils/repomix/scripts/repos.example.json +15 -0
  324. package/skills/utils/repomix/scripts/requirements.txt +15 -0
  325. package/skills/utils/repomix/scripts/tests/test_repomix_batch.py +531 -0
  326. package/skills/utils/research/SKILL.md +171 -0
  327. package/skills/utils/scout/SKILL.md +89 -0
  328. package/skills/utils/scout/references/external-scouting.md +140 -0
  329. package/skills/utils/scout/references/internal-scouting.md +119 -0
  330. package/skills/utils/scout/references/task-management-scouting.md +125 -0
  331. package/skills/utils/sequential-thinking/.env.example +8 -0
  332. package/skills/utils/sequential-thinking/README.md +183 -0
  333. package/skills/utils/sequential-thinking/SKILL.md +95 -0
  334. package/skills/utils/sequential-thinking/package.json +31 -0
  335. package/skills/utils/sequential-thinking/references/advanced-strategies.md +79 -0
  336. package/skills/utils/sequential-thinking/references/advanced-techniques.md +76 -0
  337. package/skills/utils/sequential-thinking/references/core-patterns.md +95 -0
  338. package/skills/utils/sequential-thinking/references/examples-api.md +88 -0
  339. package/skills/utils/sequential-thinking/references/examples-architecture.md +94 -0
  340. package/skills/utils/sequential-thinking/references/examples-debug.md +90 -0
  341. package/skills/utils/sequential-thinking/scripts/format-thought.js +159 -0
  342. package/skills/utils/sequential-thinking/scripts/process-thought.js +236 -0
  343. package/skills/utils/sequential-thinking/tests/format-thought.test.js +133 -0
  344. package/skills/utils/sequential-thinking/tests/process-thought.test.js +215 -0
  345. package/skills/utils/write-skill/SKILL.md +655 -0
  346. package/skills/utils/write-skill/anthropic-best-practices.md +1150 -0
  347. package/skills/utils/write-skill/examples/CLAUDE_MD_TESTING.md +189 -0
  348. package/skills/utils/write-skill/graphviz-conventions.dot +172 -0
  349. package/skills/utils/write-skill/persuasion-principles.md +187 -0
  350. package/skills/utils/write-skill/render-graphs.js +168 -0
  351. package/skills/utils/write-skill/testing-skills-with-subagents.md +384 -0
  352. package/src/commands/init.js +238 -0
@@ -0,0 +1,101 @@
1
+ # Intent Detection Logic
2
+
3
+ Detect user intent from natural language and route to appropriate workflow.
4
+
5
+ ## Detection Algorithm
6
+
7
+ ```
8
+ FUNCTION detectMode(input):
9
+ # Priority 1: Explicit flags (override all)
10
+ IF input contains "--fast": RETURN "fast"
11
+ IF input contains "--parallel": RETURN "parallel"
12
+ IF input contains "--auto": RETURN "auto"
13
+ IF input contains "--no-test": RETURN "no-test"
14
+
15
+ # Priority 2: Plan path detection
16
+ IF input matches path pattern (./plans/*, plan.md, phase-*.md):
17
+ RETURN "code"
18
+
19
+ # Priority 3: Keyword detection (case-insensitive)
20
+ keywords = lowercase(input)
21
+
22
+ IF keywords contains ["fast", "quick", "rapidly", "asap"]:
23
+ RETURN "fast"
24
+
25
+ IF keywords contains ["trust me", "auto", "yolo", "just do it"]:
26
+ RETURN "auto"
27
+
28
+ IF keywords contains ["no test", "skip test", "without test"]:
29
+ RETURN "no-test"
30
+
31
+ # Priority 4: Complexity detection
32
+ features = extractFeatures(input) # comma-separated or "and"-joined items
33
+ IF count(features) >= 3 OR keywords contains "parallel":
34
+ RETURN "parallel"
35
+
36
+ # Default: interactive workflow
37
+ RETURN "interactive"
38
+ ```
39
+
40
+ ## Feature Extraction
41
+
42
+ Detect multiple features from natural language:
43
+
44
+ ```
45
+ "implement auth, payments, and notifications" → ["auth", "payments", "notifications"]
46
+ "add login + signup + password reset" → ["login", "signup", "password reset"]
47
+ "create dashboard with charts and tables" → single feature (dashboard)
48
+ ```
49
+
50
+ **Parallel trigger:** 3+ distinct features = parallel mode
51
+
52
+ ## Mode Behaviors
53
+
54
+ | Mode | Skip Research | Skip Test | Review Gates | Auto-Approve | Parallel Exec |
55
+ |------|---------------|-----------|--------------|--------------|---------------|
56
+ | interactive | ✗ | ✗ | **Yes (stops)** | ✗ | ✗ |
57
+ | auto | ✗ | ✗ | **No (skips)** | ✓ (score≥9.5) | ✓ (all phases) |
58
+ | fast | ✓ | ✗ | Yes (stops) | ✗ | ✗ |
59
+ | parallel | Optional | ✗ | Yes (stops) | ✗ | ✓ |
60
+ | no-test | ✗ | ✓ | Yes (stops) | ✗ | ✗ |
61
+ | code | ✓ | ✗ | Yes (stops) | Per plan | Per plan |
62
+
63
+ **Review Gates:** Human approval checkpoints between major steps (see `workflow-steps.md`).
64
+ - All modes EXCEPT `auto` stop at review gates for human approval.
65
+ - `auto` mode is the only mode that runs continuously without stopping.
66
+
67
+ ## Examples
68
+
69
+ ```
70
+ "/cook implement user auth"
71
+ → Mode: interactive (default, stops at review gates)
72
+
73
+ "/cook plans/260120-auth/phase-02-api.md"
74
+ → Mode: code (path detected, stops at review gates)
75
+
76
+ "/cook quick fix for the login bug"
77
+ → Mode: fast ("quick" keyword, stops at review gates)
78
+
79
+ "/cook implement auth, payments, notifications, shipping"
80
+ → Mode: parallel (4 features, stops at review gates)
81
+
82
+ "/cook implement dashboard --fast"
83
+ → Mode: fast (explicit flag, stops at review gates)
84
+
85
+ "/cook implement everything --auto"
86
+ → Mode: auto (NO STOPS, implements all phases continuously)
87
+
88
+ "/cook implement dashboard trust me"
89
+ → Mode: auto ("trust me" keyword, NO STOPS)
90
+ ```
91
+
92
+ **Note:** Only `--auto` flag or "trust me"/"auto"/"yolo" keywords enable continuous execution.
93
+
94
+ ## Conflict Resolution
95
+
96
+ When multiple signals detected, priority order:
97
+ 1. Explicit flags (`--fast`, `--auto`, etc.)
98
+ 2. Path detection (plan files)
99
+ 3. Keywords in text
100
+ 4. Feature count analysis
101
+ 5. Default (interactive)
@@ -0,0 +1,75 @@
1
+ # Code Review Cycle
2
+
3
+ Interactive review-fix cycle used in code workflows.
4
+
5
+ ## Interactive Cycle (max 3 cycles)
6
+
7
+ ```
8
+ cycle = 0
9
+ LOOP:
10
+ 1. Run code-reviewer → score, critical_count, warnings, suggestions
11
+
12
+ 2. DISPLAY FINDINGS:
13
+ ┌─────────────────────────────────────────┐
14
+ │ Code Review Results: [score]/10 │
15
+ ├─────────────────────────────────────────┤
16
+ │ Summary: [what implemented], tests │
17
+ │ [X/X passed] │
18
+ ├─────────────────────────────────────────┤
19
+ │ Critical Issues ([N]): MUST FIX │
20
+ │ - [issue] at [file:line] │
21
+ │ Warnings ([N]): SHOULD FIX │
22
+ │ - [issue] at [file:line] │
23
+ │ Suggestions ([N]): NICE TO HAVE │
24
+ │ - [suggestion] │
25
+ └─────────────────────────────────────────┘
26
+
27
+ 3. AskUserQuestion (header: "Review & Approve"):
28
+ IF critical_count > 0:
29
+ - "Fix critical issues" → fix, re-run tester, cycle++, LOOP
30
+ - "Fix all issues" → fix all, re-run tester, cycle++, LOOP
31
+ - "Approve anyway" → PROCEED
32
+ - "Abort" → stop
33
+ ELSE:
34
+ - "Approve" → PROCEED
35
+ - "Fix warnings/suggestions" → fix, cycle++, LOOP
36
+ - "Abort" → stop
37
+
38
+ 4. IF cycle >= 3 AND user selects fix:
39
+ → "⚠ 3 review cycles completed. Final decision required."
40
+ → AskUserQuestion: "Approve with noted issues" / "Abort workflow"
41
+ ```
42
+
43
+ ## Auto-Handling Cycle (for auto modes)
44
+
45
+ ```
46
+ cycle = 0
47
+ LOOP:
48
+ 1. Run code-reviewer → score, critical_count, warnings
49
+
50
+ 2. IF score >= 9.5 AND critical_count == 0:
51
+ → Auto-approve, PROCEED
52
+
53
+ 3. ELSE IF critical_count > 0 AND cycle < 3:
54
+ → Auto-fix critical issues
55
+ → Re-run tester
56
+ → cycle++, LOOP
57
+
58
+ 4. ELSE IF critical_count > 0 AND cycle >= 3:
59
+ → ESCALATE TO USER
60
+
61
+ 5. ELSE (no critical, score < 9.5):
62
+ → Approve with warnings logged, PROCEED
63
+ ```
64
+
65
+ ## Critical Issues Definition
66
+ - Security: XSS, SQL injection, OWASP vulnerabilities
67
+ - Performance: bottlenecks, inefficient algorithms
68
+ - Architecture: violations of patterns, coupling
69
+ - Principles: YAGNI, KISS, DRY violations
70
+
71
+ ## Output Formats
72
+ - Waiting: `⏸ Step 4: Code reviewed - [score]/10 - WAITING for approval`
73
+ - After fix: `✓ Step 4: [old]/10 → Fixed [N] issues → [new]/10 - Approved`
74
+ - Auto-approved: `✓ Step 4: Code reviewed - 9.8/10 - Auto-approved`
75
+ - Approved: `✓ Step 4: Code reviewed - [score]/10 - User approved`
@@ -0,0 +1,75 @@
1
+ # Subagent Patterns
2
+
3
+ Standard patterns for spawning and using subagents in cook workflows.
4
+
5
+ ## Task Tool Pattern
6
+ ```
7
+ Task(subagent_type="[type]", prompt="[task description]", description="[brief]")
8
+ ```
9
+
10
+ ## Research Phase
11
+ ```
12
+ Task(subagent_type="researcher", prompt="Research [topic]. Report ≤150 lines.", description="Research [topic]")
13
+ ```
14
+ - Use multiple researchers in parallel for different topics
15
+ - Keep reports ≤150 lines with citations
16
+
17
+ ## Scout Phase
18
+ ```
19
+ Task(subagent_type="scout", prompt="Find files related to [feature] in codebase", description="Scout [feature]")
20
+ ```
21
+ - Use `/ck:scout ext` (preferred) or `/ck:scout` (fallback)
22
+
23
+ ## Planning Phase
24
+ ```
25
+ Task(subagent_type="planner", prompt="Create implementation plan based on reports: [reports]. Save to [path]", description="Plan [feature]")
26
+ ```
27
+ - Input: researcher and scout reports
28
+ - Output: `plan.md` + `phase-XX-*.md` files
29
+
30
+ ## UI Implementation
31
+ ```
32
+ Task(subagent_type="ui-ux-designer", prompt="Implement [feature] UI per ./docs/design-guidelines.md", description="UI [feature]")
33
+ ```
34
+ - For frontend work
35
+ - Follow design guidelines
36
+
37
+ ## Testing
38
+ ```
39
+ Task(subagent_type="tester", prompt="Run test suite for plan phase [phase-name]", description="Test [phase]")
40
+ ```
41
+ - Must achieve 100% pass rate
42
+
43
+ ## Debugging
44
+ ```
45
+ Task(subagent_type="debugger", prompt="Analyze failures: [details]", description="Debug [issue]")
46
+ ```
47
+ - Use when tests fail
48
+ - Provides root cause analysis
49
+
50
+ ## Code Review
51
+ ```
52
+ Task(subagent_type="code-reviewer", prompt="Review changes for [phase]. Check security, performance, YAGNI/KISS/DRY. Return score (X/10), critical, warnings, suggestions.", description="Review [phase]")
53
+ ```
54
+
55
+ ## Project Management
56
+ ```
57
+ Task(subagent_type="project-manager", prompt="Run full sync-back in [plan-path]: reconcile completed tasks with all phase files, backfill stale completed checkboxes across all phases, update plan.md status/progress, and report unresolved mappings.", description="Update plan")
58
+ ```
59
+
60
+ ## Documentation
61
+ ```
62
+ Task(subagent_type="docs-manager", prompt="Update docs for [phase]. Changed files: [list]", description="Update docs")
63
+ ```
64
+
65
+ ## Git Operations
66
+ ```
67
+ Task(subagent_type="git-manager", prompt="Stage and commit changes with conventional commit message", description="Commit changes")
68
+ ```
69
+
70
+ ## Parallel Execution
71
+ ```
72
+ Task(subagent_type="fullstack-developer", prompt="Implement [phase-file] with file ownership: [files]", description="Implement phase [N]")
73
+ ```
74
+ - Launch multiple for parallel phases
75
+ - Include file ownership boundaries
@@ -0,0 +1,172 @@
1
+ # Unified Workflow Steps
2
+
3
+ All modes share core steps with mode-specific variations.
4
+
5
+ ## Step 0: Intent Detection & Setup
6
+
7
+ 1. Parse input with `intent-detection.md` rules
8
+ 2. Log detected mode: `✓ Step 0: Mode [X] - [reason]`
9
+ 3. If mode=code: detect plan path, set active plan
10
+ 4. Use `TaskCreate` to create workflow step tasks (with dependencies if complex)
11
+
12
+ **Output:** `✓ Step 0: Mode [interactive|auto|fast|parallel|no-test|code] - [detection reason]`
13
+
14
+ ## Step 1: Research (skip if fast/code mode)
15
+
16
+ **Interactive/Auto:**
17
+ - Spawn multiple `researcher` agents in parallel
18
+ - Use `/ck:scout ext` or `scout` agent for codebase search
19
+ - Keep reports ≤150 lines
20
+
21
+ **Parallel:**
22
+ - Optional: max 2 researchers if complex
23
+
24
+ **Output:** `✓ Step 1: Research complete - [N] reports gathered`
25
+
26
+ ### [Review Gate 1] Post-Research (skip if auto mode)
27
+ - Present research summary to user
28
+ - Use `AskUserQuestion` to ask: "Proceed to planning?" / "Request more research" / "Abort"
29
+ - **Auto mode:** Skip this gate
30
+
31
+ ## Step 2: Planning
32
+
33
+ **Interactive/Auto/No-test:**
34
+ - Use `planner` agent with research context
35
+ - Create `plan.md` + `phase-XX-*.md` files
36
+
37
+ **Fast:**
38
+ - Use `/ck:plan --fast` with scout results only
39
+ - Minimal planning, focus on action
40
+
41
+ **Parallel:**
42
+ - Use `/ck:plan --parallel` for dependency graph + file ownership matrix
43
+
44
+ **Code:**
45
+ - Skip - plan already exists
46
+ - Parse existing plan for phases
47
+
48
+ **Output:** `✓ Step 2: Plan created - [N] phases`
49
+
50
+ ### [Review Gate 2] Post-Plan (skip if auto mode)
51
+ - Present plan overview with phases
52
+ - Use `AskUserQuestion` to ask: "Validate the plan or approve plan to start implementation?" - "Validate" / "Approve" / "Abort" / "Other" ("Request revisions")
53
+ - "Validate": run `/ck:plan validate` slash command
54
+ - "Approve": continue to implementation
55
+ - "Abort": stop the workflow
56
+ - "Other": revise the plan based on user's feedback
57
+ - **Auto mode:** Skip this gate
58
+
59
+ ## Step 3: Implementation
60
+
61
+ **IMPORTANT:**
62
+ 1. `TaskList` first — check for existing tasks (hydrated by planning skill in same session)
63
+ 2. If tasks exist → pick them up, skip re-creation
64
+ 3. If no tasks → read plan phases, `TaskCreate` for each unchecked `[ ]` item with priority order and metadata (`phase`, `planDir`, `phaseFile`)
65
+ 4. Tasks can be blocked by other tasks via `addBlockedBy`
66
+
67
+ **All modes:**
68
+ - Use `TaskUpdate` to mark tasks as `in_progress` immediately.
69
+ - Execute phase tasks sequentially (Step 3.1, 3.2, etc.)
70
+ - Use `ui-ux-designer` for frontend
71
+ - Use `ck:ai-multimodal` for image assets
72
+ - Run type checking after each file
73
+
74
+ **Parallel mode:**
75
+ - Utilize all tools of Claude Tasks: `TaskCreate`, `TaskUpdate`, `TaskGet` and `TaskList`
76
+ - Launch multiple `fullstack-developer` agents
77
+ - When agents pick up a task, use `TaskUpdate` to assign task to agent and mark tasks as `in_progress` immediately.
78
+ - Respect file ownership boundaries
79
+ - Wait for parallel group before next
80
+
81
+ **Output:** `✓ Step 3: Implemented [N] files - [X/Y] tasks complete`
82
+
83
+ ### [Review Gate 3] Post-Implementation (skip if auto mode)
84
+ - Present implementation summary (files changed, key changes)
85
+ - Use `AskUserQuestion` to ask: "Proceed to testing?" / "Request implementation changes" / "Abort"
86
+ - **Auto mode:** Skip this gate
87
+
88
+ ## Step 4: Testing (skip if no-test mode)
89
+
90
+ **All modes (except no-test):**
91
+ - Write tests: happy path, edge cases, errors
92
+ - **MUST** spawn `tester` subagent: `Task(subagent_type="tester", prompt="Run test suite", description="Run tests")`
93
+ - If failures: **MUST** spawn `debugger` subagent → fix → repeat
94
+ - **Forbidden:** fake mocks, commented tests, changed assertions, skipping subagent delegation
95
+
96
+ **Output:** `✓ Step 4: Tests [X/X passed] - tester subagent invoked`
97
+
98
+ ### [Review Gate 4] Post-Testing (skip if auto mode)
99
+ - Present test results summary
100
+ - Use `AskUserQuestion` to ask: "Proceed to code review?" / "Request test fixes" / "Abort"
101
+ - **Auto mode:** Skip this gate
102
+
103
+ ## Step 5: Code Review
104
+
105
+ **All modes - MANDATORY subagent:**
106
+ - **MUST** spawn `code-reviewer` subagent: `Task(subagent_type="code-reviewer", prompt="Review changes. Return score, critical issues, warnings.", description="Code review")`
107
+ - **DO NOT** review code yourself - delegate to subagent
108
+
109
+ **Interactive/Parallel/Code/No-test:**
110
+ - Interactive cycle (max 3): see `review-cycle.md`
111
+ - Requires user approval
112
+
113
+ **Auto:**
114
+ - Auto-approve if score≥9.5 AND 0 critical
115
+ - Auto-fix critical (max 3 cycles)
116
+ - Escalate to user after 3 failed cycles
117
+
118
+ **Fast:**
119
+ - Simplified review, no fix loop
120
+ - User approves or aborts
121
+
122
+ **Output:** `✓ Step 5: Review [score]/10 - [Approved|Auto-approved] - code-reviewer subagent invoked`
123
+
124
+ ## Step 6: Finalize
125
+
126
+ **All modes - MANDATORY subagents (NON-NEGOTIABLE):**
127
+ 1. **MUST** spawn these subagents in parallel:
128
+ - `Task(subagent_type="project-manager", prompt="Run full sync-back for [plan-path]: reconcile all completed Claude Tasks with all phase files, backfill stale completed checkboxes across every phase, then update plan.md frontmatter/table progress. Do NOT only mark current phase.", description="Update plan")`
129
+ - `Task(subagent_type="docs-manager", prompt="Update docs for changes.", description="Update docs")`
130
+ 2. Project-manager sync-back MUST include:
131
+ - Sweep all `phase-XX-*.md` files in the plan directory.
132
+ - Mark every completed item `[ ] → [x]` based on completed tasks (including earlier phases finished before current phase).
133
+ - Update `plan.md` status/progress (`pending`/`in-progress`/`completed`) from actual checkbox state.
134
+ - Return unresolved mappings if any completed task cannot be matched to a phase file.
135
+ 3. Use `TaskUpdate` to mark Claude Tasks complete after sync-back confirmation.
136
+ 4. Onboarding check (API keys, env vars)
137
+ 5. **MUST** spawn git subagent: `Task(subagent_type="git-manager", prompt="Stage and commit changes", description="Commit")`
138
+
139
+ **CRITICAL:** Step 6 is INCOMPLETE without spawning all 3 subagents. DO NOT skip subagent delegation.
140
+
141
+ **Auto mode:** Continue to next phase automatically, start from **Step 3**.
142
+ **Others:** Ask user before next phase
143
+
144
+ **Output:** `✓ Step 6: Finalized - 3 subagents invoked - Full-plan sync-back completed - Committed`
145
+
146
+ ## Mode-Specific Flow Summary
147
+
148
+ Legend: `[R]` = Review Gate (human approval required)
149
+
150
+ ```
151
+ interactive: 0 → 1 → [R] → 2 → [R] → 3 → [R] → 4 → [R] → 5(user) → 6
152
+ auto: 0 → 1 → 2 → 3 → 4 → 5(auto) → 6 → next phase (NO stops)
153
+ fast: 0 → skip → 2(fast) → [R] → 3 → [R] → 4 → [R] → 5(simple) → 6
154
+ parallel: 0 → 1? → [R] → 2(parallel) → [R] → 3(multi-agent) → [R] → 4 → [R] → 5(user) → 6
155
+ no-test: 0 → 1 → [R] → 2 → [R] → 3 → [R] → skip → 5(user) → 6
156
+ code: 0 → skip → skip → 3 → [R] → 4 → [R] → 5(user) → 6
157
+ ```
158
+
159
+ **Key difference:** `auto` mode is the ONLY mode that skips all review gates.
160
+
161
+ ## Critical Rules
162
+
163
+ - Never skip steps without mode justification
164
+ - **MANDATORY SUBAGENT DELEGATION:** Steps 4, 5, 6 MUST spawn subagents via Task tool. DO NOT implement directly.
165
+ - Step 4: `tester` (and `debugger` if failures)
166
+ - Step 5: `code-reviewer`
167
+ - Step 6: `project-manager`, `docs-manager`, `git-manager`
168
+ - Use `TaskCreate` to create Claude Tasks for each unchecked item with priority order and dependencies.
169
+ - Use `TaskUpdate` to mark Claude Tasks `in_progress` when picking up a task.
170
+ - Use `TaskUpdate` to mark Claude Tasks `complete` immediately after finalizing the task.
171
+ - All step outputs follow format: `✓ Step [N]: [status] - [metrics]`
172
+ - **VALIDATION:** If Task tool calls = 0 at end of workflow, the workflow is INCOMPLETE.
@@ -0,0 +1,121 @@
1
+ ---
2
+ name: debug
3
+ description: "Debug systematically with root cause analysis before fixes. Use for bugs, test failures, unexpected behavior, performance issues, call stack tracing, multi-layer validation, log analysis, CI/CD failures, database diagnostics, system investigation."
4
+ version: 4.0.0
5
+ languages: all
6
+ argument-hint: "[error or issue description]"
7
+ ---
8
+
9
+ # Debugging & System Investigation
10
+
11
+ Comprehensive framework combining systematic debugging, root cause tracing, defense-in-depth validation, verification protocols, and system-level investigation (logs, CI/CD, databases, performance).
12
+
13
+ ## Core Principle
14
+
15
+ **NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST**
16
+
17
+ Random fixes waste time and create new bugs. Find root cause, fix at source, validate at every layer, verify before claiming success.
18
+
19
+ ## When to Use
20
+
21
+ **Code-level:** Test failures, bugs, unexpected behavior, build failures, integration problems
22
+ **System-level:** Server errors, CI/CD pipeline failures, performance degradation, database issues, log analysis
23
+ **Always:** Before claiming work complete
24
+
25
+ ## Techniques
26
+
27
+ ### 1. Systematic Debugging (`references/systematic-debugging.md`)
28
+
29
+ Four-phase framework: Root Cause Investigation → Pattern Analysis → Hypothesis Testing → Implementation. Complete each phase before proceeding. No fixes without Phase 1.
30
+
31
+ **Load when:** Any bug/issue requiring investigation and fix
32
+
33
+ ### 2. Root Cause Tracing (`references/root-cause-tracing.md`)
34
+
35
+ Trace bugs backward through call stack to find original trigger. Fix at source, not symptom. Includes `scripts/find-polluter.sh` for bisecting test pollution.
36
+
37
+ **Load when:** Error deep in call stack, unclear where invalid data originated
38
+
39
+ ### 3. Defense-in-Depth (`references/defense-in-depth.md`)
40
+
41
+ Validate at every layer: Entry validation → Business logic → Environment guards → Debug instrumentation
42
+
43
+ **Load when:** After finding root cause, need comprehensive validation
44
+
45
+ ### 4. Verification (`references/verification.md`)
46
+
47
+ **Iron law:** NO COMPLETION CLAIMS WITHOUT FRESH VERIFICATION EVIDENCE. Run command. Read output. Then claim result.
48
+
49
+ **Load when:** About to claim work complete, fixed, or passing
50
+
51
+ ### 5. Investigation Methodology (`references/investigation-methodology.md`)
52
+
53
+ Five-step structured investigation for system-level issues: Initial Assessment → Data Collection → Analysis → Root Cause ID → Solution Development
54
+
55
+ **Load when:** Server incidents, system behavior analysis, multi-component failures
56
+
57
+ ### 6. Log & CI/CD Analysis (`references/log-and-ci-analysis.md`)
58
+
59
+ Collect and analyze logs from servers, CI/CD pipelines (GitHub Actions), application layers. Tools: `gh` CLI, structured log queries, correlation across sources.
60
+
61
+ **Load when:** CI/CD pipeline failures, server errors, deployment issues
62
+
63
+ ### 7. Performance Diagnostics (`references/performance-diagnostics.md`)
64
+
65
+ Identify bottlenecks, analyze query performance, develop optimization strategies. Covers database queries, API response times, resource utilization.
66
+
67
+ **Load when:** Performance degradation, slow queries, high latency, resource exhaustion
68
+
69
+ ### 8. Reporting Standards (`references/reporting-standards.md`)
70
+
71
+ Structured diagnostic reports: Executive Summary → Technical Analysis → Recommendations → Evidence
72
+
73
+ **Load when:** Need to produce investigation report or diagnostic summary
74
+
75
+ ### 9. Task Management (`references/task-management-debugging.md`)
76
+
77
+ Track investigation pipelines via Claude Native Tasks (TaskCreate, TaskUpdate, TaskList). Hydration pattern for multi-step investigations with dependency chains and parallel evidence collection.
78
+
79
+ **Load when:** Multi-component investigation (3+ steps), parallel log collection, coordinating debugger subagents
80
+
81
+ ### 10. Frontend Verification (`references/frontend-verification.md`)
82
+
83
+ Visual verification of frontend implementations via Chrome MCP (Claude Chrome Extension) or `ck:chrome-devtools` skill fallback. Detect if frontend-related → check Chrome MCP availability → screenshot + console error check → report. Skip if not frontend.
84
+
85
+ **Load when:** Implementation touches frontend files (tsx/jsx/vue/svelte/html/css), UI bugs, visual regressions
86
+
87
+ ## Quick Reference
88
+
89
+ ```
90
+ Code bug → systematic-debugging.md (Phase 1-4)
91
+ Deep in stack → root-cause-tracing.md (trace backward)
92
+ Found cause → defense-in-depth.md (add layers)
93
+ Claiming done → verification.md (verify first)
94
+
95
+ System issue → investigation-methodology.md (5 steps)
96
+ CI/CD failure → log-and-ci-analysis.md
97
+ Slow system → performance-diagnostics.md
98
+ Need report → reporting-standards.md
99
+
100
+ Frontend fix → frontend-verification.md (Chrome/devtools)
101
+ ```
102
+
103
+ ## Tools Integration
104
+
105
+ - **Database:** `psql` for PostgreSQL queries and diagnostics
106
+ - **CI/CD:** `gh` CLI for GitHub Actions logs and pipeline debugging
107
+ - **Codebase:** `ck:docs-seeker` skill for package/plugin docs; `repomix` for codebase summary
108
+ - **Scouting:** `/ck:scout` or `/ck:scout ext` for finding relevant files
109
+ - **Frontend:** Chrome browser or `ck:chrome-devtools` skill for visual verification (screenshots, console, network)
110
+ - **Skills:** Activate `ck:problem-solving` skill when stuck on complex issues
111
+
112
+ ## Red Flags
113
+
114
+ Stop and follow process if thinking:
115
+ - "Quick fix for now, investigate later"
116
+ - "Just try changing X and see if it works"
117
+ - "It's probably X, let me fix that"
118
+ - "Should work now" / "Seems fixed"
119
+ - "Tests pass, we're done"
120
+
121
+ **All mean:** Return to systematic process.
@@ -0,0 +1,124 @@
1
+ # Defense-in-Depth Validation
2
+
3
+ Validate at every layer data passes through to make bugs impossible.
4
+
5
+ ## Core Principle
6
+
7
+ **Validate at EVERY layer data passes through. Make bug structurally impossible.**
8
+
9
+ When fix bug caused by invalid data, adding validation at one place feels sufficient. But single check can be bypassed by different code paths, refactoring, or mocks.
10
+
11
+ ## Why Multiple Layers
12
+
13
+ Single validation: "We fixed bug"
14
+ Multiple layers: "We made bug impossible"
15
+
16
+ Different layers catch different cases:
17
+ - Entry validation catches most bugs
18
+ - Business logic catches edge cases
19
+ - Environment guards prevent context-specific dangers
20
+ - Debug logging helps when other layers fail
21
+
22
+ ## The Four Layers
23
+
24
+ ### Layer 1: Entry Point Validation
25
+ **Purpose:** Reject obviously invalid input at API boundary
26
+
27
+ ```typescript
28
+ function createProject(name: string, workingDirectory: string) {
29
+ if (!workingDirectory || workingDirectory.trim() === '') {
30
+ throw new Error('workingDirectory cannot be empty');
31
+ }
32
+ if (!existsSync(workingDirectory)) {
33
+ throw new Error(`workingDirectory does not exist: ${workingDirectory}`);
34
+ }
35
+ if (!statSync(workingDirectory).isDirectory()) {
36
+ throw new Error(`workingDirectory is not a directory: ${workingDirectory}`);
37
+ }
38
+ // proceed
39
+ }
40
+ ```
41
+
42
+ ### Layer 2: Business Logic Validation
43
+ **Purpose:** Ensure data makes sense for this operation
44
+
45
+ ```typescript
46
+ function initializeWorkspace(projectDir: string, sessionId: string) {
47
+ if (!projectDir) {
48
+ throw new Error('projectDir required for workspace initialization');
49
+ }
50
+ // proceed
51
+ }
52
+ ```
53
+
54
+ ### Layer 3: Environment Guards
55
+ **Purpose:** Prevent dangerous operations in specific contexts
56
+
57
+ ```typescript
58
+ async function gitInit(directory: string) {
59
+ // In tests, refuse git init outside temp directories
60
+ if (process.env.NODE_ENV === 'test') {
61
+ const normalized = normalize(resolve(directory));
62
+ const tmpDir = normalize(resolve(tmpdir()));
63
+
64
+ if (!normalized.startsWith(tmpDir)) {
65
+ throw new Error(
66
+ `Refusing git init outside temp dir during tests: ${directory}`
67
+ );
68
+ }
69
+ }
70
+ // proceed
71
+ }
72
+ ```
73
+
74
+ ### Layer 4: Debug Instrumentation
75
+ **Purpose:** Capture context for forensics
76
+
77
+ ```typescript
78
+ async function gitInit(directory: string) {
79
+ const stack = new Error().stack;
80
+ logger.debug('About to git init', {
81
+ directory,
82
+ cwd: process.cwd(),
83
+ stack,
84
+ });
85
+ // proceed
86
+ }
87
+ ```
88
+
89
+ ## Applying the Pattern
90
+
91
+ When find bug:
92
+
93
+ 1. **Trace data flow** - Where does bad value originate? Where used?
94
+ 2. **Map all checkpoints** - List every point data passes through
95
+ 3. **Add validation at each layer** - Entry, business, environment, debug
96
+ 4. **Test each layer** - Try to bypass layer 1, verify layer 2 catches it
97
+
98
+ ## Example from Real Session
99
+
100
+ Bug: Empty `projectDir` caused `git init` in source code
101
+
102
+ **Data flow:**
103
+ 1. Test setup → empty string
104
+ 2. `Project.create(name, '')`
105
+ 3. `WorkspaceManager.createWorkspace('')`
106
+ 4. `git init` runs in `process.cwd()`
107
+
108
+ **Four layers added:**
109
+ - Layer 1: `Project.create()` validates not empty/exists/writable
110
+ - Layer 2: `WorkspaceManager` validates projectDir not empty
111
+ - Layer 3: `WorktreeManager` refuses git init outside tmpdir in tests
112
+ - Layer 4: Stack trace logging before git init
113
+
114
+ **Result:** All 1847 tests passed, bug impossible to reproduce
115
+
116
+ ## Key Insight
117
+
118
+ All four layers were necessary. During testing, each layer caught bugs others missed:
119
+ - Different code paths bypassed entry validation
120
+ - Mocks bypassed business logic checks
121
+ - Edge cases on different platforms needed environment guards
122
+ - Debug logging identified structural misuse
123
+
124
+ **Don't stop at one validation point.** Add checks at every layer.