@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,1321 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ ClaudeKit Help - All-in-one guide with dynamic skill discovery.
4
+ Scans .claude/skills/ directory to build catalog at runtime.
5
+
6
+ Usage:
7
+ python ck-help.py # Overview with quick start
8
+ python ck-help.py fix # Category guide with workflow
9
+ python ck-help.py plan validate # Subcommand details
10
+ python ck-help.py debug login error # Task recommendations
11
+ python ck-help.py auth # Search (unknown word)
12
+ """
13
+
14
+ import sys
15
+ import re
16
+ import io
17
+ from pathlib import Path
18
+
19
+ # Fix Windows console encoding for Unicode characters
20
+ if sys.platform == 'win32':
21
+ sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8', errors='replace')
22
+
23
+
24
+ # Output type markers for LLM presentation guidance
25
+ # Format: @CK_OUTPUT_TYPE:<type>
26
+ # Types:
27
+ # - comprehensive-docs: Full documentation, show verbatim + add context
28
+ # - category-guide: Workflow guide, show full + explain workflow
29
+ # - command-details: Single command, show + offer to run
30
+ # - search-results: Search matches, show + offer alternatives
31
+ # - task-recommendations: Task-based suggestions, explain reasoning
32
+ OUTPUT_TYPES = {
33
+ "comprehensive-docs": "Show FULL output verbatim, then ADD helpful context, examples, and real-world tips",
34
+ "category-guide": "Show complete workflow, then ENHANCE with practical usage scenarios",
35
+ "command-details": "Show command info, then ADD usage examples and related commands",
36
+ "search-results": "Show all matches, then HELP user narrow down or explore",
37
+ "task-recommendations": "Show recommendations, then EXPLAIN why these fit and offer to start",
38
+ }
39
+
40
+
41
+ def emit_output_type(output_type: str) -> None:
42
+ """Emit output type marker for LLM presentation guidance."""
43
+ print(f"@CK_OUTPUT_TYPE:{output_type}")
44
+ print()
45
+
46
+
47
+ # Fuzzy matching for typo tolerance
48
+ def levenshtein_distance(s1: str, s2: str) -> int:
49
+ """Standard Levenshtein distance algorithm."""
50
+ if len(s1) < len(s2):
51
+ return levenshtein_distance(s2, s1)
52
+ if len(s2) == 0:
53
+ return len(s1)
54
+
55
+ prev_row = range(len(s2) + 1)
56
+ for i, c1 in enumerate(s1):
57
+ curr_row = [i + 1]
58
+ for j, c2 in enumerate(s2):
59
+ insertions = prev_row[j + 1] + 1
60
+ deletions = curr_row[j] + 1
61
+ substitutions = prev_row[j] + (c1 != c2)
62
+ curr_row.append(min(insertions, deletions, substitutions))
63
+ prev_row = curr_row
64
+ return prev_row[-1]
65
+
66
+
67
+ def fuzzy_match(word: str, target: str, threshold: int = 2) -> bool:
68
+ """Check if word matches target within edit distance threshold."""
69
+ if len(word) < 3: # Skip very short words
70
+ return word == target
71
+
72
+ # Exact match short-circuit
73
+ if word == target:
74
+ return True
75
+
76
+ # Require similar lengths to avoid false positives (e.g., "create" ≠ "creative")
77
+ len_diff = abs(len(word) - len(target))
78
+ if len_diff > 1:
79
+ return False
80
+
81
+ # Allow threshold based on word length (max 1/3 of target length)
82
+ max_edits = min(threshold, len(target) // 3)
83
+ if max_edits < 1:
84
+ return word == target
85
+
86
+ return levenshtein_distance(word, target) <= max_edits
87
+
88
+
89
+ # Disambiguation threshold - if top 2 scores within this, ask user
90
+ DISAMBIGUATION_THRESHOLD = 0.5
91
+
92
+
93
+ # Synonym mappings for normalization (term → canonical)
94
+ SYNONYMS = {
95
+ # Notifications
96
+ "alerts": "notifications",
97
+ "alert": "notification",
98
+
99
+ # Git/GitHub
100
+ "ci": "github actions",
101
+ "ci/cd": "github actions",
102
+ "pipeline": "github actions",
103
+ "actions": "github actions",
104
+
105
+ # Common abbreviations
106
+ "auth": "authentication",
107
+ "authn": "authentication",
108
+ "db": "database",
109
+ "repo": "repository",
110
+ "deps": "dependencies",
111
+
112
+ # Commands
113
+ "pr": "pull request",
114
+ "mr": "pull request", # GitLab users
115
+
116
+ # Testing
117
+ "specs": "tests",
118
+ "e2e": "integration test",
119
+ }
120
+
121
+
122
+ def expand_synonyms(text: str) -> str:
123
+ """Replace synonyms with canonical terms."""
124
+ result = text.lower()
125
+
126
+ # Sort by length (longest first) to handle multi-word synonyms
127
+ sorted_synonyms = sorted(SYNONYMS.items(), key=lambda x: -len(x[0]))
128
+
129
+ for synonym, canonical in sorted_synonyms:
130
+ # Word boundary aware replacement
131
+ pattern = r'\b' + re.escape(synonym) + r'\b'
132
+ result = re.sub(pattern, canonical, result, flags=re.IGNORECASE)
133
+
134
+ return result
135
+
136
+
137
+ # Task keyword mappings for intent detection
138
+ TASK_MAPPINGS = {
139
+ "plan": ["plan", "design", "architect", "research", "think", "analyze", "strategy", "how to", "approach"],
140
+ "cook": ["implement", "build", "create", "add", "feature", "code", "develop", "make", "write"],
141
+ "bootstrap": ["start", "new", "init", "setup", "project", "scaffold", "generate", "begin"],
142
+ "fix": ["fix", "bug", "error", "broken", "crash", "fail", "issue", "wrong", "debug", "troubleshoot"],
143
+ "test": ["test", "check", "verify", "validate", "spec", "unit", "integration", "coverage", "e2e"],
144
+ "docs": ["document", "readme", "docs", "explain", "comment", "documentation"],
145
+ "git": ["git", "commit", "push", "pull request", "merge", "branch", "stage", "diff", "stash"],
146
+ "review": ["review", "audit", "inspect", "quality", "refactor", "clean"],
147
+ "config": ["config", "configure", "settings", "ck.json", ".ck.json", "setup", "locale", "language", "paths"],
148
+ "coding-level": ["coding", "level", "eli5", "junior", "senior", "lead", "god", "beginner", "expert", "teach", "learn", "explain"],
149
+ # New categories
150
+ "worktree": ["worktree", "parallel", "isolate", "isolation", "concurrent", "multiple branches"],
151
+ "kanban": ["kanban", "board", "dashboard", "progress", "track", "orchestration", "visualize"],
152
+ "preview": ["preview", "view", "render", "markdown", "reader", "novel", "explain", "slides", "diagram", "ascii", "visualize", "visual"],
153
+ "journal": ["journal", "diary", "log", "entry", "reflect", "failure", "lesson"],
154
+ "watzup": ["watzup", "status", "summary", "wrap up", "what's up", "recent", "changes"],
155
+ "notifications": ["notification", "notifications", "notify", "discord", "telegram", "slack", "alert", "webhook", "stop hook", "session end", "setup notification", "setup notifications", "configure discord", "configure telegram", "configure slack", "discord webhook", "telegram bot", "slack webhook"],
156
+ }
157
+
158
+ # Known subcommands and aliases.
159
+ # Keep normalized keys in sync with skill docs.
160
+ SUBCOMMAND_DETAILS = {
161
+ "plan archive": {
162
+ "name": "/plan archive",
163
+ "description": "Archive plans and optionally journal completed work.",
164
+ "category": "plan",
165
+ "usage": "/plan archive [plan-dir-or-plan.md]",
166
+ },
167
+ "plan red-team": {
168
+ "name": "/plan red-team",
169
+ "description": "Run adversarial review against an implementation plan.",
170
+ "category": "plan",
171
+ "usage": "/plan red-team [plan-dir-or-plan.md]",
172
+ },
173
+ "plan validate": {
174
+ "name": "/plan validate",
175
+ "description": "Interview-based plan validation before implementation.",
176
+ "category": "plan",
177
+ "usage": "/plan validate [plan-dir-or-plan.md]",
178
+ },
179
+ "docs init": {
180
+ "name": "/docs init",
181
+ "description": "Create initial project docs from codebase analysis.",
182
+ "category": "docs",
183
+ "usage": "/docs init",
184
+ },
185
+ "docs update": {
186
+ "name": "/docs update",
187
+ "description": "Update existing docs based on recent project changes.",
188
+ "category": "docs",
189
+ "usage": "/docs update [focus]",
190
+ },
191
+ "docs summarize": {
192
+ "name": "/docs summarize",
193
+ "description": "Generate a concise codebase summary update.",
194
+ "category": "docs",
195
+ "usage": "/docs summarize [focus]",
196
+ },
197
+ "code-review codebase": {
198
+ "name": "/code-review codebase",
199
+ "description": "Run full codebase scan and review.",
200
+ "category": "review",
201
+ "usage": "/code-review codebase",
202
+ },
203
+ "code-review codebase parallel": {
204
+ "name": "/code-review codebase parallel",
205
+ "description": "Parallel codebase review with edge-case verification workflow.",
206
+ "category": "review",
207
+ "usage": "/code-review codebase parallel",
208
+ },
209
+ "test ui": {
210
+ "name": "/test ui",
211
+ "description": "Run UI/browser-focused testing workflow.",
212
+ "category": "test",
213
+ "usage": "/test ui [url]",
214
+ },
215
+ }
216
+
217
+ SUBCOMMAND_ALIASES = {
218
+ "plan:archive": "plan archive",
219
+ "plan:red-team": "plan red-team",
220
+ "plan:validate": "plan validate",
221
+ "docs:init": "docs init",
222
+ "docs:update": "docs update",
223
+ "docs:summarize": "docs summarize",
224
+ "review codebase": "code-review codebase",
225
+ "review codebase parallel": "code-review codebase parallel",
226
+ "review:codebase": "code-review codebase",
227
+ "review:codebase:parallel": "code-review codebase parallel",
228
+ }
229
+
230
+
231
+ def normalize_command_query(query: str) -> str:
232
+ """Normalize user command/subcommand query into comparable token form."""
233
+ normalized = query.lower().replace("/", " ").strip()
234
+ normalized = re.sub(r"\s+", " ", normalized)
235
+ return normalized
236
+
237
+
238
+ def resolve_subcommand(query: str):
239
+ """Resolve a query into canonical subcommand details, if any."""
240
+ normalized = normalize_command_query(query)
241
+ alias = SUBCOMMAND_ALIASES.get(normalized, normalized)
242
+ return SUBCOMMAND_DETAILS.get(alias)
243
+
244
+
245
+ def extract_fallback_description(file_path: Path) -> str:
246
+ """Extract first meaningful non-heading line as fallback description."""
247
+ try:
248
+ content = file_path.read_text(encoding="utf-8")
249
+ except Exception:
250
+ return ""
251
+
252
+ body = re.sub(r"^---\s*\n.*?\n---\s*\n", "", content, flags=re.DOTALL)
253
+ for line in body.splitlines():
254
+ text = line.strip()
255
+ if not text or text.startswith("#") or text.startswith("```"):
256
+ continue
257
+ return text[:200]
258
+ return ""
259
+
260
+
261
+ # Category workflows and tips
262
+ CATEGORY_GUIDES = {
263
+ "plan": {
264
+ "title": "Planning",
265
+ "workflow": [
266
+ ("Quick plan", "`/plan --fast` \"your task\""),
267
+ ("Deep research", "`/plan --hard` \"complex task\""),
268
+ ("Multi-agent", "`/plan --parallel` \"complex task\""),
269
+ ("Validate", "`/plan validate` (interview to confirm decisions)"),
270
+ ("Execute plan", "`/cook` (runs the plan)"),
271
+ ],
272
+ "tip": "Use /plan validate to confirm assumptions before coding",
273
+ },
274
+ "cook": {
275
+ "title": "Implementation",
276
+ "workflow": [
277
+ ("Quick impl", "`/cook` \"your feature\""),
278
+ ("Auto mode", "`/cook --auto` \"trust me bro\""),
279
+ ("Test", "`/test`"),
280
+ ],
281
+ "tip": "Cook is standalone - it plans internally. Use /plan → /cook for explicit planning",
282
+ },
283
+ "bootstrap": {
284
+ "title": "Project Setup",
285
+ "workflow": [
286
+ ("Quick start", "`/bootstrap --fast` \"requirements\""),
287
+ ("Full setup", "`/bootstrap` \"detailed requirements\""),
288
+ ("Auto mode", "`/bootstrap --auto` (default)"),
289
+ ],
290
+ "tip": "Include tech stack preferences in description",
291
+ },
292
+ "test": {
293
+ "title": "Testing",
294
+ "workflow": [
295
+ ("Run tests", "`/test`"),
296
+ ],
297
+ "tip": "Run tests frequently during development",
298
+ },
299
+ "docs": {
300
+ "title": "Documentation",
301
+ "workflow": [
302
+ ("Initialize", "`/docs init`"),
303
+ ("Update", "`/docs update`"),
304
+ ],
305
+ "tip": "Keep docs close to code for accuracy",
306
+ },
307
+ "review": {
308
+ "title": "Code Review",
309
+ "workflow": [
310
+ ("Full review", "`/code-review codebase`"),
311
+ ],
312
+ "tip": "Review before merging to main",
313
+ },
314
+ "coding-level": {
315
+ "title": "Coding Level (Adaptive Communication)",
316
+ "workflow": [
317
+ ("Disabled", "`codingLevel: -1` (default, no injection)"),
318
+ ("ELI5", "`codingLevel: 0` (analogies, baby steps)"),
319
+ ("Junior", "`codingLevel: 1` (WHY before HOW)"),
320
+ ("Mid-Level", "`codingLevel: 2` (patterns, trade-offs)"),
321
+ ("Senior", "`codingLevel: 3` (production code, ops)"),
322
+ ("Tech Lead", "`codingLevel: 4` (risk matrix, strategy)"),
323
+ ("God Mode", "`codingLevel: 5` (code first, no fluff)"),
324
+ ],
325
+ "tip": "Set in .ck.json. Guidelines auto-inject on session start",
326
+ },
327
+ "config": {
328
+ "title": "ClaudeKit Configuration (.ck.json)",
329
+ "workflow": [
330
+ ("Global", "Set user prefs in `~/.claude/.ck.json`"),
331
+ ("Local", "Override per-project in `./.claude/.ck.json`"),
332
+ ("Resolution", "DEFAULT → global → local (deep merge)"),
333
+ ],
334
+ "tip": "Global config works in fresh dirs; local overrides for projects",
335
+ },
336
+ # New category guides (workflow-first approach)
337
+ "worktree": {
338
+ "title": "Git Worktrees (Parallel Development)",
339
+ "workflow": [
340
+ ("Create worktree", "`/worktree` \"feature description\""),
341
+ ("Work in isolation", "cd to worktree, implement, test"),
342
+ ("Review & merge", "Create PR from worktree → merge → cleanup"),
343
+ ("List worktrees", "`/worktree list`"),
344
+ ("Remove worktree", "`/worktree remove <name>`"),
345
+ ],
346
+ "tip": "Use worktrees for parallel features without stashing. Each worktree = isolated branch + clean working directory",
347
+ },
348
+ "kanban": {
349
+ "title": "AI Orchestration Board",
350
+ "workflow": [
351
+ ("View dashboard", "`/kanban` (opens browser)"),
352
+ ("Specific plans", "`/kanban plans/my-feature/`"),
353
+ ("Track progress", "View phase completion, timeline, activity"),
354
+ ("Stop server", "`/kanban --stop`"),
355
+ ],
356
+ "tip": "Dashboard shows plan phases, progress bars, and agent activity. Future: worktree + agent orchestration",
357
+ },
358
+ "brainstorm": {
359
+ "title": "Brainstorming & Ideation",
360
+ "workflow": [
361
+ ("Brainstorm", "`/brainstorm` \"your topic\""),
362
+ ("With context", "`/brainstorm` \"topic\" (respects codingLevel)"),
363
+ ("Trade-offs", "Analyze solutions with brutal honesty"),
364
+ ],
365
+ "tip": "Use before planning to explore approaches and validate feasibility",
366
+ },
367
+ "fix": {
368
+ "title": "Fixing Issues & Debugging",
369
+ "workflow": [
370
+ ("Auto fix", "`/fix` \"describe the issue\""),
371
+ ("Parallel", "`/fix --parallel` (multi-agent debug)"),
372
+ ("Debug only", "`/debug` (root cause analysis)"),
373
+ ],
374
+ "tip": "Activate /fix before fixing any bug, error, test failure, or CI/CD issue",
375
+ },
376
+ "git": {
377
+ "title": "Git Operations",
378
+ "workflow": [
379
+ ("Commit", "`/git cm`"),
380
+ ("Commit & push", "`/git cp`"),
381
+ ("Pull request", "`/git pr` [to-branch] [from-branch]"),
382
+ ("Merge", "`/git merge` [to-branch] [from-branch]"),
383
+ ],
384
+ "tip": "Uses conventional commits with auto-split by type/scope. Scans for secrets",
385
+ },
386
+ "preview": {
387
+ "title": "Content Preview & Novel Reader",
388
+ "workflow": [
389
+ ("View markdown", "`/preview plans/plan.md`"),
390
+ ("Browse directory", "`/preview docs/`"),
391
+ ("Explain topic", "`/preview --explain OAuth flow`"),
392
+ ("Generate slides", "`/preview --slides API architecture`"),
393
+ ("Create diagram", "`/preview --diagram data flow`"),
394
+ ("ASCII only", "`/preview --ascii auth process`"),
395
+ ("Stop server", "`/preview --stop`"),
396
+ ],
397
+ "tip": "View existing markdown OR generate visual explanations (ASCII + Mermaid). Visuals save to active plan's visuals/ folder",
398
+ },
399
+ "journal": {
400
+ "title": "Technical Journaling",
401
+ "workflow": [
402
+ ("Write entry", "`/journal`"),
403
+ ("Document failures", "Capture what went wrong with emotional honesty"),
404
+ ("Lessons learned", "Turn setbacks into future guidance"),
405
+ ],
406
+ "tip": "Use after repeated test failures, critical bugs, or architectural pivots. Raw honesty = future wisdom",
407
+ },
408
+ "watzup": {
409
+ "title": "Session Review & Wrap-up",
410
+ "workflow": [
411
+ ("Review changes", "`/watzup`"),
412
+ ("Get summary", "See what was done, what files changed"),
413
+ ("Next steps", "Receive suggestions for what to do next"),
414
+ ],
415
+ "tip": "Run before ending session to capture progress and plan next steps",
416
+ },
417
+ "notifications": {
418
+ "title": "Session Notifications (Discord/Telegram/Slack)",
419
+ "workflow": [
420
+ ("1. Set env vars", "Add `DISCORD_WEBHOOK_URL` or `TELEGRAM_BOT_TOKEN`+`TELEGRAM_CHAT_ID` to `~/.claude/.env`"),
421
+ ("2. Add hook", "Add Stop hook to `.claude/settings.json` (see below)"),
422
+ ("3. Test", "`echo '{\"hook_event_name\":\"Stop\"}' | node .claude/hooks/notifications/notify.cjs`"),
423
+ ],
424
+ "tip": """Add to settings.json:
425
+ ```json
426
+ "Stop": [{"matcher": "*", "hooks": [{"type": "command", "command": "node .claude/hooks/notifications/notify.cjs"}]}]
427
+ ```
428
+ Docs: `.claude/hooks/notifications/docs/`""",
429
+ },
430
+ }
431
+
432
+
433
+ def parse_frontmatter(file_path: Path) -> dict:
434
+ """Parse YAML frontmatter from a markdown file."""
435
+ try:
436
+ content = file_path.read_text(encoding='utf-8')
437
+ except Exception:
438
+ return {}
439
+
440
+ # Check for frontmatter
441
+ if not content.startswith('---'):
442
+ return {}
443
+
444
+ # Find closing ---
445
+ end_idx = content.find('---', 3)
446
+ if end_idx == -1:
447
+ return {}
448
+
449
+ frontmatter = content[3:end_idx].strip()
450
+ result = {}
451
+
452
+ for line in frontmatter.split('\n'):
453
+ if ':' in line:
454
+ key, value = line.split(':', 1)
455
+ # Strip quotes from values
456
+ val = value.strip().strip('"').strip("'")
457
+ result[key.strip()] = val
458
+
459
+ return result
460
+
461
+
462
+ # Map skill directory names to CATEGORY_GUIDES keys
463
+ SKILL_CATEGORY_MAP = {
464
+ # CK core skills → their matching category
465
+ "code-review": "review",
466
+ "debug": "fix",
467
+ "scout": "core",
468
+ "use-mcp": "core",
469
+ "ask": "core",
470
+ "coding-level": "coding-level",
471
+ "research": "plan",
472
+ "project-management": "plan",
473
+ "plans-kanban": "kanban",
474
+ "find-skills": "core",
475
+ # External/3rd-party skills → grouped categories
476
+ "ai-artist": "ai",
477
+ "ai-multimodal": "ai",
478
+ "google-adk-python": "ai",
479
+ "backend-development": "backend",
480
+ "better-auth": "backend",
481
+ "payment-integration": "backend",
482
+ "databases": "backend",
483
+ "frontend-design": "frontend",
484
+ "frontend-development": "frontend",
485
+ "ui-styling": "frontend",
486
+ "ui-ux-pro-max": "frontend",
487
+ "web-design-guidelines": "frontend",
488
+ "react-best-practices": "frontend",
489
+ "threejs": "frontend",
490
+ "shader": "frontend",
491
+ "remotion": "frontend",
492
+ "web-frameworks": "frontend",
493
+ "mobile-development": "frontend",
494
+ "shopify": "frontend",
495
+ "devops": "infra",
496
+ "context-engineering": "infra",
497
+ "chrome-devtools": "tools",
498
+ "media-processing": "tools",
499
+ "markdown-novel-viewer": "tools",
500
+ "mermaidjs-v11": "tools",
501
+ "mcp-builder": "tools",
502
+ "mcp-management": "tools",
503
+ "docs-seeker": "tools",
504
+ "repomix": "tools",
505
+ "skill-creator": "tools",
506
+ "sequential-thinking": "tools",
507
+ "problem-solving": "tools",
508
+ "agent-browser": "tools",
509
+ "web-testing": "test",
510
+ "copywriting": "tools",
511
+ "gkg": "tools",
512
+ "mintlify": "docs",
513
+ "document-skills/docx": "tools",
514
+ "document-skills/pdf": "tools",
515
+ "document-skills/pptx": "tools",
516
+ "document-skills/xlsx": "tools",
517
+ }
518
+
519
+
520
+ def discover_skills(skills_dir: Path) -> dict:
521
+ """Scan .claude/skills/ and build skill catalog from SKILL.md files."""
522
+ skills = {}
523
+ categories = {}
524
+
525
+ if not skills_dir.exists():
526
+ return {"commands": skills, "categories": categories}
527
+
528
+ # Scan all SKILL.md files (one per skill directory)
529
+ for skill_md in sorted(skills_dir.rglob("SKILL.md")):
530
+ skill_dir = skill_md.parent
531
+ skill_name = skill_dir.name
532
+
533
+ # Handle nested skills (e.g., document-skills/docx)
534
+ if skill_dir.parent.name != 'skills':
535
+ skill_name = f"{skill_dir.parent.name}/{skill_name}"
536
+
537
+ # Skip template and ck-help itself
538
+ if skill_name in ('template-skill', 'ck-help'):
539
+ continue
540
+
541
+ # Parse frontmatter
542
+ fm = parse_frontmatter(skill_md)
543
+ description = fm.get('description', '')
544
+
545
+ # Fallback if description is missing from frontmatter
546
+ if not description:
547
+ description = extract_fallback_description(skill_md)
548
+ if not description:
549
+ description = "No description provided."
550
+
551
+ # Clean description (remove [CK] prefix, emoji indicators)
552
+ clean_desc = re.sub(r'^\[CK\]\s*', '', description).strip()
553
+ clean_desc = re.sub(r'^[^\w\s\[]+\s*', '', clean_desc).strip()
554
+
555
+ # Determine category from skill name
556
+ category = SKILL_CATEGORY_MAP.get(skill_name, skill_name)
557
+
558
+ formatted_name = f"/{skill_name}"
559
+
560
+ # Add to skills grouped by category
561
+ if category not in skills:
562
+ skills[category] = []
563
+
564
+ entry = {
565
+ "name": formatted_name,
566
+ "description": clean_desc,
567
+ "category": category,
568
+ }
569
+
570
+ # Include argument-hint for discoverability
571
+ arg_hint = fm.get('argument-hint', '')
572
+ if arg_hint:
573
+ entry["argument_hint"] = str(arg_hint)
574
+
575
+ skills[category].append(entry)
576
+
577
+ # Track categories
578
+ if category not in categories:
579
+ categories[category] = category.title()
580
+
581
+ # Sort skills within each category
582
+ for cat in skills:
583
+ skills[cat].sort(key=lambda x: x["name"])
584
+
585
+ return {"commands": skills, "categories": categories}
586
+
587
+
588
+ def detect_intent(input_str: str, categories: list) -> str:
589
+ """Smart auto-detection of user intent."""
590
+ if not input_str:
591
+ return "overview"
592
+
593
+ input_lower = input_str.lower()
594
+ words = input_str.split()
595
+
596
+ # Multiple words = likely task description (even if first word is a category)
597
+ # e.g., "test my login" should be task, not category "test"
598
+ if len(words) >= 2:
599
+ # Exception: if it looks like a command (has colon), treat as command
600
+ if ':' in input_str:
601
+ return "command"
602
+ if resolve_subcommand(input_str):
603
+ return "command"
604
+ return "task"
605
+
606
+ # Single word: check if it's a known category from discovered commands
607
+ if input_lower in [c.lower() for c in categories]:
608
+ return "category"
609
+
610
+ # Check if it's a known category from CATEGORY_GUIDES (includes non-command categories)
611
+ if input_lower in [c.lower() for c in CATEGORY_GUIDES.keys()]:
612
+ return "category"
613
+
614
+ # Single word typo tolerance: fuzzy match against categories
615
+ all_categories = set(c.lower() for c in categories) | set(c.lower() for c in CATEGORY_GUIDES.keys())
616
+ for cat in all_categories:
617
+ if fuzzy_match(input_lower, cat):
618
+ return "category"
619
+
620
+ # Single word typo tolerance: fuzzy match against task keywords
621
+ for cat, keywords in TASK_MAPPINGS.items():
622
+ for kw in keywords:
623
+ if ' ' not in kw and fuzzy_match(input_lower, kw):
624
+ return "task"
625
+
626
+ # Check if it looks like a command (has colon)
627
+ if ':' in input_str:
628
+ return "command"
629
+
630
+ # Single-token alias that maps to known subcommand (e.g., review:codebase)
631
+ if resolve_subcommand(input_str):
632
+ return "command"
633
+
634
+ return "search"
635
+
636
+
637
+ def show_overview(data: dict, prefix: str) -> None:
638
+ """Display overview with quick start guide."""
639
+ emit_output_type("category-guide")
640
+
641
+ commands = data["commands"]
642
+ categories = data["categories"]
643
+ total = sum(len(cmds) for cmds in commands.values())
644
+ help_cmd = f"/{prefix}ck-help" if prefix else "/ck-help"
645
+
646
+ print("# ClaudeKit Skills")
647
+ print()
648
+ print(f"{total} skills across {len(categories)} categories.")
649
+ print()
650
+ print("**Quick Start:**")
651
+ print(f"- `/{prefix}cook` - Implement features (standalone)")
652
+ print(f"- `/{prefix}plan` + `/{prefix}cook` - Plan then execute")
653
+ print(f"- `/{prefix}test` - Run and analyze tests")
654
+ print()
655
+ print("**Common Workflows:**")
656
+ print(f"- New feature: `/{prefix}plan` → `/{prefix}cook` → `/{prefix}test`")
657
+ print(f"- Review: `/{prefix}code-review` → `/{prefix}watzup`")
658
+ print()
659
+ print("**Categories:**")
660
+ # Merge discovered command categories with skill-only categories from CATEGORY_GUIDES
661
+ all_cats = set(categories.keys()) | set(CATEGORY_GUIDES.keys())
662
+ # Exclude internal-only categories from overview
663
+ skip_cats = {"config", "coding-level", "notifications"}
664
+ for cat_key in sorted(all_cats - skip_cats):
665
+ count = len(commands.get(cat_key, []))
666
+ suffix = f" ({count})" if count > 0 else ""
667
+ print(f"- `{cat_key}`{suffix}")
668
+ print()
669
+ print("**Usage:**")
670
+ print(f"- `{help_cmd} <category>` - Category guide with workflow")
671
+ print(f"- `{help_cmd} <skill>` - Skill details")
672
+ print(f"- `{help_cmd} <task description>` - Recommendations")
673
+ print()
674
+ print("**Tips:**")
675
+ print(f"- Unclear about approach? → `/{prefix}brainstorm` first")
676
+ print(f"- Agent generated report? → `/{prefix}preview` to view")
677
+ print("- Add `ultrathink` for deep analysis (more tokens)")
678
+ print("- `--parallel` flag (e.g., `/plan --parallel`) = multi-agent, faster but more tokens")
679
+
680
+
681
+ def show_category_guide(data: dict, category: str, prefix: str) -> None:
682
+ """Display category guide with workflow and tips."""
683
+ emit_output_type("category-guide")
684
+
685
+ categories = data["categories"]
686
+ commands = data["commands"]
687
+
688
+ # Find matching category (case-insensitive) - check both discovered and CATEGORY_GUIDES
689
+ cat_key = None
690
+ category_lower = category.lower()
691
+
692
+ for key in categories:
693
+ if key.lower() == category_lower:
694
+ cat_key = key
695
+ break
696
+
697
+ # Also check CATEGORY_GUIDES for categories without discovered commands (worktree, kanban, etc.)
698
+ if not cat_key:
699
+ for key in CATEGORY_GUIDES.keys():
700
+ if key.lower() == category_lower:
701
+ cat_key = key
702
+ break
703
+
704
+ # Fuzzy match for typos (e.g., "notifcations" → "notifications")
705
+ if not cat_key:
706
+ all_categories = list(categories.keys()) + list(CATEGORY_GUIDES.keys())
707
+ for key in all_categories:
708
+ if fuzzy_match(category_lower, key.lower()):
709
+ cat_key = key
710
+ break
711
+
712
+ if not cat_key:
713
+ all_cats = set(categories.keys()) | set(CATEGORY_GUIDES.keys())
714
+ print(f"Category '{category}' not found.")
715
+ print()
716
+ print("Available: " + ", ".join(f"`{c}`" for c in sorted(all_cats)))
717
+ return
718
+
719
+ cmds = commands.get(cat_key, [])
720
+ guide = CATEGORY_GUIDES.get(cat_key, {})
721
+
722
+ print(f"# {guide.get('title', cat_key.title())}")
723
+ print()
724
+
725
+ # Workflow first (most important)
726
+ if "workflow" in guide:
727
+ print("**Workflow:**")
728
+ for step, cmd in guide["workflow"]:
729
+ print(f"- {step}: {cmd}")
730
+ print()
731
+
732
+ # Commands list (only if we have discovered commands for this category)
733
+ if cmds:
734
+ print("**Skills:**")
735
+ for cmd in cmds:
736
+ hint = cmd.get('argument_hint', '')
737
+ hint_suffix = f" `{hint}`" if hint else ""
738
+ print(f"- `{cmd['name']}`{hint_suffix} - {cmd['description']}")
739
+
740
+ # Tip at the end
741
+ if "tip" in guide:
742
+ print()
743
+ print(f"*Tip: {guide['tip']}*")
744
+
745
+
746
+ def show_command(data: dict, command: str, prefix: str) -> None:
747
+ """Display skill details."""
748
+ commands = data["commands"]
749
+
750
+ subcommand = resolve_subcommand(command)
751
+ if subcommand:
752
+ emit_output_type("command-details")
753
+ print(f"# `{subcommand['name']}`")
754
+ print()
755
+ print(subcommand["description"])
756
+ print()
757
+ print(f"**Category:** {subcommand['category']}")
758
+ print()
759
+ print(f"**Usage:** `{subcommand['usage']}`")
760
+ return
761
+
762
+ # Normalize search term
763
+ search = normalize_command_query(command).replace(":", "").replace("-", "").replace(" ", "")
764
+
765
+ found = None
766
+ for cmds in commands.values():
767
+ for cmd in cmds:
768
+ # Normalize skill name for comparison
769
+ name = normalize_command_query(cmd["name"]).replace("-", "").replace(" ", "")
770
+ if name == search:
771
+ found = cmd
772
+ break
773
+ if found:
774
+ break
775
+
776
+ if not found:
777
+ if ":" in command:
778
+ suggested = normalize_command_query(command.replace(":", " "))
779
+ if suggested in SUBCOMMAND_DETAILS:
780
+ print(f"Legacy ':' syntax detected. Try: `{suggested}`")
781
+ print()
782
+ do_search(data, command.replace(":", " "), prefix, emit_marker=True)
783
+ return
784
+
785
+ emit_output_type("command-details")
786
+ print(f"# `{found['name']}`")
787
+ print()
788
+ print(found['description'])
789
+ print()
790
+ print(f"**Category:** {found['category']}")
791
+
792
+ # Show argument hint if available
793
+ arg_hint = found.get('argument_hint', '')
794
+ if arg_hint:
795
+ print()
796
+ print(f"**Usage:** `{found['name']} {arg_hint}`")
797
+ else:
798
+ print()
799
+ print(f"**Usage:** `{found['name']} <your-input>`")
800
+
801
+ # Show related skills (same category)
802
+ cat = found['category']
803
+ if cat in commands:
804
+ related = [c for c in commands[cat] if c['name'] != found['name']][:3]
805
+ if related:
806
+ related_names = ", ".join(f"`{r['name']}`" for r in related)
807
+ print()
808
+ print(f"**Related:** {related_names}")
809
+
810
+
811
+ def do_search(data: dict, term: str, prefix: str, emit_marker: bool = True) -> None:
812
+ """Search commands by keyword."""
813
+ if emit_marker:
814
+ emit_output_type("search-results")
815
+
816
+ commands = data["commands"]
817
+ term_lower = term.lower()
818
+ matches = []
819
+
820
+ for cmds in commands.values():
821
+ for cmd in cmds:
822
+ if term_lower in cmd["name"].lower() or term_lower in cmd["description"].lower():
823
+ matches.append(cmd)
824
+
825
+ if not matches:
826
+ print(f"No skills found for '{term}'.")
827
+ print()
828
+ print("Try browsing categories: " + ", ".join(f"`{c}`" for c in sorted(data["categories"].keys())))
829
+ return
830
+
831
+ print(f"# Search: {term}")
832
+ print()
833
+ print(f"Found {len(matches)} matches:")
834
+ for cmd in matches[:8]:
835
+ hint = cmd.get('argument_hint', '')
836
+ hint_suffix = f" `{hint}`" if hint else ""
837
+ print(f"- `{cmd['name']}`{hint_suffix} - {cmd['description']}")
838
+
839
+
840
+ def format_disambiguation(task: str, candidates: list) -> None:
841
+ """Output disambiguation prompt for close-scoring categories."""
842
+ print(f"# Clarify: {task}")
843
+ print()
844
+ print("Your query matches multiple categories. Which did you mean?")
845
+ print()
846
+
847
+ for i, (cat, score) in enumerate(candidates[:3], 1):
848
+ guide = CATEGORY_GUIDES.get(cat, {})
849
+ title = guide.get("title", cat.title())
850
+ # Show first workflow step as example
851
+ example = ""
852
+ if "workflow" in guide and guide["workflow"]:
853
+ example = f" (e.g., {guide['workflow'][0][1]})"
854
+ print(f"{i}. **{title}**{example}")
855
+
856
+ print()
857
+ print("*Reply with the number or rephrase your question.*")
858
+
859
+
860
+ def recommend_task(data: dict, task: str, prefix: str) -> None:
861
+ """Recommend commands for a task description."""
862
+ emit_output_type("task-recommendations")
863
+
864
+ commands = data["commands"]
865
+
866
+ # Expand synonyms first, then lowercase
867
+ task_expanded = expand_synonyms(task)
868
+ task_lower = task_expanded
869
+ words = task_lower.split()
870
+
871
+ # Action verbs that indicate primary intent when at sentence start
872
+ # These get BONUS weight when they appear first (imperative sentences)
873
+ # NOTE: Excluded contextual words like "setup", "add" that often precede subjects
874
+ ACTION_VERBS = {
875
+ "fix", "debug", "test", "commit", "push", "merge", "pull", "create",
876
+ "build", "implement", "write", "make", "deploy", "run",
877
+ "configure", "install", "update", "upgrade", "delete", "remove",
878
+ "review", "check", "verify", "validate", "find", "search", "locate",
879
+ "plan", "design", "refactor", "optimize", "document", "explain",
880
+ }
881
+
882
+ # Check if first word is an action verb
883
+ first_word_is_action = words[0] in ACTION_VERBS if words else False
884
+
885
+ # Score categories by keyword matches with smart weighting
886
+ scores = {}
887
+ for cat, keywords in TASK_MAPPINGS.items():
888
+ score = 0.0
889
+ for kw in keywords:
890
+ # Multi-word keywords: exact substring match, high weight
891
+ if ' ' in kw:
892
+ if kw in task_lower:
893
+ score += 3.0
894
+ # Single-word keywords: exact match first, then fuzzy fallback
895
+ else:
896
+ matched_pos = -1
897
+ is_fuzzy = False
898
+
899
+ # Try exact match first
900
+ match = re.search(r'\b' + re.escape(kw) + r'\b', task_lower)
901
+ if match:
902
+ # Find word position from character position
903
+ char_count = 0
904
+ for i, word in enumerate(words):
905
+ if char_count <= match.start() < char_count + len(word):
906
+ matched_pos = i
907
+ break
908
+ char_count += len(word) + 1
909
+ else:
910
+ # Fuzzy matching fallback for typos
911
+ for i, word in enumerate(words):
912
+ if fuzzy_match(word, kw):
913
+ matched_pos = i
914
+ is_fuzzy = True
915
+ break
916
+
917
+ if matched_pos >= 0:
918
+ # Smart weighting based on sentence structure
919
+ if len(words) > 1:
920
+ if first_word_is_action and matched_pos == 0:
921
+ weight = 2.5
922
+ elif first_word_is_action:
923
+ weight = 1.0
924
+ else:
925
+ weight = 1.0 + (matched_pos / (len(words) - 1))
926
+ else:
927
+ weight = 2.0
928
+
929
+ # Slight penalty for fuzzy matches (0.8x)
930
+ if is_fuzzy:
931
+ weight *= 0.8
932
+
933
+ score += weight
934
+ if score > 0:
935
+ scores[cat] = score
936
+
937
+ if not scores:
938
+ print(f"Not sure about: {task}")
939
+ print()
940
+ print("Try being more specific, or browse categories: " + ", ".join(f"`{c}`" for c in sorted(data["categories"].keys())))
941
+ return
942
+
943
+ sorted_cats = sorted(scores.items(), key=lambda x: -x[1])
944
+
945
+ # Check for ambiguity - if top 2 scores are close, ask user to clarify
946
+ if len(sorted_cats) >= 2:
947
+ top_score = sorted_cats[0][1]
948
+ second_score = sorted_cats[1][1]
949
+
950
+ # If scores too close, disambiguate
951
+ if top_score - second_score < DISAMBIGUATION_THRESHOLD and top_score > 0:
952
+ format_disambiguation(task, sorted_cats[:3])
953
+ return
954
+
955
+ top_cat = sorted_cats[0][0]
956
+ guide = CATEGORY_GUIDES.get(top_cat, {})
957
+
958
+ print(f"# Recommended for: {task}")
959
+ print()
960
+
961
+ # Show workflow first (most actionable)
962
+ if "workflow" in guide:
963
+ print("**Workflow:**")
964
+ for step, cmd in guide["workflow"][:3]:
965
+ print(f"- {step}: {cmd}")
966
+ print()
967
+
968
+ # Show relevant commands - only from top matched category
969
+ # Avoid showing unrelated commands from secondary matches
970
+ if top_cat in commands and commands[top_cat]:
971
+ print("**Skills:**")
972
+ for cmd in commands[top_cat][:4]:
973
+ hint = cmd.get('argument_hint', '')
974
+ hint_suffix = f" `{hint}`" if hint else ""
975
+ print(f"- `{cmd['name']}`{hint_suffix} - {cmd['description']}")
976
+
977
+ if "tip" in guide:
978
+ print()
979
+ print(f"*Tip: {guide['tip']}*")
980
+
981
+
982
+ def show_config_guide() -> None:
983
+ """Display comprehensive .ck.json configuration guide."""
984
+ emit_output_type("comprehensive-docs")
985
+
986
+ print("# ClaudeKit Configuration (.ck.json)")
987
+ print()
988
+ print("**Locations (cascading resolution):**")
989
+ print("- Global: `~/.claude/.ck.json` (user preferences)")
990
+ print("- Local: `./.claude/.ck.json` (project overrides)")
991
+ print()
992
+ print("**Resolution Order:** `DEFAULT → global → local`")
993
+ print("- Global config sets user defaults")
994
+ print("- Local config overrides for specific projects")
995
+ print("- Deep merge: nested objects merge recursively")
996
+ print()
997
+ print("**Purpose:** Customize plan naming, paths, locale, and hook behavior.")
998
+ print()
999
+ print("---")
1000
+ print()
1001
+ print("## Quick Start")
1002
+ print()
1003
+ print("**Global config** (`~/.claude/.ck.json`) - your preferences:")
1004
+ print("```json")
1005
+ print('{')
1006
+ print(' "locale": {')
1007
+ print(' "thinkingLanguage": "en",')
1008
+ print(' "responseLanguage": "vi"')
1009
+ print(' },')
1010
+ print(' "plan": { "issuePrefix": "GH-" }')
1011
+ print('}')
1012
+ print("```")
1013
+ print()
1014
+ print("**Local override** (`./.claude/.ck.json`) - project-specific:")
1015
+ print("```json")
1016
+ print('{')
1017
+ print(' "plan": { "issuePrefix": "JIRA-" },')
1018
+ print(' "paths": { "docs": "documentation" }')
1019
+ print('}')
1020
+ print("```")
1021
+ print()
1022
+ print("---")
1023
+ print()
1024
+ print("## Full Schema")
1025
+ print()
1026
+ print("```json")
1027
+ print('{')
1028
+ print(' "plan": {')
1029
+ print(' "namingFormat": "{date}-{issue}-{slug}", // Plan folder naming')
1030
+ print(' "dateFormat": "YYMMDD-HHmm", // Date format in names')
1031
+ print(' "issuePrefix": "GH-", // Issue ID prefix (null = #)')
1032
+ print(' "reportsDir": "reports", // Reports subfolder')
1033
+ print(' "resolution": {')
1034
+ print(' "order": ["session", "branch"], // Resolution chain')
1035
+ print(' "branchPattern": "(?:feat|fix|...)/.+" // Branch slug regex')
1036
+ print(' },')
1037
+ print(' "validation": {')
1038
+ print(' "mode": "prompt", // "auto" | "prompt" | "off"')
1039
+ print(' "minQuestions": 3, // Min questions to ask')
1040
+ print(' "maxQuestions": 8, // Max questions to ask')
1041
+ print(' "focusAreas": ["assumptions", "risks", "tradeoffs", "architecture"]')
1042
+ print(' }')
1043
+ print(' },')
1044
+ print(' "paths": {')
1045
+ print(' "docs": "docs", // Documentation directory')
1046
+ print(' "plans": "plans" // Plans directory')
1047
+ print(' },')
1048
+ print(' "locale": {')
1049
+ print(' "thinkingLanguage": null, // Language for reasoning ("en" recommended)')
1050
+ print(' "responseLanguage": null // Language for output ("vi", "fr", etc.)')
1051
+ print(' },')
1052
+ print(' "trust": {')
1053
+ print(' "passphrase": null, // Secret for testing context injection')
1054
+ print(' "enabled": false // Enable trust verification')
1055
+ print(' },')
1056
+ print(' "project": {')
1057
+ print(' "type": "auto", // "monorepo", "single-repo", "auto"')
1058
+ print(' "packageManager": "auto", // "npm", "pnpm", "yarn", "auto"')
1059
+ print(' "framework": "auto" // "next", "react", "vue", "auto"')
1060
+ print(' },')
1061
+ print(' "codingLevel": -1 // Adaptive communication (-1 to 5)')
1062
+ print('}')
1063
+ print("```")
1064
+ print()
1065
+ print("---")
1066
+ print()
1067
+ print("## Key Concepts")
1068
+ print()
1069
+ print("**Plan Resolution Chain:**")
1070
+ print("1. `session` - Check session temp file for active plan")
1071
+ print("2. `branch` - Match git branch slug to plan folder")
1072
+ print()
1073
+ print("**Naming Format Variables:**")
1074
+ print("- `{date}` - Formatted date (per dateFormat)")
1075
+ print("- `{issue}` - Issue ID with prefix")
1076
+ print("- `{slug}` - Descriptive slug from branch or input")
1077
+ print()
1078
+ print("**Language Settings:**")
1079
+ print("- `thinkingLanguage` - Language for internal reasoning (\"en\" recommended)")
1080
+ print("- `responseLanguage` - Language for user-facing output (\"vi\", \"fr\", etc.)")
1081
+ print()
1082
+ print("When both are set, Claude thinks in one language but responds in another.")
1083
+ print("This improves precision (English) while maintaining natural output (your language).")
1084
+ print()
1085
+ print("**Plan Validation:**")
1086
+ print("- `mode: \"prompt\"` - Ask user after plan creation (default)")
1087
+ print("- `mode: \"auto\"` - Always run validation interview")
1088
+ print("- `mode: \"off\"` - Skip; user runs `/plan validate` manually")
1089
+ print()
1090
+ print("Validation interviews the user with critical questions to confirm")
1091
+ print("assumptions, risks, and architectural decisions before implementation.")
1092
+ print()
1093
+ print("**Coding Level (Adaptive Communication):**")
1094
+ print("- `-1` = Disabled (default) - no injection, saves tokens")
1095
+ print("- `0` = ELI5 - analogies, baby steps, check-ins")
1096
+ print("- `1` = Junior - WHY before HOW, pitfalls, takeaways")
1097
+ print("- `2` = Mid-Level - patterns, trade-offs, scalability")
1098
+ print("- `3` = Senior - trade-offs table, production code, ops")
1099
+ print("- `4` = Tech Lead - executive summary, risk matrix, business impact")
1100
+ print("- `5` = God Mode - code first, minimal prose, no hand-holding")
1101
+ print()
1102
+ print("Guidelines auto-inject on session start. Commands like `/brainstorm` respect them.")
1103
+ print()
1104
+ print("---")
1105
+ print()
1106
+ print("## Edge Cases & Validation")
1107
+ print()
1108
+ print("**Path Handling:**")
1109
+ print("- Trailing slashes normalized (`plans/` → `plans`)")
1110
+ print("- Empty/whitespace-only paths fall back to defaults")
1111
+ print("- Absolute paths supported (e.g., `/home/user/all-plans`)")
1112
+ print("- Path traversal (`../`) blocked for relative paths")
1113
+ print("- Null bytes and control chars rejected")
1114
+ print()
1115
+ print("**Slug Sanitization:**")
1116
+ print("- Invalid filename chars removed: `< > : \" / \\ | ? *`")
1117
+ print("- Non-alphanumeric replaced with hyphen")
1118
+ print("- Multiple hyphens collapsed: `foo---bar` → `foo-bar`")
1119
+ print("- Leading/trailing hyphens removed")
1120
+ print("- Max 100 chars to prevent filesystem issues")
1121
+ print()
1122
+ print("**Naming Pattern Validation:**")
1123
+ print("- Pattern must contain `{slug}` placeholder")
1124
+ print("- Result must be non-empty after variable substitution")
1125
+ print("- Unresolved placeholders (except `{slug}`) trigger error")
1126
+ print("- Malformed JSON config falls back to defaults")
1127
+ print()
1128
+ print("**Consolidated Plans (advanced):**")
1129
+ print("```json")
1130
+ print('{')
1131
+ print(' "paths": {')
1132
+ print(' "plans": "/home/user/all-my-plans"')
1133
+ print(' }')
1134
+ print('}')
1135
+ print("```")
1136
+ print("Absolute paths allow storing all plans in one location across projects.")
1137
+ print()
1138
+ print("---")
1139
+ print()
1140
+ print("## Examples")
1141
+ print()
1142
+ print("**Global install user (fresh directories work):**")
1143
+ print("```bash")
1144
+ print("# ~/.claude/.ck.json - applies everywhere")
1145
+ print("cd /tmp/new-project && claude # Uses global config")
1146
+ print("```")
1147
+ print()
1148
+ print("**Project with local override:**")
1149
+ print("```bash")
1150
+ print("# Global: issuePrefix = \"GH-\"")
1151
+ print("# Local (.claude/.ck.json): issuePrefix = \"JIRA-\"")
1152
+ print("# Result: issuePrefix = \"JIRA-\" (local wins)")
1153
+ print("```")
1154
+ print()
1155
+ print("**Deep merge behavior:**")
1156
+ print("```")
1157
+ print("Global: { plan: { issuePrefix: \"GH-\", dateFormat: \"YYMMDD\" } }")
1158
+ print("Local: { plan: { issuePrefix: \"JIRA-\" } }")
1159
+ print("Result: { plan: { issuePrefix: \"JIRA-\", dateFormat: \"YYMMDD\" } }")
1160
+ print("```")
1161
+ print()
1162
+ print("*Tip: Config is optional - all fields have sensible defaults.*")
1163
+
1164
+
1165
+ def show_coding_level_guide() -> None:
1166
+ """Display comprehensive codingLevel configuration guide."""
1167
+ emit_output_type("comprehensive-docs")
1168
+
1169
+ print("# Coding Level (Adaptive Communication)")
1170
+ print()
1171
+ print("Adjusts Claude's communication style based on user's experience level.")
1172
+ print("Guidelines auto-inject on SessionStart. Commands respect them.")
1173
+ print()
1174
+ print("---")
1175
+ print()
1176
+ print("## Levels")
1177
+ print()
1178
+ print("| Level | Name | Description |")
1179
+ print("|-------|------|-------------|")
1180
+ print("| **-1** | **Disabled** | Default - no injection, saves tokens |")
1181
+ print("| 0 | ELI5 | Zero experience - analogies, baby steps, check-ins |")
1182
+ print("| 1 | Junior | 0-2 years - WHY before HOW, pitfalls, takeaways |")
1183
+ print("| 2 | Mid-Level | 3-5 years - patterns, trade-offs, scalability |")
1184
+ print("| 3 | Senior | 5-8 years - trade-offs table, production code, ops |")
1185
+ print("| 4 | Tech Lead | 8-15 years - executive summary, risk matrix, strategy |")
1186
+ print("| 5 | God Mode | 15+ years - code first, minimal prose, no fluff |")
1187
+ print()
1188
+ print("---")
1189
+ print()
1190
+ print("## Configuration")
1191
+ print()
1192
+ print("**Set in `.ck.json`:**")
1193
+ print("```json")
1194
+ print('{')
1195
+ print(' "codingLevel": 0')
1196
+ print('}')
1197
+ print("```")
1198
+ print()
1199
+ print("**Location (cascading):**")
1200
+ print("- Global: `~/.claude/.ck.json` - personal preference")
1201
+ print("- Local: `./.claude/.ck.json` - project override")
1202
+ print()
1203
+ print("---")
1204
+ print()
1205
+ print("## How It Works")
1206
+ print()
1207
+ print("1. SessionStart hook reads `codingLevel` from `.ck.json`")
1208
+ print("2. If 0-5, injects guidelines from `.claude/output-styles/coding-level-*.md`")
1209
+ print("3. Commands like `/brainstorm` follow the injected guidelines")
1210
+ print()
1211
+ print("**Token Efficiency:**")
1212
+ print("- `-1` (default): Zero injection, zero overhead")
1213
+ print("- `0-5`: Only selected level's guidelines injected (not all)")
1214
+ print()
1215
+ print("---")
1216
+ print()
1217
+ print("## Level Details")
1218
+ print()
1219
+ print("### Level 0 (ELI5)")
1220
+ print("- **MUST** use real-world analogies (labeled boxes, recipes)")
1221
+ print("- **MUST** define every technical term")
1222
+ print("- **MUST** use \"we\" language")
1223
+ print("- **MUST** end with check-in: \"Does this make sense?\"")
1224
+ print("- **MUST** comment every line of code")
1225
+ print("- Structure: Big Picture → Analogy → Baby Steps → Try It → Check-In")
1226
+ print()
1227
+ print("### Level 1 (Junior)")
1228
+ print("- Explain WHY before HOW")
1229
+ print("- Define technical terms on first use")
1230
+ print("- Include common pitfalls section")
1231
+ print("- Add Key Takeaways and Learn More links")
1232
+ print("- Structure: Context → Approach → Implementation → Pitfalls → Takeaways")
1233
+ print()
1234
+ print("### Level 2 (Mid-Level)")
1235
+ print("- Discuss design patterns and when to use them")
1236
+ print("- Highlight trade-offs explicitly")
1237
+ print("- Consider scalability implications")
1238
+ print("- Reference patterns by name")
1239
+ print("- Structure: Approach → Design → Implementation → Edge Cases")
1240
+ print()
1241
+ print("### Level 3 (Senior)")
1242
+ print("- Lead with trade-offs table")
1243
+ print("- Show production-ready code")
1244
+ print("- Discuss operational concerns (monitoring, logging)")
1245
+ print("- Flag security implications")
1246
+ print("- **NEVER** explain basic concepts")
1247
+ print("- Structure: Trade-offs → Implementation → Ops → Security")
1248
+ print()
1249
+ print("### Level 4 (Tech Lead)")
1250
+ print("- Executive summary first (3-4 sentences)")
1251
+ print("- Risk assessment matrix (Likelihood × Impact)")
1252
+ print("- Strategic options comparison")
1253
+ print("- Business impact analysis")
1254
+ print("- Identify decisions needing stakeholder alignment")
1255
+ print("- Structure: Summary → Risks → Options → Approach → Business Impact")
1256
+ print()
1257
+ print("### Level 5 (God Mode)")
1258
+ print("- Answer exactly what was asked, nothing more")
1259
+ print("- Code first, minimal prose")
1260
+ print("- No explanations unless asked")
1261
+ print("- **NEVER** use filler phrases")
1262
+ print("- Trust their judgment completely")
1263
+ print()
1264
+ print("---")
1265
+ print()
1266
+ print("## Customization")
1267
+ print()
1268
+ print("Guidelines live in `.claude/output-styles/coding-level-*.md`")
1269
+ print("Edit these files directly to customize behavior per level.")
1270
+ print()
1271
+ print("*Tip: Use `-1` (disabled) unless you're teaching or want guided explanations.*")
1272
+
1273
+
1274
+ def main():
1275
+ # Find .claude/skills directory
1276
+ script_path = Path(__file__).resolve()
1277
+ # .claude/skills/ck-help/scripts/ck-help.py -> .claude/skills
1278
+ skills_dir = script_path.parent.parent.parent
1279
+
1280
+ if not skills_dir.exists():
1281
+ print("Error: .claude/skills/ directory not found.")
1282
+ sys.exit(1)
1283
+
1284
+ # Discover skills from SKILL.md files
1285
+ data = discover_skills(skills_dir)
1286
+
1287
+ if not data["commands"]:
1288
+ print("No skills found in .claude/skills/")
1289
+ sys.exit(1)
1290
+
1291
+ # Parse input
1292
+ args = sys.argv[1:]
1293
+ input_str = " ".join(args).strip()
1294
+
1295
+ # Special case: config documentation (not a command category)
1296
+ if input_str.lower() in ["config", "configuration", ".ck.json", "ck.json"]:
1297
+ show_config_guide()
1298
+ return
1299
+
1300
+ # Special case: coding level documentation
1301
+ if input_str.lower() in ["coding-level", "codinglevel", "coding level", "level", "eli5", "god mode"]:
1302
+ show_coding_level_guide()
1303
+ return
1304
+
1305
+ # Detect intent and route
1306
+ intent = detect_intent(input_str, list(data["categories"].keys()))
1307
+
1308
+ if intent == "overview":
1309
+ show_overview(data, "")
1310
+ elif intent == "category":
1311
+ show_category_guide(data, input_str, "")
1312
+ elif intent == "command":
1313
+ show_command(data, input_str, "")
1314
+ elif intent == "task":
1315
+ recommend_task(data, input_str, "")
1316
+ else:
1317
+ do_search(data, input_str, "")
1318
+
1319
+
1320
+ if __name__ == "__main__":
1321
+ main()