Rust Stack Guide
This guide covers using Sequant with Rust projects.
Detection
Section titled “Detection”Sequant automatically detects Rust projects by looking for:
Cargo.toml
Default Commands
Section titled “Default Commands”When initialized with the Rust stack, Sequant configures these commands:
| Command | Default |
|---|---|
| Test | cargo test |
| Build | cargo build --release |
| Lint | cargo clippy |
| Check | cargo check |
File Patterns
Section titled “File Patterns”The workflow skills use these patterns to locate files:
| Pattern | Glob |
|---|---|
| Source | src/**/*.rs |
| Tests | tests/**/*.rs |
| Benchmarks | benches/**/*.rs |
Workflow Integration
Section titled “Workflow Integration”/spec Phase
Section titled “/spec Phase”During planning, Sequant will:
- Review module structure in
src/ - Check existing patterns and traits
- Look for integration tests in
tests/
/exec Phase
Section titled “/exec Phase”During implementation, the agent will:
- Run
cargo clippyfor linting - Run
cargo testfor verification - Run
cargo build --releaseto ensure it compiles
/qa Phase
Section titled “/qa Phase”Quality review includes:
- Clippy warnings check
- Documentation review (
cargo doc) - Test coverage review
- Unsafe code audit
Customization
Section titled “Customization”Override commands in .claude/.local/memory/constitution.md:
## Build Commands
- Test: `cargo test --all-features`- Build: `cargo build --release --all-features`- Lint: `cargo clippy -- -D warnings`Common Patterns
Section titled “Common Patterns”Library Crate
Section titled “Library Crate”src/├── lib.rs├── module/│ ├── mod.rs│ └── submodule.rs└── utils.rsBinary Crate
Section titled “Binary Crate”src/├── main.rs├── cli.rs├── commands/│ └── mod.rs└── lib.rsWorkspace
Section titled “Workspace”Cargo.toml # Workspace rootcrates/├── core/│ ├── Cargo.toml│ └── src/├── cli/│ ├── Cargo.toml│ └── src/-
Use
cargo clippy- Sequant runs Clippy by default; fix all warnings before the QA phase. -
Documentation - Add doc comments (
///) for public APIs; the agent will check for missing docs. -
Error Handling - Prefer
thiserrorfor library errors andanyhowfor application errors. -
Testing - Place unit tests in the same file with
#[cfg(test)]modules; integration tests go intests/.