From setupdotclaude
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.
npx claudepluginhub poshan0126/dotclaude --plugin setupdotclaude[optional: focus area like 'frontend' or 'backend']This skill uses the workspace's default tool permissions.
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.
Initializes Claude Code projects by auto-detecting Node.js frameworks from package.json and lockfiles, replaces CLAUDE.md placeholders, installs rules, hooks, and scripts.
Initializes projects for Claude Code by generating CLAUDE.md with progressive disclosure docs, auto-format hooks, test infrastructure; scaffolds empty directories via stack tooling; audits/syncs docs. Supports monorepos/multi-repo git workspaces.
Generates Claude Code project setups including CLAUDE.md, hooks, permissions, commands, and agents. Analyzes stack (TypeScript, JavaScript, Python, Go, Rust, etc.) to create minimal/standard/full configs.
Share bugs, ideas, or general feedback.
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.
Decide whether to bootstrap by checking for .claude/settings.json:
.claude/ (likely via the clone+copy flow). Skip this phase entirely and go to Phase 0.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 yes to use the bundled template."
If the user says yes, run these Bash commands to copy the bundled template (Claude Code sets $CLAUDE_PLUGIN_ROOT to 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/*.sh
Then 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.md is 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.
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.md belongs 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.
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.
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.
For each file below, propose the specific changes and ask the user to confirm before applying.
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:
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.
Update permissions to match actual commands:
npm run with the actual package manager (pnpm run, yarn, bun run, cargo, go, make, python -m pytest, etc.)Update naming conventions ONLY if the project's existing code uses different patterns:
If everything matches the defaults, leave it unchanged.
Update if the detected test framework has specific idioms. Otherwise leave as-is (it's only a few lines).
Update the paths: frontmatter to match actual project directories:
src/api/** with actual API directory paths foundsrc/auth/** with actual auth directory pathssrc/middleware/** with actual middleware pathsUpdate 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.
Uncomment the section matching the detected formatter:
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.
prisma/schema.prisma, drizzle.config.*, alembic.ini, knexfile.*, sequelize in dependencies, typeorm in dependencies, ActiveRecord patterns, flyway, liquibase)paths: frontmatter to match the actual migration directory paths foundrules/database.md entirelyAll 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.
docs/, doc/, or significant .md files beyond README)After all changes are applied, run a thorough final review pass.
Run this Bash to count non-blank lines in CLAUDE.md:
grep -cv '^[[:space:]]*$' CLAUDE.md
Apply 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.
Review the entire codebase alongside the customized .claude/ configuration:
Present the review findings to the user. If changes are needed, confirm before applying.
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.