Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Review Rust code for memory safety, concurrency patterns, performance optimization, and ecosystem tooling (cargo, clippy, rustfmt).
.claude/skills/williamzujkowski-rust-safety-performance-analyzer/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 146% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 92% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 128% | 0% |
| case-04 | ✗→✓ | ▲ Improved | 1392% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 406% | 0% |
Trigger conditions:
Not for:
cargo check or rust-analyzer LSP)cargo diagnostics)Time normalization:
NOW_ET using NIST/time.gov semantics (America/New_York, ISO-8601)NOW_ET for all citation access datesInput validation:
code_path must exist and contain valid Rust code (.rs files)analysis_focus must be one of: "safety", "concurrency", "performance", "all"rust_edition must be "2018" or "2021" (affects borrow checker and async behavior)check_unsafe must be boolean (controls unsafe block analysis depth)Source freshness:
Prerequisites:
Fast path for ownership/borrowing issues:
100 - (borrow_errors×15 + move_errors×10 + lifetime_warnings×5)Decision: If analysis_focus == "safety" AND score >90 → STOP at T1; otherwise proceed to T2.
References:
Extended validation for async/await and synchronization:
std::fs, std::thread::sleep in async fnsReference: Tokio Tutorial (accessed 2025-10-26T03:52:00-04:00)
Reference: Rust Atomics and Locks (accessed 2025-10-26T03:52:00-04:00)
Reference: Tokio: Async in Depth (accessed 2025-10-26T03:52:00-04:00)
deadlock_risk×20 + race_condition×15 + resource_leak×10Deep dive into zero-copy, allocations, and SIMD:
Reference: Rust Performance Book - Heap Allocations (accessed 2025-10-26T03:52:00-04:00)
Reference: Rust Performance Book - Type Sizes (accessed 2025-10-26T03:52:00-04:00)
Reference: Portable SIMD Project (accessed 2025-10-26T03:52:00-04:00)
Reference: Criterion.rs (accessed 2025-10-26T03:52:00-04:00)
check_unsafe == true)Reference: The Rustonomicon - Unsafe Rust (accessed 2025-10-26T03:52:00-04:00)
Analysis Focus Routing:
safety → T1 only, skip concurrency/performanceconcurrency → T1 + T2 (ownership matters for Send/Sync)performance → T1 + T3 (safety issues affect optimization validity)all → T1 + T2 + T3 (comprehensive analysis)Abort Conditions:
code_path not readable → error "File/directory not accessible"Severity Thresholds:
Ambiguity Handling:
Schema (JSON):
json{ "code_path": "string", "rust_edition": "2018 | 2021", "analysis_focus": "safety | concurrency | performance | all", "overall_score": "integer (0-100)", "safety_report": { "ownership_issues": [ { "file": "string", "line": "integer", "severity": "critical | high | medium | low", "category": "move-after-use | borrow-conflict | lifetime", "message": "string", "fix": "string (optional)" } ], "unsafe_blocks": [ { "file": "string", "line": "integer", "soundness_concern": "boolean", "rationale": "string", "safe_alternative": "string (optional)" } ] }, "concurrency_analysis": { "deadlock_risks": ["array of objects with file/line/description"], "race_conditions": ["array of objects"], "async_issues": ["array of objects with tokio-specific patterns"], "sync_primitive_recommendations": ["array of strings"] }, "performance_recommendations": { "allocations": ["array of hotspots with impact estimates"], "zero_copy_opportunities": ["array with refactoring suggestions"], "simd_candidates": ["array with vectorization potential"], "profiling_setup": "string (command to run)" }, "ecosystem_suggestions": { "recommended_crates": ["array of crate names with use cases"], "clippy_config": "string (TOML snippet)", "rustfmt_config": "string (TOML snippet)" }, "metrics": { "total_lines": "integer", "unsafe_line_count": "integer", "async_fn_count": "integer", "critical_issues": "integer", "high_issues": "integer", "medium_issues": "integer", "low_issues": "integer" }, "timestamp": "ISO-8601 string (NOW_ET)" }
Required Fields:
code_path, rust_edition, analysis_focus, overall_score, metrics, timestampsafety_report, concurrency_analysis, performance_recommendations (based on focus)Fix Suggestions:
Example: Async Rust Service with Concurrency Issues
rust// INPUT: async service with tokio runtime inefficiencies use tokio::sync::Mutex; use std::sync::Arc; async fn process_requests(db: Arc<Mutex<Database>>) { loop { let req = receive_request().await; // Issue 1: Holding lock across .await (blocking other tasks) let mut db = db.lock().await; db.update(req).await; // .await while holding Mutex // Issue 2: Blocking I/O in async context std::fs::read_to_string("config.txt").unwrap(); // Issue 3: Spawning without bound (memory leak potential) tokio::spawn(async move { slow_operation().await; }); } } // T2 ANALYSIS OUTPUT: // Critical: Mutex held across .await (line 9-10) // Fix: Minimize critical section, release before async call // High: Blocking std::fs in async fn (line 13) // Fix: Use tokio::fs::read_to_string // High: Unbounded task spawning (line 16) // Fix: Use semaphore or bounded channel
Token Budgets:
Safety:
cargo check --message-format=jsonAuditability:
Performance:
Accuracy:
cargo checkOfficial Rust Documentation (accessed 2025-10-26T03:52:00-04:00):
Async/Concurrency (accessed 2025-10-26T03:52:00-04:00):
Performance (accessed 2025-10-26T03:52:00-04:00):
Tooling Integration:
resources/clippy-config.toml - Recommended clippy lints for each focus arearesources/rustfmt.toml - Standard formatting configurationresources/cargo-deny.toml - Dependency security/license checkingCrate Recommendations by Use Case:
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-15 | pass→pass | 8,739 | 10,184 | +17% | 1 | 1 | 0% | 1,604 | 5,962 | +272% | 0 | 0 | — |
case-01 | fail→pass | 12,333 | 11,641 | -6% | 1 | 1 | 0% | 2,614 | 6,437 | +146% | 0 | 0 | — |
case-02 | fail→pass | 13,587 | 8,235 | -39% | 1 | 1 | 0% | 2,964 | 5,683 | +92% | 0 | 0 | — |
case-03 | fail→pass | 12,858 | 9,699 | -25% | 1 | 1 | 0% | 2,540 | 5,800 | +128% | 0 | 0 | — |
case-04 | fail→pass | 1,571 | 3,877 | +147% | 1 | 1 | 0% | 302 | 4,507 | +1392% | 0 | 0 | — |
case-05 | pass→pass | 12,679 | 10,532 | -17% | 1 | 1 | 0% | 2,722 | 6,044 | +122% | 0 | 0 | — |
case-06 | pass→pass | 8,805 | 7,031 | -20% | 1 | 1 | 0% | 1,541 | 5,074 | +229% | 0 | 0 | — |
case-07 | fail→pass | 4,844 | 4,668 | -4% | 1 | 1 | 0% | 987 | 4,999 | +406% | 0 | 0 | — |
case-08 | fail→pass | 15,372 | 8,421 | -45% | 1 | 1 | 0% | 2,857 | 5,776 | +102% | 0 | 0 | — |
case-09 | fail→pass | 13,268 | 11,038 | -17% | 1 | 1 | 0% | 2,668 | 5,821 | +118% | 0 | 0 | — |
case-16 | pass→pass | 17,679 | 7,305 | -59% | 1 | 1 | 0% | 3,778 | 5,295 | +40% | 0 | 0 | — |
case-10 | fail→pass | 4,968 | 12,175 | +145% | 1 | 1 | 0% | 922 | 6,221 | +575% | 0 | 0 | — |
case-11 | fail→pass | 5,192 | 6,052 | +17% | 1 | 1 | 0% | 1,171 | 5,321 | +354% | 0 | 0 | — |
case-12 | pass→pass | 9,687 | 7,563 | -22% | 1 | 1 | 0% | 2,027 | 5,495 | +171% | 0 | 0 | — |
case-13 | pass→pass | 11,645 | 9,645 | -17% | 1 | 1 | 0% | 2,634 | 5,762 | +119% | 0 | 0 | — |
case-14 | pass→pass | 7,642 | 6,231 | -18% | 1 | 1 | 0% | 1,674 | 5,046 | +201% | 0 | 0 | — |
case-17 | fail→pass | 15,327 | 8,525 | -44% | 1 | 1 | 0% | 3,115 | 5,604 | +80% | 0 | 0 | — |
case-18 | pass→pass | 4,479 | 7,236 | +62% | 1 | 1 | 0% | 927 | 5,423 | +485% | 0 | 0 | — |
case-19 | pass→pass | 7,035 | 10,330 | +47% | 1 | 1 | 0% | 1,556 | 6,126 | +294% | 0 | 0 | — |
case-20 | fail→pass | 7,044 | 4,593 | -35% | 1 | 1 | 0% | 1,414 | 4,873 | +245% | 0 | 0 | — |
case-21 | pass→fail | 27,265 | 13,483 | -51% | 1 | 1 | 0% | 5,539 | 6,462 | +17% | 0 | 0 | — |
case-22 | fail→pass | 15,293 | 8,349 | -45% | 1 | 1 | 0% | 2,990 | 5,464 | +83% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +50 percentage points is the difference between those two pass rates over the 22 comparable cases. 1 case got worse with the skill loaded, and it is included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.