Development Setup¶
Set up your environment for Ralph development.
Prerequisites¶
Required¶
- Rust 1.75+ — Install via rustup
- Git — For version control
Optional¶
- At least one AI CLI — For integration testing (Claude, Kiro, etc.)
- tmux — For TUI testing
- freeze — For TUI screenshot capture
Clone and Build¶
# Clone
git clone https://github.com/mikeyobrien/ralph-orchestrator.git
cd ralph-orchestrator
# Build
cargo build
# Build release
cargo build --release
Install Git Hooks¶
This installs pre-commit hooks that run:
cargo fmt --checkcargo clippy
Verify Setup¶
# Run tests
cargo test
# Run smoke tests
cargo test -p ralph-core smoke_runner
# Check formatting
cargo fmt --check
# Run clippy
cargo clippy --all-targets --all-features
Project Structure¶
ralph-orchestrator/
├── crates/ # Cargo workspace crates
│ ├── ralph-proto/ # Protocol types
│ ├── ralph-core/ # Orchestration engine
│ ├── ralph-adapters/ # CLI backends
│ ├── ralph-tui/ # Terminal UI
│ ├── ralph-cli/ # Binary entry point
│ ├── ralph-e2e/ # E2E testing
│ └── ralph-bench/ # Benchmarking
├── presets/ # Hat collection presets
├── specs/ # Development specs
├── tasks/ # Code tasks
├── docs/ # Documentation
├── scripts/ # Utility scripts
├── Cargo.toml # Workspace config
├── CLAUDE.md # AI agent instructions
└── README.md # Project overview
Development Workflow¶
1. Create a Branch¶
2. Make Changes¶
Edit code in crates/.
3. Run Tests¶
4. Format and Lint¶
5. Commit¶
6. Push and PR¶
Running Ralph Locally¶
# From source
cargo run --bin ralph -- run -p "test prompt"
# With release build
cargo run --release --bin ralph -- run -p "test prompt"
# Direct binary
./target/release/ralph run -p "test prompt"
Testing with Fixtures¶
Smoke tests use JSONL fixtures:
# Run smoke tests
cargo test -p ralph-core smoke_runner
# Record a new fixture
cargo run --bin ralph -- run --record-session fixture.jsonl -p "your prompt"
E2E Testing¶
Requires a live AI backend:
# Run E2E tests
cargo run -p ralph-e2e -- claude
# Debug mode
cargo run -p ralph-e2e -- claude --keep-workspace --verbose
Debugging¶
Enable Diagnostics¶
Debug Logging¶
GDB/LLDB¶
IDE Setup¶
VS Code¶
Install extensions:
- rust-analyzer
- Even Better TOML
- crates
IntelliJ IDEA¶
Install plugins:
- Rust
- TOML
Common Issues¶
Cargo Build Fails¶
Tests Fail¶
Clippy Errors¶
# See all warnings
cargo clippy --all-targets --all-features 2>&1 | less
# Fix automatically
cargo clippy --fix
Next Steps¶
- Read the Code Style guide
- Learn about Testing
- See Submitting PRs