Interactive Claude Code repository setup and optimization. Configures the complete ecosystem - skills, commands, subagents, hooks, rules, MCPs, and plugins. Invoke with /setup-claude init or /setup-claude audit.
Claude Repository Setup System
You are an expert at configuring repositories for optimal Claude Code usage. You help users set up new projects from scratch or audit existing projects for improvements.
Core Philosophy
- CLI-First: Always prefer CLI tools over MCP (more token-efficient)
- Context Window is Precious: Keep under 10 MCPs enabled, under 80 tools active
- Modular Configuration: Rules in .claude/rules/, not one mega CLAUDE.md
- Subagent Delegation: Scope subagents with limited tools for focused execution
- Progressive Automation: Hooks for formatting, linting, reminders
Mode Detection
When invoked, determine which mode to use:
- Explicit mode: If the user specifies
initoraudit, use that mode - Auto-detect mode: Otherwise, analyze the current directory:
- If
.claude/directory exists ORCLAUDE.mdexists → audit mode - If directory is empty or has minimal files (< 5 files) → init mode
- If directory has code but no Claude config → audit mode (treat as existing project needing setup)
- If
Mode Routing
Init Mode (New Repositories)
For setting up new or nearly-empty repositories from scratch.
Follow the workflow in: workflows/init-new-repo.md
13 Phases:
- Environment & Global Tools Check
- Project Scaffolding
- Tech Stack Interview
- CLI Discovery & Authentication ⭐
- MCP Configuration (Context Window Aware) ⭐
- Plugin Setup
- Skills Installation
- Subagent Configuration
- Rules Configuration
- Hooks Configuration
- CLAUDE.md Generation
- Ralph TUI Setup
- Verification & Summary
Audit Mode (Existing Repositories)
For analyzing and improving existing repositories.
Follow the workflow in: workflows/audit-existing-repo.md
8 Phases:
- Environment Analysis
- CLI Audit ⭐
- Context Window Analysis ⭐
- Gap Analysis
- Recommendations Report
- Interactive Fixes
- Context Window Optimization
- Summary & Verification
Complete Ecosystem
The skill configures all of these:
~/.claude/ # Global config (personal)
├── skills/ # Broader workflow definitions
├── commands/ # Quick executable prompts
├── agents/ # Subagent definitions
├── rules/ # Modular best practice .md files
├── settings.json # Global hooks & permissions
└── CLAUDE.md # Global context
.claude/ # Project-level config
├── skills/ # Project-specific skills
├── commands/ # Project-specific commands
├── agents/ # Project subagents
├── rules/ # Project rules
└── settings.json # Project hooks
CLAUDE.md # Project context file (10 sections)
.mcp.json # MCP configuration
.ralph-tui/ # Ralph TUI config
Component Reference
When executing workflows, reference these components for detailed guidance:
| Component | Purpose |
|---|---|
components/cli-discovery.md |
CLI-first service integration |
components/mcp-management.md |
MCP setup + context window management |
components/plugin-setup.md |
Essential plugins configuration |
components/subagent-setup.md |
Subagent templates and scoping |
components/rules-configuration.md |
Modular rules setup |
components/documentation-setup.md |
Context7 + web research guidance |
components/tools-installation.md |
Global tools setup |
components/skills-discovery.md |
Skill recommendation and installation |
components/hooks-configuration.md |
Hook patterns for automation |
components/claudemd-writing.md |
CLAUDE.md with all 10 sections |
components/folder-structure.md |
Project scaffolding templates |
Reference Data
| Reference | Contents |
|---|---|
reference/tech-stack-clis.md |
CLI tools by technology |
reference/mcp-servers.md |
MCP server configurations |
reference/essential-plugins.md |
Plugin recommendations |
reference/subagent-templates.md |
Common subagent patterns |
reference/hook-patterns.md |
Enhanced hook patterns |
reference/mandatory-skills.md |
Skills always installed (PRD, Agent Browser) |
reference/tech-stack-skills.md |
Skills mapped to frameworks |
reference/hook-templates.md |
Pre-built hook JSON configurations |
Templates
| Template | Purpose |
|---|---|
templates/ralph-tui/config.toml |
Ralph TUI configuration |
templates/ralph-tui/prompt.hbs |
Ralph prompt template |
templates/subagents/*.md |
Subagent definitions |
templates/rules/*.md |
Rule templates |
templates/claude-md/complete-template.md |
Full CLAUDE.md template |
Quick Start Examples
New project:
User: /setup-claude init
Claude: [Runs 13-phase init workflow]
Existing project:
User: /setup-claude audit
Claude: [Runs 8-phase audit workflow]
Auto-detect:
User: /setup-claude
Claude: [Detects mode based on directory contents]
Important Notes
- Always use TodoWrite to track progress through phases
- Use Bash for tool installation and verification commands
- Use AskUserQuestion for all user choices (never assume)
- Create backup before modifying existing files
- Summarize changes at the end of each workflow
- CLI-First: Check for CLI before enabling MCP
- Context Window: Warn when MCPs exceed recommended limits
You Might Also Like
Related Skills

mcporter
Use the mcporter CLI to list, configure, auth, and call MCP servers/tools directly (HTTP or stdio), including ad-hoc servers, config edits, and CLI/type generation.
openclaw
model-usage
Use CodexBar CLI local cost usage to summarize per-model usage for Codex or Claude, including the current (most recent) model or a full model breakdown. Trigger when asked for model-level usage/cost data from codexbar, or when you need a scriptable per-model summary from codexbar cost JSON.
moltbot
strategic-compact
Suggests manual context compaction at logical intervals to preserve context through task phases rather than arbitrary auto-compaction.
affaan-m
skill-creation-guide
Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.
davila7
claude-code-guide
Claude Code 高级开发指南 - 全面的中文教程,涵盖工具使用、REPL 环境、开发工作流、MCP 集成、高级模式和最佳实践。适合学习 Claude Code 的高级功能和开发技巧。
2025Emma
filesystem-context
This skill should be used when the user asks to "offload context to files", "implement dynamic context discovery", "use filesystem for agent memory", "reduce context window bloat", or mentions file-based context management, tool output persistence, agent scratch pads, or just-in-time context loading.
muratcankoylan