From cdx
Interactive setup wizard to bootstrap any project for Claude Code development. Auto-detects tech stacks, configures LSP plugins, generates tailored simplifier agents, and sets up duplication detection via jscpd. Use when user says: "set up project for Claude", "initialize Claude Code", "bootstrap Claude dev environment", "cdx setup", or "configure Claude tools".
npx claudepluginhub deviantony/claude-plugins --plugin cdxThis skill uses the workspace's default tool permissions.
You are running the CDX setup wizard. Walk the user through each step interactively, using AskUserQuestion to confirm decisions before taking action. Be concise and actionable.
Creates isolated Git worktrees for feature branches with prioritized directory selection, gitignore safety checks, auto project setup for Node/Python/Rust/Go, and baseline verification.
Executes implementation plans in current session by dispatching fresh subagents per independent task, with two-stage reviews: spec compliance then code quality.
Dispatches parallel agents to independently tackle 2+ tasks like separate test failures or subsystems without shared state or dependencies.
You are running the CDX setup wizard. Walk the user through each step interactively, using AskUserQuestion to confirm decisions before taking action. Be concise and actionable.
Before anything else, check if the project has a CLAUDE.md in the project root using Glob.
If CLAUDE.md is missing: Stop the wizard and tell the user:
This wizard works best when it can read your project's CLAUDE.md for context. Please run
/initfirst — it scans your codebase and creates a CLAUDE.md with project description, tech stack notes, and build commands. The setup wizard uses this to make smarter decisions about what to configure.Once
/initis done, run/cdx:setupagain.
Do not proceed to any further steps.
If CLAUDE.md exists: Read it in full and carry the content forward as CLAUDE_MD_CONTENT — you will reference it in Step 1 and Step 6.
Scan the project root for config files to detect the tech stack:
go.mod → Gopackage.json → JavaScript/TypeScripttsconfig.json → TypeScriptpyproject.toml, setup.py, requirements.txt → PythonCargo.toml → Rustpom.xml, build.gradle → JavaGemfile → Rubymix.exs → Elixir*.csproj → C#composer.json → PHPPackage.swift → SwiftUse Glob to check for these files. Collect all detected languages.
Next, cross-reference with CLAUDE_MD_CONTENT (from Step 0). The /init-generated CLAUDE.md typically contains a project description, tech stack notes, and build commands. Look for mentions of languages, frameworks, or tools that glob-based detection may have missed (e.g., a monorepo where config files are in subdirectories, or a language used only for tooling/scripts).
Present both sources to the user via AskUserQuestion:
Store the confirmed stack for all subsequent steps.
Check if .git/ exists in the project root using Bash: test -d .git && echo exists || echo missing
If .git/ exists: Skip to .gitignore check.
If .git/ is missing:
main)git init and set default branch.gitignore check:
.gitignore exists.env, .env.*, .DS_Store, *.swp, *.swo, .idea/, .vscode/, *.logvendor/, binary patterns__pycache__/, *.pyc, .venv/, venv/, dist/, *.egg-info/node_modules/, dist/, build/, .next/target/target/, build/, *.class.bundle/, vendor/bundle/bin/, obj/, *.suo, *.uservendor/Read the LSP plugin reference table from ${CLAUDE_PLUGIN_ROOT}/skills/setup/references/lsp-plugins.md.
For each language in the confirmed tech stack that has an LSP plugin entry:
which <binary> (e.g., which gopls, which pyright-langserver)<binary> not found for ."claude plugin install <plugin>@claude-plugins-official --scope project
After processing all languages, summarize which LSP plugins were installed and which need manual setup.
Read the base simplifier template from ${CLAUDE_PLUGIN_ROOT}/skills/setup/references/simplifier-template.md.
For each primary language in the confirmed tech stack, generate a tailored simplifier agent:
Replace {{LANGUAGE}} with the language name
Replace {{LANGUAGE_STANDARDS}} with language-specific coding standards:
Go:
fmt.Errorf with %w for error wrappinginterface{} / any when a concrete type works_ to discard errorsPython:
pathlib.Path over os.pathwith) for resource managementdataclasses or pydantic over plain dicts for structured dataTypeScript:
any typeconst over let, never use varinterface for object shapes, type for unions/intersectionsasync/await over raw Promise chains?.) and nullish coalescing (??)enum — prefer const objects or union typesRust:
? operator for error propagationimpl Trait over dyn Trait where possibleclippy recommendations as guidanceJava:
var for local variables when type is obviousOptional instead of null returnsrecord types for data-only classesRuby:
frozen_string_literal pragmaSymbol over String for identifiersC#:
var for local variables when type is obviousasync/await pattern for async codePHP:
?->)For other languages: generate reasonable defaults based on the language's community conventions.
Check for CLAUDE.md: If the project has a CLAUDE.md, note in the agent template that it should reference project-specific standards from CLAUDE.md.
Write the agent to .claude/agents/<language>-simplifier.md in the project root (create .claude/agents/ if it doesn't exist).
Use AskUserQuestion to confirm before writing each agent file.
Check if jscpd is installed: Run which jscpd via Bash
If not installed: Use AskUserQuestion — "jscpd is not installed. Install it via npm install -g jscpd?"
npm install -g jscpdFor each language in the confirmed stack:
a. Check if a config exists at ${CLAUDE_PLUGIN_ROOT}/configs/jscpd/<language>.json using Glob
b. If config exists: Read it and present to user
c. If no config exists: Generate a default config:
{
"threshold": 5,
"minLines": 20,
"minTokens": 100,
"reporters": ["console"],
"format": ["<language-format>"],
"ignore": [<language-appropriate-patterns>]
}
Language format mappings:
"go""python""typescript", JavaScript → "javascript""rust""java""ruby""csharp""php""swift"Language-appropriate ignore patterns:
vendor/**, **/*_test.go, **/*.pb.go, **/testdata/**.venv/**, venv/**, **/__pycache__/**, **/migrations/**, **/*_test.py, **/tests/**node_modules/**, dist/**, build/**, **/*.d.ts, **/*.min.jstarget/**, **/tests/**target/**, build/**, **/test/**vendor/**, **/spec/**bin/**, obj/**, **/Tests/**vendor/**, **/tests/**d. Use AskUserQuestion to confirm or adjust the config before writing
e. Write the config to .jscpd-<language>.json in the project root
Now update the project's CLAUDE.md and create language-specific rule files.
Read current state: Read the project's CLAUDE.md again (it may have been modified by other steps).
Read best practices reference: Read ${CLAUDE_PLUGIN_ROOT}/skills/setup/references/claude-md-practices.md.
Build the ## CDX Tools section from what was actually configured in previous steps. Only list items that were created — for example:
## CDX Tools
The following tools were configured by `/cdx:setup`:
- **Simplifier agents**: `.claude/agents/go-simplifier.md` — run via `/agents` to simplify code
- **LSP plugins**: `gopls` installed at project scope for Go intelligence
- **Duplication detection**: `.jscpd-go.json` — run `jscpd --config .jscpd-go.json .` to check for duplicates
- **Language rules**: `.claude/rules/cdx-go.md` — Go-specific conventions and commands
Build the ## Best Practices section using only the ## Generic block from the reference file. This section contains project-wide principles (YAGNI, early returns, single responsibility, etc.) that apply regardless of language.
Create language-specific rule files: For each language in the confirmed stack, check if the reference file has a matching ## <Language> section.
.claude/rules/cdx-<language>.md (e.g., .claude/rules/cdx-go.md) with:
paths field scoped to that language's file extensions (e.g., "**/*.go" for Go).claude/rules/ directory if it doesn't exist.Example .claude/rules/cdx-go.md:
---
paths:
- "**/*.go"
---
# Go
Build and test commands:
...
Conventions:
...
Handle re-runs:
## CDX Tools or ## Best Practices sections already exist in CLAUDE.md, replace them in place. Otherwise, append them at the end..claude/rules/cdx-<language>.md file already exists, overwrite it.Confirm before writing: Present all proposed changes to the user via AskUserQuestion before writing anything. Show: the CLAUDE.md additions/replacements and the rule files that will be created.
Present a clear summary of everything that was set up:
## CDX Setup Complete
### Tech Stack
- [list of confirmed languages]
### Git
- [initialized / already existed]
- .gitignore: [created / updated / already existed]
### LSP Plugins Installed
- [list of installed plugins]
### Simplifier Agents Created
- [list of agent files created]
### Duplication Detection
- [list of jscpd configs created]
### CLAUDE.md
- [Updated with CDX Tools and Best Practices sections]
### Language Rules
- [list of .claude/rules/cdx-<language>.md files created]
### Manual Steps Needed
- [any pending items, e.g., "Install gopls: `go install golang.org/x/tools/gopls@latest`"]
Inform the user they can now use /cdx:review to run code reviews on their project.