CLAUDE.md Master (Create/Update/Improver)
When to use
- User asks to create, improve, update, or standardize CLAUDE.md files.
Core rules
- Only include info verified in repo or config.
- Never include secrets, tokens, credentials, or user data.
- Never include task-specific or temporary instructions.
- Keep concise: root <= 200 lines, module <= 120 lines.
- Use bullets; avoid long prose.
- Commands must be copy-pasteable and sourced from repo docs/scripts/CI.
- Skip empty sections; avoid filler.
Mandatory inputs (analyze before generating)
- Build/package config relevant to detected stack (root + modules).
- Static analysis config used in repo (if present).
- Actual module structure and source patterns (scan real dirs/files).
- Representative source roots per module to extract:
package/feature structure, key types, and annotations in use.
Discovery (fast + targeted)
- Locate existing CLAUDE.md variants:
CLAUDE.md, .claude.md, .claude.local.md.
- Identify stack and entry points via minimal reads:
README.md, relevant docs/*
- Build/package files (see stack references)
- Runtime/config:
Dockerfile, docker-compose.yml, .env.example, config/*
- CI:
.github/workflows/*, .gitlab-ci.yml, .circleci/*
- Extract commands only if they exist in repo scripts/config/docs.
- Detect multi-module structure:
- Android/Gradle: read
settings.gradle or settings.gradle.kts includes.
- iOS: detect multiple targets/workspaces in
*.xcodeproj/*.xcworkspace.
- If more than one module/target has
src/ or build config, plan module CLAUDE.md files.
- For each module candidate, read its build file + minimal docs to capture
module-specific purpose, entry points, and commands.
- Scan source roots for:
- Top-level package/feature folders and layer conventions.
- Key annotations/types in use (per stack reference).
- Naming conventions used in the codebase.
- Capture non-obvious workflows/gotchas from docs or code patterns.
Performance:
- Prefer file listing + targeted reads.
- Avoid full-file reads when a section or symbol is enough.
- Skip large dirs:
node_modules, vendor, build, dist.
Stack-specific references (Pattern 2)
Read the relevant reference only when detection signals appear:
- Android/Gradle →
references/android.md
- iOS/Xcode/Swift →
references/ios.md
- PHP →
references/php.md
- Go →
references/go.md
- React (web) →
references/react-web.md
- React Native →
references/react-native.md
- Rust →
references/rust.md
- Python →
references/python.md
- Java/JVM →
references/java.md
- Node tooling →
references/node.md
- .NET/C# →
references/dotnet.md
- Dart/Flutter →
references/flutter.md
- Ruby/Rails →
references/ruby.md
- Elixir/Erlang →
references/elixir.md
- C/C++/CMake →
references/cpp.md
- Other/Unknown →
references/generic.md (fallback when no specific reference matches)
If multiple stacks are detected, read multiple references.
If no stack is recognized, use the generic reference.
Multi-module output policy (mandatory when detected)
- Always create a root
CLAUDE.md.
- Also create
CLAUDE.md inside each meaningful module/target root.
- "Meaningful" = has its own build config and
src/ (or equivalent).
- Skip tooling-only dirs like
buildSrc, gradle, scripts, tools.
- Module file must be module-specific and avoid duplication:
- Include purpose, key paths, entry points, module tests, and module
commands (if any).
- Reference shared info via
@/CLAUDE.md.
Business module CLAUDE.md policy (all stacks)
For monorepo business logic directories (src/, lib/, packages/, internal/):
- Create
CLAUDE.md for modules with >5 files OR own README
- Skip utility-only dirs:
Helper, Utils, Common, Shared, Exception, Trait, Constants
- Layered structure not required; provide module info regardless of architecture
- Max 120 lines per module CLAUDE.md
- Reference root via
@/CLAUDE.md for shared architecture/patterns
- Include: purpose, structure, key classes, dependencies, entry points
Mandatory output sections (per module CLAUDE.md)
Include these sections if detected in codebase (skip only if not present):
- Feature/component inventory: list top-level dirs under source root
- Core/shared modules: utility, common, or shared code directories
- Navigation/routing structure: navigation graphs, routes, or routers
- Network/API layer pattern: API clients, endpoints, response wrappers
- DI/injection pattern: modules, containers, or injection setup
- Build/config files: module-specific configs (proguard, manifests, etc.)
See stack-specific references for exact patterns to detect and report.
Update workflow (must follow)
Propose targeted additions only; show diffs per file.
Ask for approval before applying updates:
Cursor IDE:
Use the AskQuestion tool with these options:
- id: "approval"
- prompt: "Apply these CLAUDE.md updates?"
- options: [{"id": "yes", "label": "Yes, apply"}, {"id": "no", "label": "No, cancel"}]
Claude Code (Terminal):
Output the proposed changes and ask:
"Do you approve these updates? (yes/no)"
Stop and wait for user response before proceeding.
Other Environments (Fallback):
If no structured question tool is available:
Display proposed changes clearly
Ask: "Do you approve these updates? Reply 'yes' to apply or 'no' to cancel."
Wait for explicit user confirmation before proceeding
Apply updates, preserving custom content.
If no CLAUDE.md exists, propose a new file for approval.
Content extraction rules (mandatory)
- From codebase only:
- Extract: type/class/annotation names used, real path patterns,
naming conventions.
- Never: hardcoded values, secrets, API keys, business-specific logic.
- Never: code snippets in Do/Do Not rules.
Verification before writing
Content rules
- Include: commands, architecture summary, key paths, testing, gotchas, workflow quirks.
- Exclude: generic best practices, obvious info, unverified statements.
- Use
@path/to/file imports to avoid duplication.
- Do/Do Not format is optional; keep only if already used in the file.
- Avoid code examples except short copy-paste commands.
Existing file strategy
Detection:
- If
<!-- Generated by claude-md-editor skill --> exists → subsequent run
- Else → first run
First run + existing file:
- Backup
CLAUDE.md → CLAUDE.md.bak
- Use
.bak as a source and extract only reusable, project-specific info
- Generate a new concise file and add the marker
Subsequent run:
- Preserve custom sections and wording unless outdated or incorrect
- Update only what conflicts with current repo state
- Add missing sections only if they add real value
Never modify .claude.local.md.
Output
After updates, print a concise report:
## CLAUDE.md Update Report
- /CLAUDE.md [CREATED | BACKED_UP+CREATED | UPDATED]
- /<module>/CLAUDE.md [CREATED | UPDATED]
- Backups: list any `.bak` files
Validation checklist
- Description is specific and includes trigger terms
- No placeholders remain
- No secrets included
- Commands are real and copy-pasteable
- Report-first rule respected
- References are one level deep
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: claude-md-master3description: Master skill for CLAUDE.md lifecycle - create, update, improve with repo-verified content and multi-module support. Use when creating or updating CLAUDE.md files. Use when this capability is needed.4---56# CLAUDE.md Master (Create/Update/Improver)78## When to use9- User asks to create, improve, update, or standardize CLAUDE.md files.1011## Core rules12- Only include info verified in repo or config.13- Never include secrets, tokens, credentials, or user data.14- Never include task-specific or temporary instructions.15- Keep concise: root <= 200 lines, module <= 120 lines.16- Use bullets; avoid long prose.17- Commands must be copy-pasteable and sourced from repo docs/scripts/CI.18- Skip empty sections; avoid filler.1920## Mandatory inputs (analyze before generating)21- Build/package config relevant to detected stack (root + modules).22- Static analysis config used in repo (if present).23- Actual module structure and source patterns (scan real dirs/files).24- Representative source roots per module to extract:25 package/feature structure, key types, and annotations in use.2627## Discovery (fast + targeted)281. Locate existing CLAUDE.md variants: `CLAUDE.md`, `.claude.md`, `.claude.local.md`.292. Identify stack and entry points via minimal reads:30 - `README.md`, relevant `docs/*`31 - Build/package files (see stack references)32 - Runtime/config: `Dockerfile`, `docker-compose.yml`, `.env.example`, `config/*`33 - CI: `.github/workflows/*`, `.gitlab-ci.yml`, `.circleci/*`343. Extract commands only if they exist in repo scripts/config/docs.354. Detect multi-module structure:36 - Android/Gradle: read `settings.gradle` or `settings.gradle.kts` includes.37 - iOS: detect multiple targets/workspaces in `*.xcodeproj`/`*.xcworkspace`.38 - If more than one module/target has `src/` or build config, plan module CLAUDE.md files.395. For each module candidate, read its build file + minimal docs to capture40 module-specific purpose, entry points, and commands.416. Scan source roots for:42 - Top-level package/feature folders and layer conventions.43 - Key annotations/types in use (per stack reference).44 - Naming conventions used in the codebase.457. Capture non-obvious workflows/gotchas from docs or code patterns.4647Performance:48- Prefer file listing + targeted reads.49- Avoid full-file reads when a section or symbol is enough.50- Skip large dirs: `node_modules`, `vendor`, `build`, `dist`.5152## Stack-specific references (Pattern 2)53Read the relevant reference only when detection signals appear:54- Android/Gradle → `references/android.md`55- iOS/Xcode/Swift → `references/ios.md`56- PHP → `references/php.md`57- Go → `references/go.md`58- React (web) → `references/react-web.md`59- React Native → `references/react-native.md`60- Rust → `references/rust.md`61- Python → `references/python.md`62- Java/JVM → `references/java.md`63- Node tooling → `references/node.md`64- .NET/C# → `references/dotnet.md`65- Dart/Flutter → `references/flutter.md`66- Ruby/Rails → `references/ruby.md`67- Elixir/Erlang → `references/elixir.md`68- C/C++/CMake → `references/cpp.md`69- Other/Unknown → `references/generic.md` (fallback when no specific reference matches)7071If multiple stacks are detected, read multiple references.72If no stack is recognized, use the generic reference.7374## Multi-module output policy (mandatory when detected)75- Always create a root `CLAUDE.md`.76- Also create `CLAUDE.md` inside each meaningful module/target root.77 - "Meaningful" = has its own build config and `src/` (or equivalent).78 - Skip tooling-only dirs like `buildSrc`, `gradle`, `scripts`, `tools`.79- Module file must be module-specific and avoid duplication:80 - Include purpose, key paths, entry points, module tests, and module81 commands (if any).82 - Reference shared info via `@/CLAUDE.md`.8384## Business module CLAUDE.md policy (all stacks)85For monorepo business logic directories (`src/`, `lib/`, `packages/`, `internal/`):86- Create `CLAUDE.md` for modules with >5 files OR own README87- Skip utility-only dirs: `Helper`, `Utils`, `Common`, `Shared`, `Exception`, `Trait`, `Constants`88- Layered structure not required; provide module info regardless of architecture89- Max 120 lines per module CLAUDE.md90- Reference root via `@/CLAUDE.md` for shared architecture/patterns91- Include: purpose, structure, key classes, dependencies, entry points9293## Mandatory output sections (per module CLAUDE.md)94Include these sections if detected in codebase (skip only if not present):95- **Feature/component inventory**: list top-level dirs under source root96- **Core/shared modules**: utility, common, or shared code directories97- **Navigation/routing structure**: navigation graphs, routes, or routers98- **Network/API layer pattern**: API clients, endpoints, response wrappers99- **DI/injection pattern**: modules, containers, or injection setup100- **Build/config files**: module-specific configs (proguard, manifests, etc.)101102See stack-specific references for exact patterns to detect and report.103104## Update workflow (must follow)1051. Propose targeted additions only; show diffs per file.1061072. Ask for approval before applying updates:108109**Cursor IDE:**110Use the AskQuestion tool with these options:111- id: "approval"112- prompt: "Apply these CLAUDE.md updates?"113- options: [{"id": "yes", "label": "Yes, apply"}, {"id": "no", "label": "No, cancel"}]114115**Claude Code (Terminal):**116Output the proposed changes and ask:117"Do you approve these updates? (yes/no)"118Stop and wait for user response before proceeding.119120**Other Environments (Fallback):**121If no structured question tool is available:1221. Display proposed changes clearly1232. Ask: "Do you approve these updates? Reply 'yes' to apply or 'no' to cancel."1243. Wait for explicit user confirmation before proceeding1251263. Apply updates, preserving custom content.127128If no CLAUDE.md exists, propose a new file for approval.129130## Content extraction rules (mandatory)131- From codebase only:132 - Extract: type/class/annotation names used, real path patterns,133 naming conventions.134 - Never: hardcoded values, secrets, API keys, business-specific logic.135 - Never: code snippets in Do/Do Not rules.136137## Verification before writing138- [ ] Every rule references actual types/paths from codebase139- [ ] No code examples in Do/Do Not sections140- [ ] Patterns match what's actually in the codebase (not outdated)141142## Content rules143- Include: commands, architecture summary, key paths, testing, gotchas, workflow quirks.144- Exclude: generic best practices, obvious info, unverified statements.145- Use `@path/to/file` imports to avoid duplication.146- Do/Do Not format is optional; keep only if already used in the file.147- Avoid code examples except short copy-paste commands.148149## Existing file strategy150Detection:151- If `<!-- Generated by claude-md-editor skill -->` exists → subsequent run152- Else → first run153154First run + existing file:155- Backup `CLAUDE.md` → `CLAUDE.md.bak`156- Use `.bak` as a source and extract only reusable, project-specific info157- Generate a new concise file and add the marker158159Subsequent run:160- Preserve custom sections and wording unless outdated or incorrect161- Update only what conflicts with current repo state162- Add missing sections only if they add real value163164Never modify `.claude.local.md`.165166## Output167After updates, print a concise report:168```169## CLAUDE.md Update Report170- /CLAUDE.md [CREATED | BACKED_UP+CREATED | UPDATED]171- /<module>/CLAUDE.md [CREATED | UPDATED]172- Backups: list any `.bak` files173```174175## Validation checklist176- Description is specific and includes trigger terms177- No placeholders remain178- No secrets included179- Commands are real and copy-pasteable180- Report-first rule respected181- References are one level deep182183---184> Converted and distributed by [TomeVault](https://tomevault.io/claim/barisatalay) — claim your Tome and manage your conversions.185<!-- tomevault:4.0:skill_md:2026-04-11 -->