Rust Code Review Arguments - : Spawn specialized subagents per technology area - Path: Target directory (default: current working directory) Hard gates Complete in order before writing Issues in the output (empty scope is allowed; fabricated findings are not). 1. Scope gate: You have an explicit list of paths under review (from Step 1 or the user-provided path). Pass: List printed or "No Rust files in scope" — then stop with no Issues. 2. Compiler/linter gate: Step 3 commands were run from the crate or workspace root ( present); if they cannot run, one line states why (e.g. missing toolchain,…

\n```\n\n## Step 2: Check Rust Edition and MSRV\n\n```bash\n# Check Cargo.toml for edition and rust-version\ngrep -E 'edition|rust-version' Cargo.toml\n\n# Check workspace members if workspace\ngrep -A 20 '\\[workspace\\]' Cargo.toml\n```\n\n**Edition 2024 awareness** (requires MSRV 1.85+):\n\nIf `edition = \"2024\"` is detected, the following behavioral changes apply throughout the review:\n- `unsafe_op_in_unsafe_fn` is deny by default — unsafe operations inside `unsafe fn` MUST use explicit `unsafe {}` blocks\n- `extern \"C\" {}` blocks must be `unsafe extern \"C\" {}`\n- `#[no_mangle]` and `#[export_name]` must be `#[unsafe(no_mangle)]` and `#[unsafe(export_name)]`\n- `-> impl Trait` captures ALL in-scope lifetimes by default (RPIT lifetime capture change); use `+ use\u003c'a>` for precise capture\n- `gen` is a reserved keyword — code using it as an identifier must use `r#gen`\n- `!` (never type) falls back to `!` instead of `()` — may change behavior of inferred types\n- Temporaries in `if let` conditions and tail expressions are dropped earlier than in edition 2021\n- `Box\u003c[T]>` now implements `IntoIterator`\n\nRecord the detected edition — it affects severity calibration in Steps 3, 8, and the verification protocol.\n\n## Step 3: Verify Linter Status\n\nCRITICAL: Run clippy and check BEFORE flagging style or correctness issues. Do NOT flag issues that clippy or the compiler already catches.\n\n```bash\ncargo clippy --all-targets --all-features -- -D warnings 2>&1 | head -50\ncargo clippy -- -D clippy::perf 2>&1 | head -20\ncargo check --all-targets 2>&1 | head -50\n```\n\n**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.\n\n## Step 4: Detect Technologies\n\n```bash\n# Detect tokio async runtime\ngrep -r \"tokio\" --include=\"Cargo.toml\" -l | head -3\n\n# Detect axum web framework\ngrep -r \"axum\" --include=\"Cargo.toml\" -l | head -3\n\n# Detect sqlx database\ngrep -r \"sqlx\" --include=\"Cargo.toml\" -l | head -3\n\n# Detect serde serialization\ngrep -r \"serde\" --include=\"Cargo.toml\" -l | head -3\n\n# Detect thiserror / anyhow\ngrep -r \"thiserror\\|anyhow\" --include=\"Cargo.toml\" -l | head -3\n\n# Detect tracing\ngrep -r \"tracing\" --include=\"Cargo.toml\" -l | head -3\n\n# Check for test files in diff\ngit diff --name-only $(git merge-base HEAD main)..HEAD | grep -E '((^|/)(test|tests)/.*\\.rs$)|(_test\\.rs$)'\n\n# Check for unsafe code in diff\ngit diff $(git merge-base HEAD main)..HEAD -- '*.rs' | grep -c 'unsafe'\n\n# Detect async fn in traits (no async-trait crate needed since Rust 1.75)\ngrep -r \"async-trait\" --include=\"Cargo.toml\" -l | head -3\n\n# Detect LazyLock/LazyCell usage (replaces once_cell/lazy_static since 1.80)\ngrep -r \"once_cell\\|lazy_static\" --include=\"Cargo.toml\" -l | head -3\n\n# Detect #[expect] lint attribute usage (stable since 1.81)\ngit diff $(git merge-base HEAD main)..HEAD -- '*.rs' | grep -c '#\\[expect('\n\n# Detect macro definitions in diff\ngit diff $(git merge-base HEAD main)..HEAD -- '*.rs' | grep -cE 'macro_rules!|#\\[proc_macro|#\\[derive\\('\n\n# Detect FFI code in diff\ngit diff $(git merge-base HEAD main)..HEAD -- '*.rs' | grep -cE 'extern \"C\"|#\\[no_mangle\\]|#\\[repr\\(C\\)\\]|bindgen|#\\[unsafe\\(no_mangle\\)\\]'\n\n# Detect concurrency primitives (atomics, lock-free, hand-rolled sync)\ngit diff $(git merge-base HEAD main)..HEAD -- '*.rs' | grep -cE 'std::sync::atomic|Atomic(Bool|U?size|U?(8|16|32|64)|Ptr)|compare_exchange|fetch_(add|sub|or|and|xor|update)|UnsafeCell|unsafe impl (Send|Sync)|Ordering::(Relaxed|Acquire|Release|AcqRel|SeqCst)|atomic::fence'\n\n# Detect concurrency test tooling\ngrep -rE 'loom|^miri

Rust Code Review Arguments - : Spawn specialized subagents per technology area - Path: Target directory (default: current working directory) Hard gates Complete in order before writing Issues in the output (empty scope is allowed; fabricated findings are not). 1. Scope gate: You have an explicit list of paths under review (from Step 1 or the user-provided path). Pass: List printed or "No Rust files in scope" — then stop with no Issues. 2. Compiler/linter gate: Step 3 commands were run from the crate or workspace root ( present); if they cannot run, one line states why (e.g. missing toolchain,…

--include='Cargo.toml' -l | head -3\ngit diff $(git merge-base HEAD main)..HEAD -- '*.rs' | grep -cE 'loom::|#\\[cfg\\(loom\\)\\]|cfg_attr\\(miri'\n\n# Detect concurrency crates\ngrep -rE '^crossbeam|^arc-swap|^parking_lot|^dashmap|^flurry|^haphazard|^seize|^atomic_wait' --include='Cargo.toml' -l | head -3\n\n# Detect criterion benchmarks\ngrep -rE '^criterion' --include='Cargo.toml' -l | head -3\nls -d benches 2>/dev/null\n\n# Detect proc-macro crate or trybuild\ngrep -rE 'proc-macro\\s*=\\s*true|^trybuild' --include='Cargo.toml' -l | head -3\n\n# Detect public-surface changes (interface-design.md routing)\ngit diff $(git merge-base HEAD main)..HEAD -- '*.rs' | grep -cE '^\\+\\s*pub (trait|fn|struct|enum|mod|use)|^\\+\\s*impl[\u003c\\s].*Drop for'\n\n# Detect ecosystem patterns (patterns-in-the-wild.md routing)\ngrep -rE '^slotmap|^petgraph|^scopeguard|^indexmap' --include='Cargo.toml' -l | head -3\ngit diff $(git merge-base HEAD main)..HEAD -- '*.rs' | grep -cE 'mem::replace|swap_remove|prelude'\n```\n\n**Modern Rust detection notes:**\n- If `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.\n- If `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.\n- If `#[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.\n\n**Concurrency detection notes:**\n- If atomics (`std::sync::atomic`, `compare_exchange`, `fetch_*`), `UnsafeCell`, `unsafe impl Send/Sync`, or `crossbeam` / `arc-swap` / `parking_lot` are present in the diff, load `beagle-rust:rust-code-review` and consult `references/concurrency-primitives.md`, `references/memory-ordering.md`, and `references/lock-free-patterns.md`.\n- If the diff introduces or restructures concurrency (worker pools, actor-style channels, `tokio::spawn` patterns, threads-vs-async choices), also consult `references/concurrency-models.md` for design-level review questions.\n- If hand-rolled atomics / lock-free types appear with no `loom` dependency or no `cargo +nightly miri test` in CI, load `beagle-rust:rust-testing-code-review` and consult `references/concurrency-testing.md`.\n\n**Interface design / API surface detection:**\n- If the diff introduces or changes `pub trait`, `pub fn`, `pub struct`, derive impls on public types, `impl Drop` on owning types, or re-exports of foreign types, load `beagle-rust:rust-code-review` and consult `references/interface-design.md` for object-safety, ergonomic-impl, fallible-destructor, and hidden-contract review checks.\n- If the diff uses index-pointer graphs (`Vec\u003cNode> + usize`, `slotmap`, `petgraph`), `mem::replace`-style drop guards, extension traits, or modifies a `prelude` module, also consult `references/patterns-in-the-wild.md`.\n\n**Testing detection (criterion / trybuild / clippy strategy):**\n- If `benches/` directory or `criterion` dependency is present, load `beagle-rust:rust-testing-code-review` and consult `references/advanced-testing.md` for criterion baseline, `black_box`, and `iter_batched` review checks.\n- If proc-macro crate (`proc-macro = true`) or `trybuild` in `[dev-dependencies]`, consult `references/advanced-testing.md` for trybuild `.stderr` stability checks plus `beagle-rust:macros-code-review` `references/procedural-macros.md` for span hygiene and `syn` feature audits.\n\n## Step 5: Load Verification Protocol\n\nLoad `beagle-rust:review-verification-protocol` skill and keep its checklist in mind throughout the review.\n\n## Step 6: Load Skills\n\nUse the `Skill` tool to load each applicable skill (e.g., `Skill(skill: \"beagle-rust:rust-code-review\")`).\n\n**Always load:**\n- `beagle-rust:rust-code-review`\n\n**Conditionally load based on detection:**\n\n| Condition | Skill |\n|-----------|-------|\n| Tokio detected | `beagle-rust:tokio-async-code-review` |\n| Axum detected | `beagle-rust:axum-code-review` |\n| sqlx detected | `beagle-rust:sqlx-code-review` |\n| Serde detected | `beagle-rust:serde-code-review` |\n| Test files changed | `beagle-rust:rust-testing-code-review` |\n| Macro definitions in diff | `beagle-rust:macros-code-review` |\n| FFI code detected (extern, repr(C), bindgen) | `beagle-rust:ffi-code-review` |\n| Atomics, `UnsafeCell`, `unsafe impl Send/Sync`, `compare_exchange`, `crossbeam`, `arc-swap`, `parking_lot` | `beagle-rust:rust-code-review` (load `references/concurrency-primitives.md`, `references/memory-ordering.md`, `references/lock-free-patterns.md`) |\n| Concurrency design changes (worker pools, channels, threads-vs-async restructuring) | `beagle-rust:rust-code-review` (load `references/concurrency-models.md`) |\n| Public trait / `pub fn` / `pub struct` / `impl Drop` / re-export changes | `beagle-rust:rust-code-review` (load `references/interface-design.md`) |\n| Graph/tree code, `slotmap`, `petgraph`, `mem::replace` drop guards, extension traits, `prelude` module changes | `beagle-rust:rust-code-review` (load `references/patterns-in-the-wild.md`) |\n| `criterion` benchmarks, `benches/` directory | `beagle-rust:rust-testing-code-review` (load `references/advanced-testing.md` — criterion baseline + `black_box` + `iter_batched` checks) |\n| Proc-macro crate (`proc-macro = true`) or `trybuild` in dev-deps | `beagle-rust:rust-testing-code-review` + `beagle-rust:macros-code-review` (load `references/advanced-testing.md` trybuild + `references/procedural-macros.md` span hygiene) |\n| `loom`, `miri`, hand-rolled lock-free code under test | `beagle-rust:rust-testing-code-review` (load `references/concurrency-testing.md`) |\n\n## Step 7: Review\n\n**Sequential (default):**\n1. Load applicable skills\n2. Review core Rust quality (ownership, error handling, unsafe, traits)\n3. Review detected technology areas\n4. Consolidate findings\n\n**Parallel (--parallel flag):**\n1. Detect all technologies upfront\n2. Spawn one subagent per technology area with `Task` tool\n3. Each agent loads its skill and reviews its domain\n4. Wait for all agents\n5. Consolidate findings\n\n## Step 8: Verify Findings\n\nBefore reporting any issue:\n1. Re-read the actual code (not just diff context)\n2. For \"unused\" claims - did you search all references across the workspace?\n3. For \"missing\" claims - did you check trait definitions, derive macros, and `#[cfg]` gated code?\n4. For \"unnecessary clone\" - did you verify the borrow checker allows a reference?\n5. For \"unsafe\" issues - did you check the safety comments and surrounding invariants?\n6. Remove any findings that are style preferences, not actual issues\n\n**Edition 2024 verification rules:**\n7. Do NOT flag `unsafe {}` blocks inside `unsafe fn` as unnecessary — they are REQUIRED in edition 2024\n8. Do NOT flag `unsafe extern \"C\"` as unusual syntax — it is REQUIRED in edition 2024\n9. Do NOT flag `#[unsafe(no_mangle)]` or `#[unsafe(export_name)]` as unusual — they are REQUIRED in edition 2024\n10. For `-> impl Trait` returns, verify whether implicit lifetime capture is intentional — in edition 2024 all in-scope lifetimes are captured by default; suggest `+ use\u003c'a>` only when narrower capture is needed\n11. For code using `Box\u003c[T]>` in iterator contexts, remember `IntoIterator` is now available in edition 2024 — do not flag `.iter()` on boxed slices as the only approach\n12. If temporaries in `if let` or tail expressions cause borrow issues, consider whether edition 2024's earlier drop semantics are the root cause\n\n## Step 9: Review Convergence\n\n### Single-Pass Completeness\n\nYou 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.\n\nBefore submitting findings, ask yourself:\n- \"If all my recommended fixes are applied, will I find NEW issues in the fixed code?\"\n- \"Am I requesting new code (tests, types, modules) that will itself need review?\"\n\nIf yes to either: include those anticipated downstream issues NOW, in this review, so the author can address everything at once.\n\n### Scope Rules\n\n- Review ONLY the code in the diff and directly related existing code\n- Do NOT request new features, test infrastructure, or architectural changes that didn't exist before the diff\n- If test coverage is missing, flag it as ONE Minor issue (\"Missing test coverage for X, Y, Z\") — do NOT specify implementation details\n- Doc comments, naming issues are Minor unless they affect public API contracts\n- Do NOT request adding new dependencies (e.g., proptest, mockall, criterion)\n\n### Fix Complexity Budget\n\nFixes to existing code should be flagged at their real severity regardless of size.\n\nHowever, requests for **net-new code that didn't exist before the diff** must be classified as Informational:\n- Adding a new dependency\n- Creating entirely new modules, files, or test suites\n- Extracting new traits or abstractions\n- Adding benchmark suites\n\nThese are improvement suggestions for the author to consider in future work, not review blockers.\n\n### Iteration Policy\n\nIf this is a re-review after fixes were applied:\n- ONLY verify that previously flagged issues were addressed correctly\n- Do NOT introduce new findings unrelated to the previous review's issues\n- Accept Minor/Nice-to-Have issues that weren't fixed — do not re-flag them\n- The goal of re-review is VERIFICATION, not discovery\n\n## Output Format\n\n```markdown\n## Review Summary\n\n[1-2 sentence overview of findings]\n\n## Issues\n\n### Critical (Blocking)\n\n1. [FILE:LINE] ISSUE_TITLE\n - Issue: Description of what's wrong\n - Why: Why this matters (unsound unsafe, data race, panic, security)\n - Fix: Specific recommended fix\n\n### Major (Should Fix)\n\n2. [FILE:LINE] ISSUE_TITLE\n - Issue: ...\n - Why: ...\n - Fix: ...\n\n### Minor (Nice to Have)\n\nN. [FILE:LINE] ISSUE_TITLE\n - Issue: ...\n - Why: ...\n - Fix: ...\n\n### Informational (For Awareness)\n\nN. [FILE:LINE] SUGGESTION_TITLE\n - Suggestion: ...\n - Rationale: ...\n\n## Good Patterns\n\n- [FILE:LINE] Pattern description (preserve this)\n\n## Verdict\n\nReady: Yes | No | With fixes 1-N (Critical/Major only; Minor items are acceptable)\nRationale: [1-2 sentences]\n```\n\n## Rules\n\n- Complete **Hard gates** before writing Issues\n- Load skills BEFORE reviewing (not after)\n- Number every issue sequentially (1, 2, 3...)\n- Include FILE:LINE for each issue\n- Separate Issue/Why/Fix clearly\n- Categorize by actual severity\n- Run clippy before flagging style issues\n- Run verification after fixes\n- Report ALL issues in a single pass — do not hold back findings for later iterations\n- Re-reviews verify previous fixes ONLY — no new discovery\n- Requests for net-new code (new modules, dependencies, test suites) are Informational, not blocking\n- The Verdict ignores Minor and Informational items — only Critical and Major block approval\n\n## Post-Fix Verification\n\nAfter fixes are applied, run:\n\n```bash\ncargo check --all-targets\ncargo clippy --all-targets --all-features -- -D warnings\ncargo test --all-targets\n```\n\nAll checks must pass before approval.\n---","attachment_filenames":[],"attachments":[],"content_json":{"type":"doc","content":[{"type":"heading","attrs":{"level":1},"content":[{"text":"Rust Code Review","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Arguments","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"--parallel","type":"text","marks":[{"type":"code_inline"}]},{"text":": Spawn specialized subagents per technology area","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Path: Target directory (default: current working directory)","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Hard gates","type":"text"}]},{"type":"paragraph","content":[{"text":"Complete in order before writing ","type":"text"},{"text":"Issues","type":"text","marks":[{"type":"strong"}]},{"text":" in the output (empty scope is allowed; fabricated findings are not).","type":"text"}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Scope gate:","type":"text","marks":[{"type":"strong"}]},{"text":" You have an explicit list of ","type":"text"},{"text":".rs","type":"text","marks":[{"type":"code_inline"}]},{"text":" paths under review (from Step 1 or the user-provided path). ","type":"text"},{"text":"Pass:","type":"text","marks":[{"type":"strong"}]},{"text":" List printed or \"No Rust files in scope\" — then stop with no Issues.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Compiler/linter gate:","type":"text","marks":[{"type":"strong"}]},{"text":" Step 3 commands were run from the crate or workspace root (","type":"text"},{"text":"Cargo.toml","type":"text","marks":[{"type":"code_inline"}]},{"text":" present); if they cannot run, one line states why (e.g. missing toolchain, no ","type":"text"},{"text":"Cargo.toml","type":"text","marks":[{"type":"code_inline"}]},{"text":", sandbox). ","type":"text"},{"text":"Pass:","type":"text","marks":[{"type":"strong"}]},{"text":" You do not report a problem already shown as an error/warning in Step 3 output, and you do not duplicate compiler or clippy diagnostics the author must fix first.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Protocol gate:","type":"text","marks":[{"type":"strong"}]},{"text":" ","type":"text"},{"text":"beagle-rust:review-verification-protocol","type":"text","marks":[{"type":"code_inline"}]},{"text":" is loaded before Step 7. ","type":"text"},{"text":"Pass:","type":"text","marks":[{"type":"strong"}]},{"text":" Every Critical/Major finding satisfies Step 8 (and the protocol); if there are zero findings, say \"Protocol applied; no issues\" in the Review Summary.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Evidence gate (Critical/Major):","type":"text","marks":[{"type":"strong"}]},{"text":" For each Critical or Major item, you re-read the file at ","type":"text"},{"text":"FILE:LINE","type":"text","marks":[{"type":"code_inline"}]},{"text":" with full surrounding context (not only the diff hunk). ","type":"text"},{"text":"Pass:","type":"text","marks":[{"type":"strong"}]},{"text":" The Issue description matches observable code at that location.","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Step 1: Identify Changed Files","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"git diff --name-only $(git merge-base HEAD main)..HEAD | grep -E '\\.rs

Rust Code Review Arguments - : Spawn specialized subagents per technology area - Path: Target directory (default: current working directory) Hard gates Complete in order before writing Issues in the output (empty scope is allowed; fabricated findings are not). 1. Scope gate: You have an explicit list of paths under review (from Step 1 or the user-provided path). Pass: List printed or "No Rust files in scope" — then stop with no Issues. 2. Compiler/linter gate: Step 3 commands were run from the crate or workspace root ( present); if they cannot run, one line states why (e.g. missing toolchain,…

","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Step 2: Check Rust Edition and MSRV","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"# Check Cargo.toml for edition and rust-version\ngrep -E 'edition|rust-version' Cargo.toml\n\n# Check workspace members if workspace\ngrep -A 20 '\\[workspace\\]' Cargo.toml","type":"text"}]},{"type":"paragraph","content":[{"text":"Edition 2024 awareness","type":"text","marks":[{"type":"strong"}]},{"text":" (requires MSRV 1.85+):","type":"text"}]},{"type":"paragraph","content":[{"text":"If ","type":"text"},{"text":"edition = \"2024\"","type":"text","marks":[{"type":"code_inline"}]},{"text":" is detected, the following behavioral changes apply throughout the review:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"unsafe_op_in_unsafe_fn","type":"text","marks":[{"type":"code_inline"}]},{"text":" is deny by default — unsafe operations inside ","type":"text"},{"text":"unsafe fn","type":"text","marks":[{"type":"code_inline"}]},{"text":" MUST use explicit ","type":"text"},{"text":"unsafe {}","type":"text","marks":[{"type":"code_inline"}]},{"text":" blocks","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"extern \"C\" {}","type":"text","marks":[{"type":"code_inline"}]},{"text":" blocks must be ","type":"text"},{"text":"unsafe extern \"C\" {}","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"#[no_mangle]","type":"text","marks":[{"type":"code_inline"}]},{"text":" and ","type":"text"},{"text":"#[export_name]","type":"text","marks":[{"type":"code_inline"}]},{"text":" must be ","type":"text"},{"text":"#[unsafe(no_mangle)]","type":"text","marks":[{"type":"code_inline"}]},{"text":" and ","type":"text"},{"text":"#[unsafe(export_name)]","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"-> impl Trait","type":"text","marks":[{"type":"code_inline"}]},{"text":" captures ALL in-scope lifetimes by default (RPIT lifetime capture change); use ","type":"text"},{"text":"+ use\u003c'a>","type":"text","marks":[{"type":"code_inline"}]},{"text":" for precise capture","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"gen","type":"text","marks":[{"type":"code_inline"}]},{"text":" is a reserved keyword — code using it as an identifier must use ","type":"text"},{"text":"r#gen","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"!","type":"text","marks":[{"type":"code_inline"}]},{"text":" (never type) falls back to ","type":"text"},{"text":"!","type":"text","marks":[{"type":"code_inline"}]},{"text":" instead of ","type":"text"},{"text":"()","type":"text","marks":[{"type":"code_inline"}]},{"text":" — may change behavior of inferred types","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Temporaries in ","type":"text"},{"text":"if let","type":"text","marks":[{"type":"code_inline"}]},{"text":" conditions and tail expressions are dropped earlier than in edition 2021","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Box\u003c[T]>","type":"text","marks":[{"type":"code_inline"}]},{"text":" now implements ","type":"text"},{"text":"IntoIterator","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"paragraph","content":[{"text":"Record the detected edition — it affects severity calibration in Steps 3, 8, and the verification protocol.","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Step 3: Verify Linter Status","type":"text"}]},{"type":"paragraph","content":[{"text":"CRITICAL: Run clippy and check BEFORE flagging style or correctness issues. Do NOT flag issues that clippy or the compiler already catches.","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"cargo clippy --all-targets --all-features -- -D warnings 2>&1 | head -50\ncargo clippy -- -D clippy::perf 2>&1 | head -20\ncargo check --all-targets 2>&1 | head -50","type":"text"}]},{"type":"paragraph","content":[{"text":"Edition 2024 note:","type":"text","marks":[{"type":"strong"}]},{"text":" Edition 2024 promotes several previously-warn lints to deny (notably ","type":"text"},{"text":"unsafe_op_in_unsafe_fn","type":"text","marks":[{"type":"code_inline"}]},{"text":"). If clippy or ","type":"text"},{"text":"cargo check","type":"text","marks":[{"type":"code_inline"}]},{"text":" already reports edition-related errors, do not duplicate those as review findings — instead note that the author must fix compiler errors first.","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Step 4: Detect Technologies","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"# Detect tokio async runtime\ngrep -r \"tokio\" --include=\"Cargo.toml\" -l | head -3\n\n# Detect axum web framework\ngrep -r \"axum\" --include=\"Cargo.toml\" -l | head -3\n\n# Detect sqlx database\ngrep -r \"sqlx\" --include=\"Cargo.toml\" -l | head -3\n\n# Detect serde serialization\ngrep -r \"serde\" --include=\"Cargo.toml\" -l | head -3\n\n# Detect thiserror / anyhow\ngrep -r \"thiserror\\|anyhow\" --include=\"Cargo.toml\" -l | head -3\n\n# Detect tracing\ngrep -r \"tracing\" --include=\"Cargo.toml\" -l | head -3\n\n# Check for test files in diff\ngit diff --name-only $(git merge-base HEAD main)..HEAD | grep -E '((^|/)(test|tests)/.*\\.rs$)|(_test\\.rs$)'\n\n# Check for unsafe code in diff\ngit diff $(git merge-base HEAD main)..HEAD -- '*.rs' | grep -c 'unsafe'\n\n# Detect async fn in traits (no async-trait crate needed since Rust 1.75)\ngrep -r \"async-trait\" --include=\"Cargo.toml\" -l | head -3\n\n# Detect LazyLock/LazyCell usage (replaces once_cell/lazy_static since 1.80)\ngrep -r \"once_cell\\|lazy_static\" --include=\"Cargo.toml\" -l | head -3\n\n# Detect #[expect] lint attribute usage (stable since 1.81)\ngit diff $(git merge-base HEAD main)..HEAD -- '*.rs' | grep -c '#\\[expect('\n\n# Detect macro definitions in diff\ngit diff $(git merge-base HEAD main)..HEAD -- '*.rs' | grep -cE 'macro_rules!|#\\[proc_macro|#\\[derive\\('\n\n# Detect FFI code in diff\ngit diff $(git merge-base HEAD main)..HEAD -- '*.rs' | grep -cE 'extern \"C\"|#\\[no_mangle\\]|#\\[repr\\(C\\)\\]|bindgen|#\\[unsafe\\(no_mangle\\)\\]'\n\n# Detect concurrency primitives (atomics, lock-free, hand-rolled sync)\ngit diff $(git merge-base HEAD main)..HEAD -- '*.rs' | grep -cE 'std::sync::atomic|Atomic(Bool|U?size|U?(8|16|32|64)|Ptr)|compare_exchange|fetch_(add|sub|or|and|xor|update)|UnsafeCell|unsafe impl (Send|Sync)|Ordering::(Relaxed|Acquire|Release|AcqRel|SeqCst)|atomic::fence'\n\n# Detect concurrency test tooling\ngrep -rE 'loom|^miri

Rust Code Review Arguments - : Spawn specialized subagents per technology area - Path: Target directory (default: current working directory) Hard gates Complete in order before writing Issues in the output (empty scope is allowed; fabricated findings are not). 1. Scope gate: You have an explicit list of paths under review (from Step 1 or the user-provided path). Pass: List printed or "No Rust files in scope" — then stop with no Issues. 2. Compiler/linter gate: Step 3 commands were run from the crate or workspace root ( present); if they cannot run, one line states why (e.g. missing toolchain,…

--include='Cargo.toml' -l | head -3\ngit diff $(git merge-base HEAD main)..HEAD -- '*.rs' | grep -cE 'loom::|#\\[cfg\\(loom\\)\\]|cfg_attr\\(miri'\n\n# Detect concurrency crates\ngrep -rE '^crossbeam|^arc-swap|^parking_lot|^dashmap|^flurry|^haphazard|^seize|^atomic_wait' --include='Cargo.toml' -l | head -3\n\n# Detect criterion benchmarks\ngrep -rE '^criterion' --include='Cargo.toml' -l | head -3\nls -d benches 2>/dev/null\n\n# Detect proc-macro crate or trybuild\ngrep -rE 'proc-macro\\s*=\\s*true|^trybuild' --include='Cargo.toml' -l | head -3\n\n# Detect public-surface changes (interface-design.md routing)\ngit diff $(git merge-base HEAD main)..HEAD -- '*.rs' | grep -cE '^\\+\\s*pub (trait|fn|struct|enum|mod|use)|^\\+\\s*impl[\u003c\\s].*Drop for'\n\n# Detect ecosystem patterns (patterns-in-the-wild.md routing)\ngrep -rE '^slotmap|^petgraph|^scopeguard|^indexmap' --include='Cargo.toml' -l | head -3\ngit diff $(git merge-base HEAD main)..HEAD -- '*.rs' | grep -cE 'mem::replace|swap_remove|prelude'","type":"text"}]},{"type":"paragraph","content":[{"text":"Modern Rust detection notes:","type":"text","marks":[{"type":"strong"}]}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"If ","type":"text"},{"text":"async-trait","type":"text","marks":[{"type":"code_inline"}]},{"text":" is a dependency but the project uses edition 2024 or MSRV >= 1.75, flag as Informational — native ","type":"text"},{"text":"async fn","type":"text","marks":[{"type":"code_inline"}]},{"text":" in traits is available and ","type":"text"},{"text":"async-trait","type":"text","marks":[{"type":"code_inline"}]},{"text":" can likely be removed.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"If ","type":"text"},{"text":"once_cell","type":"text","marks":[{"type":"code_inline"}]},{"text":" or ","type":"text"},{"text":"lazy_static","type":"text","marks":[{"type":"code_inline"}]},{"text":" is a dependency but MSRV >= 1.80, flag as Informational — ","type":"text"},{"text":"std::sync::LazyLock","type":"text","marks":[{"type":"code_inline"}]},{"text":" and ","type":"text"},{"text":"std::cell::LazyCell","type":"text","marks":[{"type":"code_inline"}]},{"text":" are stable replacements.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"If ","type":"text"},{"text":"#[allow(...)]","type":"text","marks":[{"type":"code_inline"}]},{"text":" is used where ","type":"text"},{"text":"#[expect(...)]","type":"text","marks":[{"type":"code_inline"}]},{"text":" would be better (MSRV >= 1.81), note as Minor — ","type":"text"},{"text":"#[expect]","type":"text","marks":[{"type":"code_inline"}]},{"text":" warns when the suppressed lint no longer fires, keeping suppressions clean.","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"Concurrency detection notes:","type":"text","marks":[{"type":"strong"}]}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"If atomics (","type":"text"},{"text":"std::sync::atomic","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"compare_exchange","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"fetch_*","type":"text","marks":[{"type":"code_inline"}]},{"text":"), ","type":"text"},{"text":"UnsafeCell","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"unsafe impl Send/Sync","type":"text","marks":[{"type":"code_inline"}]},{"text":", or ","type":"text"},{"text":"crossbeam","type":"text","marks":[{"type":"code_inline"}]},{"text":" / ","type":"text"},{"text":"arc-swap","type":"text","marks":[{"type":"code_inline"}]},{"text":" / ","type":"text"},{"text":"parking_lot","type":"text","marks":[{"type":"code_inline"}]},{"text":" are present in the diff, load ","type":"text"},{"text":"beagle-rust:rust-code-review","type":"text","marks":[{"type":"code_inline"}]},{"text":" and consult ","type":"text"},{"text":"references/concurrency-primitives.md","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"references/memory-ordering.md","type":"text","marks":[{"type":"code_inline"}]},{"text":", and ","type":"text"},{"text":"references/lock-free-patterns.md","type":"text","marks":[{"type":"code_inline"}]},{"text":".","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"If the diff introduces or restructures concurrency (worker pools, actor-style channels, ","type":"text"},{"text":"tokio::spawn","type":"text","marks":[{"type":"code_inline"}]},{"text":" patterns, threads-vs-async choices), also consult ","type":"text"},{"text":"references/concurrency-models.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" for design-level review questions.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"If hand-rolled atomics / lock-free types appear with no ","type":"text"},{"text":"loom","type":"text","marks":[{"type":"code_inline"}]},{"text":" dependency or no ","type":"text"},{"text":"cargo +nightly miri test","type":"text","marks":[{"type":"code_inline"}]},{"text":" in CI, load ","type":"text"},{"text":"beagle-rust:rust-testing-code-review","type":"text","marks":[{"type":"code_inline"}]},{"text":" and consult ","type":"text"},{"text":"references/concurrency-testing.md","type":"text","marks":[{"type":"code_inline"}]},{"text":".","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"Interface design / API surface detection:","type":"text","marks":[{"type":"strong"}]}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"If the diff introduces or changes ","type":"text"},{"text":"pub trait","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"pub fn","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"pub struct","type":"text","marks":[{"type":"code_inline"}]},{"text":", derive impls on public types, ","type":"text"},{"text":"impl Drop","type":"text","marks":[{"type":"code_inline"}]},{"text":" on owning types, or re-exports of foreign types, load ","type":"text"},{"text":"beagle-rust:rust-code-review","type":"text","marks":[{"type":"code_inline"}]},{"text":" and consult ","type":"text"},{"text":"references/interface-design.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" for object-safety, ergonomic-impl, fallible-destructor, and hidden-contract review checks.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"If the diff uses index-pointer graphs (","type":"text"},{"text":"Vec\u003cNode> + usize","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"slotmap","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"petgraph","type":"text","marks":[{"type":"code_inline"}]},{"text":"), ","type":"text"},{"text":"mem::replace","type":"text","marks":[{"type":"code_inline"}]},{"text":"-style drop guards, extension traits, or modifies a ","type":"text"},{"text":"prelude","type":"text","marks":[{"type":"code_inline"}]},{"text":" module, also consult ","type":"text"},{"text":"references/patterns-in-the-wild.md","type":"text","marks":[{"type":"code_inline"}]},{"text":".","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"Testing detection (criterion / trybuild / clippy strategy):","type":"text","marks":[{"type":"strong"}]}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"If ","type":"text"},{"text":"benches/","type":"text","marks":[{"type":"code_inline"}]},{"text":" directory or ","type":"text"},{"text":"criterion","type":"text","marks":[{"type":"code_inline"}]},{"text":" dependency is present, load ","type":"text"},{"text":"beagle-rust:rust-testing-code-review","type":"text","marks":[{"type":"code_inline"}]},{"text":" and consult ","type":"text"},{"text":"references/advanced-testing.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" for criterion baseline, ","type":"text"},{"text":"black_box","type":"text","marks":[{"type":"code_inline"}]},{"text":", and ","type":"text"},{"text":"iter_batched","type":"text","marks":[{"type":"code_inline"}]},{"text":" review checks.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"If proc-macro crate (","type":"text"},{"text":"proc-macro = true","type":"text","marks":[{"type":"code_inline"}]},{"text":") or ","type":"text"},{"text":"trybuild","type":"text","marks":[{"type":"code_inline"}]},{"text":" in ","type":"text"},{"text":"[dev-dependencies]","type":"text","marks":[{"type":"code_inline"}]},{"text":", consult ","type":"text"},{"text":"references/advanced-testing.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" for trybuild ","type":"text"},{"text":".stderr","type":"text","marks":[{"type":"code_inline"}]},{"text":" stability checks plus ","type":"text"},{"text":"beagle-rust:macros-code-review","type":"text","marks":[{"type":"code_inline"}]},{"text":" ","type":"text"},{"text":"references/procedural-macros.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" for span hygiene and ","type":"text"},{"text":"syn","type":"text","marks":[{"type":"code_inline"}]},{"text":" feature audits.","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Step 5: Load Verification Protocol","type":"text"}]},{"type":"paragraph","content":[{"text":"Load ","type":"text"},{"text":"beagle-rust:review-verification-protocol","type":"text","marks":[{"type":"code_inline"}]},{"text":" skill and keep its checklist in mind throughout the review.","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Step 6: Load Skills","type":"text"}]},{"type":"paragraph","content":[{"text":"Use the ","type":"text"},{"text":"Skill","type":"text","marks":[{"type":"code_inline"}]},{"text":" tool to load each applicable skill (e.g., ","type":"text"},{"text":"Skill(skill: \"beagle-rust:rust-code-review\")","type":"text","marks":[{"type":"code_inline"}]},{"text":").","type":"text"}]},{"type":"paragraph","content":[{"text":"Always load:","type":"text","marks":[{"type":"strong"}]}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"beagle-rust:rust-code-review","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"paragraph","content":[{"text":"Conditionally load based on detection:","type":"text","marks":[{"type":"strong"}]}]},{"type":"table","attrs":{"layout":null},"content":[{"type":"tr","content":[{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Condition","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Skill","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Tokio detected","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"beagle-rust:tokio-async-code-review","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Axum detected","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"beagle-rust:axum-code-review","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"sqlx detected","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"beagle-rust:sqlx-code-review","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Serde detected","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"beagle-rust:serde-code-review","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Test files changed","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"beagle-rust:rust-testing-code-review","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Macro definitions in diff","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"beagle-rust:macros-code-review","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"FFI code detected (extern, repr(C), bindgen)","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"beagle-rust:ffi-code-review","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Atomics, ","type":"text"},{"text":"UnsafeCell","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"unsafe impl Send/Sync","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"compare_exchange","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"crossbeam","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"arc-swap","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"parking_lot","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"beagle-rust:rust-code-review","type":"text","marks":[{"type":"code_inline"}]},{"text":" (load ","type":"text"},{"text":"references/concurrency-primitives.md","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"references/memory-ordering.md","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"references/lock-free-patterns.md","type":"text","marks":[{"type":"code_inline"}]},{"text":")","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Concurrency design changes (worker pools, channels, threads-vs-async restructuring)","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"beagle-rust:rust-code-review","type":"text","marks":[{"type":"code_inline"}]},{"text":" (load ","type":"text"},{"text":"references/concurrency-models.md","type":"text","marks":[{"type":"code_inline"}]},{"text":")","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Public trait / ","type":"text"},{"text":"pub fn","type":"text","marks":[{"type":"code_inline"}]},{"text":" / ","type":"text"},{"text":"pub struct","type":"text","marks":[{"type":"code_inline"}]},{"text":" / ","type":"text"},{"text":"impl Drop","type":"text","marks":[{"type":"code_inline"}]},{"text":" / re-export changes","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"beagle-rust:rust-code-review","type":"text","marks":[{"type":"code_inline"}]},{"text":" (load ","type":"text"},{"text":"references/interface-design.md","type":"text","marks":[{"type":"code_inline"}]},{"text":")","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Graph/tree code, ","type":"text"},{"text":"slotmap","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"petgraph","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"mem::replace","type":"text","marks":[{"type":"code_inline"}]},{"text":" drop guards, extension traits, ","type":"text"},{"text":"prelude","type":"text","marks":[{"type":"code_inline"}]},{"text":" module changes","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"beagle-rust:rust-code-review","type":"text","marks":[{"type":"code_inline"}]},{"text":" (load ","type":"text"},{"text":"references/patterns-in-the-wild.md","type":"text","marks":[{"type":"code_inline"}]},{"text":")","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"criterion","type":"text","marks":[{"type":"code_inline"}]},{"text":" benchmarks, ","type":"text"},{"text":"benches/","type":"text","marks":[{"type":"code_inline"}]},{"text":" directory","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"beagle-rust:rust-testing-code-review","type":"text","marks":[{"type":"code_inline"}]},{"text":" (load ","type":"text"},{"text":"references/advanced-testing.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" — criterion baseline + ","type":"text"},{"text":"black_box","type":"text","marks":[{"type":"code_inline"}]},{"text":" + ","type":"text"},{"text":"iter_batched","type":"text","marks":[{"type":"code_inline"}]},{"text":" checks)","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Proc-macro crate (","type":"text"},{"text":"proc-macro = true","type":"text","marks":[{"type":"code_inline"}]},{"text":") or ","type":"text"},{"text":"trybuild","type":"text","marks":[{"type":"code_inline"}]},{"text":" in dev-deps","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"beagle-rust:rust-testing-code-review","type":"text","marks":[{"type":"code_inline"}]},{"text":" + ","type":"text"},{"text":"beagle-rust:macros-code-review","type":"text","marks":[{"type":"code_inline"}]},{"text":" (load ","type":"text"},{"text":"references/advanced-testing.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" trybuild + ","type":"text"},{"text":"references/procedural-macros.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" span hygiene)","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"loom","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"miri","type":"text","marks":[{"type":"code_inline"}]},{"text":", hand-rolled lock-free code under test","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"beagle-rust:rust-testing-code-review","type":"text","marks":[{"type":"code_inline"}]},{"text":" (load ","type":"text"},{"text":"references/concurrency-testing.md","type":"text","marks":[{"type":"code_inline"}]},{"text":")","type":"text"}]}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Step 7: Review","type":"text"}]},{"type":"paragraph","content":[{"text":"Sequential (default):","type":"text","marks":[{"type":"strong"}]}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Load applicable skills","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Review core Rust quality (ownership, error handling, unsafe, traits)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Review detected technology areas","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Consolidate findings","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"Parallel (--parallel flag):","type":"text","marks":[{"type":"strong"}]}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Detect all technologies upfront","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Spawn one subagent per technology area with ","type":"text"},{"text":"Task","type":"text","marks":[{"type":"code_inline"}]},{"text":" tool","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Each agent loads its skill and reviews its domain","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Wait for all agents","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Consolidate findings","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Step 8: Verify Findings","type":"text"}]},{"type":"paragraph","content":[{"text":"Before reporting any issue:","type":"text"}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Re-read the actual code (not just diff context)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"For \"unused\" claims - did you search all references across the workspace?","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"For \"missing\" claims - did you check trait definitions, derive macros, and ","type":"text"},{"text":"#[cfg]","type":"text","marks":[{"type":"code_inline"}]},{"text":" gated code?","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"For \"unnecessary clone\" - did you verify the borrow checker allows a reference?","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"For \"unsafe\" issues - did you check the safety comments and surrounding invariants?","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Remove any findings that are style preferences, not actual issues","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"Edition 2024 verification rules:","type":"text","marks":[{"type":"strong"}]},{"text":" 7. Do NOT flag ","type":"text"},{"text":"unsafe {}","type":"text","marks":[{"type":"code_inline"}]},{"text":" blocks inside ","type":"text"},{"text":"unsafe fn","type":"text","marks":[{"type":"code_inline"}]},{"text":" as unnecessary — they are REQUIRED in edition 2024 8. Do NOT flag ","type":"text"},{"text":"unsafe extern \"C\"","type":"text","marks":[{"type":"code_inline"}]},{"text":" as unusual syntax — it is REQUIRED in edition 2024 9. Do NOT flag ","type":"text"},{"text":"#[unsafe(no_mangle)]","type":"text","marks":[{"type":"code_inline"}]},{"text":" or ","type":"text"},{"text":"#[unsafe(export_name)]","type":"text","marks":[{"type":"code_inline"}]},{"text":" as unusual — they are REQUIRED in edition 2024 10. For ","type":"text"},{"text":"-> impl Trait","type":"text","marks":[{"type":"code_inline"}]},{"text":" returns, verify whether implicit lifetime capture is intentional — in edition 2024 all in-scope lifetimes are captured by default; suggest ","type":"text"},{"text":"+ use\u003c'a>","type":"text","marks":[{"type":"code_inline"}]},{"text":" only when narrower capture is needed 11. For code using ","type":"text"},{"text":"Box\u003c[T]>","type":"text","marks":[{"type":"code_inline"}]},{"text":" in iterator contexts, remember ","type":"text"},{"text":"IntoIterator","type":"text","marks":[{"type":"code_inline"}]},{"text":" is now available in edition 2024 — do not flag ","type":"text"},{"text":".iter()","type":"text","marks":[{"type":"code_inline"}]},{"text":" on boxed slices as the only approach 12. If temporaries in ","type":"text"},{"text":"if let","type":"text","marks":[{"type":"code_inline"}]},{"text":" or tail expressions cause borrow issues, consider whether edition 2024's earlier drop semantics are the root cause","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Step 9: Review Convergence","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Single-Pass Completeness","type":"text"}]},{"type":"paragraph","content":[{"text":"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.","type":"text"}]},{"type":"paragraph","content":[{"text":"Before submitting findings, ask yourself:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"\"If all my recommended fixes are applied, will I find NEW issues in the fixed code?\"","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"\"Am I requesting new code (tests, types, modules) that will itself need review?\"","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"If yes to either: include those anticipated downstream issues NOW, in this review, so the author can address everything at once.","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Scope Rules","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Review ONLY the code in the diff and directly related existing code","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Do NOT request new features, test infrastructure, or architectural changes that didn't exist before the diff","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"If test coverage is missing, flag it as ONE Minor issue (\"Missing test coverage for X, Y, Z\") — do NOT specify implementation details","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Doc comments, naming issues are Minor unless they affect public API contracts","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Do NOT request adding new dependencies (e.g., proptest, mockall, criterion)","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Fix Complexity Budget","type":"text"}]},{"type":"paragraph","content":[{"text":"Fixes to existing code should be flagged at their real severity regardless of size.","type":"text"}]},{"type":"paragraph","content":[{"text":"However, requests for ","type":"text"},{"text":"net-new code that didn't exist before the diff","type":"text","marks":[{"type":"strong"}]},{"text":" must be classified as Informational:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Adding a new dependency","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Creating entirely new modules, files, or test suites","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Extracting new traits or abstractions","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Adding benchmark suites","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"These are improvement suggestions for the author to consider in future work, not review blockers.","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Iteration Policy","type":"text"}]},{"type":"paragraph","content":[{"text":"If this is a re-review after fixes were applied:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"ONLY verify that previously flagged issues were addressed correctly","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Do NOT introduce new findings unrelated to the previous review's issues","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Accept Minor/Nice-to-Have issues that weren't fixed — do not re-flag them","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"The goal of re-review is VERIFICATION, not discovery","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Output Format","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"markdown"},"content":[{"text":"## Review Summary\n\n[1-2 sentence overview of findings]\n\n## Issues\n\n### Critical (Blocking)\n\n1. [FILE:LINE] ISSUE_TITLE\n - Issue: Description of what's wrong\n - Why: Why this matters (unsound unsafe, data race, panic, security)\n - Fix: Specific recommended fix\n\n### Major (Should Fix)\n\n2. [FILE:LINE] ISSUE_TITLE\n - Issue: ...\n - Why: ...\n - Fix: ...\n\n### Minor (Nice to Have)\n\n14. [FILE:LINE] ISSUE_TITLE\n - Issue: ...\n - Why: ...\n - Fix: ...\n\n### Informational (For Awareness)\n\n14. [FILE:LINE] SUGGESTION_TITLE\n - Suggestion: ...\n - Rationale: ...\n\n## Good Patterns\n\n- [FILE:LINE] Pattern description (preserve this)\n\n## Verdict\n\nReady: Yes | No | With fixes 1-N (Critical/Major only; Minor items are acceptable)\nRationale: [1-2 sentences]","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Rules","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Complete ","type":"text"},{"text":"Hard gates","type":"text","marks":[{"type":"strong"}]},{"text":" before writing Issues","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Load skills BEFORE reviewing (not after)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Number every issue sequentially (1, 2, 3...)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Include FILE:LINE for each issue","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Separate Issue/Why/Fix clearly","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Categorize by actual severity","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Run clippy before flagging style issues","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Run verification after fixes","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Report ALL issues in a single pass — do not hold back findings for later iterations","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Re-reviews verify previous fixes ONLY — no new discovery","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Requests for net-new code (new modules, dependencies, test suites) are Informational, not blocking","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"The Verdict ignores Minor and Informational items — only Critical and Major block approval","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Post-Fix Verification","type":"text"}]},{"type":"paragraph","content":[{"text":"After fixes are applied, run:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"cargo check --all-targets\ncargo clippy --all-targets --all-features -- -D warnings\ncargo test --all-targets","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"All checks must pass before approval.","type":"text"}]}]},"metadata":{"date":"2026-06-05","name":"review-rust","author":"@skillopedia","source":{"stars":61,"repo_name":"beagle","origin_url":"https://github.com/existential-birds/beagle/blob/HEAD/plugins/beagle-rust/skills/review-rust/SKILL.md","repo_owner":"existential-birds","body_sha256":"e3d5bb20111462cf7946f983a30a699475f0391cc64167c069648a29716e29ae","cluster_key":"df4a466962e8e722c15e6eb295d4a2069d8ace31f3eee7999a6b09a8981a3402","clean_bundle":{"format":"clean-skill-bundle-v1","source":"existential-birds/beagle/plugins/beagle-rust/skills/review-rust/SKILL.md","bundle_sha256":"e1079b017a7fde1b4a4b19d9b9ee0e8580a3f215dda7f17e65364a3fd6e60a0b","attachment_count":0,"text_attachments":0,"binary_attachments":0},"cluster_size":1,"skill_md_path":"plugins/beagle-rust/skills/review-rust/SKILL.md","import_metadata":{"date":"2026-06-05","author":"@skillopedia","version":"v1","category":"software-engineering","category_label":"Engineering"},"exact_dupes_collapsed_into_this":0},"version":"v1","category":"software-engineering","import_tag":"clean-skills-v1","description":"Comprehensive Rust code review with optional parallel agents","disable-model-invocation":true}},"renderedAt":1782987389633}

Rust Code Review Arguments - : Spawn specialized subagents per technology area - Path: Target directory (default: current working directory) Hard gates Complete in order before writing Issues in the output (empty scope is allowed; fabricated findings are not). 1. Scope gate: You have an explicit list of paths under review (from Step 1 or the user-provided path). Pass: List printed or "No Rust files in scope" — then stop with no Issues. 2. Compiler/linter gate: Step 3 commands were run from the crate or workspace root ( present); if they cannot run, one line states why (e.g. missing toolchain,…