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