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,694 @@
1
+ ---
2
+ name: claude-memory
3
+ description: Create and optimize CLAUDE.md memory files or .claude/rules/ modular rules for Claude Code projects. Comprehensive guidance on file hierarchy, content structure, path-scoped rules, best practices, and anti-patterns. Use when working with CLAUDE.md files, .claude/rules directories, setting up new projects, or improving Claude Code's context awareness.
4
+ argument-hint: [task description]
5
+ ---
6
+
7
+ <objective>
8
+ Master the creation of effective Claude Code memory systems using either CLAUDE.md files or the modular `.claude/rules/` directory. This skill covers file hierarchy, content structure, path-scoped rules, formatting, emphasis techniques, and common anti-patterns to avoid.
9
+
10
+ Memory files are automatically loaded at session startup, consuming tokens from your 200k context window. Every instruction competes with Claude Code's ~50 built-in instructions, leaving ~100-150 effective instruction slots for your customizations.
11
+
12
+ **Two approaches available:**
13
+
14
+ - **CLAUDE.md** - Single file, simpler, best for small projects
15
+ - **.claude/rules/** - Modular files with optional path-scoping, best for large projects
16
+ </objective>
17
+
18
+ <quick_start>
19
+ <bootstrap_new_project>
20
+ Run `/init` in Claude Code to auto-generate a CLAUDE.md with project structure.
21
+
22
+ Or create manually at project root:
23
+
24
+ ```markdown
25
+ # Project Name
26
+
27
+ ## Tech Stack
28
+
29
+ - [Primary language/framework]
30
+ - [Key libraries]
31
+
32
+ ## Commands
33
+
34
+ - `npm run dev` - Start development
35
+ - `npm test` - Run tests
36
+ - `npm run build` - Build for production
37
+
38
+ ## Code Conventions
39
+
40
+ - [2-3 critical conventions]
41
+
42
+ ## Important Context
43
+
44
+ - [1-2 architectural decisions worth knowing]
45
+ ```
46
+
47
+ </bootstrap_new_project>
48
+
49
+ <quick_add_memory>
50
+ Press `#` during a Claude Code session to quickly add new memory items without editing the file directly.
51
+ </quick_add_memory>
52
+
53
+ <edit_memory>
54
+ Use `/memory` command to open CLAUDE.md in your system editor.
55
+ </edit_memory>
56
+ </quick_start>
57
+
58
+ <file_hierarchy>
59
+ Claude Code loads CLAUDE.md files in a specific order. Higher priority files are loaded first and take precedence.
60
+
61
+ <loading_order>
62
+ | Priority | Location | Purpose | Scope |
63
+ |----------|----------|---------|-------|
64
+ | 1 (Highest) | `/Library/Application Support/ClaudeCode/CLAUDE.md` (macOS) | Enterprise policy (managed by IT) | All org users |
65
+ | 2 | `./CLAUDE.md` or `./.claude/CLAUDE.md` | Project memory (git-tracked) | Team via git |
66
+ | 2 | `./.claude/rules/*.md` | Modular rules (git-tracked) | Team via git |
67
+ | 3 | `~/.claude/CLAUDE.md` | User preferences (global) | All your projects |
68
+ | 3 | `~/.claude/rules/*.md` | Personal modular rules (global) | All your projects |
69
+ | 4 (Lowest) | `./CLAUDE.local.md` | Personal project prefs (auto-gitignored) | Just you |
70
+ </loading_order>
71
+
72
+ <recursive_loading>
73
+ Claude recurses UP from current directory to root, loading all CLAUDE.md files found.
74
+
75
+ Running Claude in `foo/bar/` loads:
76
+
77
+ 1. `foo/bar/CLAUDE.md`
78
+ 2. `foo/CLAUDE.md`
79
+ 3. Root-level files
80
+
81
+ Claude also discovers CLAUDE.md in SUBTREES when reading files in those directories.
82
+ </recursive_loading>
83
+
84
+ <monorepo_strategy>
85
+ For monorepos, use layered approach:
86
+
87
+ ```
88
+ root/
89
+ ├── CLAUDE.md # Universal: tech stack, git workflow
90
+ ├── apps/
91
+ │ ├── web/CLAUDE.md # Frontend-specific patterns
92
+ │ └── api/CLAUDE.md # Backend-specific patterns
93
+ └── packages/
94
+ └── shared/CLAUDE.md # Shared library conventions
95
+ ```
96
+
97
+ Root file defines WHEN to use patterns; subtree files define HOW.
98
+ </monorepo_strategy>
99
+ </file_hierarchy>
100
+
101
+ <rules_directory>
102
+ The `.claude/rules/` directory provides a **modular alternative** to monolithic CLAUDE.md files. Instead of one large file, you organize instructions into multiple focused markdown files.
103
+
104
+ <when_to_use_rules>
105
+ **Use `.claude/rules/` when:**
106
+
107
+ - Project has many distinct concerns (testing, security, API, frontend)
108
+ - Different rules apply to different file types
109
+ - Team members maintain different areas
110
+ - You want to update one concern without touching others
111
+
112
+ **Use CLAUDE.md when:**
113
+
114
+ - Project is small/simple
115
+ - All rules are universal
116
+ - You prefer a single source of truth
117
+ </when_to_use_rules>
118
+
119
+ <rules_structure>
120
+
121
+ ```
122
+ .claude/rules/
123
+ ├── code-style.md # Formatting and conventions
124
+ ├── testing.md # Test requirements
125
+ ├── security.md # Security checklist
126
+ ├── frontend/
127
+ │ ├── react.md # React-specific patterns
128
+ │ └── styles.md # CSS conventions
129
+ └── backend/
130
+ ├── api.md # API development rules
131
+ └── database.md # Database conventions
132
+ ```
133
+
134
+ **Key points:**
135
+
136
+ - All `.md` files are discovered recursively
137
+ - No imports or configuration needed
138
+ - Same priority as CLAUDE.md
139
+ - Supports symlinks for sharing rules across projects
140
+ </rules_structure>
141
+
142
+ <path_scoped_rules>
143
+ Rules can be scoped to specific files using YAML frontmatter:
144
+
145
+ ```yaml
146
+ ---
147
+ paths:
148
+ - "src/api/**/*.ts"
149
+ ---
150
+ # API Development Rules
151
+
152
+ - All API endpoints must include input validation
153
+ - Use the standard error response format
154
+ ```
155
+
156
+ **Path patterns supported:**
157
+
158
+ | Pattern | Matches |
159
+ | ---------------------- | ------------------------------------------ |
160
+ | `**/*.ts` | All TypeScript files in any directory |
161
+ | `src/**/*` | All files under `src/` directory |
162
+ | `src/components/*.tsx` | React components in specific directory |
163
+ | `src/**/*.{ts,tsx}` | TypeScript and TSX files (brace expansion) |
164
+ | `{src,lib}/**/*.ts` | Files in multiple directories |
165
+
166
+ **Syntax note:** The `paths` field must be a YAML array (list format with `-` prefix and quoted strings).
167
+
168
+ **Rules without `paths` frontmatter** load unconditionally for all files.
169
+ </path_scoped_rules>
170
+
171
+ <user_level_rules>
172
+ Create personal rules that apply to all your projects:
173
+
174
+ ```
175
+ ~/.claude/rules/
176
+ ├── preferences.md # Your coding preferences
177
+ ├── workflows.md # Your preferred workflows
178
+ └── git.md # Your git conventions
179
+ ```
180
+
181
+ User-level rules load before project rules, giving project rules higher priority for overrides.
182
+ </user_level_rules>
183
+
184
+ <symlinks_support>
185
+ Share common rules across multiple projects using symlinks:
186
+
187
+ ```bash
188
+ # Symlink a shared rules directory
189
+ ln -s ~/shared-claude-rules .claude/rules/shared
190
+
191
+ # Symlink individual rule files
192
+ ln -s ~/company-standards/security.md .claude/rules/security.md
193
+ ```
194
+
195
+ Circular symlinks are detected and handled gracefully.
196
+ </symlinks_support>
197
+ </rules_directory>
198
+
199
+ <content_framework>
200
+ Structure your CLAUDE.md using the WHAT-WHY-HOW framework:
201
+
202
+ **WHAT** - Project Context: Tech stack, directory structure, architecture
203
+ **WHY** - Purpose: Architectural decisions, why patterns exist
204
+ **HOW** - Workflow: Commands, testing, git workflow, verification steps
205
+
206
+ ```markdown
207
+ ## Tech Stack
208
+
209
+ - Next.js 15 with App Router
210
+ - PostgreSQL via Prisma ORM
211
+
212
+ ## Architecture Decisions
213
+
214
+ - Server Components for data fetching
215
+ - All forms use TanStack Form
216
+
217
+ ## Commands
218
+
219
+ - `pnpm dev` - Start dev server
220
+ - `pnpm test:ci` - Run tests
221
+ - `pnpm build` - Production build
222
+
223
+ ## Git Workflow
224
+
225
+ - Branch: `feature/name` or `fix/name`
226
+ - Run tests before committing
227
+ ```
228
+
229
+ See [references/section-templates.md](references/section-templates.md) for complete templates.
230
+ </content_framework>
231
+
232
+ <emphasis_techniques>
233
+ Claude follows emphasized instructions more reliably. Use these techniques strategically for critical rules.
234
+
235
+ <keyword_hierarchy>
236
+ Use emphasis keywords in order of severity:
237
+
238
+ | Keyword | Use For | Example |
239
+ | ------------- | --------------------- | -------------------------------------------- |
240
+ | **CRITICAL** | Non-negotiable rules | `**CRITICAL**: Never commit secrets` |
241
+ | **NEVER** | Absolute prohibitions | `NEVER: Push directly to main` |
242
+ | **ALWAYS** | Mandatory behaviors | `ALWAYS: Run tests before pushing` |
243
+ | **IMPORTANT** | Significant guidance | `IMPORTANT: Keep components under 300 lines` |
244
+ | **YOU MUST** | Explicit requirements | `YOU MUST: Use TanStack Form for forms` |
245
+
246
+ </keyword_hierarchy>
247
+
248
+ <formatting_patterns>
249
+ **Bold + CRITICAL keyword:**
250
+
251
+ ```markdown
252
+ **CRITICAL**: Always run tests before pushing code
253
+ ```
254
+
255
+ **Capitalized emphasis:**
256
+
257
+ ```markdown
258
+ IMPORTANT: Do not commit environment variables
259
+ YOU MUST: Follow the git workflow outlined below
260
+ NEVER: Include API keys in code
261
+ ALWAYS: Use TypeScript strict mode
262
+ ```
263
+
264
+ **Strikethrough for forbidden options:**
265
+
266
+ ```markdown
267
+ - `pnpm test:ci` - Run tests (use this)
268
+ - ~~`pnpm test`~~ - NEVER use (interactive mode)
269
+ ```
270
+
271
+ **Visual markers (use sparingly):**
272
+
273
+ ```markdown
274
+ ⚠️ WARNING: This affects production data
275
+ 🔒 SECURITY: Never commit secrets to git
276
+ ```
277
+
278
+ </formatting_patterns>
279
+
280
+ <placement_strategy>
281
+ Order matters. Claude pays more attention to:
282
+
283
+ 1. **First items** in each section (put critical rules first)
284
+ 2. **Repeated items** across sections (repeat critical rules in context)
285
+ 3. **Emphasized items** with CRITICAL/NEVER/ALWAYS keywords
286
+
287
+ Structure your file with critical rules first:
288
+
289
+ ```markdown
290
+ ## Code Conventions
291
+
292
+ ### Critical Rules
293
+
294
+ - **NEVER** commit .env files
295
+ - **ALWAYS** run tests before pushing
296
+ - **CRITICAL**: Use TanStack Form for ALL forms
297
+
298
+ ### General Guidelines
299
+
300
+ - Prefer Server Components
301
+ - Keep components under 300 lines
302
+ ```
303
+
304
+ </placement_strategy>
305
+
306
+ <repetition_for_emphasis>
307
+ For extremely important rules, repeat in multiple relevant contexts:
308
+
309
+ ```markdown
310
+ ## Forms
311
+
312
+ **CRITICAL**: Use TanStack Form for ALL forms
313
+
314
+ ## Before Editing
315
+
316
+ - **CRITICAL**: Use TanStack Form for forms
317
+
318
+ ## Code Review Checklist
319
+
320
+ - [ ] Forms use TanStack Form (**CRITICAL**)
321
+ ```
322
+
323
+ </repetition_for_emphasis>
324
+ </emphasis_techniques>
325
+
326
+ <writing_effective_instructions>
327
+ <golden_rule>
328
+ Show your CLAUDE.md to someone with minimal project context. If they're confused, Claude will be too.
329
+ </golden_rule>
330
+
331
+ <be_specific>
332
+ Vague instructions cause inconsistent behavior:
333
+
334
+ ```markdown
335
+ ❌ VAGUE:
336
+
337
+ - Format code properly
338
+ - Write good tests
339
+ - Follow best practices
340
+
341
+ ✅ SPECIFIC:
342
+
343
+ - Run `pnpm lint` before committing (Prettier configured)
344
+ - Write tests in `__tests__/` using Vitest
345
+ - Use TanStack Form for all forms (see `src/features/form/`)
346
+ ```
347
+
348
+ </be_specific>
349
+
350
+ <show_dont_tell>
351
+ When format matters, show examples:
352
+
353
+ ```markdown
354
+ ❌ TELLING:
355
+ Use conventional commits with type and description.
356
+
357
+ ✅ SHOWING:
358
+
359
+ ## Commit Format
360
+ ```
361
+
362
+ feat(auth): implement JWT authentication
363
+
364
+ Add login endpoint and token validation
365
+
366
+ ```
367
+ Types: feat, fix, refactor, docs, test, chore
368
+ ```
369
+
370
+ </show_dont_tell>
371
+
372
+ <eliminate_ambiguity>
373
+ Replace vague phrases with clear directives:
374
+
375
+ | Ambiguous | Clear Alternative |
376
+ | -------------------- | ----------------------------------- |
377
+ | "Try to..." | "Always..." or "Never..." |
378
+ | "Should probably..." | "Must..." or "May optionally..." |
379
+ | "Generally..." | "Always... except when [condition]" |
380
+ | "Consider..." | "If [condition], then [action]" |
381
+
382
+ </eliminate_ambiguity>
383
+
384
+ <define_edge_cases>
385
+ Anticipate questions and answer them:
386
+
387
+ ```markdown
388
+ ❌ INCOMPLETE:
389
+ Run tests before pushing.
390
+
391
+ ✅ COMPLETE:
392
+
393
+ ## Testing
394
+
395
+ - Run `pnpm test:ci` before pushing
396
+ - If tests fail, fix before committing
397
+ - New features require tests in `__tests__/`
398
+ - Minimum 80% coverage for new code
399
+ ```
400
+
401
+ </define_edge_cases>
402
+
403
+ <provide_decision_criteria>
404
+ When Claude must make choices, give criteria:
405
+
406
+ ```markdown
407
+ ## Component Choice
408
+
409
+ **Use Server Component when:**
410
+
411
+ - Data fetching only
412
+ - No user interaction needed
413
+
414
+ **Use Client Component when:**
415
+
416
+ - User interaction required
417
+ - Browser APIs needed (localStorage, window)
418
+ ```
419
+
420
+ </provide_decision_criteria>
421
+
422
+ <separate_obligation_levels>
423
+ Clearly distinguish requirements from suggestions:
424
+
425
+ ```markdown
426
+ ## API Development
427
+
428
+ ### Must Have
429
+
430
+ - Input validation with Zod
431
+ - Error handling for all endpoints
432
+
433
+ ### Nice to Have
434
+
435
+ - Pagination for list endpoints
436
+ - Caching headers
437
+
438
+ ### Must Not
439
+
440
+ - Expose internal errors to clients
441
+ - Log sensitive data
442
+ ```
443
+
444
+ </separate_obligation_levels>
445
+ </writing_effective_instructions>
446
+
447
+ <size_constraints>
448
+ <limits>
449
+
450
+ - **Ideal**: 100-200 lines maximum
451
+ - **Practical max**: 300 lines before splitting
452
+ - **Universal items**: Under 60 lines
453
+
454
+ **Why these limits matter:**
455
+
456
+ - Claude reliably follows ~150-200 total instructions
457
+ - Claude Code's system prompt uses ~50 instructions
458
+ - Leaves ~100-150 slots for YOUR instructions
459
+ - Irrelevant content degrades instruction-following
460
+ </limits>
461
+
462
+ <scaling_strategy>
463
+ When exceeding limits:
464
+
465
+ 1. Move task-specific details to separate files
466
+ 2. Link from CLAUDE.md with descriptions
467
+ 3. Use progressive disclosure pattern
468
+
469
+ ```markdown
470
+ ## Detailed Guides
471
+
472
+ - **API Routes**: See [docs/api-patterns.md](docs/api-patterns.md)
473
+ - **Testing**: See [docs/testing-guide.md](docs/testing-guide.md)
474
+ - **Deployment**: See [docs/deployment.md](docs/deployment.md)
475
+ ```
476
+
477
+ </scaling_strategy>
478
+ </size_constraints>
479
+
480
+ <imports_feature>
481
+ CLAUDE.md supports importing other markdown files:
482
+
483
+ ```markdown
484
+ ## External References
485
+
486
+ @docs/coding-standards.md
487
+ @~/.claude/my-global-preferences.md
488
+ @./team-conventions.md
489
+ ```
490
+
491
+ <import_rules>
492
+
493
+ - Supports relative and absolute paths
494
+ - Home directory expansion with `~`
495
+ - Recursive imports up to 5 levels deep
496
+ - NOT evaluated inside code blocks or backticks
497
+ </import_rules>
498
+ </imports_feature>
499
+
500
+ <anti_patterns>
501
+ <never_include>
502
+ **Code Style Rules** - Use linters instead (LLMs are expensive, linters are free)
503
+
504
+ **Secrets** - NEVER include API keys, database URLs, tokens, credentials
505
+
506
+ **Too Much Content** - Link to docs instead of embedding 500+ lines
507
+
508
+ **Extensive Code** - Reference files instead (code examples become outdated)
509
+
510
+ **Vague Instructions** - Be specific (see `<writing_effective_instructions>`)
511
+ </never_include>
512
+
513
+ <examples_what_to_avoid>
514
+
515
+ ```markdown
516
+ ❌ BAD:
517
+
518
+ - Use 2-space indentation (use Prettier instead)
519
+ - DATABASE_URL=postgresql://... (never include secrets)
520
+ - [500 lines of API docs] (link to external file)
521
+ - Format code properly (too vague)
522
+
523
+ ✅ GOOD:
524
+
525
+ - ESLint/Prettier configured (see .eslintrc)
526
+ - Credentials in `.env` (never committed)
527
+ - API guide: See [docs/api.md](docs/api.md)
528
+ - Run `pnpm lint` before committing
529
+ ```
530
+
531
+ </examples_what_to_avoid>
532
+ </anti_patterns>
533
+
534
+ <examples>
535
+ For complete examples, see reference files:
536
+
537
+ - **Minimal example**: [references/section-templates.md](references/section-templates.md) (templates section)
538
+ - **Comprehensive SaaS**: [references/comprehensive-example.md](references/comprehensive-example.md)
539
+ - **Project-specific**: [references/project-patterns.md](references/project-patterns.md) (Next.js, Express, Python, Monorepo)
540
+ </examples>
541
+
542
+ <workflow>
543
+ <decision_point>
544
+ **ALWAYS ASK FIRST: Storage Strategy**
545
+
546
+ Before creating or updating memory files, ask the user:
547
+
548
+ > Do you want to use a single CLAUDE.md file or split into separate `.claude/rules/` files?
549
+ >
550
+ > **Option 1: Single CLAUDE.md** - All instructions in one file (simpler, best for small projects)
551
+ > **Option 2: Modular .claude/rules/** - Split by concern with optional path-scoping (better for large projects)
552
+
553
+ Use AskUserQuestion to present these options before proceeding.
554
+
555
+ **Decision guide:**
556
+
557
+ - **Choose CLAUDE.md** if: < 100 lines of instructions, simple project, universal rules
558
+ - **Choose .claude/rules/** if: 100+ lines, multiple file types with different rules, team maintains different areas
559
+ </decision_point>
560
+
561
+ <creating_new>
562
+ **Creating New Memory (CLAUDE.md approach)**
563
+
564
+ 1. Start with `/init` or minimal template
565
+ 2. Add tech stack and commands first
566
+ 3. Add conventions as you encounter friction
567
+ 4. Test with real tasks
568
+ 5. Iterate based on Claude's behavior
569
+ </creating_new>
570
+
571
+ <creating_rules>
572
+ **Creating New Memory (.claude/rules/ approach)**
573
+
574
+ 1. Create `.claude/rules/` directory
575
+ 2. Start with one file per major concern:
576
+ - `general.md` - Universal project rules
577
+ - `testing.md` - Testing conventions
578
+ - `code-style.md` - Code conventions
579
+ 3. Add path-scoped rules as needed:
580
+ ```yaml
581
+ ---
582
+ paths:
583
+ - "src/api/**/*.ts"
584
+ ---
585
+ # API rules here
586
+ ```
587
+ 4. Test with real tasks in different file contexts
588
+ 5. Split or merge files based on usage patterns
589
+ </creating_rules>
590
+
591
+ <maintaining>
592
+ **Maintaining Memory Files**
593
+
594
+ 1. Review quarterly (or when project changes significantly)
595
+ 2. Remove outdated instructions
596
+ 3. Add patterns that required repeated explanation
597
+ 4. Keep CLAUDE.md under 200 lines (or split to .claude/rules/)
598
+ 5. Use `#` for quick additions during work
599
+ </maintaining>
600
+
601
+ <migrating_to_rules>
602
+ **Migrating from CLAUDE.md to .claude/rules/**
603
+
604
+ When CLAUDE.md exceeds 200 lines:
605
+
606
+ 1. Identify distinct sections (testing, API, frontend, etc.)
607
+ 2. Create `.claude/rules/` directory
608
+ 3. Move each section to its own file
609
+ 4. Add `paths` frontmatter where rules are file-type specific
610
+ 5. Keep only universal essentials in CLAUDE.md (or delete it)
611
+ 6. Test to ensure rules load correctly
612
+ </migrating_to_rules>
613
+
614
+ <troubleshooting>
615
+ **Common Issues**
616
+
617
+ | Problem | Solution |
618
+ | --------------------------- | ------------------------------------------------ |
619
+ | Claude ignores instructions | Reduce file size, add emphasis (CRITICAL, NEVER) |
620
+ | Context overflow | Use `/clear`, split into .claude/rules/ files |
621
+ | Outdated information | Review quarterly, remove stale content |
622
+ | Instructions conflict | Consolidate, use hierarchy (root vs subtree) |
623
+ | Rules not loading | Check file is `.md`, in correct directory |
624
+ | Path rules not applying | Verify glob pattern matches target files |
625
+
626
+ </troubleshooting>
627
+ </workflow>
628
+
629
+ <advanced_features>
630
+ <local_overrides>
631
+ Use `CLAUDE.local.md` for personal preferences (auto-gitignored):
632
+
633
+ - Personal shortcuts and aliases
634
+ - Editor-specific settings
635
+ - Local testing commands
636
+ </local_overrides>
637
+
638
+ <settings_integration>
639
+ CLAUDE.md works alongside `settings.json`:
640
+
641
+ - `settings.json`: Permissions, allowed tools, environment variables
642
+ - `CLAUDE.md`: Context, conventions, workflow instructions
643
+ </settings_integration>
644
+
645
+ <progressive_disclosure>
646
+ For complex projects, link to detailed docs. Claude only loads when relevant:
647
+
648
+ ```markdown
649
+ ## References
650
+
651
+ - **Database**: See [docs/database.md](docs/database.md)
652
+ - **API**: See [docs/api.md](docs/api.md)
653
+ ```
654
+
655
+ </progressive_disclosure>
656
+ </advanced_features>
657
+
658
+ <success_criteria>
659
+ A well-crafted Claude memory system:
660
+
661
+ **For CLAUDE.md approach:**
662
+
663
+ - Loads in under 200 lines
664
+ - Contains only project-specific context (not general knowledge)
665
+ - Uses emphasis for critical rules (CRITICAL, NEVER, ALWAYS)
666
+ - Avoids code style rules (use linters)
667
+ - Contains NO secrets or credentials
668
+ - Provides clear commands for common tasks
669
+ - Follows WHAT-WHY-HOW structure
670
+
671
+ **For .claude/rules/ approach:**
672
+
673
+ - Each file focused on one concern (testing, API, security, etc.)
674
+ - Path-scoped rules use accurate glob patterns
675
+ - No duplicate rules across files
676
+ - Files organized in logical subdirectories
677
+ - Symlinks used for shared rules across projects
678
+
679
+ **Both approaches:**
680
+
681
+ - Gets updated as project evolves
682
+ - Improves Claude's first-try accuracy on tasks
683
+ - User was asked which approach they prefer before implementation
684
+ </success_criteria>
685
+
686
+ <reference_guides>
687
+ For deeper topics:
688
+
689
+ - **Rules directory guide**: [references/rules-directory-guide.md](references/rules-directory-guide.md) - Complete guide to .claude/rules/ with official documentation, path-scoping, YAML syntax, and examples
690
+ - **Prompting techniques**: [references/prompting-techniques.md](references/prompting-techniques.md) - Master guide for writing effective instructions, emphasis strategies, clarity techniques
691
+ - **Comprehensive example**: [references/comprehensive-example.md](references/comprehensive-example.md) - Full production SaaS CLAUDE.md
692
+ - **Section templates**: [references/section-templates.md](references/section-templates.md) - Copy-paste templates for each section
693
+ - **Common patterns by project type**: [references/project-patterns.md](references/project-patterns.md) - Next.js, Express, Python, Monorepo patterns
694
+ </reference_guides>