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".
From claude-clinpx claudepluginhub richfrem/agent-plugins-skills --plugin claude-cliThis skill is limited to using the following tools:
evals/evals.jsonevals/results.tsvreferences/claude-directory-spec.mdreferences/claude-settings-schema.mdSorts ECC skills, commands, rules, hooks, and extras into DAILY vs LIBRARY buckets using repo evidence like file extensions and configs. Creates trimmed install plan for project-specific needs.
Enables AI agents to execute x402 payments with per-task budgets, spending controls, and non-custodial wallets via MCP tools. Use when agents pay for APIs, services, or other agents.
Implements structured self-debugging workflow for AI agent failures: capture errors, diagnose patterns like loops or context overflow, apply contained recoveries, and generate introspection reports.
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.
Ask the user the following questions. Collect all answers before proceeding. Do not scaffold anything yet.
.env, secrets, credentials dirs)CLAUDE.md or .claude/ already exist? If yes, should we optimize the existing one or start fresh?.claude/ vs. other rule locations.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.
.claude/rules/ files.claude/rules/ for domain-specific conventionsTemplate 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]
.claude/rules/)paths: frontmatter to scope rules to file types — this keeps them out of context unless relevantsettings.jsonAlways include:
$schema line for editor validationpermissions.deny for sensitive files discovered in Phase 1permissions.allow for commands the user confirmed are safesettings.local.jsonGenerate only if the user has personal overrides. Add to .gitignore if not already there.
After writing files:
wc -l .claude/CLAUDE.md — report line count and flag if over 200settings.json is valid JSONSummary 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
CLAUDE.md (>200 lines), enter optimization mode: analyze existing content, propose what to split into rules files, and confirm before modifying.claude/ already exists with committed files: show a diff of what would change and require explicit confirmation per filesettings.json.env, .env.*, and secrets/