agentleFS
krishnamallamkrishnamallam/upbox/.claude/skills/setupdotclaude/SKILL.md

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

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 1

    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.

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
  1. Distinctive:

    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 …

    line 12
  2. Very specific:

    If it exists: the user has already populated .claude/ (likely via the clone+copy flow).

    line 18
  3. Distinctive:

    If it does NOT exist: bootstrap from the bundled template.

    line 19
  4. Very specific:

    Use AskUserQuestion: "This project has no .claude/ set up yet.

    line 23
  5. Very specific:

    If the user says no, stop with: "setupdotclaude needs dotclaude's content to operate.

    line 25
  6. Very specific:

    If the user says yes, run these Bash commands to copy the bundled template (Claude Code sets $CLAUDE_PLUGIN_ROOT to this plugin's …

    line 27
  7. Very specific:

    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 …

    line 55
  8. Distinctive:

    After cleanup, briefly tell the user what was removed (count of files plus directories), then continue.

    line 75
  9. Very specific:

    Check: package.json, pyproject.toml, Cargo.toml, go.mod, Gemfile, composer.json, build.gradle, pom.xml, Makefile, Dockerfile.

    line 81
  10. Distinctive:

    Check git log --oneline -20 for commit message style.

    line 93
  11. Distinctive:

    If the user provides corrections, incorporate them.

    line 113
  12. Distinctive:

    Update permissions to match actual commands:

    line 145
  13. Distinctive:

    Add project-specific allow rules for detected scripts

    line 147
  14. Distinctive:

    Keep deny rules for secrets as-is (these are universal)

    line 148
  15. Distinctive:

    Update naming conventions ONLY if the project's existing code uses different patterns:

    line 152
  16. Distinctive:

    If the project uses different file naming than the template, update

    line 154
  17. Distinctive:

    If the project's import style differs, update the import order section

    line 155
  18. Distinctive:

    If everything matches the defaults, leave it unchanged.

    line 157
  19. Distinctive:

    Update if the detected test framework has specific idioms.

    line 161
  20. Very specific:

    Update the paths: frontmatter to match actual project directories:

    line 165
  21. Distinctive:

    If none found, keep the defaults as reasonable guesses

    line 169
  22. Very specific:

    Update the paths: frontmatter to match actual backend directories (same paths as security.md plus service/handler directories).

    line 173
  23. Distinctive:

    If frontend exists: update the Component Framework table to highlight which options the project actually uses (detected from dependencies)

    line 178
  24. Distinctive:

    Update path patterns in frontmatter if the project uses non-standard directories

    line 179
  25. Very specific:

    Check the default branch name (git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null or git remote show origin).

    line 194
  26. Very specific:

    Check if the project has a database (look for: migration directories, ORM config files like prisma/schema.prisma, drizzle.config.*, …

    line 198
  27. Very specific:

    If database/migrations detected: keep the rule, update paths: frontmatter to match the actual migration directory paths found

    line 199
  28. Very specific:

    If no database detected: delete rules/database.md entirely

    line 200
  29. Distinctive:

    All skills are methodology-based and project-agnostic.

    line 204
  30. Very specific:

    If the user wants a minimal setup, list the actual contents of .claude/skills/ (run ls -1 .claude/skills/) and use AskUserQuestion to ask …

    line 206
  31. Distinctive:

    frontend-designer.md: delete if no frontend files exist

    line 210
  32. Very specific:

    doc-reviewer.md: delete if the project has no documentation directory (no docs/, doc/, or significant .md files beyond README)

    line 211
  33. Distinctive:

    security-reviewer.md: keep (security applies everywhere)

    line 212
  34. Distinctive:

    After all changes are applied, run a thorough final review pass.

    line 218
  35. Distinctive:

    Run this Bash to count non-blank lines in CLAUDE.md:

    line 222
  36. Distinctive:

    Do the rules match how the code is actually written?

    line 243
  37. Distinctive:

    Do the settings permissions cover the commands the project actually uses?

    line 244
  38. Distinctive:

    Do the security rule paths match where sensitive code actually lives?

    line 245
  39. Distinctive:

    Do the hook protections cover the files that actually need protecting in this project?

    line 246
  40. Distinctive:

    Remove any redundancy introduced during customization.

    line 248
  41. Distinctive:

    Ensure no file contradicts another.

    line 249
  42. Distinctive:

    Verify all YAML frontmatter is valid.

    line 251
  43. Very specific:

    Verify all hook scripts referenced in settings.json exist and are executable.

    line 252
  44. Distinctive:

    After everything is finalized, count CLAUDE.md's non-blank lines once more and present a summary:

    line 258
  45. Distinctive:

    NEVER write changes without user confirmation first

    line 281
  46. Distinctive:

    NEVER delete a file without confirming.

    line 282
  47. Distinctive:

    If the project is empty (no source files, no manifests), bootstrap defaults and stop.

    line 283
  48. Distinctive:

    If detection is uncertain, ASK the user rather than guessing

    line 284
  49. Distinctive:

    Keep it minimal. If the default works, leave it alone.

    line 286

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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:

  1. Use AskUserQuestion: "This project has no .claude/ set up yet. Bootstrap it from the dotclaude template bundled in this plugin?" Options: yes / no.
  2. 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."
  3. 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
  4. 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.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.

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:

SectionKeep if...Otherwise
ArchitectureThe 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 DecisionsAt least one decision exists where knowing the WHY would prevent a wrong fix (auth tokens in httpOnly cookies because XSS).Delete.
Domain KnowledgeAt least one term, abbreviation, or concept is non-obvious from the code.Delete.
WorkflowYou have project-specific workflow quirks.Delete. Generic workflow lines duplicate rules/code-quality.md.
Don'tsAt 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 run with 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.*, sequelize in dependencies, typeorm in dependencies, ActiveRecord patterns, 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.md entirely

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 .md files 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.md

Apply the budget:

Non-blank linesVerdictAction
Under 25PASSContinue.
25 to 50WARNList the longest sections by line count and ask the user via AskUserQuestion which to trim. Apply trims they confirm, then continue.
Over 50FAILBlock. 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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.