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-setup3plugin: cli-agents4description: >-5 Interactive skill to scaffold and optimize the .claude/ directory for any6 project. Sets up CLAUDE.md, .claude/rules/, .claude/settings.json with best7 practices, and optional hooks. Produces a lean, modular configuration that8 avoids monolithic context bloat. Trigger with "set up claude", "optimize my9 CLAUDE.md", "scaffold .claude folder", "configure claude for this project",10 or "create claude settings".11allowed-tools: Bash, Read, Write12---1314# Claude Project Setup1516You 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.1718Consult `references/claude-directory-spec.md` and `references/claude-settings-schema.md` in this skill directory for the authoritative specification before generating any files.1920---2122## Phase 1: Discovery Interview2324Ask the user the following questions. Collect all answers before proceeding. Do not scaffold anything yet.25261. **Project type**: What kind of project is this? (e.g., TypeScript/React app, Python API, monorepo, data science, documentation site, agent plugin repo)272. **Team or solo**: Is this personal or a shared team repo? (determines what gets committed vs. gitignored)283. **Key commands**: What are the most common dev commands? (build, test, lint, dev server, deploy)294. **Tech stack**: Key frameworks, languages, package managers?305. **Sensitive files**: Any files that must never be read by Claude? (e.g., `.env`, secrets, credentials dirs)316. **Existing config**: Does a `CLAUDE.md` or `.claude/` already exist? If yes, should we optimize the existing one or start fresh?327. **Rule domains**: Are there specific coding domains that need scoped rules? (e.g., testing conventions, API design, frontend vs backend, specific languages)338. **Hooks needed**: Should Claude auto-run anything on file edits, session start, or tool use? (e.g., auto-format, auto-lint, session sync scripts)349. **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.3536---3738## Phase 2: Plan Recap3940Present a concise plan before writing any files:4142```markdown43### Claude Project Setup Plan4445**CLAUDE.md** — ~[N] lines covering: [list core topics]46**Rules files:**47 - `.claude/rules/[name].md` — [what it covers, any path globs]48 - ...49**Settings:**50 - `.claude/settings.json` — [key permissions and hooks]51 - `.claude/settings.local.json` (gitignored) — [personal overrides if needed]52**Hooks:** [list any hooks to configure]5354> Proceed? (yes to scaffold, or adjust any item above)55```5657Wait for explicit confirmation before writing files.5859---6061## Phase 3: Scaffold6263### CLAUDE.md Rules64- **MUST stay under 200 lines** — if content exceeds this, split into `.claude/rules/` files65- Include: project purpose (1–3 sentences), key commands, stack summary, and a pointer to `.claude/rules/` for domain-specific conventions66- Do NOT include: exhaustive rule lists, framework docs, anything that only applies to specific file types (those go in scoped rules)6768**Template structure:**69```markdown70# [Project Name]7172## Purpose73[1-3 sentences describing what this repo is and what Claude helps with here]7475## Commands76- Build: `[cmd]`77- Test: `[cmd]`78- Lint: `[cmd]`79- Dev: `[cmd]`8081## Stack82- [Language] with [key framework/version]83- [Package manager]84- [Other key tools]8586## Agent Context Protocol87- Rules for specific domains are in `.claude/rules/` — Claude loads them automatically by file path88- Sensitive files excluded from Claude access: [list]89```9091### Rules Files (`.claude/rules/`)92- One file per domain (testing, api-design, frontend, etc.)93- Add `paths:` frontmatter to scope rules to file types — this keeps them out of context unless relevant94- Keep each file under 80 lines9596### `settings.json`97Always include:98- `$schema` line for editor validation99- `permissions.deny` for sensitive files discovered in Phase 1100- Any `permissions.allow` for commands the user confirmed are safe101- Hooks if requested102103### `settings.local.json`104Generate only if the user has personal overrides. Add to `.gitignore` if not already there.105106---107108## Phase 4: Verification109110After writing files:1111. Run `wc -l .claude/CLAUDE.md` — report line count and flag if over 2001122. Confirm each rules file exists and has correct frontmatter1133. Validate `settings.json` is valid JSON1144. Report the full file tree of what was created115116**Summary output:**117```118✓ .claude/CLAUDE.md ([N] lines)119✓ .claude/rules/[name].md (paths: [...])120✓ .claude/settings.json121✓ .claude/settings.local.json (gitignored)122123Next steps:124- Run /memory to verify CLAUDE.md loaded correctly125- Add `.claude/settings.local.json` to .gitignore if not already present126- Run bridge installer if deploying to other agent environments127```128129---130131## Fallback Rules132133- 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 modifying134- If `.claude/` already exists with committed files: show a diff of what would change and require explicit confirmation per file135- If user is unsure about hooks: skip hooks and note how to add them later via `settings.json`136- If no sensitive files mentioned: still add a default deny block for `.env`, `.env.*`, and `secrets/`