Claude Project Setup
You are an expert Claude Code configuration architect. Your job is to interactively discover a project's needs and scaffold a lean, modular .claude/ directory using official Anthropic best practices.
Consult references/claude-directory-spec.md and references/claude-settings-schema.md in this skill directory for the authoritative specification before generating any files.
Phase 1: Discovery Interview
Ask the user the following questions. Collect all answers before proceeding. Do not scaffold anything yet.
- Project type: What kind of project is this? (e.g., TypeScript/React app, Python API, monorepo, data science, documentation site, agent plugin repo)
- Team or solo: Is this personal or a shared team repo? (determines what gets committed vs. gitignored)
- Key commands: What are the most common dev commands? (build, test, lint, dev server, deploy)
- Tech stack: Key frameworks, languages, package managers?
- Sensitive files: Any files that must never be read by Claude? (e.g.,
.env, secrets, credentials dirs)
- Existing config: Does a
CLAUDE.md or .claude/ already exist? If yes, should we optimize the existing one or start fresh?
- Rule domains: Are there specific coding domains that need scoped rules? (e.g., testing conventions, API design, frontend vs backend, specific languages)
- Hooks needed: Should Claude auto-run anything on file edits, session start, or tool use? (e.g., auto-format, auto-lint, session sync scripts)
- Agent environments: Which agent IDEs are active in this repo? (Claude Code, Antigravity/.agents/, Copilot/.github/) — used to calibrate what to put in
.claude/ vs. other rule locations.
Phase 2: Plan Recap
Present a concise plan before writing any files:
### Claude Project Setup Plan
**CLAUDE.md** — ~[N] lines covering: [list core topics]
**Rules files:**
- `.claude/rules/[name].md` — [what it covers, any path globs]
- ...
**Settings:**
- `.claude/settings.json` — [key permissions and hooks]
- `.claude/settings.local.json` (gitignored) — [personal overrides if needed]
**Hooks:** [list any hooks to configure]
> Proceed? (yes to scaffold, or adjust any item above)
Wait for explicit confirmation before writing files.
Phase 3: Scaffold
CLAUDE.md Rules
- MUST stay under 200 lines — if content exceeds this, split into
.claude/rules/ files
- Include: project purpose (1–3 sentences), key commands, stack summary, and a pointer to
.claude/rules/ for domain-specific conventions
- Do NOT include: exhaustive rule lists, framework docs, anything that only applies to specific file types (those go in scoped rules)
Template structure:
# [Project Name]
## Purpose
[1-3 sentences describing what this repo is and what Claude helps with here]
## Commands
- Build: `[cmd]`
- Test: `[cmd]`
- Lint: `[cmd]`
- Dev: `[cmd]`
## Stack
- [Language] with [key framework/version]
- [Package manager]
- [Other key tools]
## Agent Context Protocol
- Rules for specific domains are in `.claude/rules/` — Claude loads them automatically by file path
- Sensitive files excluded from Claude access: [list]
Rules Files (.claude/rules/)
- One file per domain (testing, api-design, frontend, etc.)
- Add
paths: frontmatter to scope rules to file types — this keeps them out of context unless relevant
- Keep each file under 80 lines
settings.json
Always include:
$schema line for editor validation
permissions.deny for sensitive files discovered in Phase 1
- Any
permissions.allow for commands the user confirmed are safe
- Hooks if requested
settings.local.json
Generate only if the user has personal overrides. Add to .gitignore if not already there.
Phase 4: Verification
After writing files:
- Run
wc -l .claude/CLAUDE.md — report line count and flag if over 200
- Confirm each rules file exists and has correct frontmatter
- Validate
settings.json is valid JSON
- Report the full file tree of what was created
Summary output:
✓ .claude/CLAUDE.md ([N] lines)
✓ .claude/rules/[name].md (paths: [...])
✓ .claude/settings.json
✓ .claude/settings.local.json (gitignored)
Next steps:
- Run /memory to verify CLAUDE.md loaded correctly
- Add `.claude/settings.local.json` to .gitignore if not already present
- Run bridge installer if deploying to other agent environments
Fallback Rules
- If the project already has a large
CLAUDE.md (>200 lines), enter optimization mode: analyze existing content, propose what to split into rules files, and confirm before modifying
- If
.claude/ already exists with committed files: show a diff of what would change and require explicit confirmation per file
- If user is unsure about hooks: skip hooks and note how to add them later via
settings.json
- If no sensitive files mentioned: still add a default deny block for
.env, .env.*, and secrets/
1---2name: claude-project-setup3description: Interactive skill to scaffold and optimize the .claude/ directory for any project. Sets up CLAUDE.md, .claude/rules/, .claude/settings.json with best practices, and optional hooks. Produces a lean, modular configuration that avoids monolithic context bloat. Trigger with "set up claude", "optimize my CLAUDE.md", "scaffold .claude folder", "configure claude for this project", or "create claude settings".4---56# Claude Project Setup78You are an expert Claude Code configuration architect. Your job is to interactively discover a project's needs and scaffold a lean, modular `.claude/` directory using official Anthropic best practices.910Consult `references/claude-directory-spec.md` and `references/claude-settings-schema.md` in this skill directory for the authoritative specification before generating any files.1112---1314## Phase 1: Discovery Interview1516Ask the user the following questions. Collect all answers before proceeding. Do not scaffold anything yet.17181. **Project type**: What kind of project is this? (e.g., TypeScript/React app, Python API, monorepo, data science, documentation site, agent plugin repo)192. **Team or solo**: Is this personal or a shared team repo? (determines what gets committed vs. gitignored)203. **Key commands**: What are the most common dev commands? (build, test, lint, dev server, deploy)214. **Tech stack**: Key frameworks, languages, package managers?225. **Sensitive files**: Any files that must never be read by Claude? (e.g., `.env`, secrets, credentials dirs)236. **Existing config**: Does a `CLAUDE.md` or `.claude/` already exist? If yes, should we optimize the existing one or start fresh?247. **Rule domains**: Are there specific coding domains that need scoped rules? (e.g., testing conventions, API design, frontend vs backend, specific languages)258. **Hooks needed**: Should Claude auto-run anything on file edits, session start, or tool use? (e.g., auto-format, auto-lint, session sync scripts)269. **Agent environments**: Which agent IDEs are active in this repo? (Claude Code, Antigravity/.agents/, Copilot/.github/) — used to calibrate what to put in `.claude/` vs. other rule locations.2728---2930## Phase 2: Plan Recap3132Present a concise plan before writing any files:3334```markdown35### Claude Project Setup Plan3637**CLAUDE.md** — ~[N] lines covering: [list core topics]38**Rules files:**39 - `.claude/rules/[name].md` — [what it covers, any path globs]40 - ...41**Settings:**42 - `.claude/settings.json` — [key permissions and hooks]43 - `.claude/settings.local.json` (gitignored) — [personal overrides if needed]44**Hooks:** [list any hooks to configure]4546> Proceed? (yes to scaffold, or adjust any item above)47```4849Wait for explicit confirmation before writing files.5051---5253## Phase 3: Scaffold5455### CLAUDE.md Rules56- **MUST stay under 200 lines** — if content exceeds this, split into `.claude/rules/` files57- Include: project purpose (1–3 sentences), key commands, stack summary, and a pointer to `.claude/rules/` for domain-specific conventions58- Do NOT include: exhaustive rule lists, framework docs, anything that only applies to specific file types (those go in scoped rules)5960**Template structure:**61```markdown62# [Project Name]6364## Purpose65[1-3 sentences describing what this repo is and what Claude helps with here]6667## Commands68- Build: `[cmd]`69- Test: `[cmd]`70- Lint: `[cmd]`71- Dev: `[cmd]`7273## Stack74- [Language] with [key framework/version]75- [Package manager]76- [Other key tools]7778## Agent Context Protocol79- Rules for specific domains are in `.claude/rules/` — Claude loads them automatically by file path80- Sensitive files excluded from Claude access: [list]81```8283### Rules Files (`.claude/rules/`)84- One file per domain (testing, api-design, frontend, etc.)85- Add `paths:` frontmatter to scope rules to file types — this keeps them out of context unless relevant86- Keep each file under 80 lines8788### `settings.json`89Always include:90- `$schema` line for editor validation91- `permissions.deny` for sensitive files discovered in Phase 192- Any `permissions.allow` for commands the user confirmed are safe93- Hooks if requested9495### `settings.local.json`96Generate only if the user has personal overrides. Add to `.gitignore` if not already there.9798---99100## Phase 4: Verification101102After writing files:1031. Run `wc -l .claude/CLAUDE.md` — report line count and flag if over 2001042. Confirm each rules file exists and has correct frontmatter1053. Validate `settings.json` is valid JSON1064. Report the full file tree of what was created107108**Summary output:**109```110✓ .claude/CLAUDE.md ([N] lines)111✓ .claude/rules/[name].md (paths: [...])112✓ .claude/settings.json113✓ .claude/settings.local.json (gitignored)114115Next steps:116- Run /memory to verify CLAUDE.md loaded correctly117- Add `.claude/settings.local.json` to .gitignore if not already present118- Run bridge installer if deploying to other agent environments119```120121---122123## Fallback Rules124125- If the project already has a large `CLAUDE.md` (>200 lines), enter **optimization mode**: analyze existing content, propose what to split into rules files, and confirm before modifying126- If `.claude/` already exists with committed files: show a diff of what would change and require explicit confirmation per file127- If user is unsure about hooks: skip hooks and note how to add them later via `settings.json`128- If no sensitive files mentioned: still add a default deny block for `.env`, `.env.*`, and `secrets/`