You are setting up a new project with proper scaffolding and documentation.
This command:
- •Gathers project info through interactive questions
- •Creates project config files (package.json, requirements.txt, etc.)
- •Asks before running install commands
- •Creates
.agent/documentation structure from templates - •Creates
CLAUDE.mdproject instructions - •Optionally initializes git
Templates Location: ~/.claude/scaffolds/templates/
Step 1: Check Current State
Check what exists:
ls -la ls -la .agent/ 2>/dev/null ls -la package.json requirements.txt go.mod Cargo.toml 2>/dev/null git rev-parse --is-inside-work-tree 2>/dev/null
Report findings:
PROJECT STATE Directory: [current directory name] Git repo: [Yes/No] Found: - .agent/: [Yes/No] - CLAUDE.md: [Yes/No] - package.json: [Yes/No] - requirements.txt: [Yes/No] - Other project files: [list] [If .agent/ exists] This project appears to already be initialized. Would you like to: A) Reinitialize (will backup existing .agent/) B) Cancel Choose: (A/B)
If already initialized and user chooses B, exit.
If user chooses A, backup .agent/ to .agent.backup.[timestamp]/.
Step 2: Verify Templates Exist
CRITICAL: Check that templates are available:
ls -la ~/.claude/scaffolds/templates/ ls -la ~/.claude/scaffolds/templates/agent/
If templates don't exist, show error:
ERROR: Templates not found at ~/.claude/scaffolds/templates/ The workflow templates are required for /setup.
Step 3: Interactive Questions
Use AskUserQuestion to gather project configuration:
Question 1: Project Name
- •Options: "[Directory name]" / "Custom name"
Question 2: Language
- •Options: "TypeScript" / "JavaScript" / "Python" / "Go"
Question 3: Framework (based on language)
- •TypeScript/JS: "Express" / "React" / "Next.js" / "None"
- •Python: "Django" / "FastAPI" / "Flask" / "None"
- •Go: "Gin" / "Echo" / "None"
Question 4: Database
- •Options: "PostgreSQL" / "MySQL" / "SQLite" / "None"
Question 5: Docker
- •Options: "Yes" / "No"
Question 6: Task Management Workflow
- •Options: "VK (Vibe Kanban)" / "Local Tasks" / "Both"
Question 7: Initial Roadmap
- •Options: "Yes" / "No"
Step 4: Gather Product Vision
Ask for product context:
Tell me about your project: 1. **What does it do?** (1-2 sentences) 2. **Who is it for?** (target users) 3. **What problem does it solve?**
Step 5: Confirm Configuration
Display summary and ask to proceed.
Step 6: Create Project Files
Based on configuration, create appropriate files. See stack-configs/ for language-specific configurations.
Step 7: Ask to Run Install Commands
Present commands that need to run:
- •For Node.js:
npm install - •For Python:
python3 -m venv venv && pip install -r requirements.txt - •For Go:
go mod tidy
Ask before executing.
Step 8: Create .agent/ Documentation Structure FROM TEMPLATES
Create directories:
mkdir -p .agent/features mkdir -p .agent/system mkdir -p .agent/sops mkdir -p .agent/known-issues
If Local Tasks or Both workflow:
mkdir -p .agent/tasks
Template Variables to Replace:
| Variable | Value |
|---|---|
{{PROJECT_NAME}} | User's project name |
{{LANGUAGE}} | Selected language |
{{FRAMEWORK}} | Selected framework |
{{DATABASE}} | Selected database |
{{TEST_FRAMEWORK}} | pytest, jest, go test |
{{DEV_COMMAND}} | Development command |
{{TEST_COMMAND}} | Test command |
{{BUILD_COMMAND}} | Build command |
{{INIT_DATE}} | Today's date |
Copy and process templates from ~/.claude/scaffolds/templates/ to .agent/.
Step 9: Select Project Practices
Read the practices index to determine which coding practices apply to this project:
# Read the index cat ~/.claude/practices/INDEX.md
Select practices based on project configuration:
| Project Attribute | Practices to Include |
|---|---|
| ALL projects (mandatory) | tdd (ALWAYS), testing-principles, documentation-standards |
| Python + Django | django-patterns, permission-checks |
| Frontend / UI work | tailwind-utilities |
| Docker | docker-compose |
| Bug-heavy / maintenance project | bug_analysis |
| Refactoring focus | code_refactoring |
Note: tdd is mandatory for ALL projects — every implementation task writes tests first.
Write .agent/practices.md listing the selected practices:
# Project Practices
Selected coding practices for this project. These are inlined into task descriptions when planning.
| Practice | File | Reason |
|----------|------|--------|
| TDD | `~/.claude/practices/tdd.md` | {why it applies} |
| Django Patterns | `~/.claude/practices/django-patterns.md` | {why it applies} |
| ... | ... | ... |
Source index: `~/.claude/practices/INDEX.md`
This file is referenced by /plan when creating tasks — it reads the selected practices and inlines their content into task descriptions.
Step 10: Create .gitignore
If doesn't exist, create appropriate .gitignore for the stack.
Step 11: Git Integration (Optional)
Offer to initialize git and create initial commit.
Step 12: Final Report
PROJECT SETUP COMPLETE Project: [Project Name] Language: [Language] Framework: [Framework] Database: [Database] Docker: [Yes/No] Task Management: [VK / Local Tasks / Both] FILES CREATED: [List all created files] NEXT STEPS: 1. Review generated files 2. Define your first feature: /feature <description>