aiblueprint-cli 1.4.59 → 1.4.61

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 (184) hide show
  1. package/README.md +16 -36
  2. package/agents-config/agents/action.md +1 -1
  3. package/agents-config/agents/explore-codebase.md +53 -53
  4. package/agents-config/agents/explore-docs.md +50 -69
  5. package/agents-config/agents/websearch.md +36 -40
  6. package/agents-config/claude-config/scripts/.claude/skills/fix-on-my-computer/SKILL.md +81 -0
  7. package/agents-config/claude-config/scripts/CLAUDE.md +10 -4
  8. package/agents-config/claude-config/scripts/bun.lockb +0 -0
  9. package/agents-config/claude-config/scripts/package.json +22 -30
  10. package/agents-config/claude-config/scripts/statusline/CLAUDE.md +37 -155
  11. package/agents-config/claude-config/scripts/statusline/README.md +18 -94
  12. package/agents-config/claude-config/scripts/statusline/defaults.json +13 -10
  13. package/agents-config/claude-config/scripts/statusline/fixtures/mock-transcript.jsonl +4 -4
  14. package/agents-config/claude-config/scripts/statusline/fixtures/test-input.json +4 -4
  15. package/agents-config/claude-config/scripts/statusline/src/commands/interactive-config.ts +403 -0
  16. package/agents-config/claude-config/scripts/statusline/src/index.ts +33 -82
  17. package/agents-config/claude-config/scripts/statusline/src/lib/config-types.ts +7 -1
  18. package/agents-config/claude-config/scripts/statusline/src/lib/formatters.ts +40 -0
  19. package/agents-config/claude-config/scripts/statusline/src/lib/presets.ts +13 -13
  20. package/agents-config/claude-config/scripts/statusline/src/lib/render-pure.ts +24 -5
  21. package/agents-config/claude-config/scripts/statusline/statusline.config.free.json +79 -0
  22. package/agents-config/claude-config/scripts/statusline/statusline.config.json +77 -77
  23. package/agents-config/codex-config/config.toml +9 -0
  24. package/agents-config/codex-config/hooks/command-deny-list.ts +203 -0
  25. package/agents-config/commands/prompts/create-vitejs-app.md +272 -0
  26. package/agents-config/commands/prompts/nextjs-add-prisma-db.md +136 -0
  27. package/agents-config/commands/prompts/nextjs-setup-better-auth.md +173 -0
  28. package/agents-config/commands/prompts/nextjs-setup-project.md +200 -0
  29. package/agents-config/commands/prompts/prompt.md +55 -0
  30. package/agents-config/commands/prompts/saas-challenge-idea.md +135 -0
  31. package/agents-config/commands/prompts/saas-create-architecture.md +242 -0
  32. package/agents-config/commands/prompts/saas-create-headline.md +132 -0
  33. package/agents-config/commands/prompts/saas-create-landing-copywritting.md +267 -0
  34. package/agents-config/commands/prompts/saas-create-legals-docs.md +176 -0
  35. package/agents-config/commands/prompts/saas-create-logos.md +240 -0
  36. package/agents-config/commands/prompts/saas-create-prd.md +195 -0
  37. package/agents-config/commands/prompts/saas-create-tasks.md +240 -0
  38. package/agents-config/commands/prompts/saas-define-pricing.md +293 -0
  39. package/agents-config/commands/prompts/saas-find-domain-name.md +190 -0
  40. package/agents-config/commands/prompts/saas-implement-landing-page.md +257 -0
  41. package/agents-config/commands/prompts/setup-tmux.md +160 -0
  42. package/agents-config/commands/prompts/tools.md +148 -0
  43. package/agents-config/scripts/.claude/skills/fix-on-my-computer/SKILL.md +81 -0
  44. package/agents-config/scripts/CLAUDE.md +37 -0
  45. package/agents-config/scripts/biome.json +37 -0
  46. package/agents-config/scripts/bun.lockb +0 -0
  47. package/agents-config/scripts/package.json +24 -0
  48. package/agents-config/scripts/statusline/CLAUDE.md +87 -0
  49. package/agents-config/scripts/statusline/README.md +117 -0
  50. package/agents-config/scripts/statusline/__tests__/context.test.ts +229 -0
  51. package/agents-config/scripts/statusline/__tests__/formatters.test.ts +108 -0
  52. package/agents-config/scripts/statusline/__tests__/statusline.test.ts +309 -0
  53. package/agents-config/scripts/statusline/defaults.json +82 -0
  54. package/agents-config/scripts/statusline/fixtures/mock-transcript.jsonl +4 -0
  55. package/agents-config/scripts/statusline/fixtures/test-input.json +35 -0
  56. package/agents-config/scripts/statusline/src/commands/interactive-config.ts +403 -0
  57. package/agents-config/scripts/statusline/src/index.ts +141 -0
  58. package/agents-config/scripts/statusline/src/lib/config-types.ts +110 -0
  59. package/agents-config/scripts/statusline/src/lib/config.ts +21 -0
  60. package/agents-config/scripts/statusline/src/lib/context.ts +103 -0
  61. package/agents-config/scripts/statusline/src/lib/formatters.ts +426 -0
  62. package/agents-config/scripts/statusline/src/lib/git.ts +100 -0
  63. package/agents-config/scripts/statusline/src/lib/menu-factories.ts +224 -0
  64. package/agents-config/scripts/statusline/src/lib/presets.ts +177 -0
  65. package/agents-config/scripts/statusline/src/lib/render-pure.ts +516 -0
  66. package/agents-config/scripts/statusline/src/lib/types.ts +36 -0
  67. package/agents-config/scripts/statusline/src/lib/utils.ts +15 -0
  68. package/agents-config/scripts/statusline/statusline.config.free.json +79 -0
  69. package/agents-config/scripts/statusline/statusline.config.json +79 -0
  70. package/agents-config/scripts/statusline/test-with-fixtures.ts +37 -0
  71. package/agents-config/scripts/statusline/test.ts +20 -0
  72. package/agents-config/scripts/statusline/tsconfig.json +27 -0
  73. package/agents-config/scripts/tsconfig.json +27 -0
  74. package/agents-config/skills/{subagent-creator → agents-managers}/SKILL.md +47 -47
  75. package/agents-config/skills/{subagent-creator/references/subagents.md → agents-managers/references/agents.md} +45 -45
  76. package/agents-config/skills/{subagent-creator → agents-managers}/references/context-management.md +20 -20
  77. package/agents-config/skills/{subagent-creator → agents-managers}/references/debugging-agents.md +27 -27
  78. package/agents-config/skills/{subagent-creator → agents-managers}/references/error-handling-and-recovery.md +19 -19
  79. package/agents-config/skills/{subagent-creator → agents-managers}/references/evaluation-and-testing.md +29 -29
  80. package/agents-config/skills/{subagent-creator → agents-managers}/references/orchestration-patterns.md +5 -5
  81. package/agents-config/skills/{subagent-creator/references/writing-subagent-prompts.md → agents-managers/references/writing-agent-prompts.md} +23 -23
  82. package/agents-config/skills/codex-environment/SKILL.md +2 -0
  83. package/agents-config/skills/commit/SKILL.md +2 -0
  84. package/agents-config/skills/create-pr/SKILL.md +2 -0
  85. package/agents-config/skills/environments-manager/SKILL.md +271 -0
  86. package/agents-config/skills/environments-manager/examples/claude/.worktreeinclude +3 -0
  87. package/agents-config/skills/environments-manager/examples/claude/commands/dev.md +5 -0
  88. package/agents-config/skills/environments-manager/examples/claude/commands/lint.md +5 -0
  89. package/agents-config/skills/environments-manager/examples/claude/commands/test.md +5 -0
  90. package/agents-config/skills/environments-manager/examples/claude/commands/typecheck.md +5 -0
  91. package/agents-config/skills/environments-manager/examples/claude/settings.json +24 -0
  92. package/agents-config/skills/environments-manager/examples/codex/environments/environment.toml +29 -0
  93. package/agents-config/skills/environments-manager/examples/cursor/worktrees.json +3 -0
  94. package/agents-config/skills/environments-manager/examples/scripts/claude-worktree-create.sh +96 -0
  95. package/agents-config/skills/environments-manager/examples/scripts/claude-worktree-remove.sh +66 -0
  96. package/agents-config/skills/environments-manager/examples/scripts/dev.sh +15 -0
  97. package/agents-config/skills/environments-manager/examples/scripts/worktree-down.sh +22 -0
  98. package/agents-config/skills/environments-manager/examples/scripts/worktree-up.sh +50 -0
  99. package/agents-config/skills/environments-manager/references/claude.md +156 -0
  100. package/agents-config/skills/environments-manager/references/codex.md +97 -0
  101. package/agents-config/skills/environments-manager/references/cursor.md +88 -0
  102. package/agents-config/skills/fix-pr-comments/SKILL.md +2 -0
  103. package/agents-config/skills/grill-me/SKILL.md +10 -0
  104. package/agents-config/skills/merge/SKILL.md +2 -0
  105. package/agents-config/skills/rules-manager/SKILL.md +191 -0
  106. package/agents-config/skills/rules-manager/references/agents-vs-claude.md +66 -0
  107. package/agents-config/skills/rules-manager/references/examples.md +117 -0
  108. package/agents-config/skills/skill-manager/SKILL.md +101 -0
  109. package/agents-config/skills/skill-manager/references/claude-code.md +81 -0
  110. package/agents-config/skills/skill-manager/references/codex.md +288 -0
  111. package/agents-config/skills/skill-manager/references/cursor.md +125 -0
  112. package/agents-config/skills/skill-manager/references/description-recommandation.md +97 -0
  113. package/agents-config/skills/skill-manager/scripts/inspect-description.ts +743 -0
  114. package/agents-config/skills/ultrathink/SKILL.md +2 -0
  115. package/dist/cli.js +581 -299
  116. package/package.json +1 -1
  117. package/agents-config/claude-config/scripts/statusline/data/.gitignore +0 -8
  118. package/agents-config/claude-config/scripts/statusline/data/.gitkeep +0 -0
  119. package/agents-config/claude-config/scripts/statusline/docs/ARCHITECTURE.md +0 -166
  120. package/agents-config/claude-config/scripts/statusline/src/tests/spend-v2.test.ts +0 -306
  121. package/agents-config/skills/apex/SKILL.md +0 -261
  122. package/agents-config/skills/apex/scripts/setup-templates.sh +0 -100
  123. package/agents-config/skills/apex/scripts/update-progress.sh +0 -80
  124. package/agents-config/skills/apex/steps/step-00-init.md +0 -267
  125. package/agents-config/skills/apex/steps/step-00b-branch.md +0 -126
  126. package/agents-config/skills/apex/steps/step-00b-economy.md +0 -244
  127. package/agents-config/skills/apex/steps/step-00b-interactive.md +0 -153
  128. package/agents-config/skills/apex/steps/step-01-analyze.md +0 -361
  129. package/agents-config/skills/apex/steps/step-02-plan.md +0 -264
  130. package/agents-config/skills/apex/steps/step-03-execute.md +0 -239
  131. package/agents-config/skills/apex/steps/step-04-validate.md +0 -251
  132. package/agents-config/skills/apex/templates/00-context.md +0 -43
  133. package/agents-config/skills/apex/templates/01-analyze.md +0 -10
  134. package/agents-config/skills/apex/templates/02-plan.md +0 -10
  135. package/agents-config/skills/apex/templates/03-execute.md +0 -10
  136. package/agents-config/skills/apex/templates/04-validate.md +0 -10
  137. package/agents-config/skills/apex/templates/README.md +0 -176
  138. package/agents-config/skills/apex/templates/step-complete.md +0 -7
  139. package/agents-config/skills/claude-memory/SKILL.md +0 -293
  140. package/agents-config/skills/claude-memory/references/comprehensive-example.md +0 -175
  141. package/agents-config/skills/claude-memory/references/optimize-guide.md +0 -300
  142. package/agents-config/skills/claude-memory/references/project-patterns.md +0 -334
  143. package/agents-config/skills/claude-memory/references/prompting-techniques.md +0 -411
  144. package/agents-config/skills/claude-memory/references/rules-directory-guide.md +0 -298
  145. package/agents-config/skills/claude-memory/references/section-templates.md +0 -347
  146. package/agents-config/skills/fix-errors/SKILL.md +0 -61
  147. package/agents-config/skills/fix-grammar/SKILL.md +0 -59
  148. package/agents-config/skills/ralph-loop/SKILL.md +0 -117
  149. package/agents-config/skills/ralph-loop/scripts/setup.sh +0 -278
  150. package/agents-config/skills/ralph-loop/steps/step-00-init.md +0 -215
  151. package/agents-config/skills/ralph-loop/steps/step-01-interactive-prd.md +0 -366
  152. package/agents-config/skills/ralph-loop/steps/step-02-create-stories.md +0 -273
  153. package/agents-config/skills/ralph-loop/steps/step-03-finish.md +0 -245
  154. package/agents-config/skills/skill-creator/LICENSE.txt +0 -202
  155. package/agents-config/skills/skill-creator/SKILL.md +0 -421
  156. package/agents-config/skills/skill-creator/package.json +0 -5
  157. package/agents-config/skills/skill-creator/references/output-patterns.md +0 -82
  158. package/agents-config/skills/skill-creator/references/progressive-disclosure-patterns.md +0 -374
  159. package/agents-config/skills/skill-creator/references/prompting-integration.md +0 -363
  160. package/agents-config/skills/skill-creator/references/real-world-examples.md +0 -513
  161. package/agents-config/skills/skill-creator/references/script-patterns.md +0 -385
  162. package/agents-config/skills/skill-creator/references/workflows.md +0 -28
  163. package/agents-config/skills/skill-creator/references/xml-tag-guide.md +0 -606
  164. package/agents-config/skills/skill-creator/scripts/init-skill.ts +0 -214
  165. package/agents-config/skills/skill-creator/scripts/package-skill.ts +0 -146
  166. package/agents-config/skills/skill-creator/scripts/validate.ts +0 -138
  167. package/agents-config/skills/workflow-apex-free/SKILL.md +0 -261
  168. package/agents-config/skills/workflow-apex-free/scripts/setup-templates.sh +0 -100
  169. package/agents-config/skills/workflow-apex-free/scripts/update-progress.sh +0 -80
  170. package/agents-config/skills/workflow-apex-free/steps/step-00-init.md +0 -267
  171. package/agents-config/skills/workflow-apex-free/steps/step-00b-branch.md +0 -126
  172. package/agents-config/skills/workflow-apex-free/steps/step-00b-economy.md +0 -244
  173. package/agents-config/skills/workflow-apex-free/steps/step-00b-interactive.md +0 -153
  174. package/agents-config/skills/workflow-apex-free/steps/step-01-analyze.md +0 -361
  175. package/agents-config/skills/workflow-apex-free/steps/step-02-plan.md +0 -264
  176. package/agents-config/skills/workflow-apex-free/steps/step-03-execute.md +0 -239
  177. package/agents-config/skills/workflow-apex-free/steps/step-04-validate.md +0 -251
  178. package/agents-config/skills/workflow-apex-free/templates/00-context.md +0 -43
  179. package/agents-config/skills/workflow-apex-free/templates/01-analyze.md +0 -10
  180. package/agents-config/skills/workflow-apex-free/templates/02-plan.md +0 -10
  181. package/agents-config/skills/workflow-apex-free/templates/03-execute.md +0 -10
  182. package/agents-config/skills/workflow-apex-free/templates/04-validate.md +0 -10
  183. package/agents-config/skills/workflow-apex-free/templates/README.md +0 -176
  184. package/agents-config/skills/workflow-apex-free/templates/step-complete.md +0 -7
@@ -1,300 +0,0 @@
1
- # CLAUDE.md Optimization Guide
2
-
3
- ## Research Foundation
4
-
5
- Based on "Evaluating AGENTS.md" (ETH Zurich, arXiv 2602.11988, Feb 2026) — the first rigorous study of repository context files for coding agents:
6
-
7
- **Key findings:**
8
- - Context files with unnecessary specs **reduce** task success rates vs no context at all
9
- - LLM-generated context files reduced success by 0.5-2% and increased costs 20-23%
10
- - Developer-written **minimal** files improved performance by 4%
11
- - Repository overviews are useless — agents discover structure themselves
12
- - Removing redundant documentation improved performance by 2.7%
13
- - Instructions ARE reliably followed (mentioned tools used 1.6-2.5x more) — the problem is **what** you instruct, not **whether** it's followed
14
- - Files averaging 641 words performed; files with unnecessary complexity degraded
15
-
16
- **The paradox:** More instructions = worse performance. The agent follows your instructions faithfully, but unnecessary constraints make the task harder.
17
-
18
- **Conclusion:** Write only what the agent cannot discover on its own. Everything else is noise that actively hurts.
19
-
20
- ## Additional Metrics (SFEIR Institute, Feb 2026)
21
-
22
- - Files over 200 lines: 30% of directives silently lost
23
- - Vague instructions: +45% manual corrections needed
24
- - Explicit prohibitions: more effective than positive guidance
25
- - Modular `.claude/rules/` with path-scoping: 40% noise reduction, 35% relevance increase
26
- - Documented test/build commands: 30% reduction in back-and-forth
27
- - 3-5 concrete code examples: 40% reduction in correction requests
28
-
29
- ## The 7 Essential Sections
30
-
31
- Every optimized CLAUDE.md should contain ONLY these. Nothing else.
32
-
33
- ### 1. Project Purpose (1-3 lines)
34
- What the project is. One sentence is ideal. The agent doesn't need your vision or goals.
35
-
36
- ```markdown
37
- # MyApp
38
- SaaS invoice management platform with Stripe billing.
39
- ```
40
-
41
- **Kill:** Vision statements, goals, target audience, roadmaps, business metrics, "why we built this."
42
-
43
- ### 2. Tech Stack (compact)
44
- Only technologies the agent can't detect from package.json/config files.
45
-
46
- ```markdown
47
- ## Tech Stack
48
- - Next.js 15 (App Router) + TypeScript
49
- - Prisma + PostgreSQL
50
- - TanStack Form + Zod
51
- - Tailwind + shadcn/ui
52
- ```
53
-
54
- **Kill:** Version numbers from lockfiles, obvious deps (React in Next.js), descriptions of what each lib does.
55
-
56
- ### 3. Core Commands
57
- Commands the agent needs. Only non-obvious ones.
58
-
59
- ```markdown
60
- ## Commands
61
- - `pnpm dev` - Dev server
62
- - `pnpm build` - Production build
63
- - `pnpm db:push` - Push schema changes
64
- - `pnpm db:seed` - Seed database
65
- ```
66
-
67
- **Kill:** `pnpm install` (obvious), `pnpm start` (obvious), self-explanatory package.json scripts.
68
-
69
- ### 4. Testing Commands
70
- How to run tests. The research shows documented test commands reduce back-and-forth 30%.
71
-
72
- ```markdown
73
- ## Testing
74
- - `pnpm test` - Run all tests
75
- - `pnpm test:e2e` - E2E tests (needs running dev server)
76
- - Single file: `pnpm vitest run path/to/file.test.ts`
77
- ```
78
-
79
- ### 5. Important Files
80
- Only files the agent wouldn't find naturally. Architecture-critical, non-obvious files.
81
-
82
- ```markdown
83
- ## Important Files
84
- - `src/lib/auth.ts` - Auth config (Better Auth)
85
- - `src/lib/safe-actions.ts` - Server action wrapper
86
- ```
87
-
88
- **Kill:** `package.json`, `tsconfig.json`, `next.config.js`, any standard framework file the agent already knows.
89
-
90
- ### 6. Project-Specific Rules (Highest Value)
91
- Prohibitions and constraints that prevent recurring mistakes. Research shows explicit prohibitions are more effective than positive guidance.
92
-
93
- ```markdown
94
- ## Rules
95
- - NEVER import from `@/features/*/server` in client components
96
- - ALWAYS use `safe-action` wrapper for server actions
97
- - Use TanStack Form for ALL forms (not native form/useState)
98
- - Errors must use `ActionError` not `throw new Error`
99
- ```
100
-
101
- **These are the most valuable lines in the entire file.** Each rule should encode a mistake that was made before and must not be repeated.
102
-
103
- ### 7. Workflow (optional)
104
- Only if the project has a non-standard workflow.
105
-
106
- ```markdown
107
- ## Workflow
108
- - Start with plan mode for features touching 3+ files
109
- - Run `pnpm build` after changes (strict TypeScript)
110
- ```
111
-
112
- **Kill:** Standard git workflows, obvious PR processes.
113
-
114
- ## The 6 Bloat Categories (What to Remove)
115
-
116
- ### Category 1: Linter-Enforced Rules
117
- The research is clear: if a tool enforces it, the context file shouldn't mention it.
118
-
119
- Delete anything ESLint, Prettier, Biome, or TypeScript strict mode handles:
120
- - Indentation, semicolons, trailing commas, quote style
121
- - Import ordering, max line length
122
- - Naming conventions in ESLint rules
123
- - "Use const over let" / "Prefer arrow functions"
124
- - "No unused variables" / "No any type"
125
- - Type annotation rules
126
-
127
- **Test:** Does `.eslintrc`, `biome.json`, or `tsconfig.json` enforce this? → Delete from CLAUDE.md.
128
-
129
- ### Category 2: Repository Overviews
130
- The paper proved these are useless — agents discover repo structure themselves with zero performance benefit:
131
-
132
- - Directory structure descriptions (agent can `ls`)
133
- - Folder explanations (`src/components/ contains React components`)
134
- - Architecture diagrams in text
135
- - "This is a monorepo" (agent sees `packages/` or `apps/`)
136
- - Framework defaults ("Next.js uses file-based routing")
137
- - Feature descriptions ("The auth module handles login")
138
-
139
- ### Category 3: Marketing / Goals / Vision
140
- Zero value for code generation:
141
- - Mission statements, vision, goals
142
- - Target audience, competitive positioning
143
- - Feature roadmaps, business metrics
144
- - "Why we built this" narratives
145
-
146
- ### Category 4: Redundant Specifications
147
- The paper found removing redundant docs improved performance by 2.7%:
148
-
149
- - Copy of TypeScript config settings
150
- - Copy of ESLint config
151
- - Environment variable names (agent reads `.env.example`)
152
- - Database schema prose (agent reads `schema.prisma`)
153
- - API route docs (agent reads the code)
154
- - Component prop docs (TypeScript types handle this)
155
- - README content repeated in CLAUDE.md
156
-
157
- ### Category 5: Verbose Explanations
158
- Multi-paragraph explanations actively hurt — they consume context budget and add complexity:
159
-
160
- - Paragraphs explaining why a pattern exists (one line is enough)
161
- - Tutorials, onboarding guides, historical context
162
- - Code examples longer than 5 lines (reference the file instead)
163
- - Filler phrases: "In order to", "It's important to note that", "Please make sure to"
164
-
165
- ### Category 6: Generic Best Practices
166
- The agent already knows these. Adding them wastes instruction slots:
167
- - "Write clean code" / "Follow SOLID principles"
168
- - "Write tests" (without specific commands)
169
- - "Use meaningful variable names" / "Keep functions small"
170
- - "DRY principle" / "Handle errors properly"
171
-
172
- ## Optimization Process
173
-
174
- ### Step 1: Inventory
175
- Read every CLAUDE.md and `.claude/rules/*.md` in the project.
176
- Count total lines across all files.
177
-
178
- ### Step 2: Cross-check linter configs
179
- Read ESLint/Biome/Prettier/TypeScript configs. Any CLAUDE.md line duplicating an enforced rule → delete.
180
-
181
- ### Step 3: Apply the 6 bloat categories
182
- For each line ask: **"Can the agent discover this by reading the project, or does a linter enforce this?"**
183
- If yes → delete.
184
-
185
- ### Step 4: Check for redundancy
186
- - Information duplicated across files → consolidate
187
- - Information in README also in CLAUDE.md → remove from CLAUDE.md
188
- - Information derivable from config files → remove
189
-
190
- ### Step 5: Compress survivors
191
- - Paragraphs → bullet points
192
- - 3-line rules → 1-line rules
193
- - Remove all filler words
194
- - Merge related items
195
-
196
- ### Step 6: Verify essentials remain
197
- - [ ] Project purpose (1-3 lines)
198
- - [ ] Tech stack (compact, non-obvious only)
199
- - [ ] Core commands (non-obvious only)
200
- - [ ] Testing commands
201
- - [ ] Important files (non-obvious only)
202
- - [ ] Project-specific rules (prohibitions + constraints)
203
- - [ ] Workflow (only if non-standard)
204
-
205
- ### Step 7: Present changes
206
- Show before/after with line counts. Explain what was removed and why (cite category). Let user approve.
207
-
208
- ## Target Metrics
209
-
210
- | Metric | Target | Research Basis |
211
- |--------|--------|----------------|
212
- | Total lines | < 100 ideal, < 150 max | >200 lines = 30% directive loss |
213
- | Sections | 5-7 | Minimal requirements only |
214
- | Filler words | 0 | +45% corrections when vague |
215
- | Linter-duplicate rules | 0 | Already enforced = wasted tokens |
216
- | Marketing/goals text | 0 | Zero value for code generation |
217
- | Generic best practices | 0 | Agent already knows them |
218
- | Repository overviews | 0 | Research: zero navigation benefit |
219
-
220
- ## Before vs After Example
221
-
222
- ### Before (bloated — 47 lines, typical file is 200+)
223
- ```markdown
224
- # MyApp - AI-Powered Invoice Management
225
-
226
- ## Vision
227
- MyApp aims to simplify invoicing for small businesses worldwide.
228
-
229
- ## Goals
230
- - Reach 10,000 users by Q3 2025
231
- - Achieve 99.9% uptime
232
-
233
- ## Tech Stack
234
- - Next.js 15 with App Router for server-side rendering
235
- - React 19 for building user interfaces
236
- - TypeScript for type safety
237
- - Prisma ORM for database access
238
- - PostgreSQL database hosted on Neon
239
- - Tailwind CSS for styling
240
- - shadcn/ui component library
241
- - Stripe for payment processing
242
-
243
- ## Directory Structure
244
- - src/app/ - Next.js app router pages
245
- - src/components/ - Reusable React components
246
- - src/lib/ - Utility functions
247
- - src/features/ - Feature modules
248
- - prisma/ - Database schema
249
-
250
- ## Code Style
251
- - Use 2-space indentation
252
- - Use semicolons
253
- - Use single quotes
254
- - Use const over let
255
- - No unused variables
256
- - Prefer arrow functions
257
- - Use PascalCase for components
258
- - Use camelCase for functions
259
-
260
- ## Important Notes
261
- In order to maintain code quality, it's important to note that
262
- all developers should follow clean code principles and ensure
263
- that the codebase remains maintainable and readable.
264
- ```
265
-
266
- ### After (optimized — complete file, 22 lines)
267
- ```markdown
268
- # MyApp
269
- SaaS invoice management platform.
270
-
271
- ## Tech Stack
272
- - Next.js 15 (App Router) + TypeScript
273
- - Prisma + PostgreSQL (Neon)
274
- - Stripe payments
275
- - Tailwind + shadcn/ui
276
-
277
- ## Commands
278
- - `pnpm dev` - Dev server
279
- - `pnpm build` - Build
280
- - `pnpm test` - Tests
281
- - `pnpm db:push` - Push schema
282
-
283
- ## Important Files
284
- - `src/lib/auth.ts` - Auth config
285
- - `src/lib/safe-actions.ts` - Server action wrapper
286
-
287
- ## Rules
288
- - ALWAYS use safe-action wrapper for server actions
289
- - NEVER import server modules in client components
290
- - Use TanStack Form for ALL forms
291
- ```
292
-
293
- **What was removed and why:**
294
- - Vision/Goals (Category 3: marketing — zero code value)
295
- - React 19, TypeScript descriptions (Category 2: obvious from package.json)
296
- - Directory structure (Category 2: agent discovers via `ls`)
297
- - All code style rules (Category 1: ESLint/Prettier enforces these)
298
- - "Important Notes" paragraph (Category 6: generic best practices + Category 5: filler)
299
-
300
- **Result:** 47 → 22 lines. Research predicts ~4% better task completion and ~20% cost reduction.
@@ -1,334 +0,0 @@
1
- <project_patterns>
2
- CLAUDE.md patterns optimized for specific project types.
3
-
4
- <nextjs_app_router>
5
- ```markdown
6
- # [Project Name] - Next.js App Router
7
-
8
- ## Tech Stack
9
- - Next.js 15 with App Router
10
- - TypeScript (strict mode)
11
- - TailwindCSS + shadcn/ui
12
- - [Database solution]
13
-
14
- ## Commands
15
- - `pnpm dev` - Start dev server
16
- - `pnpm build` - Production build
17
- - `pnpm lint` - Check code
18
- - `pnpm test:ci` - Run tests
19
-
20
- ## Directory Structure
21
- ```
22
- app/
23
- ├── (auth)/ # Auth routes
24
- ├── (dashboard)/ # Dashboard routes
25
- ├── api/ # API routes
26
- └── layout.tsx # Root layout
27
- src/
28
- ├── components/ # UI components
29
- ├── lib/ # Utilities
30
- └── hooks/ # React hooks
31
- ```
32
-
33
- ## Conventions
34
-
35
- ### Components
36
- - Prefer Server Components
37
- - Use `"use client"` only for interactivity
38
- - Keep components under 300 lines
39
-
40
- ### Data Fetching
41
- - Server Components: Direct database access
42
- - Client Components: TanStack Query
43
- - Mutations: Server Actions
44
-
45
- ### File Naming
46
- - `page.tsx` - Route pages
47
- - `layout.tsx` - Layouts
48
- - `loading.tsx` - Loading states
49
- - `error.tsx` - Error boundaries
50
-
51
- ## Important
52
- - **NEVER** use `use client` for data fetching
53
- - Always add `loading.tsx` for async pages
54
- - Use `generateMetadata` for SEO
55
- ```
56
- </nextjs_app_router>
57
-
58
- <nextjs_pages_router>
59
- ```markdown
60
- # [Project Name] - Next.js Pages Router
61
-
62
- ## Tech Stack
63
- - Next.js 14 with Pages Router
64
- - TypeScript
65
- - TailwindCSS
66
-
67
- ## Commands
68
- - `pnpm dev` - Development
69
- - `pnpm build` - Production build
70
- - `pnpm test` - Run tests
71
-
72
- ## Directory Structure
73
- ```
74
- pages/
75
- ├── api/ # API routes
76
- ├── _app.tsx # App wrapper
77
- ├── _document.tsx # Document
78
- └── index.tsx # Home page
79
- src/
80
- ├── components/ # Components
81
- ├── lib/ # Utilities
82
- └── hooks/ # Hooks
83
- ```
84
-
85
- ## Data Fetching
86
- - `getServerSideProps` - SSR data
87
- - `getStaticProps` - SSG data
88
- - `useSWR` or TanStack Query - Client data
89
-
90
- ## API Routes
91
- - Located in `pages/api/`
92
- - Use `NextApiRequest` and `NextApiResponse` types
93
- ```
94
- </nextjs_pages_router>
95
-
96
- <react_vite>
97
- ```markdown
98
- # [Project Name] - React + Vite
99
-
100
- ## Tech Stack
101
- - React 18 + TypeScript
102
- - Vite for bundling
103
- - TailwindCSS
104
- - TanStack Query
105
-
106
- ## Commands
107
- - `pnpm dev` - Start dev server
108
- - `pnpm build` - Production build
109
- - `pnpm preview` - Preview build
110
- - `pnpm test` - Run tests
111
-
112
- ## Directory Structure
113
- ```
114
- src/
115
- ├── components/ # UI components
116
- ├── features/ # Feature modules
117
- ├── hooks/ # Custom hooks
118
- ├── lib/ # Utilities
119
- ├── routes/ # Route components
120
- └── main.tsx # Entry point
121
- ```
122
-
123
- ## Conventions
124
- - Functional components only
125
- - Custom hooks for logic reuse
126
- - TanStack Query for server state
127
- - Zustand for client state
128
- ```
129
- </react_vite>
130
-
131
- <node_express>
132
- ```markdown
133
- # [Project Name] - Node.js API
134
-
135
- ## Tech Stack
136
- - Node.js + Express
137
- - TypeScript
138
- - PostgreSQL + Prisma
139
- - Jest for testing
140
-
141
- ## Commands
142
- - `pnpm dev` - Start with hot reload
143
- - `pnpm build` - Compile TypeScript
144
- - `pnpm start` - Start production
145
- - `pnpm test` - Run tests
146
-
147
- ## Directory Structure
148
- ```
149
- src/
150
- ├── controllers/ # Route handlers
151
- ├── middleware/ # Express middleware
152
- ├── models/ # Data models
153
- ├── routes/ # Route definitions
154
- ├── services/ # Business logic
155
- ├── utils/ # Helpers
156
- └── index.ts # Entry point
157
- ```
158
-
159
- ## Conventions
160
- - Controllers handle HTTP only
161
- - Services contain business logic
162
- - Middleware for cross-cutting concerns
163
- - Always validate input with Zod
164
-
165
- ## Error Handling
166
- - Use custom error classes
167
- - Central error middleware
168
- - Always return consistent error format
169
- ```
170
- </node_express>
171
-
172
- <python_fastapi>
173
- ```markdown
174
- # [Project Name] - Python FastAPI
175
-
176
- ## Tech Stack
177
- - Python 3.11+
178
- - FastAPI
179
- - SQLAlchemy + PostgreSQL
180
- - Pytest
181
-
182
- ## Commands
183
- - `uvicorn main:app --reload` - Development
184
- - `pytest` - Run tests
185
- - `ruff check .` - Lint
186
- - `ruff format .` - Format
187
-
188
- ## Directory Structure
189
- ```
190
- app/
191
- ├── api/ # Route handlers
192
- ├── core/ # Config, security
193
- ├── db/ # Database models
194
- ├── schemas/ # Pydantic models
195
- ├── services/ # Business logic
196
- └── main.py # Entry point
197
- ```
198
-
199
- ## Conventions
200
- - Pydantic for validation
201
- - Dependency injection for services
202
- - Async where beneficial
203
- - Type hints everywhere
204
- ```
205
- </python_fastapi>
206
-
207
- <monorepo_turborepo>
208
- ```markdown
209
- # [Project Name] - Turborepo Monorepo
210
-
211
- ## Tech Stack
212
- - Turborepo for build orchestration
213
- - pnpm workspaces
214
- - TypeScript
215
-
216
- ## Commands
217
- - `pnpm install` - Install all deps
218
- - `pnpm dev` - Start all apps
219
- - `pnpm build` - Build all packages
220
- - `pnpm test` - Test all packages
221
- - `pnpm --filter web dev` - Start specific app
222
-
223
- ## Directory Structure
224
- ```
225
- apps/
226
- ├── web/ # Main frontend
227
- ├── api/ # Backend API
228
- └── admin/ # Admin panel
229
- packages/
230
- ├── ui/ # Shared components
231
- ├── config/ # Shared config
232
- ├── types/ # Shared types
233
- └── utils/ # Shared utilities
234
- ```
235
-
236
- ## Package Development
237
- - Changes to `packages/*` require rebuild
238
- - Use `pnpm --filter` for targeted commands
239
- - Shared types in `packages/types`
240
-
241
- ## Conventions
242
- - Each app has its own CLAUDE.md
243
- - Root CLAUDE.md for universal rules
244
- - Keep packages focused and minimal
245
- ```
246
- </monorepo_turborepo>
247
-
248
- <cli_tool>
249
- ```markdown
250
- # [Tool Name] - CLI Tool
251
-
252
- ## Tech Stack
253
- - TypeScript
254
- - Commander.js for CLI
255
- - Chalk for colors
256
-
257
- ## Commands
258
- - `pnpm dev` - Watch mode
259
- - `pnpm build` - Compile
260
- - `pnpm link` - Link globally
261
- - `[tool-name] --help` - Show help
262
-
263
- ## Directory Structure
264
- ```
265
- src/
266
- ├── commands/ # CLI commands
267
- ├── lib/ # Core logic
268
- ├── utils/ # Helpers
269
- └── index.ts # Entry point
270
- ```
271
-
272
- ## Adding Commands
273
- 1. Create command in `src/commands/`
274
- 2. Register in `src/index.ts`
275
- 3. Add tests in `__tests__/`
276
-
277
- ## Output Conventions
278
- - Use chalk for colors
279
- - Errors to stderr
280
- - Progress with ora spinners
281
- ```
282
- </cli_tool>
283
-
284
- <library_package>
285
- ```markdown
286
- # [Library Name] - npm Package
287
-
288
- ## Tech Stack
289
- - TypeScript
290
- - tsup for bundling
291
- - Vitest for testing
292
-
293
- ## Commands
294
- - `pnpm build` - Build package
295
- - `pnpm test` - Run tests
296
- - `pnpm dev` - Watch mode
297
- - `pnpm publish` - Publish to npm
298
-
299
- ## Directory Structure
300
- ```
301
- src/
302
- ├── index.ts # Main exports
303
- ├── utils/ # Internal helpers
304
- └── types.ts # Type definitions
305
- ```
306
-
307
- ## Publishing Checklist
308
- 1. Update version in package.json
309
- 2. Run tests: `pnpm test`
310
- 3. Build: `pnpm build`
311
- 4. Publish: `pnpm publish`
312
-
313
- ## Conventions
314
- - Export types alongside functions
315
- - Document with JSDoc
316
- - Maintain backwards compatibility
317
- ```
318
- </library_package>
319
- </project_patterns>
320
-
321
- <customization_notes>
322
- <adapt_sections>
323
- Each pattern is a starting point. Adapt by:
324
-
325
- 1. Removing irrelevant sections
326
- 2. Adding project-specific conventions
327
- 3. Adjusting commands for your setup
328
- 4. Including critical architectural decisions
329
- </adapt_sections>
330
-
331
- <keep_minimal>
332
- Even for complex projects, aim for under 150 lines. Move detailed documentation to separate files and link from CLAUDE.md.
333
- </keep_minimal>
334
- </customization_notes>