aiblueprint-cli 1.4.59 → 1.4.60

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 (179) 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/commands/prompts/create-vitejs-app.md +272 -0
  24. package/agents-config/commands/prompts/nextjs-add-prisma-db.md +136 -0
  25. package/agents-config/commands/prompts/nextjs-setup-better-auth.md +173 -0
  26. package/agents-config/commands/prompts/nextjs-setup-project.md +200 -0
  27. package/agents-config/commands/prompts/prompt.md +55 -0
  28. package/agents-config/commands/prompts/saas-challenge-idea.md +135 -0
  29. package/agents-config/commands/prompts/saas-create-architecture.md +242 -0
  30. package/agents-config/commands/prompts/saas-create-headline.md +132 -0
  31. package/agents-config/commands/prompts/saas-create-landing-copywritting.md +267 -0
  32. package/agents-config/commands/prompts/saas-create-legals-docs.md +176 -0
  33. package/agents-config/commands/prompts/saas-create-logos.md +240 -0
  34. package/agents-config/commands/prompts/saas-create-prd.md +195 -0
  35. package/agents-config/commands/prompts/saas-create-tasks.md +240 -0
  36. package/agents-config/commands/prompts/saas-define-pricing.md +293 -0
  37. package/agents-config/commands/prompts/saas-find-domain-name.md +190 -0
  38. package/agents-config/commands/prompts/saas-implement-landing-page.md +257 -0
  39. package/agents-config/commands/prompts/setup-tmux.md +160 -0
  40. package/agents-config/commands/prompts/tools.md +148 -0
  41. package/agents-config/scripts/.claude/skills/fix-on-my-computer/SKILL.md +81 -0
  42. package/agents-config/scripts/CLAUDE.md +37 -0
  43. package/agents-config/scripts/biome.json +37 -0
  44. package/agents-config/scripts/bun.lockb +0 -0
  45. package/agents-config/scripts/package.json +24 -0
  46. package/agents-config/scripts/statusline/CLAUDE.md +87 -0
  47. package/agents-config/scripts/statusline/README.md +117 -0
  48. package/agents-config/scripts/statusline/__tests__/context.test.ts +229 -0
  49. package/agents-config/scripts/statusline/__tests__/formatters.test.ts +108 -0
  50. package/agents-config/scripts/statusline/__tests__/statusline.test.ts +309 -0
  51. package/agents-config/scripts/statusline/defaults.json +82 -0
  52. package/agents-config/scripts/statusline/fixtures/mock-transcript.jsonl +4 -0
  53. package/agents-config/scripts/statusline/fixtures/test-input.json +35 -0
  54. package/agents-config/scripts/statusline/src/commands/interactive-config.ts +403 -0
  55. package/agents-config/scripts/statusline/src/index.ts +141 -0
  56. package/agents-config/scripts/statusline/src/lib/config-types.ts +110 -0
  57. package/agents-config/scripts/statusline/src/lib/config.ts +21 -0
  58. package/agents-config/scripts/statusline/src/lib/context.ts +103 -0
  59. package/agents-config/scripts/statusline/src/lib/formatters.ts +426 -0
  60. package/agents-config/scripts/statusline/src/lib/git.ts +100 -0
  61. package/agents-config/scripts/statusline/src/lib/menu-factories.ts +224 -0
  62. package/agents-config/scripts/statusline/src/lib/presets.ts +177 -0
  63. package/agents-config/scripts/statusline/src/lib/render-pure.ts +516 -0
  64. package/agents-config/scripts/statusline/src/lib/types.ts +36 -0
  65. package/agents-config/scripts/statusline/src/lib/utils.ts +15 -0
  66. package/agents-config/scripts/statusline/statusline.config.free.json +79 -0
  67. package/agents-config/scripts/statusline/statusline.config.json +79 -0
  68. package/agents-config/scripts/statusline/test-with-fixtures.ts +37 -0
  69. package/agents-config/scripts/statusline/test.ts +20 -0
  70. package/agents-config/scripts/statusline/tsconfig.json +27 -0
  71. package/agents-config/scripts/tsconfig.json +27 -0
  72. package/agents-config/skills/{subagent-creator → agents-managers}/SKILL.md +47 -47
  73. package/agents-config/skills/{subagent-creator/references/subagents.md → agents-managers/references/agents.md} +45 -45
  74. package/agents-config/skills/{subagent-creator → agents-managers}/references/context-management.md +20 -20
  75. package/agents-config/skills/{subagent-creator → agents-managers}/references/debugging-agents.md +27 -27
  76. package/agents-config/skills/{subagent-creator → agents-managers}/references/error-handling-and-recovery.md +19 -19
  77. package/agents-config/skills/{subagent-creator → agents-managers}/references/evaluation-and-testing.md +29 -29
  78. package/agents-config/skills/{subagent-creator → agents-managers}/references/orchestration-patterns.md +5 -5
  79. package/agents-config/skills/{subagent-creator/references/writing-subagent-prompts.md → agents-managers/references/writing-agent-prompts.md} +23 -23
  80. package/agents-config/skills/codex-environment/SKILL.md +2 -0
  81. package/agents-config/skills/commit/SKILL.md +2 -0
  82. package/agents-config/skills/create-pr/SKILL.md +2 -0
  83. package/agents-config/skills/environments-manager/SKILL.md +271 -0
  84. package/agents-config/skills/environments-manager/examples/claude/.worktreeinclude +3 -0
  85. package/agents-config/skills/environments-manager/examples/claude/commands/dev.md +5 -0
  86. package/agents-config/skills/environments-manager/examples/claude/commands/lint.md +5 -0
  87. package/agents-config/skills/environments-manager/examples/claude/commands/test.md +5 -0
  88. package/agents-config/skills/environments-manager/examples/claude/commands/typecheck.md +5 -0
  89. package/agents-config/skills/environments-manager/examples/claude/settings.json +24 -0
  90. package/agents-config/skills/environments-manager/examples/codex/environments/environment.toml +29 -0
  91. package/agents-config/skills/environments-manager/examples/cursor/worktrees.json +3 -0
  92. package/agents-config/skills/environments-manager/examples/scripts/claude-worktree-create.sh +96 -0
  93. package/agents-config/skills/environments-manager/examples/scripts/claude-worktree-remove.sh +66 -0
  94. package/agents-config/skills/environments-manager/examples/scripts/dev.sh +15 -0
  95. package/agents-config/skills/environments-manager/examples/scripts/worktree-down.sh +22 -0
  96. package/agents-config/skills/environments-manager/examples/scripts/worktree-up.sh +50 -0
  97. package/agents-config/skills/environments-manager/references/claude.md +156 -0
  98. package/agents-config/skills/environments-manager/references/codex.md +97 -0
  99. package/agents-config/skills/environments-manager/references/cursor.md +88 -0
  100. package/agents-config/skills/fix-pr-comments/SKILL.md +2 -0
  101. package/agents-config/skills/grill-me/SKILL.md +10 -0
  102. package/agents-config/skills/merge/SKILL.md +2 -0
  103. package/agents-config/skills/rules-manager/SKILL.md +191 -0
  104. package/agents-config/skills/rules-manager/references/agents-vs-claude.md +66 -0
  105. package/agents-config/skills/rules-manager/references/examples.md +117 -0
  106. package/agents-config/skills/skill-manager/SKILL.md +83 -0
  107. package/agents-config/skills/skill-manager/references/claude-code.md +81 -0
  108. package/agents-config/skills/skill-manager/references/codex.md +288 -0
  109. package/agents-config/skills/skill-manager/references/cursor.md +125 -0
  110. package/agents-config/skills/ultrathink/SKILL.md +2 -0
  111. package/package.json +1 -1
  112. package/agents-config/claude-config/scripts/statusline/data/.gitignore +0 -8
  113. package/agents-config/claude-config/scripts/statusline/data/.gitkeep +0 -0
  114. package/agents-config/claude-config/scripts/statusline/docs/ARCHITECTURE.md +0 -166
  115. package/agents-config/claude-config/scripts/statusline/src/tests/spend-v2.test.ts +0 -306
  116. package/agents-config/skills/apex/SKILL.md +0 -261
  117. package/agents-config/skills/apex/scripts/setup-templates.sh +0 -100
  118. package/agents-config/skills/apex/scripts/update-progress.sh +0 -80
  119. package/agents-config/skills/apex/steps/step-00-init.md +0 -267
  120. package/agents-config/skills/apex/steps/step-00b-branch.md +0 -126
  121. package/agents-config/skills/apex/steps/step-00b-economy.md +0 -244
  122. package/agents-config/skills/apex/steps/step-00b-interactive.md +0 -153
  123. package/agents-config/skills/apex/steps/step-01-analyze.md +0 -361
  124. package/agents-config/skills/apex/steps/step-02-plan.md +0 -264
  125. package/agents-config/skills/apex/steps/step-03-execute.md +0 -239
  126. package/agents-config/skills/apex/steps/step-04-validate.md +0 -251
  127. package/agents-config/skills/apex/templates/00-context.md +0 -43
  128. package/agents-config/skills/apex/templates/01-analyze.md +0 -10
  129. package/agents-config/skills/apex/templates/02-plan.md +0 -10
  130. package/agents-config/skills/apex/templates/03-execute.md +0 -10
  131. package/agents-config/skills/apex/templates/04-validate.md +0 -10
  132. package/agents-config/skills/apex/templates/README.md +0 -176
  133. package/agents-config/skills/apex/templates/step-complete.md +0 -7
  134. package/agents-config/skills/claude-memory/SKILL.md +0 -293
  135. package/agents-config/skills/claude-memory/references/comprehensive-example.md +0 -175
  136. package/agents-config/skills/claude-memory/references/optimize-guide.md +0 -300
  137. package/agents-config/skills/claude-memory/references/project-patterns.md +0 -334
  138. package/agents-config/skills/claude-memory/references/prompting-techniques.md +0 -411
  139. package/agents-config/skills/claude-memory/references/rules-directory-guide.md +0 -298
  140. package/agents-config/skills/claude-memory/references/section-templates.md +0 -347
  141. package/agents-config/skills/fix-errors/SKILL.md +0 -61
  142. package/agents-config/skills/fix-grammar/SKILL.md +0 -59
  143. package/agents-config/skills/ralph-loop/SKILL.md +0 -117
  144. package/agents-config/skills/ralph-loop/scripts/setup.sh +0 -278
  145. package/agents-config/skills/ralph-loop/steps/step-00-init.md +0 -215
  146. package/agents-config/skills/ralph-loop/steps/step-01-interactive-prd.md +0 -366
  147. package/agents-config/skills/ralph-loop/steps/step-02-create-stories.md +0 -273
  148. package/agents-config/skills/ralph-loop/steps/step-03-finish.md +0 -245
  149. package/agents-config/skills/skill-creator/LICENSE.txt +0 -202
  150. package/agents-config/skills/skill-creator/SKILL.md +0 -421
  151. package/agents-config/skills/skill-creator/package.json +0 -5
  152. package/agents-config/skills/skill-creator/references/output-patterns.md +0 -82
  153. package/agents-config/skills/skill-creator/references/progressive-disclosure-patterns.md +0 -374
  154. package/agents-config/skills/skill-creator/references/prompting-integration.md +0 -363
  155. package/agents-config/skills/skill-creator/references/real-world-examples.md +0 -513
  156. package/agents-config/skills/skill-creator/references/script-patterns.md +0 -385
  157. package/agents-config/skills/skill-creator/references/workflows.md +0 -28
  158. package/agents-config/skills/skill-creator/references/xml-tag-guide.md +0 -606
  159. package/agents-config/skills/skill-creator/scripts/init-skill.ts +0 -214
  160. package/agents-config/skills/skill-creator/scripts/package-skill.ts +0 -146
  161. package/agents-config/skills/skill-creator/scripts/validate.ts +0 -138
  162. package/agents-config/skills/workflow-apex-free/SKILL.md +0 -261
  163. package/agents-config/skills/workflow-apex-free/scripts/setup-templates.sh +0 -100
  164. package/agents-config/skills/workflow-apex-free/scripts/update-progress.sh +0 -80
  165. package/agents-config/skills/workflow-apex-free/steps/step-00-init.md +0 -267
  166. package/agents-config/skills/workflow-apex-free/steps/step-00b-branch.md +0 -126
  167. package/agents-config/skills/workflow-apex-free/steps/step-00b-economy.md +0 -244
  168. package/agents-config/skills/workflow-apex-free/steps/step-00b-interactive.md +0 -153
  169. package/agents-config/skills/workflow-apex-free/steps/step-01-analyze.md +0 -361
  170. package/agents-config/skills/workflow-apex-free/steps/step-02-plan.md +0 -264
  171. package/agents-config/skills/workflow-apex-free/steps/step-03-execute.md +0 -239
  172. package/agents-config/skills/workflow-apex-free/steps/step-04-validate.md +0 -251
  173. package/agents-config/skills/workflow-apex-free/templates/00-context.md +0 -43
  174. package/agents-config/skills/workflow-apex-free/templates/01-analyze.md +0 -10
  175. package/agents-config/skills/workflow-apex-free/templates/02-plan.md +0 -10
  176. package/agents-config/skills/workflow-apex-free/templates/03-execute.md +0 -10
  177. package/agents-config/skills/workflow-apex-free/templates/04-validate.md +0 -10
  178. package/agents-config/skills/workflow-apex-free/templates/README.md +0 -176
  179. package/agents-config/skills/workflow-apex-free/templates/step-complete.md +0 -7
@@ -1,293 +0,0 @@
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: [init | optimize | task description]
5
- ---
6
-
7
- <core_principle>
8
- Memory files consume tokens from the context window. ~100-150 instruction slots available for your customizations. Keep files minimal — only include what the agent cannot discover on its own.
9
-
10
- **Two approaches:**
11
- - **CLAUDE.md** — Single file, best for small projects (< 100 lines)
12
- - **.claude/rules/** — Modular files with optional path-scoping, best for large projects
13
- </core_principle>
14
-
15
- <quick_start>
16
- Run `/init` to auto-generate a CLAUDE.md. Or create manually:
17
-
18
- ```markdown
19
- # Project Name
20
-
21
- ## Tech Stack
22
- - [Primary framework]
23
- - [Key non-obvious libraries]
24
-
25
- ## Commands
26
- - `npm run dev` - Dev server
27
- - `npm test` - Run tests
28
- - `npm run build` - Build
29
-
30
- ## Rules
31
- - [2-3 critical project-specific rules]
32
- ```
33
-
34
- - Press `#` during a session to add memory items quickly
35
- - Use `/memory` to open CLAUDE.md in your editor
36
- </quick_start>
37
-
38
- <file_hierarchy>
39
-
40
- | Priority | Location | Scope |
41
- |----------|----------|-------|
42
- | 1 (Highest) | Enterprise policy (managed by IT) | All org users |
43
- | 2 | `./CLAUDE.md` or `./.claude/CLAUDE.md` | Team via git |
44
- | 2 | `./.claude/rules/*.md` | Team via git |
45
- | 3 | `~/.claude/CLAUDE.md` | All your projects |
46
- | 3 | `~/.claude/rules/*.md` | All your projects |
47
- | 4 (Lowest) | `./CLAUDE.local.md` (auto-gitignored) | Just you |
48
-
49
- Claude recurses UP from current directory, loading all CLAUDE.md files found. Also discovers CLAUDE.md in subtrees when reading files in those directories.
50
-
51
- **Monorepo strategy:** Root file defines WHEN; subtree files define HOW.
52
- ```
53
- root/CLAUDE.md # Universal: tech stack, git workflow
54
- apps/web/CLAUDE.md # Frontend-specific
55
- apps/api/CLAUDE.md # Backend-specific
56
- ```
57
- </file_hierarchy>
58
-
59
- <rules_directory>
60
- The `.claude/rules/` directory splits instructions into focused markdown files.
61
-
62
- **Use `.claude/rules/` when:** many concerns, different rules for different file types, team maintains different areas.
63
- **Use CLAUDE.md when:** small project, universal rules, single source of truth.
64
-
65
- Path-scoped rules use YAML frontmatter:
66
- ```yaml
67
- ---
68
- paths:
69
- - "src/api/**/*.ts"
70
- ---
71
- # API Rules
72
- - All endpoints must include input validation
73
- ```
74
-
75
- Supported patterns: `**/*.ts`, `src/**/*`, `src/**/*.{ts,tsx}`, `{src,lib}/**/*.ts`
76
-
77
- Rules without `paths` frontmatter load unconditionally.
78
-
79
- See [references/rules-directory-guide.md](references/rules-directory-guide.md) for complete guide including symlinks, user-level rules, and migration.
80
- </rules_directory>
81
-
82
- <content_structure>
83
- Structure CLAUDE.md with only these sections:
84
-
85
- 1. **Project purpose** (1-3 lines) — What the project is
86
- 2. **Tech stack** (compact) — Only non-obvious technologies
87
- 3. **Commands** — Non-obvious dev, build, and test commands
88
- 4. **Important files** — Architecture-critical, non-obvious files only
89
- 5. **Rules** — Prohibitions and constraints that prevent mistakes (highest-value lines)
90
- 6. **Workflow** (optional) — Only if non-standard
91
-
92
- **Do NOT include:**
93
- - Repository overviews (agent discovers structure itself)
94
- - Code style rules (linters enforce these)
95
- - Generic best practices ("write clean code", "DRY", "SOLID")
96
- - Redundant specs (copies of config files, env vars, schema descriptions)
97
- - Marketing/goals (vision statements, KPIs, roadmaps)
98
- - Verbose explanations (paragraphs where one line suffices)
99
-
100
- See [references/section-templates.md](references/section-templates.md) for ready-to-use templates.
101
- See [references/project-patterns.md](references/project-patterns.md) for framework-specific patterns.
102
- </content_structure>
103
-
104
- <writing_rules>
105
- **Golden rule:** If someone with zero project context reads your CLAUDE.md and gets confused, Claude will too.
106
-
107
- **Be specific, never vague:**
108
- ```
109
- ❌ "Format code properly" / "Write good tests" / "Follow best practices"
110
- ✅ "Run `pnpm lint` before committing" / "Tests in `__tests__/` using Vitest"
111
- ```
112
-
113
- **Prohibitions > positive guidance:**
114
- ```
115
- ❌ "Try to use TanStack Form for forms"
116
- ✅ "NEVER use native form/useState for forms — ALWAYS use TanStack Form"
117
- ```
118
-
119
- **Show, don't tell:** When format matters, show a concrete example (3-5 lines max).
120
-
121
- **Emphasis hierarchy:** CRITICAL > NEVER > ALWAYS > IMPORTANT > YOU MUST
122
- - Put critical rules **first** in each section
123
- - Use **bold + keyword** for non-negotiable rules: `**CRITICAL**: Never commit secrets`
124
-
125
- See [references/prompting-techniques.md](references/prompting-techniques.md) for advanced techniques.
126
- </writing_rules>
127
-
128
- <size_limits>
129
- - **Ideal:** < 100 lines
130
- - **Maximum:** 150 lines before performance degrades
131
- - **Over 200 lines:** directives start getting lost
132
-
133
- When exceeding limits, split into `.claude/rules/` files or link to separate docs:
134
- ```markdown
135
- - **API patterns**: See [docs/api-patterns.md](docs/api-patterns.md)
136
- - **Testing guide**: See [docs/testing-guide.md](docs/testing-guide.md)
137
- ```
138
-
139
- CLAUDE.md supports importing: `@docs/coding-standards.md` (relative/absolute paths, `~` expansion, up to 5 levels deep, not evaluated inside code blocks).
140
- </size_limits>
141
-
142
- <workflow>
143
- **ALWAYS ASK FIRST: Storage Strategy**
144
-
145
- Before creating or updating memory files, use AskUserQuestion:
146
- - **Option 1: Single CLAUDE.md** — < 100 lines, simple project, universal rules
147
- - **Option 2: Modular .claude/rules/** — 100+ lines, different rules for different files
148
-
149
- **Creating new memory:**
150
- 1. Start with `/init` or minimal template
151
- 2. Add tech stack and commands first
152
- 3. Add rules only as you encounter friction
153
- 4. Test with real tasks, iterate based on Claude's behavior
154
-
155
- **Maintaining:**
156
- 1. Review quarterly or when project changes significantly
157
- 2. Remove outdated instructions
158
- 3. Add patterns that required repeated explanation
159
- 4. Use `#` for quick additions during work
160
-
161
- **Troubleshooting:**
162
-
163
- | Problem | Solution |
164
- |---------|----------|
165
- | Claude ignores instructions | Reduce file size, add emphasis (CRITICAL, NEVER) |
166
- | Context overflow | Use `/clear`, split into .claude/rules/ |
167
- | Instructions conflict | Consolidate, use hierarchy (root vs subtree) |
168
- | Path rules not applying | Verify glob pattern matches target files |
169
- </workflow>
170
-
171
- <init_workflow>
172
- ## `/claude-memory init` — Create Minimal CLAUDE.md
173
-
174
- When the user argument contains "init", execute this workflow to scaffold a CLAUDE.md with only the essential sections.
175
-
176
- ### Step 1: Detect project context
177
-
178
- Read `package.json` (or equivalent: `pyproject.toml`, `Cargo.toml`, `go.mod`, etc.) to detect:
179
- - Project name
180
- - Tech stack (framework, language)
181
- - Available scripts/commands (dev, build, test)
182
-
183
- Also check for existing linter configs (ESLint, Biome, Prettier, tsconfig) — do NOT include rules they already enforce.
184
-
185
- ### Step 2: Identify important files
186
-
187
- Scan for non-obvious architecture-critical files. Look for:
188
- - Auth config files
189
- - Server action wrappers, API helpers
190
- - Database schema files
191
- - Custom middleware or shared utilities
192
- - Skip standard framework files (package.json, tsconfig, next.config, etc.)
193
-
194
- ### Step 3: Generate CLAUDE.md
195
-
196
- Create the file with ONLY these sections. Each section should be compact — the whole file should be under 50 lines.
197
-
198
- ```markdown
199
- # [Project Name]
200
- [One-line description of what this project is]
201
-
202
- ## Tech Stack
203
- - [Only non-obvious technologies — skip deps detectable from config files]
204
-
205
- ## Commands
206
- - `[dev command]` - Dev server
207
- - `[build command]` - Build
208
- - `[test command]` - Tests
209
- - [Any non-obvious commands like db:push, seed, etc.]
210
-
211
- ## Important Files
212
- - [Only files the agent wouldn't discover naturally]
213
-
214
- ## Rules
215
- - [Leave empty with a comment: "Add project-specific rules as you encounter friction"]
216
- ```
217
-
218
- ### Step 4: Present and write
219
-
220
- Show the generated file to the user. Write it to `./CLAUDE.md` after approval.
221
-
222
- **Rules:**
223
- - NEVER include directory structure, code style rules, generic best practices, or marketing text
224
- - NEVER include anything a linter or TypeScript already enforces
225
- - Target: 20-50 lines. If it's longer, you're including too much
226
- - The Rules section starts empty — it gets populated over time as mistakes happen
227
- </init_workflow>
228
-
229
- <optimize_workflow>
230
- ## `/claude-memory optimize` — Deep CLAUDE.md Cleanup
231
-
232
- When the user argument contains "optimize", execute this workflow.
233
-
234
- **CRITICAL — Step 0 is MANDATORY. Do NOT skip it. Do NOT start optimizing without reading the guide first.**
235
-
236
- ### Step 0: Read the optimization guide (REQUIRED FIRST)
237
-
238
- YOU MUST use the Read tool on `{SKILL_PATH}/references/optimize-guide.md` BEFORE doing anything else.
239
- This file contains the research data (ETH Zurich study), the 6 bloat categories with specific examples, target metrics, and before/after examples. Without reading it, you will miss removal criteria and produce a subpar optimization.
240
-
241
- ### Step 1: Inventory
242
-
243
- Read every CLAUDE.md, CLAUDE.local.md, and `.claude/rules/*.md` in the project. Count total lines.
244
-
245
- ### Step 2: Read linter configs
246
-
247
- Read ESLint/Biome/Prettier/TypeScript configs. Any CLAUDE.md line duplicating an enforced rule → delete.
248
-
249
- ### Step 3: Apply the 6 bloat categories from the guide
250
-
251
- For each line ask: "Can the agent discover this by reading the project, or does a linter enforce this?" If yes → delete.
252
-
253
- Remove everything matching:
254
- 1. Linter-enforced rules (ESLint, Prettier, Biome, TypeScript strict)
255
- 2. Marketing / goals / vision (zero code value)
256
- 3. Obvious info the agent discovers itself (directory structure, framework defaults, deps from package.json)
257
- 4. Verbose explanations (paragraphs where 1 line suffices, tutorials, history)
258
- 5. Redundant specs (copies of config files, schema descriptions, env var lists)
259
- 6. Generic best practices ("write clean code", "DRY", "SOLID")
260
-
261
- ### Step 4: Keep only essentials
262
-
263
- - Project purpose (1-3 lines)
264
- - Tech stack (compact, non-obvious only)
265
- - Core commands (non-obvious only)
266
- - Testing commands
267
- - Important files (non-obvious only)
268
- - Project-specific rules (prohibitions + constraints)
269
- - Workflow (only if non-standard)
270
-
271
- ### Step 5: Compress
272
-
273
- - Paragraphs → bullet points
274
- - 3-line rules → 1-line rules
275
- - Zero filler words ("In order to", "It's important to note that")
276
- - Merge related items
277
-
278
- ### Step 6: Present diff
279
-
280
- Show before/after with line counts. For each removal, cite which bloat category it falls under.
281
- Let user approve before applying changes.
282
-
283
- **Target:** < 100 lines ideal, < 150 max.
284
- </optimize_workflow>
285
-
286
- <reference_guides>
287
- - **Optimization guide**: [references/optimize-guide.md](references/optimize-guide.md) — Research-backed bloat checklist, 6 removal categories, before/after examples
288
- - **Rules directory**: [references/rules-directory-guide.md](references/rules-directory-guide.md) — Complete .claude/rules/ guide with path-scoping, YAML syntax, symlinks, migration
289
- - **Prompting techniques**: [references/prompting-techniques.md](references/prompting-techniques.md) — Emphasis strategies, clarity techniques, constraint patterns
290
- - **Section templates**: [references/section-templates.md](references/section-templates.md) — Copy-paste templates for each section type
291
- - **Comprehensive example**: [references/comprehensive-example.md](references/comprehensive-example.md) — Full production SaaS CLAUDE.md
292
- - **Project patterns**: [references/project-patterns.md](references/project-patterns.md) — Next.js, Express, Python, Monorepo patterns
293
- </reference_guides>
@@ -1,175 +0,0 @@
1
- <comprehensive_example>
2
- This is a full-featured CLAUDE.md example for a production SaaS application. Use as inspiration, adapting to your specific project.
3
-
4
- ```markdown
5
- # Thumbnail.io - AI Thumbnail Generator
6
-
7
- ## About
8
- AI-powered YouTube thumbnail generator SaaS. Users create thumbnails via text prompts, reference persons, and inspiration images.
9
-
10
- ## Tech Stack
11
- - **Framework**: Next.js 15 with App Router
12
- - **Language**: TypeScript (strict mode)
13
- - **Styling**: TailwindCSS v4 + shadcn/ui
14
- - **Database**: PostgreSQL with Prisma ORM
15
- - **Auth**: Better Auth with organization support
16
- - **Email**: React Email with Resend
17
- - **Payments**: Stripe (subscriptions + credits)
18
- - **Testing**: Vitest (unit), Playwright (e2e)
19
- - **Package Manager**: pnpm
20
-
21
- ## Directory Structure
22
- ```
23
- app/ # Next.js App Router pages
24
- src/
25
- ├── components/ # UI components (shadcn in ui/, custom in nowts/)
26
- ├── features/ # Feature modules with actions, queries, schemas
27
- ├── lib/ # Utilities and configurations
28
- ├── hooks/ # Custom React hooks
29
- emails/ # React Email templates
30
- prisma/ # Database schema and migrations
31
- e2e/ # End-to-end tests
32
- __tests__/ # Unit tests
33
- ```
34
-
35
- ## Key Features
36
- - **Editor**: `@/features/editor/` - Main thumbnail generation
37
- - **Persons**: `@/features/person/` - Reference person management
38
- - **Credits**: `@/features/credits/` - Usage-based credit system
39
- - **Forms**: `@/features/form/tanstack-form.tsx` - TanStack Form setup
40
-
41
- ## Commands
42
-
43
- ### Development
44
- - `pnpm dev` - Start development server with Turbopack
45
- - `pnpm build` - Build application
46
- - `pnpm ts` - TypeScript type checking
47
- - `pnpm lint` - ESLint with auto-fix
48
- - `pnpm clean` - Lint + type check + format
49
-
50
- ### Testing
51
- **CRITICAL - Always use CI commands:**
52
- - `pnpm test:ci` - Unit tests (non-interactive)
53
- - `pnpm test:e2e:ci` - E2E tests (headless)
54
-
55
- **NEVER use interactive commands:**
56
- - ~~`pnpm test`~~ - Interactive mode breaks Claude Code
57
- - ~~`pnpm test:e2e`~~ - Interactive mode breaks Claude Code
58
-
59
- ### Database
60
- - `pnpm prisma:seed` - Seed database
61
- - `pnpm better-auth:migrate` - Generate auth schema
62
-
63
- ## Code Conventions
64
-
65
- ### TypeScript
66
- - Use `type` over `interface` (enforced by ESLint)
67
- - No enums - use maps instead
68
- - Strict mode - no `any` types
69
- - Prefer `??` over `||`
70
-
71
- ### React/Next.js
72
- - Prefer Server Components over Client Components
73
- - Use `"use client"` only for Web API access
74
- - Wrap client components in `Suspense` with fallback
75
- - **ALWAYS** use `PageProps<"/route/path">` for page components
76
-
77
- ### Forms
78
- **CRITICAL - Use TanStack Form for ALL forms:**
79
-
80
- ```tsx
81
- import { Form, useForm } from "@/features/form/tanstack-form";
82
-
83
- const form = useForm({
84
- schema: MySchema,
85
- defaultValues: { field: "" },
86
- onSubmit: async (values) => { /* handle */ },
87
- });
88
-
89
- return (
90
- <Form form={form}>
91
- <form.AppField name="field">
92
- {(field) => (
93
- <field.Field>
94
- <field.Label>Label</field.Label>
95
- <field.Content>
96
- <field.Input placeholder="..." />
97
- <field.Message />
98
- </field.Content>
99
- </field.Field>
100
- )}
101
- </form.AppField>
102
- <form.SubmitButton>Submit</form.SubmitButton>
103
- </Form>
104
- );
105
- ```
106
-
107
- **NEVER use React Hook Form directly.**
108
-
109
- ### Server Actions
110
- - Suffix files with `.action.ts`
111
- - Use `@src/lib/actions/safe-actions.ts` for all actions
112
- - Use `resolveActionResult` helper for mutations
113
-
114
- ### API Routes
115
- - All routes in `/app/api` MUST use `@src/lib/zod-route.ts`
116
- - All HTTP requests MUST use `@src/lib/up-fetch.ts` (never raw `fetch`)
117
-
118
- ### Authentication
119
- - Server: `getUser()` (optional) or `getRequiredUser()` (required)
120
- - Client: `useSession()` from auth-client.ts
121
- - Organization: `getCurrentOrgCache()`
122
-
123
- ## Styling Preferences
124
- - Use typography components from `@src/components/ui/typography.tsx`
125
- - Prefer `flex flex-col gap-4` over `space-y-4`
126
- - Use Card component from `@src/components/ui/card.tsx`
127
- - Never use emojis (prefer Lucide icons)
128
- - Never use gradients unless explicitly requested
129
-
130
- ## TypeScript Imports
131
- - `@/*` → `@src`
132
- - `@email/*` → `@emails`
133
- - `@app/*` → `@app`
134
-
135
- ## Workflow
136
-
137
- ### Before Editing Files
138
- 🚨 **CRITICAL** 🚨
139
- **Read at least 3 files** before editing:
140
- 1. Similar files (understand patterns)
141
- 2. Imported dependencies (understand APIs)
142
-
143
- ### Debugging
144
- - Add logs at each step
145
- - Ask user to send logs for debugging
146
-
147
- ## Important Files
148
- - `src/lib/auth.ts` - Auth configuration
149
- - `src/features/dialog-manager/` - Global dialog system
150
- - `src/features/form/tanstack-form.tsx` - Form setup (**CRITICAL**)
151
- - `src/lib/actions/safe-actions.ts` - Server action utilities
152
- - `src/lib/zod-route.ts` - API route utilities
153
- - `src/site-config.ts` - Site configuration
154
-
155
- ## Database
156
- - Main schema: `prisma/schema/schema.prisma`
157
- - Auth schema: `prisma/schema/better-auth.prisma` (auto-generated)
158
- - All queries must include `tenant_id` for multi-tenant support
159
- ```
160
- </comprehensive_example>
161
-
162
- <usage_notes>
163
- This example demonstrates:
164
-
165
- - Clear tech stack documentation
166
- - Directory structure visualization
167
- - Critical command distinctions (CI vs interactive)
168
- - Specific code patterns with examples
169
- - Emphasis on critical rules
170
- - File location references
171
- - Workflow requirements
172
- - Import path conventions
173
-
174
- Adapt sections to match your project's actual structure and conventions.
175
- </usage_notes>