nemonix-cli 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 (281) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +186 -0
  3. package/dist/cli.js +6870 -0
  4. package/package.json +48 -0
  5. package/src/config/claude-code-config/.claude/commands/setup-tmux.md +0 -0
  6. package/src/config/claude-code-config/CHANGELOG.md +261 -0
  7. package/src/config/claude-code-config/README.md +1 -0
  8. package/src/config/claude-code-config/agents/action.md +36 -0
  9. package/src/config/claude-code-config/agents/clean-code-runner.md +61 -0
  10. package/src/config/claude-code-config/agents/code-reviewer.md +172 -0
  11. package/src/config/claude-code-config/agents/code-simplifier.md +49 -0
  12. package/src/config/claude-code-config/agents/explore-codebase.md +65 -0
  13. package/src/config/claude-code-config/agents/explore-docs.md +65 -0
  14. package/src/config/claude-code-config/agents/explore-fast.md +22 -0
  15. package/src/config/claude-code-config/agents/implementer.md +181 -0
  16. package/src/config/claude-code-config/agents/snipper.md +36 -0
  17. package/src/config/claude-code-config/agents/websearch.md +42 -0
  18. package/src/config/claude-code-config/commands/prompts/create-vitejs-app.md +272 -0
  19. package/src/config/claude-code-config/commands/prompts/nextjs-add-prisma-db.md +136 -0
  20. package/src/config/claude-code-config/commands/prompts/nextjs-setup-better-auth.md +173 -0
  21. package/src/config/claude-code-config/commands/prompts/nextjs-setup-project.md +200 -0
  22. package/src/config/claude-code-config/commands/prompts/prompt.md +55 -0
  23. package/src/config/claude-code-config/commands/prompts/saas-challenge-idea.md +135 -0
  24. package/src/config/claude-code-config/commands/prompts/saas-create-architecture.md +242 -0
  25. package/src/config/claude-code-config/commands/prompts/saas-create-headline.md +132 -0
  26. package/src/config/claude-code-config/commands/prompts/saas-create-landing-copywritting.md +267 -0
  27. package/src/config/claude-code-config/commands/prompts/saas-create-legals-docs.md +176 -0
  28. package/src/config/claude-code-config/commands/prompts/saas-create-logos.md +240 -0
  29. package/src/config/claude-code-config/commands/prompts/saas-create-prd.md +195 -0
  30. package/src/config/claude-code-config/commands/prompts/saas-create-tasks.md +240 -0
  31. package/src/config/claude-code-config/commands/prompts/saas-define-pricing.md +293 -0
  32. package/src/config/claude-code-config/commands/prompts/saas-find-domain-name.md +190 -0
  33. package/src/config/claude-code-config/commands/prompts/saas-implement-landing-page.md +257 -0
  34. package/src/config/claude-code-config/commands/prompts/setup-tmux.md +160 -0
  35. package/src/config/claude-code-config/commands/prompts/tools.md +148 -0
  36. package/src/config/claude-code-config/hooks/hook-post-file.ts +162 -0
  37. package/src/config/claude-code-config/scripts/.claude/skills/fix-on-my-computer/SKILL.md +81 -0
  38. package/src/config/claude-code-config/scripts/CLAUDE.md +50 -0
  39. package/src/config/claude-code-config/scripts/auto-rename-session/CLAUDE.md +59 -0
  40. package/src/config/claude-code-config/scripts/auto-rename-session/__tests__/shared.test.ts +185 -0
  41. package/src/config/claude-code-config/scripts/auto-rename-session/__tests__/title-generation.test.ts +44 -0
  42. package/src/config/claude-code-config/scripts/auto-rename-session/fixtures/sample-transcript.jsonl +3 -0
  43. package/src/config/claude-code-config/scripts/auto-rename-session/fixtures/transcript-short-message.jsonl +2 -0
  44. package/src/config/claude-code-config/scripts/auto-rename-session/fixtures/transcript-with-title.jsonl +3 -0
  45. package/src/config/claude-code-config/scripts/auto-rename-session/src/index.ts +113 -0
  46. package/src/config/claude-code-config/scripts/auto-rename-session/src/rename-all.ts +148 -0
  47. package/src/config/claude-code-config/scripts/auto-rename-session/src/shared.ts +157 -0
  48. package/src/config/claude-code-config/scripts/auto-rename-session/src/worker.ts +58 -0
  49. package/src/config/claude-code-config/scripts/biome.json +37 -0
  50. package/src/config/claude-code-config/scripts/claude-code-ai/CLAUDE.md +84 -0
  51. package/src/config/claude-code-config/scripts/claude-code-ai/__tests__/claude.test.ts +19 -0
  52. package/src/config/claude-code-config/scripts/claude-code-ai/__tests__/paths.test.ts +68 -0
  53. package/src/config/claude-code-config/scripts/claude-code-ai/claude.ts +56 -0
  54. package/src/config/claude-code-config/scripts/claude-code-ai/cli.ts +46 -0
  55. package/src/config/claude-code-config/scripts/claude-code-ai/helper/credentials.ts +76 -0
  56. package/src/config/claude-code-config/scripts/claude-code-ai/helper/index.ts +9 -0
  57. package/src/config/claude-code-config/scripts/claude-code-ai/helper/paths.ts +51 -0
  58. package/src/config/claude-code-config/scripts/command-validator/CLAUDE.md +112 -0
  59. package/src/config/claude-code-config/scripts/command-validator/README.md +147 -0
  60. package/src/config/claude-code-config/scripts/command-validator/src/__tests__/validator.test.ts +99 -0
  61. package/src/config/claude-code-config/scripts/command-validator/src/cli.ts +121 -0
  62. package/src/config/claude-code-config/scripts/command-validator/src/lib/security-rules.ts +174 -0
  63. package/src/config/claude-code-config/scripts/command-validator/src/lib/types.ts +34 -0
  64. package/src/config/claude-code-config/scripts/command-validator/src/lib/validator.ts +90 -0
  65. package/src/config/claude-code-config/scripts/package.json +43 -0
  66. package/src/config/claude-code-config/scripts/statusline/CLAUDE.md +205 -0
  67. package/src/config/claude-code-config/scripts/statusline/README.md +193 -0
  68. package/src/config/claude-code-config/scripts/statusline/__tests__/context.test.ts +229 -0
  69. package/src/config/claude-code-config/scripts/statusline/__tests__/formatters.test.ts +108 -0
  70. package/src/config/claude-code-config/scripts/statusline/__tests__/statusline.test.ts +309 -0
  71. package/src/config/claude-code-config/scripts/statusline/data/.gitkeep +0 -0
  72. package/src/config/claude-code-config/scripts/statusline/defaults.json +82 -0
  73. package/src/config/claude-code-config/scripts/statusline/docs/ARCHITECTURE.md +166 -0
  74. package/src/config/claude-code-config/scripts/statusline/fixtures/mock-transcript.jsonl +4 -0
  75. package/src/config/claude-code-config/scripts/statusline/fixtures/test-input.json +35 -0
  76. package/src/config/claude-code-config/scripts/statusline/src/analyze-daily-usage.ts +151 -0
  77. package/src/config/claude-code-config/scripts/statusline/src/commands/interactive-config.ts +515 -0
  78. package/src/config/claude-code-config/scripts/statusline/src/debug-payloads.ts +195 -0
  79. package/src/config/claude-code-config/scripts/statusline/src/index.ts +224 -0
  80. package/src/config/claude-code-config/scripts/statusline/src/lib/config-types.ts +110 -0
  81. package/src/config/claude-code-config/scripts/statusline/src/lib/config.ts +21 -0
  82. package/src/config/claude-code-config/scripts/statusline/src/lib/context.ts +103 -0
  83. package/src/config/claude-code-config/scripts/statusline/src/lib/features/limits/commands/weekly-analysis.ts +108 -0
  84. package/src/config/claude-code-config/scripts/statusline/src/lib/features/limits/index.ts +111 -0
  85. package/src/config/claude-code-config/scripts/statusline/src/lib/features/limits/types.ts +15 -0
  86. package/src/config/claude-code-config/scripts/statusline/src/lib/features/spend/commands/migrate-to-sqlite.ts +136 -0
  87. package/src/config/claude-code-config/scripts/statusline/src/lib/features/spend/commands/spend-day.ts +79 -0
  88. package/src/config/claude-code-config/scripts/statusline/src/lib/features/spend/commands/spend-month.ts +66 -0
  89. package/src/config/claude-code-config/scripts/statusline/src/lib/features/spend/commands/spend-project.ts +85 -0
  90. package/src/config/claude-code-config/scripts/statusline/src/lib/features/spend/database.ts +395 -0
  91. package/src/config/claude-code-config/scripts/statusline/src/lib/features/spend/index.ts +178 -0
  92. package/src/config/claude-code-config/scripts/statusline/src/lib/features/spend/payload-logger.ts +161 -0
  93. package/src/config/claude-code-config/scripts/statusline/src/lib/features/spend/types.ts +37 -0
  94. package/src/config/claude-code-config/scripts/statusline/src/lib/formatters.ts +426 -0
  95. package/src/config/claude-code-config/scripts/statusline/src/lib/git.ts +100 -0
  96. package/src/config/claude-code-config/scripts/statusline/src/lib/menu-factories.ts +224 -0
  97. package/src/config/claude-code-config/scripts/statusline/src/lib/presets.ts +177 -0
  98. package/src/config/claude-code-config/scripts/statusline/src/lib/render-pure.ts +516 -0
  99. package/src/config/claude-code-config/scripts/statusline/src/lib/types.ts +36 -0
  100. package/src/config/claude-code-config/scripts/statusline/src/lib/utils.ts +15 -0
  101. package/src/config/claude-code-config/scripts/statusline/src/stats.ts +119 -0
  102. package/src/config/claude-code-config/scripts/statusline/src/tests/spend-v2.test.ts +377 -0
  103. package/src/config/claude-code-config/scripts/statusline/src/tools/fixed-cost-calc.ts +317 -0
  104. package/src/config/claude-code-config/scripts/statusline/statusline.config.free.json +79 -0
  105. package/src/config/claude-code-config/scripts/statusline/statusline.config.json +100 -0
  106. package/src/config/claude-code-config/scripts/statusline/test-with-fixtures.ts +37 -0
  107. package/src/config/claude-code-config/scripts/statusline/test.ts +20 -0
  108. package/src/config/claude-code-config/scripts/statusline/tsconfig.json +27 -0
  109. package/src/config/claude-code-config/scripts/tsconfig.json +27 -0
  110. package/src/config/claude-code-config/settings.json +92 -0
  111. package/src/config/claude-code-config/skills/aibuilder-create-saas/SKILL.md +176 -0
  112. package/src/config/claude-code-config/skills/aibuilder-create-saas/references/architecture-template.md +436 -0
  113. package/src/config/claude-code-config/skills/aibuilder-create-saas/references/challenge-framework.md +289 -0
  114. package/src/config/claude-code-config/skills/aibuilder-create-saas/references/discovery-framework.md +338 -0
  115. package/src/config/claude-code-config/skills/aibuilder-create-saas/references/prd-template.md +452 -0
  116. package/src/config/claude-code-config/skills/aibuilder-create-saas/references/task-template.md +263 -0
  117. package/src/config/claude-code-config/skills/aibuilder-create-saas/references/tools.md +132 -0
  118. package/src/config/claude-code-config/skills/aibuilder-create-saas/scripts/rename-project.sh +42 -0
  119. package/src/config/claude-code-config/skills/aibuilder-create-saas/scripts/setup.sh +104 -0
  120. package/src/config/claude-code-config/skills/aibuilder-create-saas/steps/step-00-init.md +174 -0
  121. package/src/config/claude-code-config/skills/aibuilder-create-saas/steps/step-01-discovery.md +342 -0
  122. package/src/config/claude-code-config/skills/aibuilder-create-saas/steps/step-02-brainstorm.md +230 -0
  123. package/src/config/claude-code-config/skills/aibuilder-create-saas/steps/step-03-validate.md +372 -0
  124. package/src/config/claude-code-config/skills/aibuilder-create-saas/steps/step-04-prd.md +364 -0
  125. package/src/config/claude-code-config/skills/aibuilder-create-saas/steps/step-05-architecture.md +904 -0
  126. package/src/config/claude-code-config/skills/aibuilder-create-saas/steps/step-06-tasks.md +446 -0
  127. package/src/config/claude-code-config/skills/explore/SKILL.md +119 -0
  128. package/src/config/claude-code-config/skills/frontend-design/LICENSE.txt +177 -0
  129. package/src/config/claude-code-config/skills/frontend-design/SKILL.md +42 -0
  130. package/src/config/claude-code-config/skills/git-commit/SKILL.md +42 -0
  131. package/src/config/claude-code-config/skills/git-create-pr/SKILL.md +53 -0
  132. package/src/config/claude-code-config/skills/git-fix-pr-comments/SKILL.md +51 -0
  133. package/src/config/claude-code-config/skills/git-merge/SKILL.md +68 -0
  134. package/src/config/claude-code-config/skills/marketing-copywriting/SKILL.md +72 -0
  135. package/src/config/claude-code-config/skills/meta-claude-memory/SKILL.md +694 -0
  136. package/src/config/claude-code-config/skills/meta-claude-memory/references/comprehensive-example.md +175 -0
  137. package/src/config/claude-code-config/skills/meta-claude-memory/references/project-patterns.md +334 -0
  138. package/src/config/claude-code-config/skills/meta-claude-memory/references/prompting-techniques.md +411 -0
  139. package/src/config/claude-code-config/skills/meta-claude-memory/references/rules-directory-guide.md +298 -0
  140. package/src/config/claude-code-config/skills/meta-claude-memory/references/section-templates.md +347 -0
  141. package/src/config/claude-code-config/skills/meta-hooks-creator/SKILL.md +357 -0
  142. package/src/config/claude-code-config/skills/meta-hooks-creator/references/command-vs-prompt.md +287 -0
  143. package/src/config/claude-code-config/skills/meta-hooks-creator/references/examples.md +689 -0
  144. package/src/config/claude-code-config/skills/meta-hooks-creator/references/hook-types.md +495 -0
  145. package/src/config/claude-code-config/skills/meta-hooks-creator/references/input-output-schemas.md +503 -0
  146. package/src/config/claude-code-config/skills/meta-hooks-creator/references/matchers.md +517 -0
  147. package/src/config/claude-code-config/skills/meta-hooks-creator/references/troubleshooting.md +653 -0
  148. package/src/config/claude-code-config/skills/meta-prompt-creator/SKILL.md +285 -0
  149. package/src/config/claude-code-config/skills/meta-prompt-creator/references/anthropic-best-practices.md +126 -0
  150. package/src/config/claude-code-config/skills/meta-prompt-creator/references/anti-patterns.md +57 -0
  151. package/src/config/claude-code-config/skills/meta-prompt-creator/references/clarity-principles.md +54 -0
  152. package/src/config/claude-code-config/skills/meta-prompt-creator/references/context-management.md +389 -0
  153. package/src/config/claude-code-config/skills/meta-prompt-creator/references/few-shot-patterns.md +47 -0
  154. package/src/config/claude-code-config/skills/meta-prompt-creator/references/openai-best-practices.md +50 -0
  155. package/src/config/claude-code-config/skills/meta-prompt-creator/references/prompt-templates.md +110 -0
  156. package/src/config/claude-code-config/skills/meta-prompt-creator/references/reasoning-techniques.md +52 -0
  157. package/src/config/claude-code-config/skills/meta-prompt-creator/references/system-prompt-patterns.md +48 -0
  158. package/src/config/claude-code-config/skills/meta-prompt-creator/references/xml-structure.md +36 -0
  159. package/src/config/claude-code-config/skills/meta-skill-creator/LICENSE.txt +202 -0
  160. package/src/config/claude-code-config/skills/meta-skill-creator/SKILL.md +421 -0
  161. package/src/config/claude-code-config/skills/meta-skill-creator/package.json +5 -0
  162. package/src/config/claude-code-config/skills/meta-skill-creator/references/output-patterns.md +82 -0
  163. package/src/config/claude-code-config/skills/meta-skill-creator/references/progressive-disclosure-patterns.md +374 -0
  164. package/src/config/claude-code-config/skills/meta-skill-creator/references/prompting-integration.md +363 -0
  165. package/src/config/claude-code-config/skills/meta-skill-creator/references/real-world-examples.md +513 -0
  166. package/src/config/claude-code-config/skills/meta-skill-creator/references/script-patterns.md +385 -0
  167. package/src/config/claude-code-config/skills/meta-skill-creator/references/workflows.md +28 -0
  168. package/src/config/claude-code-config/skills/meta-skill-creator/references/xml-tag-guide.md +606 -0
  169. package/src/config/claude-code-config/skills/meta-skill-creator/scripts/init-skill.ts +214 -0
  170. package/src/config/claude-code-config/skills/meta-skill-creator/scripts/package-skill.ts +146 -0
  171. package/src/config/claude-code-config/skills/meta-skill-creator/scripts/validate.ts +138 -0
  172. package/src/config/claude-code-config/skills/meta-skill-workflow-creator/SKILL.md +390 -0
  173. package/src/config/claude-code-config/skills/meta-skill-workflow-creator/references/ask-patterns.md +225 -0
  174. package/src/config/claude-code-config/skills/meta-skill-workflow-creator/references/prompt-engineering.md +377 -0
  175. package/src/config/claude-code-config/skills/meta-skill-workflow-creator/references/state-management.md +275 -0
  176. package/src/config/claude-code-config/skills/meta-skill-workflow-creator/references/step-template.md +334 -0
  177. package/src/config/claude-code-config/skills/meta-skill-workflow-creator/references/workflow-patterns.md +300 -0
  178. package/src/config/claude-code-config/skills/meta-subagent-creator/SKILL.md +451 -0
  179. package/src/config/claude-code-config/skills/meta-subagent-creator/references/context-management.md +567 -0
  180. package/src/config/claude-code-config/skills/meta-subagent-creator/references/debugging-agents.md +714 -0
  181. package/src/config/claude-code-config/skills/meta-subagent-creator/references/error-handling-and-recovery.md +502 -0
  182. package/src/config/claude-code-config/skills/meta-subagent-creator/references/evaluation-and-testing.md +374 -0
  183. package/src/config/claude-code-config/skills/meta-subagent-creator/references/orchestration-patterns.md +591 -0
  184. package/src/config/claude-code-config/skills/meta-subagent-creator/references/subagents.md +599 -0
  185. package/src/config/claude-code-config/skills/meta-subagent-creator/references/writing-subagent-prompts.md +513 -0
  186. package/src/config/claude-code-config/skills/ralph-loop/SKILL.md +117 -0
  187. package/src/config/claude-code-config/skills/ralph-loop/scripts/setup.sh +278 -0
  188. package/src/config/claude-code-config/skills/ralph-loop/steps/step-00-init.md +215 -0
  189. package/src/config/claude-code-config/skills/ralph-loop/steps/step-01-interactive-prd.md +366 -0
  190. package/src/config/claude-code-config/skills/ralph-loop/steps/step-02-create-stories.md +273 -0
  191. package/src/config/claude-code-config/skills/ralph-loop/steps/step-03-finish.md +245 -0
  192. package/src/config/claude-code-config/skills/ralph-tasks/SKILL.md +88 -0
  193. package/src/config/claude-code-config/skills/ralph-tasks/scripts/add-task.sh +36 -0
  194. package/src/config/claude-code-config/skills/ralph-tasks/scripts/list-tasks.sh +66 -0
  195. package/src/config/claude-code-config/skills/ralph-tasks/scripts/remove-task.sh +47 -0
  196. package/src/config/claude-code-config/skills/ralph-tasks/scripts/setup.sh +201 -0
  197. package/src/config/claude-code-config/skills/ralph-tasks/steps/action-add-search.md +131 -0
  198. package/src/config/claude-code-config/skills/ralph-tasks/steps/action-add.md +46 -0
  199. package/src/config/claude-code-config/skills/ralph-tasks/steps/action-init.md +123 -0
  200. package/src/config/claude-code-config/skills/ralph-tasks/steps/action-list.md +58 -0
  201. package/src/config/claude-code-config/skills/ralph-tasks/steps/action-remove.md +48 -0
  202. package/src/config/claude-code-config/skills/ralph-tasks/steps/action-setup.md +46 -0
  203. package/src/config/claude-code-config/skills/ralph-tasks/steps/action-wake-up.md +62 -0
  204. package/src/config/claude-code-config/skills/utils-fix-errors/SKILL.md +61 -0
  205. package/src/config/claude-code-config/skills/utils-fix-grammar/SKILL.md +59 -0
  206. package/src/config/claude-code-config/skills/utils-oneshot/SKILL.md +56 -0
  207. package/src/config/claude-code-config/skills/utils-refactor/SKILL.md +89 -0
  208. package/src/config/claude-code-config/skills/utils-save-docs/SKILL.md +74 -0
  209. package/src/config/claude-code-config/skills/utils-ultrathink/SKILL.md +42 -0
  210. package/src/config/claude-code-config/skills/workflow-apex/SKILL.md +116 -0
  211. package/src/config/claude-code-config/skills/workflow-apex/scripts/setup-templates.sh +144 -0
  212. package/src/config/claude-code-config/skills/workflow-apex/scripts/update-progress.sh +80 -0
  213. package/src/config/claude-code-config/skills/workflow-apex/steps/step-00-init.md +273 -0
  214. package/src/config/claude-code-config/skills/workflow-apex/steps/step-00b-branch.md +126 -0
  215. package/src/config/claude-code-config/skills/workflow-apex/steps/step-00b-economy.md +244 -0
  216. package/src/config/claude-code-config/skills/workflow-apex/steps/step-00b-interactive.md +165 -0
  217. package/src/config/claude-code-config/skills/workflow-apex/steps/step-00b-save.md +123 -0
  218. package/src/config/claude-code-config/skills/workflow-apex/steps/step-01-analyze.md +361 -0
  219. package/src/config/claude-code-config/skills/workflow-apex/steps/step-02-plan.md +422 -0
  220. package/src/config/claude-code-config/skills/workflow-apex/steps/step-02b-tasks.md +301 -0
  221. package/src/config/claude-code-config/skills/workflow-apex/steps/step-03-execute-teams.md +297 -0
  222. package/src/config/claude-code-config/skills/workflow-apex/steps/step-03-execute.md +239 -0
  223. package/src/config/claude-code-config/skills/workflow-apex/steps/step-04-validate.md +264 -0
  224. package/src/config/claude-code-config/skills/workflow-apex/steps/step-05-examine.md +294 -0
  225. package/src/config/claude-code-config/skills/workflow-apex/steps/step-06-resolve.md +237 -0
  226. package/src/config/claude-code-config/skills/workflow-apex/steps/step-07-tests.md +250 -0
  227. package/src/config/claude-code-config/skills/workflow-apex/steps/step-08-run-tests.md +308 -0
  228. package/src/config/claude-code-config/skills/workflow-apex/steps/step-09-finish.md +193 -0
  229. package/src/config/claude-code-config/skills/workflow-apex/templates/00-context.md +53 -0
  230. package/src/config/claude-code-config/skills/workflow-apex/templates/01-analyze.md +10 -0
  231. package/src/config/claude-code-config/skills/workflow-apex/templates/02-plan.md +10 -0
  232. package/src/config/claude-code-config/skills/workflow-apex/templates/03-execute.md +10 -0
  233. package/src/config/claude-code-config/skills/workflow-apex/templates/04-validate.md +10 -0
  234. package/src/config/claude-code-config/skills/workflow-apex/templates/05-examine.md +10 -0
  235. package/src/config/claude-code-config/skills/workflow-apex/templates/06-resolve.md +10 -0
  236. package/src/config/claude-code-config/skills/workflow-apex/templates/07-tests.md +10 -0
  237. package/src/config/claude-code-config/skills/workflow-apex/templates/08-run-tests.md +10 -0
  238. package/src/config/claude-code-config/skills/workflow-apex/templates/09-finish.md +10 -0
  239. package/src/config/claude-code-config/skills/workflow-apex/templates/README.md +195 -0
  240. package/src/config/claude-code-config/skills/workflow-apex/templates/step-complete.md +7 -0
  241. package/src/config/claude-code-config/skills/workflow-brainstorm/SKILL.md +127 -0
  242. package/src/config/claude-code-config/skills/workflow-brainstorm/steps/step-01-explore.md +230 -0
  243. package/src/config/claude-code-config/skills/workflow-brainstorm/steps/step-02-challenge.md +238 -0
  244. package/src/config/claude-code-config/skills/workflow-brainstorm/steps/step-03-synthesize.md +337 -0
  245. package/src/config/claude-code-config/skills/workflow-brainstorm/steps/step-04-action.md +285 -0
  246. package/src/config/claude-code-config/skills/workflow-ci-fixer/SKILL.md +150 -0
  247. package/src/config/claude-code-config/skills/workflow-ci-fixer/references/cli-commands.md +122 -0
  248. package/src/config/claude-code-config/skills/workflow-ci-fixer/references/github-cli.md +243 -0
  249. package/src/config/claude-code-config/skills/workflow-ci-fixer/references/troubleshooting.md +362 -0
  250. package/src/config/claude-code-config/skills/workflow-ci-fixer/references/vercel-cli.md +192 -0
  251. package/src/config/claude-code-config/skills/workflow-ci-fixer/steps/step-00-init.md +157 -0
  252. package/src/config/claude-code-config/skills/workflow-ci-fixer/steps/step-01-watch-ci.md +192 -0
  253. package/src/config/claude-code-config/skills/workflow-ci-fixer/steps/step-02-analyze-errors.md +263 -0
  254. package/src/config/claude-code-config/skills/workflow-ci-fixer/steps/step-03-fix-locally.md +312 -0
  255. package/src/config/claude-code-config/skills/workflow-ci-fixer/steps/step-04-commit-push.md +206 -0
  256. package/src/config/claude-code-config/skills/workflow-ci-fixer/steps/step-05-cleanup.md +196 -0
  257. package/src/config/claude-code-config/skills/workflow-clean-code/SKILL.md +129 -0
  258. package/src/config/claude-code-config/skills/workflow-clean-code/references/general-clean-code.md +347 -0
  259. package/src/config/claude-code-config/skills/workflow-clean-code/references/nextjs-clean-code.md +458 -0
  260. package/src/config/claude-code-config/skills/workflow-clean-code/references/react-clean-code.md +406 -0
  261. package/src/config/claude-code-config/skills/workflow-clean-code/references/tanstack-query-best-practices.md +516 -0
  262. package/src/config/claude-code-config/skills/workflow-clean-code/references/zustand-best-practices.md +491 -0
  263. package/src/config/claude-code-config/skills/workflow-clean-code/steps/step-01-scan.md +137 -0
  264. package/src/config/claude-code-config/skills/workflow-clean-code/steps/step-02-apply.md +152 -0
  265. package/src/config/claude-code-config/skills/workflow-clean-code/steps/step-03-verify.md +143 -0
  266. package/src/config/claude-code-config/skills/workflow-debug/SKILL.md +126 -0
  267. package/src/config/claude-code-config/skills/workflow-debug/references/log-technique.md +285 -0
  268. package/src/config/claude-code-config/skills/workflow-debug/steps/step-00-init.md +94 -0
  269. package/src/config/claude-code-config/skills/workflow-debug/steps/step-01-analyze.md +180 -0
  270. package/src/config/claude-code-config/skills/workflow-debug/steps/step-01b-log-instrumentation.md +271 -0
  271. package/src/config/claude-code-config/skills/workflow-debug/steps/step-02-find-solutions.md +141 -0
  272. package/src/config/claude-code-config/skills/workflow-debug/steps/step-03-propose.md +142 -0
  273. package/src/config/claude-code-config/skills/workflow-debug/steps/step-04-fix.md +176 -0
  274. package/src/config/claude-code-config/skills/workflow-debug/steps/step-05-verify.md +279 -0
  275. package/src/config/claude-code-config/skills/workflow-review-code/SKILL.md +219 -0
  276. package/src/config/claude-code-config/skills/workflow-review-code/references/clean-code-principles.md +140 -0
  277. package/src/config/claude-code-config/skills/workflow-review-code/references/code-quality-metrics.md +174 -0
  278. package/src/config/claude-code-config/skills/workflow-review-code/references/feedback-patterns.md +149 -0
  279. package/src/config/claude-code-config/skills/workflow-review-code/references/security-checklist.md +127 -0
  280. package/src/config/claude-code-config/song/finish.mp3 +0 -0
  281. package/src/config/claude-code-config/song/need-human.mp3 +0 -0
@@ -0,0 +1,411 @@
1
+ <prompting_techniques>
2
+ Master guide for writing effective instructions in CLAUDE.md files. These techniques ensure Claude follows your guidance reliably.
3
+
4
+ <core_principle>
5
+ Show your CLAUDE.md to someone with minimal project context. If they're confused about what to do, Claude will be too.
6
+ </core_principle>
7
+
8
+ <emphasis_strategies>
9
+ Claude follows emphasized instructions more reliably. Use these techniques strategically for critical rules.
10
+
11
+ <keyword_emphasis>
12
+ **CRITICAL** - For non-negotiable rules that must never be broken:
13
+ ```markdown
14
+ **CRITICAL**: Always run tests before pushing code
15
+ **CRITICAL**: Never commit .env files
16
+ ```
17
+
18
+ **NEVER** - For absolute prohibitions:
19
+ ```markdown
20
+ NEVER: Include API keys in code
21
+ NEVER: Push directly to main branch
22
+ NEVER: Use React Hook Form (use TanStack Form instead)
23
+ ```
24
+
25
+ **ALWAYS** - For mandatory behaviors:
26
+ ```markdown
27
+ ALWAYS: Use TypeScript strict mode
28
+ ALWAYS: Run linter before committing
29
+ ALWAYS: Add tests for new features
30
+ ```
31
+
32
+ **IMPORTANT** - For significant but not critical rules:
33
+ ```markdown
34
+ IMPORTANT: Keep components under 300 lines
35
+ IMPORTANT: Use Server Components where possible
36
+ ```
37
+
38
+ **YOU MUST** - For explicit requirements:
39
+ ```markdown
40
+ YOU MUST: Follow the git workflow outlined below
41
+ YOU MUST: Read related files before editing
42
+ ```
43
+ </keyword_emphasis>
44
+
45
+ <visual_markers>
46
+ Use symbols for visual emphasis (sparingly):
47
+
48
+ ```markdown
49
+ ⚠️ WARNING: This affects production data
50
+ 🔒 SECURITY: Never commit secrets to git
51
+ ❌ FORBIDDEN: Do not use interactive test commands
52
+ ✅ REQUIRED: All PRs must pass CI checks
53
+ ```
54
+
55
+ Reserve visual markers for the most critical items only.
56
+ </visual_markers>
57
+
58
+ <formatting_emphasis>
59
+ **Bold for critical terms:**
60
+ ```markdown
61
+ Use **TanStack Form** for all forms (not React Hook Form)
62
+ ```
63
+
64
+ **Strikethrough for forbidden options:**
65
+ ```markdown
66
+ Commands:
67
+ - `pnpm test:ci` - Run tests
68
+ - ~~`pnpm test`~~ - NEVER use (interactive mode)
69
+ ```
70
+
71
+ **Code blocks for exact commands:**
72
+ ```markdown
73
+ Before pushing, run:
74
+ ```bash
75
+ pnpm lint && pnpm test:ci && pnpm build
76
+ ```
77
+ ```
78
+ </formatting_emphasis>
79
+
80
+ <placement_strategy>
81
+ Order matters. Claude pays more attention to:
82
+
83
+ 1. **First items** in each section
84
+ 2. **Repeated items** across sections
85
+ 3. **Emphasized items** with CRITICAL/NEVER/ALWAYS
86
+
87
+ Structure your CLAUDE.md with critical rules first:
88
+
89
+ ```markdown
90
+ ## Code Conventions
91
+
92
+ ### Critical Rules (Follow These First)
93
+ - **NEVER** commit .env files
94
+ - **ALWAYS** run tests before pushing
95
+ - **CRITICAL**: Use TanStack Form for ALL forms
96
+
97
+ ### General Guidelines
98
+ - Prefer Server Components
99
+ - Keep components under 300 lines
100
+ - Use TypeScript strict mode
101
+ ```
102
+ </placement_strategy>
103
+
104
+ <repetition_technique>
105
+ For extremely important rules, repeat in multiple contexts:
106
+
107
+ ```markdown
108
+ ## Forms
109
+ **CRITICAL**: Use TanStack Form for ALL forms
110
+ Import from `@/features/form/tanstack-form`
111
+
112
+ ## Before Editing Files
113
+ - Read similar files for patterns
114
+ - **CRITICAL**: Use TanStack Form for forms (see Forms section)
115
+
116
+ ## Code Review Checklist
117
+ - [ ] Tests passing
118
+ - [ ] Forms use TanStack Form (**CRITICAL**)
119
+ ```
120
+ </repetition_technique>
121
+ </emphasis_strategies>
122
+
123
+ <clarity_techniques>
124
+ <be_specific>
125
+ Vague instructions cause inconsistent behavior. Be explicit:
126
+
127
+ ```markdown
128
+ ❌ VAGUE:
129
+ - Format code properly
130
+ - Write good tests
131
+ - Follow best practices
132
+
133
+ ✅ SPECIFIC:
134
+ - Use 2-space indentation (Prettier configured)
135
+ - Write tests in `__tests__/` using Vitest
136
+ - Use TanStack Form for all forms
137
+ ```
138
+ </be_specific>
139
+
140
+ <show_dont_tell>
141
+ When format matters, show examples rather than describing:
142
+
143
+ ```markdown
144
+ ❌ TELLING:
145
+ Use conventional commits with type, scope, and description.
146
+
147
+ ✅ SHOWING:
148
+ ## Commit Format
149
+ ```
150
+ feat(auth): implement JWT authentication
151
+
152
+ Add login endpoint and token validation middleware
153
+ ```
154
+
155
+ Types: feat, fix, refactor, docs, test, chore
156
+ ```
157
+ </show_dont_tell>
158
+
159
+ <define_edge_cases>
160
+ Anticipate questions and answer them:
161
+
162
+ ```markdown
163
+ ❌ INCOMPLETE:
164
+ Run tests before pushing.
165
+
166
+ ✅ COMPLETE:
167
+ ## Testing
168
+ - Run `pnpm test:ci` before pushing
169
+ - If tests fail, fix before committing
170
+ - For new features, add tests in `__tests__/`
171
+ - Minimum 80% coverage for new code
172
+ ```
173
+ </define_edge_cases>
174
+
175
+ <eliminate_ambiguity>
176
+ Replace ambiguous phrases with clear directives:
177
+
178
+ ```markdown
179
+ ❌ AMBIGUOUS PHRASES:
180
+ - "Try to..." → Implies optional
181
+ - "Should probably..." → Unclear obligation
182
+ - "Generally..." → When are exceptions allowed?
183
+ - "Consider..." → Do it or not?
184
+
185
+ ✅ CLEAR PHRASES:
186
+ - "Always..." or "Never..." → Clear requirement
187
+ - "Must..." or "May optionally..." → Clear obligation
188
+ - "Always... except when [condition]" → Rule with exception
189
+ - "If [condition], then [action]" → Clear conditional
190
+ ```
191
+ </eliminate_ambiguity>
192
+
193
+ <sequential_steps>
194
+ For multi-step processes, use numbered lists:
195
+
196
+ ```markdown
197
+ ## Before Pushing Code
198
+
199
+ 1. Run linter: `pnpm lint`
200
+ 2. Run type check: `pnpm ts`
201
+ 3. Run tests: `pnpm test:ci`
202
+ 4. Verify build: `pnpm build`
203
+ 5. If all pass, commit and push
204
+ ```
205
+
206
+ Sequential steps create clear expectations and prevent skipping.
207
+ </sequential_steps>
208
+ </clarity_techniques>
209
+
210
+ <instruction_structure>
211
+ <must_nice_mustnot>
212
+ Clearly separate obligation levels:
213
+
214
+ ```markdown
215
+ ## API Development
216
+
217
+ ### Must Have
218
+ - Input validation with Zod
219
+ - Error handling for all endpoints
220
+ - TypeScript types for request/response
221
+
222
+ ### Nice to Have
223
+ - Pagination for list endpoints
224
+ - Caching headers
225
+ - Rate limiting
226
+
227
+ ### Must Not
228
+ - Expose internal errors to clients
229
+ - Log sensitive data
230
+ - Skip authentication checks
231
+ ```
232
+ </must_nice_mustnot>
233
+
234
+ <decision_criteria>
235
+ When Claude must make choices, provide criteria:
236
+
237
+ ```markdown
238
+ ## Component Choice
239
+
240
+ **Use Server Component when:**
241
+ - Data fetching only
242
+ - No user interaction
243
+ - No browser APIs needed
244
+
245
+ **Use Client Component when:**
246
+ - User interaction required (forms, buttons)
247
+ - Browser APIs needed (localStorage, window)
248
+ - Real-time updates needed
249
+ ```
250
+ </decision_criteria>
251
+
252
+ <success_criteria>
253
+ Define what success looks like:
254
+
255
+ ```markdown
256
+ ## Definition of Done
257
+
258
+ A feature is complete when:
259
+ - [ ] All tests pass
260
+ - [ ] Build succeeds
261
+ - [ ] Code reviewed and approved
262
+ - [ ] Documentation updated (if applicable)
263
+ - [ ] No TypeScript errors
264
+ ```
265
+ </success_criteria>
266
+ </instruction_structure>
267
+
268
+ <context_provision>
269
+ <give_purpose>
270
+ Explain WHY, not just WHAT:
271
+
272
+ ```markdown
273
+ ❌ JUST WHAT:
274
+ Use TanStack Form for all forms.
275
+
276
+ ✅ WHAT + WHY:
277
+ Use TanStack Form for all forms.
278
+ - Unified validation with Zod schemas
279
+ - Consistent error handling across app
280
+ - Server action integration built-in
281
+ ```
282
+ </give_purpose>
283
+
284
+ <provide_examples>
285
+ Input/output examples teach patterns better than descriptions:
286
+
287
+ ```markdown
288
+ ## File Naming
289
+
290
+ ### Server Actions
291
+ ```
292
+ user.action.ts ✅ Correct
293
+ userActions.ts ❌ Wrong
294
+ actions/user.ts ❌ Wrong
295
+ ```
296
+
297
+ ### API Routes
298
+ ```
299
+ app/api/users/route.ts ✅ Correct
300
+ app/api/users.ts ❌ Wrong
301
+ ```
302
+ ```
303
+ </provide_examples>
304
+
305
+ <link_to_files>
306
+ Reference actual files for complex patterns:
307
+
308
+ ```markdown
309
+ ## Patterns
310
+
311
+ For implementation examples:
312
+ - **Forms**: See `src/features/form/tanstack-form.tsx`
313
+ - **Server Actions**: See `src/lib/actions/safe-actions.ts`
314
+ - **API Routes**: See `src/lib/zod-route.ts`
315
+ ```
316
+ </link_to_files>
317
+ </context_provision>
318
+
319
+ <constraint_techniques>
320
+ <hard_constraints>
321
+ For absolute limits, use explicit language:
322
+
323
+ ```markdown
324
+ ## Hard Constraints
325
+
326
+ - Maximum component size: 300 lines
327
+ - Maximum function size: 50 lines
328
+ - Maximum file size: 500 lines
329
+ - **NEVER** exceed these limits
330
+ ```
331
+ </hard_constraints>
332
+
333
+ <conditional_constraints>
334
+ For context-dependent rules:
335
+
336
+ ```markdown
337
+ ## Component Complexity
338
+
339
+ **Simple components (< 100 lines):**
340
+ - Keep in single file
341
+ - No need for separate test file if trivial
342
+
343
+ **Complex components (100-300 lines):**
344
+ - Extract hooks to separate files
345
+ - Require dedicated test file
346
+
347
+ **If approaching 300 lines:**
348
+ - Split into sub-components
349
+ - Extract logic to custom hooks
350
+ ```
351
+ </conditional_constraints>
352
+
353
+ <escape_hatches>
354
+ Provide alternatives for edge cases:
355
+
356
+ ```markdown
357
+ ## Default Patterns
358
+
359
+ Use Server Components for data fetching.
360
+
361
+ **Exception**: Use Client Component with TanStack Query when:
362
+ - Real-time updates needed
363
+ - Optimistic updates required
364
+ - Complex client-side caching needed
365
+ ```
366
+ </escape_hatches>
367
+ </constraint_techniques>
368
+
369
+ <testing_your_instructions>
370
+ <clarity_test>
371
+ Ask yourself:
372
+ 1. Could a developer unfamiliar with this project follow these instructions?
373
+ 2. Are there any ambiguous terms?
374
+ 3. Is anything left to interpretation that shouldn't be?
375
+ 4. Are the most critical rules emphasized?
376
+ </clarity_test>
377
+
378
+ <effectiveness_test>
379
+ After using for a few sessions:
380
+ 1. Did Claude follow the instructions?
381
+ 2. Which instructions were ignored?
382
+ 3. What did Claude do wrong?
383
+ 4. What additional context would help?
384
+
385
+ Iterate based on observed behavior, not assumptions.
386
+ </effectiveness_test>
387
+
388
+ <common_issues>
389
+ | Problem | Solution |
390
+ |---------|----------|
391
+ | Claude ignores instruction | Add emphasis (CRITICAL, NEVER), move to top |
392
+ | Claude does wrong thing | Be more specific, add examples |
393
+ | Claude asks for clarification | Anticipate question, add answer |
394
+ | Inconsistent behavior | Add edge case handling, remove ambiguity |
395
+ </common_issues>
396
+ </testing_your_instructions>
397
+ </prompting_techniques>
398
+
399
+ <writing_checklist>
400
+ Before finalizing your CLAUDE.md:
401
+
402
+ - [ ] Critical rules use CRITICAL/NEVER/ALWAYS emphasis
403
+ - [ ] Most important items appear first in each section
404
+ - [ ] Vague phrases replaced with specific instructions
405
+ - [ ] Edge cases addressed
406
+ - [ ] Examples provided for complex patterns
407
+ - [ ] File references for implementation details
408
+ - [ ] Ambiguous phrases eliminated
409
+ - [ ] Under 200 lines total
410
+ - [ ] Tested with real tasks
411
+ </writing_checklist>
@@ -0,0 +1,298 @@
1
+ # .claude/rules/ Directory - Official Guide
2
+
3
+ Complete guide to using modular rules with `.claude/rules/` directory, based on official Claude Code documentation.
4
+
5
+ ## Overview
6
+
7
+ For larger projects, organize instructions into multiple files using the `.claude/rules/` directory. This allows teams to maintain focused, well-organized rule files instead of one large CLAUDE.md.
8
+
9
+ ## Basic Structure
10
+
11
+ Place markdown files in your project's `.claude/rules/` directory:
12
+
13
+ ```
14
+ your-project/
15
+ ├── .claude/
16
+ │ ├── CLAUDE.md # Main project instructions
17
+ │ └── rules/
18
+ │ ├── code-style.md # Code style guidelines
19
+ │ ├── testing.md # Testing conventions
20
+ │ └── security.md # Security requirements
21
+ ```
22
+
23
+ **Key points:**
24
+ - All `.md` files in `.claude/rules/` are automatically loaded as project memory
25
+ - Same priority as `.claude/CLAUDE.md`
26
+ - No imports or configuration needed
27
+
28
+ ## Path-Specific Rules
29
+
30
+ Rules can be scoped to specific files using YAML frontmatter with the `paths` field. These conditional rules only apply when Claude is working with files matching the specified patterns.
31
+
32
+ ### Syntax
33
+
34
+ ```yaml
35
+ ---
36
+ paths:
37
+ - "src/api/**/*.ts"
38
+ ---
39
+
40
+ # API Development Rules
41
+
42
+ - All API endpoints must include input validation
43
+ - Use the standard error response format
44
+ - Include OpenAPI documentation comments
45
+ ```
46
+
47
+ **Important:**
48
+ - `paths` must be a YAML array (list format with `-` prefix)
49
+ - Rules **without** a `paths` field are loaded unconditionally
50
+ - Conditional rules only load when working with matching files
51
+
52
+ ### Glob Patterns
53
+
54
+ The `paths` field supports standard glob patterns:
55
+
56
+ | Pattern | Matches |
57
+ | ---------------------- | ---------------------------------------- |
58
+ | `**/*.ts` | All TypeScript files in any directory |
59
+ | `src/**/*` | All files under `src/` directory |
60
+ | `*.md` | Markdown files in the project root |
61
+ | `src/components/*.tsx` | React components in a specific directory |
62
+
63
+ ### Multiple Patterns
64
+
65
+ Specify multiple patterns in the array:
66
+
67
+ ```yaml
68
+ ---
69
+ paths:
70
+ - "src/**/*.ts"
71
+ - "lib/**/*.ts"
72
+ - "tests/**/*.test.ts"
73
+ ---
74
+ ```
75
+
76
+ ### Brace Expansion
77
+
78
+ Use brace expansion for matching multiple extensions or directories:
79
+
80
+ ```yaml
81
+ ---
82
+ paths:
83
+ - "src/**/*.{ts,tsx}"
84
+ - "{src,lib}/**/*.ts"
85
+ ---
86
+
87
+ # TypeScript/React Rules
88
+ ```
89
+
90
+ This expands `src/**/*.{ts,tsx}` to match both `.ts` and `.tsx` files.
91
+
92
+ ## Subdirectories
93
+
94
+ Rules can be organized into subdirectories for better structure:
95
+
96
+ ```
97
+ .claude/rules/
98
+ ├── frontend/
99
+ │ ├── react.md
100
+ │ └── styles.md
101
+ ├── backend/
102
+ │ ├── api.md
103
+ │ └── database.md
104
+ └── general.md
105
+ ```
106
+
107
+ All `.md` files are discovered recursively in any subdirectory depth.
108
+
109
+ ## Symlinks
110
+
111
+ The `.claude/rules/` directory supports symlinks, allowing you to share common rules across multiple projects:
112
+
113
+ ```bash
114
+ # Symlink a shared rules directory
115
+ ln -s ~/shared-claude-rules .claude/rules/shared
116
+
117
+ # Symlink individual rule files
118
+ ln -s ~/company-standards/security.md .claude/rules/security.md
119
+ ```
120
+
121
+ **Behavior:**
122
+ - Symlinks are resolved and their contents are loaded normally
123
+ - Circular symlinks are detected and handled gracefully
124
+ - Great for sharing company standards across projects
125
+
126
+ ## User-Level Rules
127
+
128
+ Create personal rules that apply to all your projects in `~/.claude/rules/`:
129
+
130
+ ```
131
+ ~/.claude/rules/
132
+ ├── preferences.md # Your personal coding preferences
133
+ └── workflows.md # Your preferred workflows
134
+ ```
135
+
136
+ **Priority:**
137
+ - User-level rules load before project rules
138
+ - Project rules take higher priority (can override user rules)
139
+ - User rules typically **don't** need `paths` frontmatter (apply globally)
140
+
141
+ ## Examples
142
+
143
+ ### Unconditional Project Rule
144
+
145
+ File: `.claude/rules/testing.md`
146
+
147
+ ```markdown
148
+ # Testing Conventions
149
+
150
+ - Write tests in `__tests__/` directories
151
+ - Use Vitest for unit tests
152
+ - Minimum 80% coverage for new code
153
+ - Run `pnpm test` before committing
154
+ ```
155
+
156
+ No frontmatter needed - applies to entire project.
157
+
158
+ ### Path-Specific Rule
159
+
160
+ File: `.claude/rules/api-standards.md`
161
+
162
+ ```yaml
163
+ ---
164
+ paths:
165
+ - "src/api/**/*.ts"
166
+ - "src/routes/**/*.ts"
167
+ ---
168
+
169
+ # API Development Standards
170
+
171
+ - All endpoints must validate input with Zod
172
+ - Use standard error response format
173
+ - Include rate limiting for public endpoints
174
+ - Document with OpenAPI comments
175
+ ```
176
+
177
+ Only loads when working with API-related TypeScript files.
178
+
179
+ ### Frontend-Specific Rules
180
+
181
+ File: `.claude/rules/frontend/react.md`
182
+
183
+ ```yaml
184
+ ---
185
+ paths:
186
+ - "src/components/**/*.{tsx,ts}"
187
+ - "src/app/**/*.tsx"
188
+ ---
189
+
190
+ # React Component Guidelines
191
+
192
+ - Prefer Server Components (Next.js App Router)
193
+ - Use `"use client"` only when needed for interactivity
194
+ - Keep components under 300 lines
195
+ - Extract hooks to separate files
196
+ ```
197
+
198
+ ### User-Level Global Rule
199
+
200
+ File: `~/.claude/rules/preferences.md`
201
+
202
+ ```markdown
203
+ # My Personal Coding Preferences
204
+
205
+ - I prefer concise variable names (no unnecessary verbosity)
206
+ - Always add error boundaries around async operations
207
+ - Use early returns to reduce nesting
208
+ ```
209
+
210
+ No frontmatter - applies to all projects globally.
211
+
212
+ ## Best Practices
213
+
214
+ ### Keep Rules Focused
215
+
216
+ Each file should cover one topic:
217
+ - ✅ `testing.md` - All testing conventions
218
+ - ✅ `api-design.md` - API-specific patterns
219
+ - ✅ `security.md` - Security requirements
220
+ - ❌ `everything.md` - Mixed concerns
221
+
222
+ ### Use Descriptive Filenames
223
+
224
+ The filename should indicate what the rules cover:
225
+ - ✅ `database-migrations.md`
226
+ - ✅ `error-handling.md`
227
+ - ❌ `stuff.md`
228
+ - ❌ `misc.md`
229
+
230
+ ### Use Conditional Rules Sparingly
231
+
232
+ Only add `paths` frontmatter when rules **truly** apply to specific file types:
233
+ - ✅ API validation rules → `paths: ["src/api/**/*.ts"]`
234
+ - ✅ React component rules → `paths: ["**/*.tsx"]`
235
+ - ❌ General project conventions → No paths needed
236
+
237
+ ### Organize with Subdirectories
238
+
239
+ Group related rules:
240
+
241
+ ```
242
+ .claude/rules/
243
+ ├── frontend/
244
+ │ ├── components.md
245
+ │ ├── styling.md
246
+ │ └── state-management.md
247
+ ├── backend/
248
+ │ ├── api.md
249
+ │ ├── database.md
250
+ │ └── auth.md
251
+ └── general.md
252
+ ```
253
+
254
+ ### Avoid Duplication
255
+
256
+ Don't repeat the same rules in multiple files. If a rule applies globally, put it in:
257
+ 1. Root-level rule file (e.g., `.claude/rules/general.md`)
258
+ 2. Or in `.claude/CLAUDE.md`
259
+
260
+ ## Troubleshooting
261
+
262
+ | Problem | Solution |
263
+ |---------|----------|
264
+ | Rules not loading | Ensure file extension is `.md` and in `.claude/rules/` |
265
+ | Path rules not applying | Verify glob pattern matches target files exactly |
266
+ | Rules conflicting | Check for duplicates across multiple files |
267
+ | Too many rules loading | Use `paths` frontmatter to scope appropriately |
268
+
269
+ ## When to Use .claude/rules/ vs CLAUDE.md
270
+
271
+ **Use `.claude/rules/` when:**
272
+ - Project has many distinct concerns (testing, security, API, frontend)
273
+ - Different rules apply to different file types
274
+ - Team members maintain different areas
275
+ - You want to update one concern without touching others
276
+ - CLAUDE.md exceeds 200 lines
277
+
278
+ **Use CLAUDE.md when:**
279
+ - Project is small/simple (< 100 lines of instructions)
280
+ - All rules are universal across the project
281
+ - You prefer a single source of truth
282
+ - Quick setup is priority
283
+
284
+ ## Migration Path
285
+
286
+ When CLAUDE.md grows too large (200+ lines):
287
+
288
+ 1. **Identify sections**: testing, API, frontend, security, etc.
289
+ 2. **Create `.claude/rules/` directory**
290
+ 3. **Move each section** to its own file
291
+ 4. **Add `paths` frontmatter** where rules are file-type specific
292
+ 5. **Keep universal essentials** in CLAUDE.md (or remove it entirely)
293
+ 6. **Test** to ensure rules load correctly
294
+
295
+ ## Reference
296
+
297
+ Based on official Claude Code documentation:
298
+ https://code.claude.com/docs/mcp/claude-md#modular-rules-with-clauderules