Generate or update the project's CLAUDE.md file based on blueprint artifacts, PRDs, and project structure.
When to Use This Skill
| Use this skill when... |
Use alternative when... |
| Need to create/update CLAUDE.md for team instructions |
Use /blueprint:rules for path-specific rules |
| Want to add @imports to existing CLAUDE.md |
Use /blueprint:generate-rules to create rules from PRDs |
| Need to create CLAUDE.local.md for personal preferences |
Editing individual rule files directly |
| Converting inline content to lean @import structure |
Just need to view current memory configuration |
CLAUDE.md vs Auto Memory
Claude Code has two complementary systems for project context. CLAUDE.md should contain team-shared instructions — not patterns Claude learns on its own.
| Belongs in CLAUDE.md |
Belongs in Auto Memory (managed by Claude) |
| Team coding standards |
Debugging insights and workarounds |
| Build/test/lint commands |
Personal workflow preferences |
| Architecture decisions |
Project-specific patterns learned over time |
| Required conventions |
File relationships and navigation shortcuts |
| CI/CD workflows |
Common mistakes and how to fix them |
Auto memory lives at ~/.claude/projects/<project>/memory/ and is managed automatically. Do not duplicate auto memory concerns into CLAUDE.md.
Memory Hierarchy (precedence low → high)
- User-level rules:
~/.claude/rules/ — personal rules across all projects
- CLAUDE.md (project): Team-shared project instructions (checked into git)
- CLAUDE.local.md: Personal project-specific preferences (gitignored)
- .claude/rules/: Modular, path-specific rules
- Managed policy: Organization-wide instructions (enterprise, system paths)
- Auto memory: Claude's own notes (
~/.claude/projects/<project>/memory/)
@import Syntax
CLAUDE.md files support importing other markdown files to stay lean:
# Project: MyApp
@docs/architecture.md
@docs/conventions.md
@.claude/rules/testing.md
- Paths are relative to the file containing the import
- Recursive imports supported (max depth 5)
- Imports are not evaluated inside code spans or code blocks
- First-time external imports trigger an approval dialog
Use @import to reference existing documentation rather than duplicating content into CLAUDE.md.
Steps:
Check current state:
- Look for existing
CLAUDE.md in project root
- Look for existing
CLAUDE.local.md (personal preferences, gitignored)
- Read
docs/blueprint/manifest.json for configuration
- Check for
~/.claude/rules/ (user-level rules)
- Determine
claude_md_mode (single, modular, or both)
Determine action (use AskUserQuestion):
{If CLAUDE.md exists:}
question: "CLAUDE.md already exists. What would you like to do?"
options:
- "Update with latest project info" → merge updates
- "Regenerate completely" → overwrite (backup first)
- "Add missing sections only" → append new content
- "Add @imports for existing docs" → replace inline content with imports
- "Convert to modular rules" → split into .claude/rules/
- "Create CLAUDE.local.md" → personal preferences (gitignored)
- "View current structure" → analyze and display
{If CLAUDE.md doesn't exist:}
question: "No CLAUDE.md found. How would you like to create it?"
options:
- "Generate from project analysis" → auto-generate
- "Generate from PRDs" → use blueprint PRDs
- "Generate with @imports (lean)" → auto-generate using imports for existing docs
- "Start with template" → use starter template
- "Use modular rules instead" → skip CLAUDE.md, use rules/
Gather project context:
- Project structure: Detect language, framework, build tools
- PRDs: Read
docs/prds/*.md for requirements
- Work overview: Current phase and progress
- Existing rules: Content from
.claude/rules/ if present
- Git history: Recent patterns and conventions
- Dependencies: Package managers, key libraries
Generate CLAUDE.md sections:
Standard sections (focused on team-shared instructions):
# Project: {name}
## Overview
{Brief project description from PRDs or detection}
## Tech Stack
- Language: {detected}
- Framework: {detected}
- Build: {detected}
- Test: {detected}
## Development Workflow
### Getting Started
{Setup commands}
### Running Tests
{Test commands}
### Building
{Build commands}
## Architecture
{Key architectural decisions from PRDs — or use @import:}
@docs/prds/architecture-prd.md
## Conventions
### Code Style
{Detected or from PRDs}
### Commit Messages
{Conventional commits if detected}
### Testing Requirements
{From PRDs or rules}
## See Also
{If modular rules enabled:}
- `.claude/rules/` - Detailed rules by domain
- `docs/prds/` - Product requirements
Sections to omit (auto memory handles these automatically):
- "Current Focus" — Claude tracks this in auto memory
- "Key Files" — Claude learns file relationships automatically
- Debugging tips — Claude records these in auto memory topic files
If modular rules mode = "both":
If modular rules mode = "modular":
6b. If "Create CLAUDE.local.md" selected:
6c. If "Add @imports" selected:
- Scan existing CLAUDE.md for sections with content that exists in other files
- Replace duplicated content with
@path/to/source.md imports
- Preserve CLAUDE.md-only content inline
- Show diff of changes before applying
Smart update (for existing CLAUDE.md):
Sync with modular rules:
- If rules exist in
.claude/rules/
- Detect duplicated content
- Offer to deduplicate:
question: "Found duplicate content between CLAUDE.md and rules/. How to resolve?"
options:
- "Keep in CLAUDE.md, remove from rules"
- "Keep in rules, reference from CLAUDE.md"
- "Keep both (may cause confusion)"
Update manifest:
- Record CLAUDE.md generation/update
- Track which PRDs contributed
- Update timestamp
Update task registry:
Update the task registry entry in docs/blueprint/manifest.json:
jq --arg now "$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
'.task_registry["claude-md"].last_completed_at = $now |
.task_registry["claude-md"].last_result = "success" |
.task_registry["claude-md"].stats.runs_total = ((.task_registry["claude-md"].stats.runs_total // 0) + 1)' \
docs/blueprint/manifest.json > tmp.json && mv tmp.json docs/blueprint/manifest.json
Report:
✅ CLAUDE.md updated!
{Created | Updated}: CLAUDE.md
{If created:} CLAUDE.local.md (personal preferences, gitignored)
Sections:
- Overview ✅
- Tech Stack ✅
- Development Workflow ✅
- Architecture ✅
- Conventions ✅
@imports used: {count, if any}
- @docs/prds/architecture.md
- @.claude/rules/testing.md
Sources used:
- PRDs: {list}
- Rules: {list}
- Project detection: {what was detected}
{If modular mode:}
Note: Detailed rules are in .claude/rules/
CLAUDE.md serves as overview and quick reference.
Note: "Current Focus" and "Key Files" are managed by Claude's
auto memory — no need to maintain these in CLAUDE.md.
Run `/blueprint:status` to see full configuration.
CLAUDE.md Best Practices:
- Keep it concise (< 500 lines ideally)
- Focus on team-shared instructions (standards, commands, architecture)
- Use
@import to reference existing docs instead of duplicating content
- Use
CLAUDE.local.md for personal preferences (auto-gitignored)
- Reference
.claude/rules/ for detailed, path-specific rules
- Let auto memory handle "Current Focus", "Key Files", debugging tips
- Update when PRDs change significantly
Prompt for next action (use AskUserQuestion):
question: "CLAUDE.md updated. What would you like to do next?"
options:
- label: "Check blueprint status (Recommended)"
description: "Run /blueprint:status to verify configuration"
- label: "Manage modular rules"
description: "Add or edit rules in .claude/rules/"
- label: "Continue development"
description: "Run /project:continue to work on next task"
- label: "I'm done for now"
description: "Exit - CLAUDE.md is saved"
Based on selection:
- "Check blueprint status" → Run
/blueprint:status
- "Manage modular rules" → Run
/blueprint:rules
- "Continue development" → Run
/project:continue
- "I'm done" → Exit
Template Sections (customize per project type):
| Project Type |
Key Sections |
| Python |
Virtual env, pytest, type hints |
| Node.js |
Package manager, test runner, build |
| Rust |
Cargo, clippy, unsafe usage rules |
| Monorepo |
Workspace structure, shared deps |
| API |
Endpoints, auth, error handling |
| Frontend |
Components, state, styling |
1---2name: blueprint-claude-md3description: Generate or update CLAUDE.md from blueprint artifacts. Use when adding team instructions, converting inline content to @imports, or setting up CLAUDE.local.md.4---5
6Generate or update the project's CLAUDE.md file based on blueprint artifacts, PRDs, and project structure.
7
8## When to Use This Skill
9
10| Use this skill when... | Use alternative when... |
11|------------------------|-------------------------|
12| Need to create/update CLAUDE.md for team instructions | Use `/blueprint:rules` for path-specific rules |
13| Want to add @imports to existing CLAUDE.md | Use `/blueprint:generate-rules` to create rules from PRDs |
14| Need to create CLAUDE.local.md for personal preferences | Editing individual rule files directly |
15| Converting inline content to lean @import structure | Just need to view current memory configuration |
16
17## CLAUDE.md vs Auto Memory
18
19Claude Code has two complementary systems for project context. CLAUDE.md should contain **team-shared instructions** — not patterns Claude learns on its own.
20
21| Belongs in CLAUDE.md | Belongs in Auto Memory (managed by Claude) |
22|----------------------|---------------------------------------------|
23| Team coding standards | Debugging insights and workarounds |
24| Build/test/lint commands | Personal workflow preferences |
25| Architecture decisions | Project-specific patterns learned over time |
26| Required conventions | File relationships and navigation shortcuts |
27| CI/CD workflows | Common mistakes and how to fix them |
28
29Auto memory lives at `~/.claude/projects/<project>/memory/` and is managed automatically. Do not duplicate auto memory concerns into CLAUDE.md.
30
31## Memory Hierarchy (precedence low → high)
32
331. **User-level rules**: `~/.claude/rules/` — personal rules across all projects
342. **CLAUDE.md (project)**: Team-shared project instructions (checked into git)
353. **CLAUDE.local.md**: Personal project-specific preferences (gitignored)
364. **.claude/rules/**: Modular, path-specific rules
375. **Managed policy**: Organization-wide instructions (enterprise, system paths)
386. **Auto memory**: Claude's own notes (`~/.claude/projects/<project>/memory/`)
39
40## @import Syntax
41
42CLAUDE.md files support importing other markdown files to stay lean:
43
44```markdown
45# Project: MyApp
46
47@docs/architecture.md
48@docs/conventions.md
49@.claude/rules/testing.md
50```
51
52- Paths are relative to the file containing the import
53- Recursive imports supported (max depth 5)
54- Imports are not evaluated inside code spans or code blocks
55- First-time external imports trigger an approval dialog
56
57Use `@import` to reference existing documentation rather than duplicating content into CLAUDE.md.
58
59**Steps**:
60
611. **Check current state**:
62 - Look for existing `CLAUDE.md` in project root
63 - Look for existing `CLAUDE.local.md` (personal preferences, gitignored)
64 - Read `docs/blueprint/manifest.json` for configuration
65 - Check for `~/.claude/rules/` (user-level rules)
66 - Determine `claude_md_mode` (single, modular, or both)
67
682. **Determine action** (use AskUserQuestion):
69 ```
70 {If CLAUDE.md exists:}
71 question: "CLAUDE.md already exists. What would you like to do?"
72 options:
73 - "Update with latest project info" → merge updates
74 - "Regenerate completely" → overwrite (backup first)
75 - "Add missing sections only" → append new content
76 - "Add @imports for existing docs" → replace inline content with imports
77 - "Convert to modular rules" → split into .claude/rules/
78 - "Create CLAUDE.local.md" → personal preferences (gitignored)
79 - "View current structure" → analyze and display
80
81 {If CLAUDE.md doesn't exist:}
82 question: "No CLAUDE.md found. How would you like to create it?"
83 options:
84 - "Generate from project analysis" → auto-generate
85 - "Generate from PRDs" → use blueprint PRDs
86 - "Generate with @imports (lean)" → auto-generate using imports for existing docs
87 - "Start with template" → use starter template
88 - "Use modular rules instead" → skip CLAUDE.md, use rules/
89 ```
90
913. **Gather project context**:
92 - **Project structure**: Detect language, framework, build tools
93 - **PRDs**: Read `docs/prds/*.md` for requirements
94 - **Work overview**: Current phase and progress
95 - **Existing rules**: Content from `.claude/rules/` if present
96 - **Git history**: Recent patterns and conventions
97 - **Dependencies**: Package managers, key libraries
98
994. **Generate CLAUDE.md sections**:
100
101 **Standard sections** (focused on team-shared instructions):
102 ```markdown
103 # Project: {name}
104
105 ## Overview
106 {Brief project description from PRDs or detection}
107
108 ## Tech Stack
109 - Language: {detected}
110 - Framework: {detected}
111 - Build: {detected}
112 - Test: {detected}
113
114 ## Development Workflow
115
116 ### Getting Started
117 {Setup commands}
118
119 ### Running Tests
120 {Test commands}
121
122 ### Building
123 {Build commands}
124
125 ## Architecture
126 {Key architectural decisions from PRDs — or use @import:}
127 @docs/prds/architecture-prd.md
128
129 ## Conventions
130
131 ### Code Style
132 {Detected or from PRDs}
133
134 ### Commit Messages
135 {Conventional commits if detected}
136
137 ### Testing Requirements
138 {From PRDs or rules}
139
140 ## See Also
141 {If modular rules enabled:}
142 - `.claude/rules/` - Detailed rules by domain
143 - `docs/prds/` - Product requirements
144 ```
145
146 **Sections to omit** (auto memory handles these automatically):
147 - "Current Focus" — Claude tracks this in auto memory
148 - "Key Files" — Claude learns file relationships automatically
149 - Debugging tips — Claude records these in auto memory topic files
150
1515. **If modular rules mode = "both"**:
152 - Keep CLAUDE.md as high-level overview
153 - Reference `.claude/rules/` for details:
154 ```markdown
155 ## Detailed Rules
156 See `.claude/rules/` for domain-specific guidelines:
157 - `development.md` - Development workflow
158 - `testing.md` - Testing requirements
159 - `frontend/` - Frontend-specific rules
160 - `backend/` - Backend-specific rules
161 ```
162
1636. **If modular rules mode = "modular"**:
164 - Create minimal CLAUDE.md with `@import` references
165 - Move detailed content to `.claude/rules/`
166 - Example lean CLAUDE.md:
167 ```markdown
168 # Project: {name}
169
170 ## Overview
171 {One-paragraph description}
172
173 @docs/prds/main.md
174
175 ## Development
176 {Build, test, lint commands}
177
178 ## Rules
179 See `.claude/rules/` for detailed guidelines.
180 ```
181
1826b. **If "Create CLAUDE.local.md" selected**:
183 - Create `CLAUDE.local.md` in project root for personal preferences
184 - Add `CLAUDE.local.md` to `.gitignore` if not already present
185 - Template:
186 ```markdown
187 # Personal Preferences
188
189 ## My Environment
190 - IDE: {detected or ask}
191 - Terminal: {detected or ask}
192
193 ## My Workflow Preferences
194 - {Personal conventions not shared with team}
195 ```
196
1976c. **If "Add @imports" selected**:
198 - Scan existing CLAUDE.md for sections with content that exists in other files
199 - Replace duplicated content with `@path/to/source.md` imports
200 - Preserve CLAUDE.md-only content inline
201 - Show diff of changes before applying
202
2037. **Smart update** (for existing CLAUDE.md):
204 - Parse existing sections
205 - Identify outdated content (compare with PRDs, structure)
206 - Offer section-by-section updates:
207 ```
208 question: "Found outdated sections. Which would you like to update?"
209 options: [list of sections]
210 allowMultiSelect: true
211 ```
212
2138. **Sync with modular rules**:
214 - If rules exist in `.claude/rules/`
215 - Detect duplicated content
216 - Offer to deduplicate:
217 ```
218 question: "Found duplicate content between CLAUDE.md and rules/. How to resolve?"
219 options:
220 - "Keep in CLAUDE.md, remove from rules"
221 - "Keep in rules, reference from CLAUDE.md"
222 - "Keep both (may cause confusion)"
223 ```
224
2259. **Update manifest**:
226 - Record CLAUDE.md generation/update
227 - Track which PRDs contributed
228 - Update timestamp
229
23010. **Update task registry**:
231
232 Update the task registry entry in `docs/blueprint/manifest.json`:
233
234 ```bash
235 jq --arg now "$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
236 '.task_registry["claude-md"].last_completed_at = $now |
237 .task_registry["claude-md"].last_result = "success" |
238 .task_registry["claude-md"].stats.runs_total = ((.task_registry["claude-md"].stats.runs_total // 0) + 1)' \
239 docs/blueprint/manifest.json > tmp.json && mv tmp.json docs/blueprint/manifest.json
240 ```
241
24211. **Report**:
243 ```
244 ✅ CLAUDE.md updated!
245
246 {Created | Updated}: CLAUDE.md
247 {If created:} CLAUDE.local.md (personal preferences, gitignored)
248
249 Sections:
250 - Overview ✅
251 - Tech Stack ✅
252 - Development Workflow ✅
253 - Architecture ✅
254 - Conventions ✅
255
256 @imports used: {count, if any}
257 - @docs/prds/architecture.md
258 - @.claude/rules/testing.md
259
260 Sources used:
261 - PRDs: {list}
262 - Rules: {list}
263 - Project detection: {what was detected}
264
265 {If modular mode:}
266 Note: Detailed rules are in .claude/rules/
267 CLAUDE.md serves as overview and quick reference.
268
269 Note: "Current Focus" and "Key Files" are managed by Claude's
270 auto memory — no need to maintain these in CLAUDE.md.
271
272 Run `/blueprint:status` to see full configuration.
273 ```
274
275**CLAUDE.md Best Practices**:
276- Keep it concise (< 500 lines ideally)
277- Focus on team-shared instructions (standards, commands, architecture)
278- Use `@import` to reference existing docs instead of duplicating content
279- Use `CLAUDE.local.md` for personal preferences (auto-gitignored)
280- Reference `.claude/rules/` for detailed, path-specific rules
281- Let auto memory handle "Current Focus", "Key Files", debugging tips
282- Update when PRDs change significantly
283
28412. **Prompt for next action** (use AskUserQuestion):
285 ```
286 question: "CLAUDE.md updated. What would you like to do next?"
287 options:
288 - label: "Check blueprint status (Recommended)"
289 description: "Run /blueprint:status to verify configuration"
290 - label: "Manage modular rules"
291 description: "Add or edit rules in .claude/rules/"
292 - label: "Continue development"
293 description: "Run /project:continue to work on next task"
294 - label: "I'm done for now"
295 description: "Exit - CLAUDE.md is saved"
296 ```
297
298 **Based on selection:**
299 - "Check blueprint status" → Run `/blueprint:status`
300 - "Manage modular rules" → Run `/blueprint:rules`
301 - "Continue development" → Run `/project:continue`
302 - "I'm done" → Exit
303
304**Template Sections** (customize per project type):
305
306| Project Type | Key Sections |
307|--------------|--------------|
308| Python | Virtual env, pytest, type hints |
309| Node.js | Package manager, test runner, build |
310| Rust | Cargo, clippy, unsafe usage rules |
311| Monorepo | Workspace structure, shared deps |
312| API | Endpoints, auth, error handling |
313| Frontend | Components, state, styling |