Skip to content
Development
Command

/setup

Interactive setup wizard - analyzes tech stack, generates PROJECT.md, configures hooks

From plugin
autonomous-dev
3226 skills16 agents26 commands1 MCP
Install
$ npx -y skills add akaszubski/autonomous-dev --agent claude-code

How it fires

How this command gets triggered: by you, by Claude, or both.

  • Fires itselfClaude auto-loads it when your prompt matches the work.
  • You can call itInvoke it directly when you want it.
  • Slash command/setup

Context preview

What this command does when you run it.

Interactive setup wizard - analyzes tech stack, generates PROJECT.md, configures hooks

Command definition

setup.md
name: setup
description: Interactive setup wizard - analyzes tech stack, generates PROJECT.md, configures hooks
argument-hint: "[--project-dir <path>]"
allowed-tools: [Read, Write, Bash, Grep, Glob]
disable-model-invocation: true
user-invocable: true
user_facing: true

/setup - Project Initialization Wizard

**Purpose**: Initialize autonomous-dev in a project with intelligent PROJECT.md generation.

**Core Value**: Analyzes your codebase and generates comprehensive PROJECT.md (brownfield) or guides you through creation (greenfield).

---

Quick Start

/setup

**Time**: 2-5 minutes **Interactive**: Yes (guides you through choices)

---

Implementation

Step 1: Install Plugin Files

# Delegate to sync_dispatcher for reliable file installation
echo "Installing plugin files..."
python3 .claude/lib/sync_dispatcher.py --github

# Fallback if .claude/lib doesn't exist yet (fresh install)
if [ $? -ne 0 ]; then
  # Try from plugins/ directory (dev environment)
  python3 plugins/autonomous-dev/lib/sync_dispatcher.py --github
fi

**What this does**:

  • Downloads latest files from GitHub
  • Copies to `.claude/` directory
  • Validates all paths for security
  • Non-destructive (preserves existing PROJECT.md, .env)

**If sync fails**: Show error and suggest manual sync with `/sync --github`

---

Step 1.5: Create .env Configuration

After plugin files are installed, create `.env` from template:

# Check if .env already exists
if [ ! -f ".env" ]; then
  # Copy from .env.example if it exists (standard convention)
  if [ -f ".env.example" ]; then
    cp .env.example .env
    echo "Created .env from .env.example"
  else
    # Create minimal .env with essential settings
    cat > .env << 'ENVEOF'
# autonomous-dev Environment Configuration
# See: https://github.com/akaszubski/autonomous-dev#environment-setup

# =============================================================================
# API KEYS (REQUIRED - fill these in!)
# =============================================================================
GITHUB_TOKEN=ghp_your_token_here
# ANTHROPIC_API_KEY=sk-ant-your_key_here

# =============================================================================
# GIT AUTOMATION (enabled by default)
# =============================================================================
AUTO_GIT_ENABLED=true
AUTO_GIT_PUSH=true
AUTO_GIT_PR=false

# =============================================================================
# TOOL AUTO-APPROVAL (reduces permission prompts)
# =============================================================================
MCP_AUTO_APPROVE=true

# =============================================================================
# BATCH PROCESSING
# =============================================================================
BATCH_RETRY_ENABLED=true
ENVEOF
    echo "Created .env with default settings"
  fi
fi

# Ensure .env is in .gitignore
if [ -f ".gitignore" ]; then
  if ! grep -q "^\.env$" .gitignore; then
    echo ".env" >> .gitignore
    echo "Added .env to .gitignore"
  fi
else
  echo ".env" > .gitignore
  echo "Created .gitignore with .env"
fi

**After creating .env, ALWAYS prompt the user:**

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚠️  ACTION REQUIRED: Configure your .env file
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

A .env file has been created with default settings. You MUST update the
API keys and tokens for full functionality.

Required (at minimum):
  GITHUB_TOKEN=ghp_your_token_here
    → Create at: https://github.com/settings/tokens
    → Scopes needed: repo, read:org

Optional but recommended:
  ANTHROPIC_API_KEY=sk-ant-your_key_here
    → Get from: https://console.anthropic.com/
    → Enables: GenAI security scanning, test generation, doc fixes

Key settings already enabled:
  AUTO_GIT_ENABLED=true     (auto-commit after /implement)
  AUTO_GIT_PUSH=true        (auto-push commits)
  MCP_AUTO_APPROVE=true     (reduce permission prompts)
  BATCH_RETRY_ENABLED=true  (retry transient failures)

Edit .env now:
  vim .env
  # or
  code .env

See all options: cat .env  (file is fully documented)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

**Wait for user confirmation before continuing to Step 2.**

---

Step 1.6: Initialize per-repo .mcp.json (Issue #948)

**Why**: Per-repo `.mcp.json` is the recommended default. MCP servers configured globally in `~/.claude/settings.json` mcpServers inject tool definitions into every prompt — even when irrelevant — costing 5-10K tokens per turn for a typical 5-server setup. Per-repo `.mcp.json` scopes servers to where they're actually used.

# Step 1.6a: Bootstrap .mcp.json from a reference template if absent
if [ -f ".mcp.json" ]; then
  echo "Preserving existing .mcp.json"
else
  TEMPLATE_PATH=""
  for candidate in ".claude/.mcp/config.template.json" ".mcp/config.template.json" "plugins/autonomous-dev/.mcp/config.template.json"; do
    if [ -f "$candidate" ]; then TEMPLATE_PATH="$candidate"; break; fi
  done
  if [ -n "$TEMPLATE_PATH" ]; then
    cp "$TEMPLATE_PATH" .mcp.json
    echo "Created .mcp.json from $TEMPLATE_PATH"
  else
    echo '{"mcpServers": {}}' > .mcp.json
    echo "Created .mcp.json placeholder (no template found)"
  fi
fi

# Step 1.6b: Auto-gitignore .mcp.json if it contains inline secrets
HELPER="plugins/autonomous-dev/scripts/migrate_mcp_to_repo.py"
if [ ! -f "$HELPER" ]; then
  HELPER=".claude/scripts/migrate_mcp_to_repo.py"
fi
HAS_SECRETS="False"
if [ -f "$HELPER" ]; then
  HAS_SECRETS=$(python3 "$HELPER" --check-only --repo . 2>/dev/null \
    | python3 -c "import json,sys; print(json.load(sys.stdin).get('secrets_detected', False))" 2>/dev/null \
    || echo "False")
fi

if [ "$HAS_SECRETS" = "True" ]; then
  if [ -f ".gitignore" ]; then
    if ! grep -q '^\.mcp\.json$' .gitignore; then
      echo ".mcp.json" >> .gitignore
      echo "Added .mcp.json to .
Read more
Ships withautonomous-dev

A harness that wraps Claude Code with enforcement, specialist agents, and alignment gates to deliver consistent, production-grade software engineering outcomes.

Get the whole plugin, auto-invoked
Stats
32
Stars
0
Views
5
Forks
Active
Maintenance
Python
Language
2h ago
Last commit
9mo ago
Created

Repo: akaszubski/autonomous-dev