rust-sota-arsenal
Reference guide for state-of-the-art Rust tooling across refactoring, profiling, benchmarking, testing, and SIMD optimization. Use whenever the.
What this skill does
# Rust SOTA Arsenal
State-of-the-art Rust tooling knowledge for refactoring, profiling, benchmarking, testing, and SIMD optimization — tools that LLMs often lack deep training data on.
> **Self-Evolving Skill**: This skill improves through use. If instructions are wrong, parameters drifted, or a workaround was needed — fix this file immediately, don't defer. Only update for real, reproducible issues.
## CRITICAL: Web-Verify Before Acting
**The reference docs in this skill are a starting point, not ground truth.** Tool versions, compatibility matrices, and API surfaces evolve faster than static docs. Before recommending specific versions or making upgrade decisions:
1. **Check crates.io for latest versions**: `WebFetch` the crates.io API to get current version info
```
WebFetch: https://crates.io/api/v1/crates/{crate_name}
Prompt: "What is the latest version? List recent versions."
```
2. **Check dependency compatibility**: When upgrading (e.g., PyO3), verify downstream crate compatibility
```
WebFetch: https://crates.io/api/v1/crates/{crate_name}/{version}/dependencies
Prompt: "What version of {dependency} does this require?"
```
3. **Search for breaking changes**: `WebSearch` for changelogs and migration guides
```
WebSearch: "{crate_name} latest version changelog migration"
```
4. **Fallback: Firecrawl scrape** (if WebFetch fails or returns incomplete data — e.g., JS-heavy pages, rate limits):
```bash
curl -s -X POST http://littleblack:3002/v1/scrape \
-H "Content-Type: application/json" \
-d '{"url": "https://crates.io/crates/{crate_name}", "formats": ["markdown"], "waitFor": 0}' \
| jq -r '.data.markdown'
```
Requires Tailscale connectivity. See `/devops-tools:firecrawl-research-patterns` for full API reference.
**Why**: The opendeviationbar-py session discovered PyO3 was at 0.28.2 (not 0.28) and pyo3-arrow at 0.17.0 only by web-searching — static docs would have led to wrong upgrade decisions.
## When to Use
- Refactoring Rust code (AST-aware search/replace, API compatibility)
- Performance work (profiling, PGO, Cargo profile tuning)
- Benchmarking (choosing divan vs Criterion, setting up benchmarks)
- Testing (faster test runner, mutation testing, feature flag testing)
- SIMD optimization (portable SIMD on stable Rust)
- Migrating PyO3 bindings (0.22+)
## Quick Reference
| Tool | Install | One-liner | Category |
| --------------------- | ------------------------------------- | -------------------------------------- | ------------ |
| `ast-grep` | `cargo install ast-grep` | AST-aware search/rewrite for Rust | Refactoring |
| `cargo-semver-checks` | `cargo install cargo-semver-checks` | API compat linting (hundreds of lints) | Refactoring |
| `samply` | `cargo install samply` | Profile → Firefox Profiler UI | Performance |
| `cargo-pgo` | `cargo install cargo-pgo` | PGO + BOLT optimization | Performance |
| `cargo-wizard` | `cargo install cargo-wizard` | Auto-configure Cargo profiles | Performance |
| `divan` | `divan = "<version>"` in dev-deps | `#[divan::bench]` attribute API | Benchmarking |
| `criterion` | `criterion = "<version>"` in dev-deps | Statistics-driven, Gnuplot reports | Benchmarking |
| `cargo-nextest` | `cargo install cargo-nextest` | 3x faster, process-per-test | Testing |
| `cargo-mutants` | `cargo install cargo-mutants` | Mutation testing (missed/caught) | Testing |
| `cargo-hack` | `cargo install cargo-hack` | Feature powerset testing | Testing |
| `macerator` | `macerator = "<version>"` in deps | Type-generic SIMD + multiversioning | SIMD |
| `cargo-audit` | `cargo install cargo-audit` | RUSTSEC vulnerability scan | Dependencies |
| `cargo-deny` | `cargo install cargo-deny` | License + advisory + ban | Dependencies |
| `cargo-vet` | `cargo install cargo-vet` | Mozilla supply chain audit | Dependencies |
| `cargo-outdated` | `cargo install cargo-outdated` | Dependency freshness | Dependencies |
| `cargo-geiger` | `cargo install cargo-geiger` | Detect unsafe code in deps | Dependencies |
| `cargo-machete` | `cargo install cargo-machete` | Find unused dependencies | Dependencies |
## Refactoring Workflow
### ast-grep: AST-Aware Search and Rewrite
**When to use**: Refactoring patterns across a codebase — safer than regex because it understands Rust syntax.
```bash
# Search for .unwrap() calls
ast-grep --pattern '$X.unwrap()' --lang rust
# Replace unwrap with expect
ast-grep --pattern '$X.unwrap()' --rewrite '$X.expect("TODO: handle error")' --lang rust
# Find unsafe blocks
ast-grep --pattern 'unsafe { $$$BODY }' --lang rust
# Convert match to if-let (single-arm + wildcard)
ast-grep --pattern 'match $X { $P => $E, _ => () }' --rewrite 'if let $P = $X { $E }' --lang rust
```
For complex multi-rule transforms, use YAML rule files. See [ast-grep reference](./references/ast-grep-rust.md).
### cargo-semver-checks: API Compatibility
**When to use**: Before publishing a crate version — catches accidental breaking changes.
```bash
# Check current changes against last published version
cargo semver-checks check-release
# Check against specific baseline
cargo semver-checks check-release --baseline-version 1.2.0
# Workspace mode
cargo semver-checks check-release --workspace
```
Hundreds of built-in lints covering function removal, type changes, trait impl changes, and more (lint count grows with each release). See [cargo-semver-checks reference](./references/cargo-semver-checks.md).
## Performance Workflow
### Step 1: Profile with samply
```bash
# Build with debug info (release speed + symbols)
cargo build --release
# Profile (macOS — uses dtrace, needs SIP consideration)
samply record ./target/release/my-binary
# Opens Firefox Profiler UI in browser automatically
# Look for: hot functions, call trees, flame graphs
```
See [samply reference](./references/samply-profiling.md) for macOS dtrace setup and flame graph interpretation.
### Step 2: Auto-configure profiles with cargo-wizard
```bash
# Interactive — choose optimization goal
cargo wizard
# Templates:
# 1. "fast-compile" — minimize build time (incremental, low opt)
# 2. "fast-runtime" — maximize performance (LTO, codegen-units=1)
# 3. "min-size" — minimize binary size (opt-level="z", LTO, strip)
```
cargo-wizard writes directly to `Cargo.toml` `[profile.*]` sections. Endorsed by the Cargo team. See [cargo-wizard reference](./references/cargo-wizard.md).
### Step 3: PGO + BOLT with cargo-pgo
Three-phase workflow for maximum performance:
```bash
# Phase 1: Instrument
cargo pgo build
# Phase 2: Collect profiles (run representative workload)
./target/release/my-binary < typical_input.txt
# Phase 3: Optimize with collected profiles
cargo pgo optimize
# Optional Phase 4: BOLT (post-link optimization, Linux only)
cargo pgo bolt optimize
```
PGO typically gives 10-20% speedup on CPU-bound code. See [cargo-pgo reference](./references/cargo-pgo.md).
## Benchmarking Workflow
### divan vs Criterion — When to Use Which
| Aspect | divan | Criterion |
| -------------------- | ----------------------------------------- | --------------------------------------------------- |
| API style | `#[divan::bench]` attribute | `criterion_group!` + `criterion_main!` macros |
| Setup | Add dep + `#[divan::bench]` Related in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.