setupdotclaude
Skill2 starsChanged 6 months agoMITView on GitHub
Set up dotclaude in any project end-to-end. Bootstrap `.claude/` from the bundled template if missing, then customize every config file to match the project's actual tech stack, conventions, and patterns.
- Deletes or force-pushes
1 other project uses a version of this.
Adopted by
Most recently taken up by
- poshan0126/dotclaudetheir own version, first seen Oct 8, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- poshan0126/dotclaude★ 871same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository9 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- context-budgetSkill
- debug-fixSkill
- explainSkill
- pr-reviewSkill
- refactorSkill
- shipSkill
- tddSkill
- test-writerSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
49 rules. About 0 are common, 34 are distinctive, and 15 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈34
Distinctive · estimate
This author's own choices. Worth a look.
15
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
If the project is empty or has no source code yet, bootstrap defaults but tell the user the customization passes will be skipped until they …
- Very specific: line 18
If it exists: the user has already populated .claude/ (likely via the clone+copy flow).
- Distinctive: line 19
If it does NOT exist: bootstrap from the bundled template.
- Very specific: line 23
Use AskUserQuestion: "This project has no .claude/ set up yet.
- Very specific: line 25
If the user says no, stop with: "setupdotclaude needs dotclaude's content to operate.
- Very specific: line 27
If the user says yes, run these Bash commands to copy the bundled template (Claude Code sets $CLAUDE_PLUGIN_ROOT to this plugin's …
- Very specific: line 55
If $CLAUDE_PLUGIN_ROOT is unset (rare, only when this skill is run from a non-plugin location like a direct clone), tell the user to either …
- Distinctive: line 75
After cleanup, briefly tell the user what was removed (count of files plus directories), then continue.
- Very specific: line 81
Check: package.json, pyproject.toml, Cargo.toml, go.mod, Gemfile, composer.json, build.gradle, pom.xml, Makefile, Dockerfile.
- Distinctive: line 93
Check git log --oneline -20 for commit message style.
- Distinctive: line 113
If the user provides corrections, incorporate them.
- Distinctive: line 145
Update permissions to match actual commands:
- Distinctive: line 147
Add project-specific allow rules for detected scripts
- Distinctive: line 148
Keep deny rules for secrets as-is (these are universal)
- Distinctive: line 152
Update naming conventions ONLY if the project's existing code uses different patterns:
- Distinctive: line 154
If the project uses different file naming than the template, update
- Distinctive: line 155
If the project's import style differs, update the import order section
- Distinctive: line 157
If everything matches the defaults, leave it unchanged.
- Distinctive: line 161
Update if the detected test framework has specific idioms.
- Very specific: line 165
Update the paths: frontmatter to match actual project directories:
- Distinctive: line 169
If none found, keep the defaults as reasonable guesses
- Very specific: line 173
Update the paths: frontmatter to match actual backend directories (same paths as security.md plus service/handler directories).
- Distinctive: line 178
If frontend exists: update the Component Framework table to highlight which options the project actually uses (detected from dependencies)
- Distinctive: line 179
Update path patterns in frontmatter if the project uses non-standard directories
- Very specific: line 194
Check the default branch name (git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null or git remote show origin).
- Very specific: line 198
Check if the project has a database (look for: migration directories, ORM config files like prisma/schema.prisma, drizzle.config.*, …
- Very specific: line 199
If database/migrations detected: keep the rule, update paths: frontmatter to match the actual migration directory paths found
- Very specific: line 200
If no database detected: delete rules/database.md entirely
- Distinctive: line 204
All skills are methodology-based and project-agnostic.
- Very specific: line 206
If the user wants a minimal setup, list the actual contents of .claude/skills/ (run ls -1 .claude/skills/) and use AskUserQuestion to ask …
- Distinctive: line 210
frontend-designer.md: delete if no frontend files exist
- Very specific: line 211
doc-reviewer.md: delete if the project has no documentation directory (no docs/, doc/, or significant .md files beyond README)
- Distinctive: line 212
security-reviewer.md: keep (security applies everywhere)
- Distinctive: line 218
After all changes are applied, run a thorough final review pass.
- Distinctive: line 222
Run this Bash to count non-blank lines in CLAUDE.md:
- Distinctive: line 243
Do the rules match how the code is actually written?
- Distinctive: line 244
Do the settings permissions cover the commands the project actually uses?
- Distinctive: line 245
Do the security rule paths match where sensitive code actually lives?
- Distinctive: line 246
Do the hook protections cover the files that actually need protecting in this project?
- Distinctive: line 248
Remove any redundancy introduced during customization.
- Distinctive: line 249
Ensure no file contradicts another.
- Distinctive: line 251
Verify all YAML frontmatter is valid.
- Very specific: line 252
Verify all hook scripts referenced in settings.json exist and are executable.
- Distinctive: line 258
After everything is finalized, count CLAUDE.md's non-blank lines once more and present a summary:
- Distinctive: line 281
NEVER write changes without user confirmation first
- Distinctive: line 282
NEVER delete a file without confirming.
- Distinctive: line 283
If the project is empty (no source files, no manifests), bootstrap defaults and stop.
- Distinctive: line 284
If detection is uncertain, ASK the user rather than guessing
- Distinctive: line 286
Keep it minimal. If the default works, leave it alone.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Set up dotclaude in this project end-to-end. If .claude/ doesn't exist yet, bootstrap it from the template bundled inside this plugin; then customize every config file to match the actual tech stack, conventions, and patterns in use. Confirm with the user before each change using AskUserQuestion.
CLAUDE.md must be at the project root (./CLAUDE.md), NOT inside .claude/. All other config files live inside .claude/.
If the project is empty or has no source code yet, bootstrap defaults but tell the user the customization passes will be skipped until they add code.
Phase Init: Bootstrap .claude/ if missing
Decide whether to bootstrap by checking for .claude/settings.json:
- If it exists: the user has already populated
.claude/(likely via the clone+copy flow). Skip this phase entirely and go to Phase 0. - If it does NOT exist: bootstrap from the bundled template.
When bootstrapping:
- Use AskUserQuestion: "This project has no
.claude/set up yet. Bootstrap it from the dotclaude template bundled in this plugin?" Options:yes/no. - If the user says no, stop with: "setupdotclaude needs dotclaude's content to operate. Either clone https://github.com/poshan0126/dotclaude and copy the files in, or re-run and choose
yesto use the bundled template." If the user says yes, run these Bash commands to copy the bundled template (Claude Code sets
$CLAUDE_PLUGIN_ROOTto this plugin's installation directory):mkdir -p .claude cp "$CLAUDE_PLUGIN_ROOT/template/settings.json" .claude/ cp -r "$CLAUDE_PLUGIN_ROOT/template/rules" .claude/ cp -r "$CLAUDE_PLUGIN_ROOT/template/skills" .claude/ cp -r "$CLAUDE_PLUGIN_ROOT/template/agents" .claude/ cp -r "$CLAUDE_PLUGIN_ROOT/template/hooks" .claude/ chmod +x .claude/hooks/*.shThen handle the project-root files (don't clobber existing
CLAUDE.md):[ -f ./CLAUDE.md ] || cp "$CLAUDE_PLUGIN_ROOT/template/CLAUDE.md" ./ [ -f ./CLAUDE.local.md.example ] || cp "$CLAUDE_PLUGIN_ROOT/template/CLAUDE.local.md.example" ./Then ensure
CLAUDE.local.mdis gitignored:touch .gitignore grep -qxF 'CLAUDE.local.md' .gitignore || echo 'CLAUDE.local.md' >> .gitignore- Tell the user what was placed and continue to Phase 0.
If $CLAUDE_PLUGIN_ROOT is unset (rare, only when this skill is run from a non-plugin location like a direct clone), tell the user to either re-install via the marketplace or follow the manual clone+copy flow at https://github.com/poshan0126/dotclaude.
Phase 0: Clean Up Non-Config Files
Before continuing, delete files and directories inside .claude/ that come along with a clone+copy of the dotclaude repo but don't belong in a project's .claude/. They waste tokens at runtime or just clutter the directory. Use Bash with rm -rf (or rm -f for files). Don't error on missing entries.
Files to remove from .claude/:
.claude/README.md(repo README accidentally copied in).claude/CONTRIBUTING.md(repo contributing guide).claude/LICENSE(repo license).claude/CLAUDE.md(CLAUDE.mdbelongs at the project root, not inside.claude/).claude/.gitignore(for the dotclaude repo, not the project; the project has its own root.gitignore).claude/settings.local.json.example(example template, not used at runtime).claude/rules/README.md,.claude/agents/README.md,.claude/hooks/README.md,.claude/skills/README.md(folder descriptions for GitHub browsing only)
Directories to remove from .claude/ (only exist when a user did a bulk cp -r dotclaude/* .claude/; they belong to the dotclaude repo, not to a consuming project):
.claude/.claude-plugin/(marketplace catalog, only used for plugin distribution).claude/plugins/(per-plugin self-contained copies, only used for plugin distribution).claude/scripts/(repo maintenance scripts like sync-plugins.sh)
After cleanup, briefly tell the user what was removed (count of files plus directories), then continue.
Phase 1: Detect Tech Stack
Scan for package manifests, config files, and folder structure to detect: language, framework, package manager, test framework, linter/formatter, architecture pattern, and source/test directories.
Check: package.json, pyproject.toml, Cargo.toml, go.mod, Gemfile, composer.json, build.gradle, pom.xml, Makefile, Dockerfile.
Check for monorepo indicators: workspaces key in package.json, pnpm-workspace.yaml, lerna.json, nx.json, turbo.json, or multiple package.json files at depth 2+. If a monorepo is detected, ask the user which packages/apps to focus on and customize rule path patterns to include package prefixes (e.g., packages/api/src/** instead of src/**).
Detect frameworks from dependencies and config files (frontend, backend, CSS, components, ORM/DB).
Detect test framework from config files (jest.config.*, vitest.config.*, pytest.ini, conftest.py, playwright.config.*, etc.).
Detect linter/formatter from config files (.eslintrc.*, .prettierrc.*, biome.json, ruff.toml, tsconfig.json, .editorconfig, etc.).
Detect folder structure pattern (feature-based, layered, monorepo, MVC) and locate source, test, API, and auth directories.
Check git log --oneline -20 for commit message style.
Phase 2: Present Findings
Present a summary to the user using AskUserQuestion:
I scanned your project. Here's what I found:
**Stack**: [language] + [framework] + [CSS] + [DB]
**Package manager**: [npm/pnpm/yarn/bun/pip/cargo/go]
**Test framework**: [jest/vitest/pytest/etc.]
**Linter/Formatter**: [eslint+prettier/ruff/clippy/etc.]
**Architecture**: [layered/feature-based/monorepo/etc.]
**Source dirs**: [list]
**Test dirs**: [list]
Should I customize the .claude/ files based on this? (yes/no/corrections)If the user provides corrections, incorporate them.
Phase 3: Customize Each File
For each file below, propose the specific changes and ask the user to confirm before applying.
3.1 CLAUDE.md (target: under 25 non-blank lines, hard cap: 50)
CLAUDE.md loads every turn for every developer. Aggressive trimming pays for itself fast.
Replace the template commands with actual commands from the detected manifest:
- Build: actual build command from package.json scripts, Makefile targets, etc.
- Test: actual test command plus how to run a single test file.
- Lint/Format: actual lint and format commands.
- Dev: actual dev server command.
Strip every > REPLACE: block. They are template guidance, not content.
For each remaining section, decide on inclusion:
| Section | Keep if... | Otherwise |
| Architecture | The project has at least one non-obvious structural decision (a domain split, a layering rule that contradicts the file tree). | Delete. Listing source directories is duplicative. Claude can explore. |
| Key Decisions | At least one decision exists where knowing the WHY would prevent a wrong fix (auth tokens in httpOnly cookies because XSS). | Delete. |
| Domain Knowledge | At least one term, abbreviation, or concept is non-obvious from the code. | Delete. |
| Workflow | You have project-specific workflow quirks. | Delete. Generic workflow lines duplicate rules/code-quality.md. |
| Don'ts | At least one project-specific don't (don't modify *.gen.ts). | Delete. Generic don'ts belong in rules. |
Most projects end up with just Commands plus three to five extra lines. That's expected. A 10-line CLAUDE.md is healthy.
3.2 settings.json
Update permissions to match actual commands:
- Replace
npm runwith the actual package manager (pnpm run,yarn,bun run,cargo,go,make,python -m pytest, etc.) - Add project-specific allow rules for detected scripts
- Keep deny rules for secrets as-is (these are universal)
3.3 rules/code-quality.md
Update naming conventions ONLY if the project's existing code uses different patterns:
- Sample 5-10 source files to detect actual naming style (camelCase vs snake_case, etc.)
- If the project uses different file naming than the template, update
- If the project's import style differs, update the import order section
If everything matches the defaults, leave it unchanged.
3.4 rules/testing.md
Update if the detected test framework has specific idioms. Otherwise leave as-is (it's only a few lines).
3.5 rules/security.md
Update the paths: frontmatter to match actual project directories:
- Replace
src/api/**with actual API directory paths found - Replace
src/auth/**with actual auth directory paths - Replace
src/middleware/**with actual middleware paths - If none found, keep the defaults as reasonable guesses
3.5b rules/error-handling.md
Update the paths: frontmatter to match actual backend directories (same paths as security.md plus service/handler directories). If the project has no backend, delete this file.
3.6 rules/frontend.md
- If no frontend files exist (no .tsx, .jsx, .vue, .svelte, .css): delete this file entirely
- If frontend exists: update the Component Framework table to highlight which options the project actually uses (detected from dependencies)
- Update path patterns in frontmatter if the project uses non-standard directories
3.7 hooks/format-on-save.sh
Uncomment the section matching the detected formatter:
- Prettier found: uncomment Node.js section
- Black/isort found: uncomment Python section
- Ruff found: uncomment Ruff section
- Biome found: uncomment Biome section
- rustfmt found: uncomment Rust section
- gofmt found: uncomment Go section
- Multiple languages: uncomment all relevant sections
3.8 hooks/block-dangerous-commands.sh
Check the default branch name (git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null or git remote show origin). If it's not main or master, update the regex pattern.
3.9 rules/database.md
- Check if the project has a database (look for: migration directories, ORM config files like
prisma/schema.prisma,drizzle.config.*,alembic.ini,knexfile.*,sequelizein dependencies,typeormin dependencies,ActiveRecordpatterns,flyway,liquibase) - If database/migrations detected: keep the rule, update
paths:frontmatter to match the actual migration directory paths found - If no database detected: delete
rules/database.mdentirely
3.10 skills/
All skills are methodology-based and project-agnostic. Leave unchanged by default.
If the user wants a minimal setup, list the actual contents of .claude/skills/ (run ls -1 .claude/skills/) and use AskUserQuestion to ask which (if any) directories they want to delete. Delete the ones they opt out of. Otherwise keep all.
3.11 agents/
- frontend-designer.md: delete if no frontend files exist
- doc-reviewer.md: delete if the project has no documentation directory (no
docs/,doc/, or significant.mdfiles beyond README) - security-reviewer.md: keep (security applies everywhere)
- code-reviewer.md: keep (universal)
- performance-reviewer.md: keep (universal)
Phase 4: Review & Simplify
After all changes are applied, run a thorough final review pass.
CLAUDE.md size budget (hard check)
Run this Bash to count non-blank lines in CLAUDE.md:
grep -cv '^[[:space:]]*$' CLAUDE.mdApply the budget:
| Non-blank lines | Verdict | Action |
| Under 25 | PASS | Continue. |
| 25 to 50 | WARN | List the longest sections by line count and ask the user via AskUserQuestion which to trim. Apply trims they confirm, then continue. |
| Over 50 | FAIL | Block. Identify the top three biggest sections by line count and propose specific cuts. Do not continue Phase 4 until CLAUDE.md is at or under 50 non-blank lines. |
Reasons to stay tight: every line of CLAUDE.md loads on every turn for every developer. A 50-line file across 50 turns/day costs roughly 1,000 tokens of always-on overhead, every day, even on a one-line bugfix.
Strip any remaining > REPLACE: placeholder blocks. They are template guidance that should have been replaced with real content or removed during Phase 3.1.
Codebase consistency review
Review the entire codebase alongside the customized .claude/ configuration:
- Do the rules match how the code is actually written?
- Do the settings permissions cover the commands the project actually uses?
- Do the security rule paths match where sensitive code actually lives?
- Do the hook protections cover the files that actually need protecting in this project?
- Are there project patterns, conventions, or architectural decisions not yet captured in the config?
- Remove any redundancy introduced during customization.
- Ensure no file contradicts another.
- Trim any verbose instructions back to essentials.
- Verify all YAML frontmatter is valid.
- Verify all hook scripts referenced in settings.json exist and are executable.
Present the review findings to the user. If changes are needed, confirm before applying.
Phase 5: Summary
After everything is finalized, count CLAUDE.md's non-blank lines once more and present a summary:
Setup complete. Here's what was customized:
- Bootstrap: [yes, copied template into .claude/ | no, used existing .claude/]
- CLAUDE.md: [N non-blank lines]. Verdict: [PASS under 25 / WARN 25-50 / FAIL over 50]. Customized commands for [stack].
- settings.json: permissions updated for [package manager]
- rules/security.md: paths updated to [actual dirs]
- rules/frontend.md: [kept/removed]
- hooks/format-on-save.sh: enabled [formatter]
- [any other changes]
Files left as defaults (universal, no project-specific changes needed):
- [list]
Review pass: [any issues found and fixed, or "all clean"]
Tip: run `/context-budget` to see the per-turn token cost of the resulting configuration, broken down by always-loaded vs path-scoped vs invoked-only.Rules
- NEVER write changes without user confirmation first
- NEVER delete a file without confirming. Propose "remove" and explain why.
- If the project is empty (no source files, no manifests), bootstrap defaults and stop. Tell the user "Project appears empty. Keeping all defaults. Re-run after adding code to customize."
- If detection is uncertain, ASK the user rather than guessing
- Preserve any manual edits the user has already made to .claude/ files. Only update sections that need project-specific customization.
- Keep it minimal. If the default works, leave it alone.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

