cc-dev-template 0.1.44 → 0.1.46
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.
- package/bin/install.js +19 -0
- package/package.json +1 -1
- package/src/commands/done.md +5 -11
- package/src/scripts/statusline.js +28 -11
- package/src/skills/claude-md/SKILL.md +55 -0
- package/src/skills/claude-md/references/audit.md +115 -0
- package/src/skills/claude-md/references/create.md +72 -0
- package/src/skills/claude-md/references/principles.md +132 -0
package/bin/install.js
CHANGED
|
@@ -251,6 +251,25 @@ if (fs.existsSync(mergeSettingsPath)) {
|
|
|
251
251
|
});
|
|
252
252
|
}
|
|
253
253
|
|
|
254
|
+
// Remove deprecated plugins
|
|
255
|
+
console.log('\nCleanup:');
|
|
256
|
+
if (fs.existsSync(settingsFile)) {
|
|
257
|
+
try {
|
|
258
|
+
const settings = JSON.parse(fs.readFileSync(settingsFile, 'utf8'));
|
|
259
|
+
if (settings.enabledPlugins && settings.enabledPlugins['code-simplifier@claude-plugins-official']) {
|
|
260
|
+
delete settings.enabledPlugins['code-simplifier@claude-plugins-official'];
|
|
261
|
+
fs.writeFileSync(settingsFile, JSON.stringify(settings, null, 2));
|
|
262
|
+
console.log('✓ Removed deprecated code-simplifier plugin');
|
|
263
|
+
} else {
|
|
264
|
+
console.log(' No deprecated plugins to remove');
|
|
265
|
+
}
|
|
266
|
+
} catch (e) {
|
|
267
|
+
console.log(' No deprecated plugins to remove');
|
|
268
|
+
}
|
|
269
|
+
} else {
|
|
270
|
+
console.log(' No deprecated plugins to remove');
|
|
271
|
+
}
|
|
272
|
+
|
|
254
273
|
console.log('\n' + '='.repeat(50));
|
|
255
274
|
console.log('Installation complete!');
|
|
256
275
|
console.log('='.repeat(50));
|
package/package.json
CHANGED
package/src/commands/done.md
CHANGED
|
@@ -19,17 +19,11 @@ This requires full conversation context. Handle it yourself rather than delegati
|
|
|
19
19
|
|
|
20
20
|
## Steps
|
|
21
21
|
|
|
22
|
-
**1.
|
|
23
|
-
|
|
24
|
-
Stage your changes, then use the code simplifier agent to refine them for clarity and consistency. Run tests afterward to verify nothing broke.
|
|
25
|
-
|
|
26
|
-
Skip this step if no code simplifier agent is available.
|
|
27
|
-
|
|
28
|
-
**2. Commit your work**
|
|
22
|
+
**1. Commit your work**
|
|
29
23
|
|
|
30
24
|
Write clear commit messages that explain what was accomplished. This IS your record of completed work.
|
|
31
25
|
|
|
32
|
-
**
|
|
26
|
+
**2. Update `docs/CURRENT_WORK.md`**
|
|
33
27
|
|
|
34
28
|
This file is forward-looking. Review it holistically and ensure it contains ONLY:
|
|
35
29
|
|
|
@@ -46,7 +40,7 @@ This file is forward-looking. Review it holistically and ensure it contains ONLY
|
|
|
46
40
|
|
|
47
41
|
The file should be scannable in 30 seconds. If it takes longer, it's too long.
|
|
48
42
|
|
|
49
|
-
**
|
|
43
|
+
**3. Capture workflow discoveries (rarely)**
|
|
50
44
|
|
|
51
45
|
Add to CLAUDE.md only high-value operational knowledge that can't be found by reading code:
|
|
52
46
|
- Dev commands, ports, local URLs
|
|
@@ -55,11 +49,11 @@ Add to CLAUDE.md only high-value operational knowledge that can't be found by re
|
|
|
55
49
|
|
|
56
50
|
Most sessions: add nothing.
|
|
57
51
|
|
|
58
|
-
**
|
|
52
|
+
**4. Push**
|
|
59
53
|
|
|
60
54
|
Push your commits to the remote.
|
|
61
55
|
|
|
62
|
-
**
|
|
56
|
+
**5. Report what was updated**
|
|
63
57
|
|
|
64
58
|
Summarize: commits made, CURRENT_WORK.md changes, any items removed/added.
|
|
65
59
|
|
|
@@ -191,18 +191,35 @@ function main() {
|
|
|
191
191
|
|
|
192
192
|
// Get token usage from context_window (available in Claude Code v2.0.70+)
|
|
193
193
|
let tokenData = null;
|
|
194
|
-
if (data.context_window
|
|
195
|
-
const usage = data.context_window.current_usage;
|
|
196
|
-
const used =
|
|
197
|
-
(usage.input_tokens || 0) +
|
|
198
|
-
(usage.cache_read_input_tokens || 0) +
|
|
199
|
-
(usage.cache_creation_input_tokens || 0);
|
|
194
|
+
if (data.context_window) {
|
|
200
195
|
const limit = data.context_window.context_window_size || 200000;
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
196
|
+
|
|
197
|
+
// Use new percentage fields if available (v2.1.6+)
|
|
198
|
+
if (typeof data.context_window.used_percentage === 'number') {
|
|
199
|
+
const usage = data.context_window.current_usage;
|
|
200
|
+
const used = usage
|
|
201
|
+
? (usage.input_tokens || 0) +
|
|
202
|
+
(usage.cache_read_input_tokens || 0) +
|
|
203
|
+
(usage.cache_creation_input_tokens || 0)
|
|
204
|
+
: 0;
|
|
205
|
+
tokenData = {
|
|
206
|
+
used,
|
|
207
|
+
limit,
|
|
208
|
+
percentage: Math.round(data.context_window.used_percentage),
|
|
209
|
+
};
|
|
210
|
+
} else if (data.context_window.current_usage) {
|
|
211
|
+
// Fallback to manual calculation for older versions
|
|
212
|
+
const usage = data.context_window.current_usage;
|
|
213
|
+
const used =
|
|
214
|
+
(usage.input_tokens || 0) +
|
|
215
|
+
(usage.cache_read_input_tokens || 0) +
|
|
216
|
+
(usage.cache_creation_input_tokens || 0);
|
|
217
|
+
tokenData = {
|
|
218
|
+
used,
|
|
219
|
+
limit,
|
|
220
|
+
percentage: Math.min(100, Math.round((used / limit) * 100)),
|
|
221
|
+
};
|
|
222
|
+
}
|
|
206
223
|
}
|
|
207
224
|
|
|
208
225
|
// Generate context display
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: claude-md
|
|
3
|
+
description: This skill should be used when working with CLAUDE.md files. Activate when the user asks to "audit CLAUDE.md", "create a CLAUDE.md", "update the CLAUDE.md", "clean up CLAUDE.md files", or "check CLAUDE.md best practices". Also activate proactively whenever about to create or modify any CLAUDE.md file - the skill contains required principles for how these files should be written.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# CLAUDE.md Management
|
|
7
|
+
|
|
8
|
+
Base directory for this skill: ~/.claude/skills/claude-md
|
|
9
|
+
|
|
10
|
+
## When This Activates
|
|
11
|
+
|
|
12
|
+
- User asks to audit, create, update, or clean up CLAUDE.md files
|
|
13
|
+
- You are about to create or modify any CLAUDE.md file
|
|
14
|
+
|
|
15
|
+
**If you're about to touch a CLAUDE.md file, read this skill first.**
|
|
16
|
+
|
|
17
|
+
## What To Do
|
|
18
|
+
|
|
19
|
+
Determine the task:
|
|
20
|
+
|
|
21
|
+
| Task | Action |
|
|
22
|
+
|------|--------|
|
|
23
|
+
| **Creating** a new CLAUDE.md | Read `references/create.md` |
|
|
24
|
+
| **Modifying** an existing CLAUDE.md | Read `references/principles.md`, then edit |
|
|
25
|
+
| **Auditing** a project's CLAUDE.md files | Read `references/audit.md` |
|
|
26
|
+
|
|
27
|
+
## Core Principle
|
|
28
|
+
|
|
29
|
+
CLAUDE.md files are **orientation prompts**. They answer: "Where am I? What matters here? What should I know that I can't read from the code?"
|
|
30
|
+
|
|
31
|
+
The test: **Would Claude know where it is and what matters?**
|
|
32
|
+
|
|
33
|
+
## Quick Reference
|
|
34
|
+
|
|
35
|
+
**Belongs in CLAUDE.md:**
|
|
36
|
+
- Why this folder/repo exists
|
|
37
|
+
- Current focus (what matters NOW)
|
|
38
|
+
- Where to find things (progressive disclosure)
|
|
39
|
+
- Tribal knowledge, gotchas, non-obvious learnings
|
|
40
|
+
- Project conventions not obvious from code
|
|
41
|
+
|
|
42
|
+
**Does NOT belong:**
|
|
43
|
+
- Content duplicated from parent CLAUDE.md (hierarchy is automatic)
|
|
44
|
+
- Step-by-step workflows (put in docs or skills)
|
|
45
|
+
- Detailed examples (trust the model)
|
|
46
|
+
- Operational runbooks
|
|
47
|
+
- Anything over ~100 lines (suspect)
|
|
48
|
+
|
|
49
|
+
## Hierarchy Rule
|
|
50
|
+
|
|
51
|
+
Claude automatically reads CLAUDE.md files up through the directory tree. A child file inherits everything from its parents.
|
|
52
|
+
|
|
53
|
+
**Never duplicate parent content in child files.** Each file should only contain what's specific to that folder.
|
|
54
|
+
|
|
55
|
+
For full principles, read `references/principles.md`.
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# Auditing CLAUDE.md Files
|
|
2
|
+
|
|
3
|
+
## Process
|
|
4
|
+
|
|
5
|
+
1. **Discover** - Find all CLAUDE.md files in the project
|
|
6
|
+
2. **Map hierarchy** - Understand parent-child relationships
|
|
7
|
+
3. **Check each file** - Against principles
|
|
8
|
+
4. **Fix issues** - Automatically apply best practices
|
|
9
|
+
|
|
10
|
+
## Step 1: Discover
|
|
11
|
+
|
|
12
|
+
Find all CLAUDE.md files:
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
find . -name "CLAUDE.md" -type f | head -20
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Or use Glob:
|
|
19
|
+
```
|
|
20
|
+
**/CLAUDE.md
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Step 2: Map Hierarchy
|
|
24
|
+
|
|
25
|
+
For each file, identify:
|
|
26
|
+
- Its parent CLAUDE.md files (walking up the tree)
|
|
27
|
+
- Its child CLAUDE.md files (in subdirectories)
|
|
28
|
+
|
|
29
|
+
This matters because content flows down. Children inherit from parents.
|
|
30
|
+
|
|
31
|
+
## Step 3: Check Each File
|
|
32
|
+
|
|
33
|
+
Read each CLAUDE.md and check for these issues:
|
|
34
|
+
|
|
35
|
+
### Length Issues
|
|
36
|
+
| Check | Issue | Fix |
|
|
37
|
+
|-------|-------|-----|
|
|
38
|
+
| Over 100 lines | Probably bloated | Extract workflows to docs, remove duplication |
|
|
39
|
+
| Over 150 lines | Definitely bloated | Aggressive pruning needed |
|
|
40
|
+
|
|
41
|
+
### Content Issues
|
|
42
|
+
| Check | Issue | Fix |
|
|
43
|
+
|-------|-------|-----|
|
|
44
|
+
| Step-by-step workflows | Doesn't belong | Move to docs/ or skills/, leave pointer |
|
|
45
|
+
| Detailed examples | Over-explaining | Remove, trust the model |
|
|
46
|
+
| Credentials/passwords | Security + bloat | Move to dedicated docs |
|
|
47
|
+
| Duplicate of parent | Redundant | Remove entirely |
|
|
48
|
+
|
|
49
|
+
### Structure Issues
|
|
50
|
+
| Check | Issue | Fix |
|
|
51
|
+
|-------|-------|-----|
|
|
52
|
+
| No clear purpose statement | Disorienting | Add one-line description at top |
|
|
53
|
+
| Missing "Current Focus" | For active projects | Add if this is active work |
|
|
54
|
+
| Walls of text | Hard to scan | Break into sections, use bullets |
|
|
55
|
+
|
|
56
|
+
### Hierarchy Issues
|
|
57
|
+
| Check | Issue | Fix |
|
|
58
|
+
|-------|-------|-----|
|
|
59
|
+
| Child repeats parent content | Duplication | Remove from child |
|
|
60
|
+
| Child has general project info | Wrong level | Move to root CLAUDE.md |
|
|
61
|
+
| Deep file (3+ levels) exists | Probably unnecessary | Consider removing |
|
|
62
|
+
|
|
63
|
+
## Step 4: Fix Issues
|
|
64
|
+
|
|
65
|
+
For each issue found:
|
|
66
|
+
|
|
67
|
+
1. **Read the file** (required before editing)
|
|
68
|
+
2. **Apply the fix** using Edit tool
|
|
69
|
+
3. **Move extracted content** to appropriate location (docs/, etc.)
|
|
70
|
+
4. **Verify** the result
|
|
71
|
+
|
|
72
|
+
### Common Fixes
|
|
73
|
+
|
|
74
|
+
**Extracting a workflow:**
|
|
75
|
+
1. Create `docs/workflows/[topic].md` with the detailed content
|
|
76
|
+
2. Replace in CLAUDE.md with: "See `docs/workflows/[topic].md` for [description]"
|
|
77
|
+
|
|
78
|
+
**Removing duplication:**
|
|
79
|
+
1. Check parent file has the content
|
|
80
|
+
2. Delete the duplicated section from child
|
|
81
|
+
3. Optionally add: "Inherits [topic] from parent CLAUDE.md"
|
|
82
|
+
|
|
83
|
+
**Pruning over-explanation:**
|
|
84
|
+
1. Identify the core point
|
|
85
|
+
2. Reduce to 1-2 lines that trust the model
|
|
86
|
+
3. Remove examples, edge cases, detailed instructions
|
|
87
|
+
|
|
88
|
+
## Audit Report
|
|
89
|
+
|
|
90
|
+
After checking all files, summarize:
|
|
91
|
+
|
|
92
|
+
```
|
|
93
|
+
CLAUDE.md Audit Summary
|
|
94
|
+
=======================
|
|
95
|
+
Files checked: X
|
|
96
|
+
Issues found: Y
|
|
97
|
+
Issues fixed: Z
|
|
98
|
+
|
|
99
|
+
Changes made:
|
|
100
|
+
- [file]: [what was fixed]
|
|
101
|
+
- [file]: [what was fixed]
|
|
102
|
+
|
|
103
|
+
Remaining concerns:
|
|
104
|
+
- [any issues that need human decision]
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
## Red Flags
|
|
108
|
+
|
|
109
|
+
These indicate a CLAUDE.md that needs significant rework:
|
|
110
|
+
|
|
111
|
+
- **200+ lines** - Needs major pruning
|
|
112
|
+
- **Code blocks with >10 lines** - Workflows belong in docs
|
|
113
|
+
- **Tables with >5 rows** - Probably too detailed
|
|
114
|
+
- **Multiple "how to" sections** - Wrong content type
|
|
115
|
+
- **Same content in parent and child** - Hierarchy violation
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# Creating a CLAUDE.md
|
|
2
|
+
|
|
3
|
+
## Before Writing
|
|
4
|
+
|
|
5
|
+
1. **Check the hierarchy** - Find all parent CLAUDE.md files up to the root
|
|
6
|
+
2. **Read them** - Understand what's already covered
|
|
7
|
+
3. **Identify the gap** - What does this folder need that parents don't provide?
|
|
8
|
+
|
|
9
|
+
If the parent files already cover everything, you probably don't need a new CLAUDE.md.
|
|
10
|
+
|
|
11
|
+
## Structure Template
|
|
12
|
+
|
|
13
|
+
Use this as a starting point, not a rigid template. Include only sections that add value.
|
|
14
|
+
|
|
15
|
+
```markdown
|
|
16
|
+
# [Folder/Project Name]
|
|
17
|
+
|
|
18
|
+
[One-line description of what this is and why it exists]
|
|
19
|
+
|
|
20
|
+
## Current Focus
|
|
21
|
+
|
|
22
|
+
[What's actively being worked on. What matters NOW.]
|
|
23
|
+
|
|
24
|
+
## [Key Section]
|
|
25
|
+
|
|
26
|
+
[Whatever is most important for this specific folder - could be dev commands, structure, rules, etc.]
|
|
27
|
+
|
|
28
|
+
## Finding Information
|
|
29
|
+
|
|
30
|
+
[Where to look for docs, workflows, detailed guides - progressive disclosure]
|
|
31
|
+
|
|
32
|
+
## Gotchas
|
|
33
|
+
|
|
34
|
+
[Non-obvious things that would save pain if known upfront]
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Guidelines
|
|
38
|
+
|
|
39
|
+
### Keep It Short
|
|
40
|
+
Aim for 40-80 lines. If you're going longer, you're probably including content that belongs elsewhere.
|
|
41
|
+
|
|
42
|
+
### Lead with Purpose
|
|
43
|
+
The first lines should orient Claude immediately. What is this? Why does it exist?
|
|
44
|
+
|
|
45
|
+
### Current Focus Section
|
|
46
|
+
Include this for active projects. It answers "what matters NOW?" and helps Claude prioritize.
|
|
47
|
+
|
|
48
|
+
### Be Specific to This Folder
|
|
49
|
+
Everything in this file should be specific to this directory. General project info belongs in the root CLAUDE.md.
|
|
50
|
+
|
|
51
|
+
### Progressive Disclosure
|
|
52
|
+
Point to docs, don't inline them:
|
|
53
|
+
- Good: "See `docs/systems/M5_CLOUD.md` for server access"
|
|
54
|
+
- Bad: [50 lines of SSH commands and credentials]
|
|
55
|
+
|
|
56
|
+
## What NOT to Include
|
|
57
|
+
|
|
58
|
+
- Content from parent CLAUDE.md files
|
|
59
|
+
- Step-by-step workflows (put in docs/)
|
|
60
|
+
- Detailed examples (trust the model)
|
|
61
|
+
- Frequently changing content
|
|
62
|
+
- Anything Claude could infer from the code
|
|
63
|
+
|
|
64
|
+
## After Writing
|
|
65
|
+
|
|
66
|
+
Verify:
|
|
67
|
+
1. Under 100 lines?
|
|
68
|
+
2. No duplication with parent files?
|
|
69
|
+
3. Would Claude know where it is and what matters?
|
|
70
|
+
4. Written as orientation, not documentation?
|
|
71
|
+
|
|
72
|
+
If all yes, you're done.
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
# CLAUDE.md Principles
|
|
2
|
+
|
|
3
|
+
## The Mental Model
|
|
4
|
+
|
|
5
|
+
CLAUDE.md files are prompts for orienting Claude in a codebase. They're read automatically when Claude works in a directory.
|
|
6
|
+
|
|
7
|
+
**Think of it as a briefing for a senior colleague joining the project** - not a manual for a junior who needs hand-holding.
|
|
8
|
+
|
|
9
|
+
## The Test
|
|
10
|
+
|
|
11
|
+
After reading a CLAUDE.md, would Claude know:
|
|
12
|
+
1. Where it is (what is this folder/repo?)
|
|
13
|
+
2. What matters NOW (current focus, active work)
|
|
14
|
+
3. Where to find things (progressive disclosure to docs)
|
|
15
|
+
4. What gotchas exist (tribal knowledge)
|
|
16
|
+
|
|
17
|
+
If yes, the file is doing its job.
|
|
18
|
+
|
|
19
|
+
## What Belongs
|
|
20
|
+
|
|
21
|
+
### Purpose and Context
|
|
22
|
+
- What this folder/repo is and why it exists
|
|
23
|
+
- The mental model for how things fit together
|
|
24
|
+
- Current focus - what's actively being worked on
|
|
25
|
+
|
|
26
|
+
### Progressive Disclosure
|
|
27
|
+
- Pointers to documentation ("See docs/INDEX.md for...")
|
|
28
|
+
- Key reference docs listed by name
|
|
29
|
+
- Where workflows and detailed guides live
|
|
30
|
+
|
|
31
|
+
### Tribal Knowledge
|
|
32
|
+
- Gotchas discovered during sessions
|
|
33
|
+
- Non-obvious conventions
|
|
34
|
+
- Things that would save pain if known upfront
|
|
35
|
+
- "We use X instead of Y" (without spelling out examples)
|
|
36
|
+
|
|
37
|
+
### Quick Reference (sparingly)
|
|
38
|
+
- Dev commands if truly common (one-liners only)
|
|
39
|
+
- Key URLs or entry points
|
|
40
|
+
- Simple folder structure if it aids orientation
|
|
41
|
+
|
|
42
|
+
## What Does NOT Belong
|
|
43
|
+
|
|
44
|
+
### Duplicated Content
|
|
45
|
+
Claude reads CLAUDE.md files up through the hierarchy automatically. If a parent file says "We use TypeScript", the child file should NOT repeat this.
|
|
46
|
+
|
|
47
|
+
**Rule:** Before adding something, check if a parent already covers it.
|
|
48
|
+
|
|
49
|
+
### Detailed Workflows
|
|
50
|
+
Step-by-step processes belong in:
|
|
51
|
+
- `docs/` folder
|
|
52
|
+
- Skills (`.claude/skills/`)
|
|
53
|
+
- Dedicated workflow files
|
|
54
|
+
|
|
55
|
+
CLAUDE.md points to these, doesn't contain them.
|
|
56
|
+
|
|
57
|
+
### Micromanagement
|
|
58
|
+
Trust the model. If you say "We use Base UI instead of Radix", Claude understands the implications. Don't add:
|
|
59
|
+
- Lists of every Radix component and its Base UI equivalent
|
|
60
|
+
- Example code for each case
|
|
61
|
+
- Exhaustive edge cases
|
|
62
|
+
|
|
63
|
+
### Operational Runbooks
|
|
64
|
+
SSH commands, database credentials, deployment scripts - these belong in dedicated docs, not CLAUDE.md.
|
|
65
|
+
|
|
66
|
+
### Frequently Changing Content
|
|
67
|
+
CLAUDE.md should be stable. If content changes often, it belongs elsewhere (like CURRENT_WORK.md or a status doc).
|
|
68
|
+
|
|
69
|
+
## Length Guideline
|
|
70
|
+
|
|
71
|
+
No hard limit, but **over 100 lines is suspect**.
|
|
72
|
+
|
|
73
|
+
A good CLAUDE.md is typically 40-80 lines. If it's longer, ask:
|
|
74
|
+
- Is there duplication with parent files?
|
|
75
|
+
- Are there workflows that should be extracted?
|
|
76
|
+
- Am I explaining things Claude already knows?
|
|
77
|
+
|
|
78
|
+
## Writing Style
|
|
79
|
+
|
|
80
|
+
CLAUDE.md files are prompts. Apply prompting best practices:
|
|
81
|
+
|
|
82
|
+
### Explain WHY, Not Just WHAT
|
|
83
|
+
Bad: "Run `npm run dev` to start the server"
|
|
84
|
+
Good: "Dev server runs on :5173. Hot reload handles code changes - no restart needed."
|
|
85
|
+
|
|
86
|
+
### Positive Framing
|
|
87
|
+
Bad: "Don't put workflows in CLAUDE.md"
|
|
88
|
+
Good: "Workflows belong in docs/ or skills/"
|
|
89
|
+
|
|
90
|
+
### Be Direct
|
|
91
|
+
Bad: "You might want to check the docs folder"
|
|
92
|
+
Good: "Start at docs/INDEX.md for all documentation"
|
|
93
|
+
|
|
94
|
+
### Trust Intelligence
|
|
95
|
+
Bad: Listing every ShadCN component and how to use it
|
|
96
|
+
Good: "Use ShadCN for all UI. Discuss before building custom components."
|
|
97
|
+
|
|
98
|
+
## Hierarchy Examples
|
|
99
|
+
|
|
100
|
+
**Root CLAUDE.md** (project level):
|
|
101
|
+
- What the project is
|
|
102
|
+
- Overall structure
|
|
103
|
+
- Where documentation lives
|
|
104
|
+
- External systems overview
|
|
105
|
+
|
|
106
|
+
**Subdirectory CLAUDE.md** (e.g., `roost/CLAUDE.md`):
|
|
107
|
+
- What this specific folder is
|
|
108
|
+
- Rules specific to this codebase
|
|
109
|
+
- Dev commands for this folder
|
|
110
|
+
- Does NOT repeat project-level context
|
|
111
|
+
|
|
112
|
+
**Deep subdirectory** (e.g., `src/components/CLAUDE.md`):
|
|
113
|
+
- Only if there's something specific to know
|
|
114
|
+
- Usually unnecessary - parent files cover it
|
|
115
|
+
- If created, extremely focused (20-30 lines max)
|
|
116
|
+
|
|
117
|
+
## Capturing Gotchas
|
|
118
|
+
|
|
119
|
+
When a session reveals something painful:
|
|
120
|
+
|
|
121
|
+
1. **Identify the learning** - What would have saved time if known upfront?
|
|
122
|
+
2. **Find the right file** - Which CLAUDE.md is this specific to?
|
|
123
|
+
3. **Add concisely** - One or two lines, not a full explanation
|
|
124
|
+
4. **Trust the model** - State the gotcha, don't over-explain
|
|
125
|
+
|
|
126
|
+
Example:
|
|
127
|
+
```markdown
|
|
128
|
+
## Gotchas
|
|
129
|
+
|
|
130
|
+
- qrServer tracks `development` branch, not master
|
|
131
|
+
- Convex queries can't be called from other queries - use actions for composition
|
|
132
|
+
```
|