CWC Setup
Sophisticated automated workshop setup command integrated into claude-code for Agent Battle workshops. The cwc-setup command demonstrates advanced educational infrastructure automation, handling complex multi-service coordination while providing intelligent debugging support when standard automation fails.
Command Architecture
Single Entry Point: The /cwc-setup command in Claude Code initiates a comprehensive setup process that handles:
- Environment variable validation
- Runtime detection and installation
- Multi-service deployment
- Network connectivity establishment
- Real-time progress monitoring
Adaptive Debugging: When automated setup fails, the system provides intelligent troubleshooting that can:
- Diagnose platform-specific issues (macOS Java stubs, Homebrew problems)
- Install missing dependencies automatically
- Provide clear manual fallback instructions
- Maintain context across multiple debugging sessions
Setup Process Flow
Phase 1: Environment Validation
# Required participant variables
ANTHROPIC_API_KEY # User's API key from console.anthropic.com
PARTICIPANT # Unique identifier for leaderboard
MINECRAFT_EULA # Must be 'accept' (user must agree explicitly)
# Event configuration (from .env.event)
LEADERBOARD_URL, LEADERBOARD_KEY, WIKI_MCP_URL, MC_SEED
Phase 2: Runtime Detection
- Java runtime validation (common failure point on macOS)
- Node.js and Python version checking
- Dependency resolution and installation
Phase 3: Service Orchestration
- Minecraft server deployment with JAR download (~50MB)
- Local leaderboard service on port 8888
- Bot framework initialization
- Cloudflare tunnel establishment for external access
Phase 4: Validation and Handoff
- Browser interface deployment (http://localhost:8088/view)
- Agent runner preparation
- Participant guidance for next steps
Common Failure Patterns
Java Runtime Issues: macOS systems often have /usr/bin/java stubs that pass detection but lack actual JDK installations. Resolution requires:
brew install openjdk@21
sudo ln -sfn $(brew --prefix openjdk@21)/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/
Cloudflare Rate Limiting: 429 errors during tunnel establishment require wait periods and retry logic.
Dependency Installation: npm package installation can be slow (~1-2 minutes) and occasionally fails, requiring re-runs.
Homebrew Integration: Missing symlinks or PATH configuration issues can cause dependency installation failures.
Educational Design Philosophy
Progressive Transparency: Setup provides real-time feedback through task notifications, showing exactly what's happening during long operations.
Graceful Degradation: When automation fails, the system doesn't just crash but provides clear diagnostic information and manual recovery paths.
Platform Adaptation: Handles diverse participant machine configurations without requiring pre-workshop environment standardization.
Learning Focus: Despite complex technical infrastructure, keeps participants focused on AI agent development rather than system administration.
Technical Implementation
Real-time Monitoring: Uses Claude Code's task notification system to provide live progress updates during setup operations.
Multi-Session Continuity: Complex debugging scenarios can span multiple Claude Code sessions while maintaining context about previous failures and attempted solutions.
Intelligent Error Recovery: When standard automation fails, provides platform-specific troubleshooting that adapts to the actual system configuration detected.
The CWC Setup system represents a sophisticated approach to educational infrastructure automation, acknowledging that "simple" setup processes require extensive engineering to work reliably across diverse real-world environments.