name: rairos-dev
description: Rairos project development workflow - Rust build, test, debug, and code analysis. Use when working on Rairos codebase (100% Rust, 150 crates). Triggers: cargo build, cargo test, flamegraph, CodeGraph, adding CLI commands, adding MCP tools.
Rairos Development
Quick Start
make build-dev
make test
./rairos.sh --help
Build Variants
| Command | Use Case |
|---|
make build | Release build (parallel + mold + ccache) |
make build-dev | Debug build (faster) |
unset RUSTC_WRAPPER && cargo build -p rairos-cli | Single crate |
unset RUSTC_WRAPPER && cargo build --release -p rairos-cli | Release single crate |
Testing
make test
unset RUSTC_WRAPPER && cargo test -p rairos-codegraph
unset RUSTC_WRAPPER && cargo test -p rairos-cli -- --nocapture
Debugging
RUST_LOG=debug ./rairos.sh <command>
RUST_LOG=debug ./rairos.sh <command>
Code Analysis (CodeGraph MCP)
Use CodeGraph MCP tools for code exploration:
| Tool | Purpose |
|---|
codegraph_files | Project structure (start here) |
codegraph_search | Find symbols by name |
codegraph_context | Build context for a task |
codegraph_callers | Find who calls a function |
codegraph_callees | Find what a function calls |
codegraph_impact | Analyze change impact |
See CODERIEF.md for detailed usage.
Code Quality
cargo clippy -p rairos-cli
cargo fmt -- --check
cargo audit
Adding New Features
New CLI Command
- Add command variant to
Commands enum in main.rs
- Create handler in
handlers/<feature>.rs
- Add match arm in command dispatch
Template:
Commands::NewCommand { arg } => {
handle_new_command(arg)?;
}
New MCP Tool
- Add tool definition in
rairos-mcp/src/handlers.rs
- Implement handler function with
fn name(&self) -> &str
- Register in tool list
Common Issues
| Issue | Solution |
|---|
| Memory | unset RUSTC_WRAPPER && CARGO_BUILD_JOBS=1 cargo build |
| Disk full | rm -rf target/ |
| Tree-sitter ABI error | Use tree-sitter 0.23, not 0.24 |
| Slow tests | Test single crate: -p <name> |
Project Structure
crates/
├── rairos-cli/ # 148 CLI commands
├── rairos-core/ # DB, FTS5, constants
├── rairos-mcp/ # 0 MCP tools
├── rairos-codegraph/ # CodeGraph MCP server
└── ... (140 other crates)
See REFERENCE.md for full architecture details.