con un clic
review-rust
Comprehensive Rust code review with optional parallel agents
Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
Menú
Comprehensive Rust code review with optional parallel agents
Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
Basado en la clasificación ocupacional SOC
Create Claude Code skills with best practices, structure, validation, and testing. Use when designing or refining skills, prompts, references, or supporting files.
Use when the user wants a cited, structured read of local documents and project knowledge. Triggers on: "analyze these docs", "scan my project for context", "read the docs folder", "summarize what's in .beagle/concepts/", "extract context from docs/", "what's in this folder", "go read everything in X and tell me what's there". Also invoked programmatically by other beagle skills (prfaq-beagle Ignition, brainstorm-beagle reference points, strategy-interview context grounding) via the companion contract. Does NOT trigger on codebase lookups ("find this function", "search the repo"), web research (use web-research), LLM-as-judge evaluation (use llm-judge), or document editing (use humanize-beagle). Produces a written scan plan, parallel-subagent findings, and a cited synthesis report on disk — never inline prose, never unsourced claims.
Use when the user has a fuzzy idea and wants to shape it into a concrete project spec before planning or building. Triggers on: "brainstorm this", "I have an idea for...", "help me think through this project", "what should I build", "spec this out". Also catches vague feature descriptions needing structured questioning to clarify scope. Does NOT write code, plan implementation, review strategy docs, or run strategy interviews — produces a WHAT/WHY spec through dialogue, not a HOW plan.
Use when the user wants to pressure-test a product, internal-tool, or OSS concept against Amazon's Working Backwards PRFAQ gauntlet before committing to a spec. Triggers on: "work backwards", "write a PRFAQ", "press release first", "is this idea worth building", "pressure-test this concept", "filter this before brainstorm", "is this a real product". Also catches solution-first pitches ("I want to build X that does Y") and technology-first pitches ("use AI to...") that need customer-first filtering. Produces a binary pass/fail verdict, not a polished doc. Hardcore coaching — direct, skeptical, concrete. On pass, hands off to brainstorm-beagle with a concept brief. Does NOT write code, plan implementation, scaffold projects, or draft specs.
Use when the user wants web research: gathering cited, multi-angle evidence on a specific question. Triggers on: "research X for me", "do web research on", "look up sources for", "find citations for", "gather evidence on", "what does the web say about X". Also invoked programmatically by other beagle skills (prfaq-beagle Ignition, brainstorm-beagle reference points, strategy-interview context grounding) via the companion contract. Does NOT trigger on codebase lookups ("find this function", "search the repo"), local file search, LLM-as-judge evaluation, or paywalled/auth-gated scraping. Produces a written plan, parallel-subagent findings, and a cited synthesis report on disk — never inline prose, never unsourced claims.
generate release notes for changes since a given tag
| description | Comprehensive Rust code review with optional parallel agents |
| name | review-rust |
| disable-model-invocation | true |
--parallel: Spawn specialized subagents per technology areagit diff --name-only $(git merge-base HEAD main)..HEAD | grep -E '\.rs$'
# Check Cargo.toml for edition and rust-version
grep -E 'edition|rust-version' Cargo.toml
# Check workspace members if workspace
grep -A 20 '\[workspace\]' Cargo.toml
Edition 2024 awareness (requires MSRV 1.85+):
If edition = "2024" is detected, the following behavioral changes apply throughout the review:
unsafe_op_in_unsafe_fn is deny by default — unsafe operations inside unsafe fn MUST use explicit unsafe {} blocksextern "C" {} blocks must be unsafe extern "C" {}#[no_mangle] and #[export_name] must be #[unsafe(no_mangle)] and #[unsafe(export_name)]-> impl Trait captures ALL in-scope lifetimes by default (RPIT lifetime capture change); use + use<'a> for precise capturegen is a reserved keyword — code using it as an identifier must use r#gen! (never type) falls back to ! instead of () — may change behavior of inferred typesif let conditions and tail expressions are dropped earlier than in edition 2021Box<[T]> now implements IntoIteratorRecord the detected edition — it affects severity calibration in Steps 3, 8, and the verification protocol.
CRITICAL: Run clippy and check BEFORE flagging style or correctness issues. Do NOT flag issues that clippy or the compiler already catches.
cargo clippy --all-targets --all-features -- -D warnings 2>&1 | head -50
cargo clippy -- -D clippy::perf 2>&1 | head -20
cargo check --all-targets 2>&1 | head -50
Edition 2024 note: Edition 2024 promotes several previously-warn lints to deny (notably unsafe_op_in_unsafe_fn). If clippy or cargo check already reports edition-related errors, do not duplicate those as review findings — instead note that the author must fix compiler errors first.
# Detect tokio async runtime
grep -r "tokio" --include="Cargo.toml" -l | head -3
# Detect axum web framework
grep -r "axum" --include="Cargo.toml" -l | head -3
# Detect sqlx database
grep -r "sqlx" --include="Cargo.toml" -l | head -3
# Detect serde serialization
grep -r "serde" --include="Cargo.toml" -l | head -3
# Detect thiserror / anyhow
grep -r "thiserror\|anyhow" --include="Cargo.toml" -l | head -3
# Detect tracing
grep -r "tracing" --include="Cargo.toml" -l | head -3
# Check for test files in diff
git diff --name-only $(git merge-base HEAD main)..HEAD | grep -E '((^|/)(test|tests)/.*\.rs$)|(_test\.rs$)'
# Check for unsafe code in diff
git diff $(git merge-base HEAD main)..HEAD -- '*.rs' | grep -c 'unsafe'
# Detect async fn in traits (no async-trait crate needed since Rust 1.75)
grep -r "async-trait" --include="Cargo.toml" -l | head -3
# Detect LazyLock/LazyCell usage (replaces once_cell/lazy_static since 1.80)
grep -r "once_cell\|lazy_static" --include="Cargo.toml" -l | head -3
# Detect #[expect] lint attribute usage (stable since 1.81)
git diff $(git merge-base HEAD main)..HEAD -- '*.rs' | grep -c '#\[expect('
# Detect macro definitions in diff
git diff $(git merge-base HEAD main)..HEAD -- '*.rs' | grep -cE 'macro_rules!|#\[proc_macro|#\[derive\('
# Detect FFI code in diff
git diff $(git merge-base HEAD main)..HEAD -- '*.rs' | grep -cE 'extern "C"|#\[no_mangle\]|#\[repr\(C\)\]|bindgen|#\[unsafe\(no_mangle\)\]'
Modern Rust detection notes:
async-trait is a dependency but the project uses edition 2024 or MSRV >= 1.75, flag as Informational — native async fn in traits is available and async-trait can likely be removed.once_cell or lazy_static is a dependency but MSRV >= 1.80, flag as Informational — std::sync::LazyLock and std::cell::LazyCell are stable replacements.#[allow(...)] is used where #[expect(...)] would be better (MSRV >= 1.81), note as Minor — #[expect] warns when the suppressed lint no longer fires, keeping suppressions clean.Load beagle-rust:review-verification-protocol skill and keep its checklist in mind throughout the review.
Use the Skill tool to load each applicable skill (e.g., Skill(skill: "beagle-rust:rust-code-review")).
Always load:
beagle-rust:rust-code-reviewConditionally load based on detection:
| Condition | Skill |
|---|---|
| Tokio detected | beagle-rust:tokio-async-code-review |
| Axum detected | beagle-rust:axum-code-review |
| sqlx detected | beagle-rust:sqlx-code-review |
| Serde detected | beagle-rust:serde-code-review |
| Test files changed | beagle-rust:rust-testing-code-review |
| Macro definitions in diff | beagle-rust:macros-code-review |
| FFI code detected (extern, repr(C), bindgen) | beagle-rust:ffi-code-review |
Sequential (default):
Parallel (--parallel flag):
Task toolBefore reporting any issue:
#[cfg] gated code?Edition 2024 verification rules:
7. Do NOT flag unsafe {} blocks inside unsafe fn as unnecessary — they are REQUIRED in edition 2024
8. Do NOT flag unsafe extern "C" as unusual syntax — it is REQUIRED in edition 2024
9. Do NOT flag #[unsafe(no_mangle)] or #[unsafe(export_name)] as unusual — they are REQUIRED in edition 2024
10. For -> impl Trait returns, verify whether implicit lifetime capture is intentional — in edition 2024 all in-scope lifetimes are captured by default; suggest + use<'a> only when narrower capture is needed
11. For code using Box<[T]> in iterator contexts, remember IntoIterator is now available in edition 2024 — do not flag .iter() on boxed slices as the only approach
12. If temporaries in if let or tail expressions cause borrow issues, consider whether edition 2024's earlier drop semantics are the root cause
You MUST report ALL issues across ALL categories (ownership, error handling, async, types, tests, security, performance) in a single review pass. Do not hold back issues for later rounds.
Before submitting findings, ask yourself:
If yes to either: include those anticipated downstream issues NOW, in this review, so the author can address everything at once.
Fixes to existing code should be flagged at their real severity regardless of size.
However, requests for net-new code that didn't exist before the diff must be classified as Informational:
These are improvement suggestions for the author to consider in future work, not review blockers.
If this is a re-review after fixes were applied:
## Review Summary
[1-2 sentence overview of findings]
## Issues
### Critical (Blocking)
1. [FILE:LINE] ISSUE_TITLE
- Issue: Description of what's wrong
- Why: Why this matters (unsound unsafe, data race, panic, security)
- Fix: Specific recommended fix
### Major (Should Fix)
2. [FILE:LINE] ISSUE_TITLE
- Issue: ...
- Why: ...
- Fix: ...
### Minor (Nice to Have)
N. [FILE:LINE] ISSUE_TITLE
- Issue: ...
- Why: ...
- Fix: ...
### Informational (For Awareness)
N. [FILE:LINE] SUGGESTION_TITLE
- Suggestion: ...
- Rationale: ...
## Good Patterns
- [FILE:LINE] Pattern description (preserve this)
## Verdict
Ready: Yes | No | With fixes 1-N (Critical/Major only; Minor items are acceptable)
Rationale: [1-2 sentences]
After fixes are applied, run:
cargo check --all-targets
cargo clippy --all-targets --all-features -- -D warnings
cargo test --all-targets
All checks must pass before approval.