.claude/skills/rig-migrate/SKILL.md
Help migrate Rig code between versions. Use when upgrading rig-core or companion crates, resolving breaking changes, or updating deprecated APIs. Detects the current version from Cargo.toml automatically.
npx skillsauth add 0xplaygrounds/rig rig-migrateInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Current project Rig version (auto-detected):
!`grep -E '^rig-core|^rig ' Cargo.toml 2>/dev/null || grep -rE 'rig-core\s*=' Cargo.toml */Cargo.toml 2>/dev/null | head -5 || echo "rig-core version not found in Cargo.toml"`
Latest Rig release:
!`cargo search rig-core --limit 1 2>/dev/null || echo "Could not fetch latest version. Check https://crates.io/crates/rig-core"`
cargo fmt, cargo clippy --all-targets --all-features, cargo test.All trait bounds must use WASM-compatible variants:
// Before
pub trait MyTrait: Send + Sync {
fn method(&self) -> impl Future<Output = ()> + Send;
}
// After
use rig::{WasmCompatSend, WasmCompatSync};
pub trait MyTrait: WasmCompatSend + WasmCompatSync {
fn method(&self) -> impl Future<Output = ()> + WasmCompatSend;
}
Search pattern: grep -rn ': Send\b\|+ Send\b\|: Sync\b\|+ Sync\b' --include='*.rs'
// Before
fn process() -> Result<(), String> { ... }
// After
#[derive(Debug, thiserror::Error)]
enum ProcessError {
#[error("Parse failed: {0}")]
Parse(#[from] serde_json::Error),
}
fn process() -> Result<(), ProcessError> { ... }
Search pattern: grep -rn 'Result<.*,\s*String>' --include='*.rs' (results should be manually verified to avoid false positives)
When providers update their APIs, Rig's type definitions change. Check the CHANGELOG for specific field additions/removals.
Typical changes:
GPT_4 -> GPT_4O)CompletionRequest now has an optional model field:
// When constructing CompletionRequest manually, include the field:
let request = CompletionRequest {
model: None, // or Some("model-override".to_string())
preamble: None,
chat_history: OneOrMany::one("Hello".into()),
// ... rest of fields
};
Use this checklist when migrating:
rig-core version in all Cargo.toml filesrig-mongodb, rig-lancedb, etc.)Send/Sync with WasmCompatSend/WasmCompatSyncString error types with proper error enums.unwrap() / .expect() on fallible operationscargo fmt && cargo clippy --all-targets --all-features && cargo testtools
Build LLM-powered applications with Rig, the Rust AI framework. Use when creating agents, RAG pipelines, tool-calling workflows, structured extraction, or streaming completions. Covers all providers with a unified API.
tools
<!-- This file is generated by scripts/sync_agent_instruction_files.sh. --> <!-- Do not edit this file directly; update AGENTS.md and re-run the sync script. --> --- name: rig-wasm-check description: > Audit Rig code for WebAssembly compatibility. Use when verifying that trait bounds use WasmCompatSend/WasmCompatSync, futures use WasmBoxedFuture, and error types have proper conditional compilation. allowed-tools: - Read - Glob - Grep --- # Rig WASM Compatibility Check Audit code fo
tools
<!-- This file is generated by scripts/sync_agent_instruction_files.sh. --> <!-- Do not edit this file directly; update AGENTS.md and re-run the sync script. --> --- name: rig-vector-store description: > Implement a Rig vector store companion crate. Use when adding a new vector database backend (MongoDB, LanceDB, Qdrant, etc.) or reviewing an existing vector store integration. argument-hint: "[store-backend]" allowed-tools: - Read - Glob - Grep - Edit - Write - Bash --- # Rig
tools
<!-- This file is generated by scripts/sync_agent_instruction_files.sh. --> <!-- Do not edit this file directly; update AGENTS.md and re-run the sync script. --> --- name: rig-review description: > Review Rig changes against mandatory quality gates before opening a PR. Use before submitting code to verify error handling, WASM compatibility, coding style, and required checks pass. allowed-tools: - Read - Glob - Grep - Bash --- # Rig Pre-PR Review Perform a Rig-focused pre-PR revie