[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6H1EHW3HCFT8R372EE2HGXF":3,"skill-same:01M6H1EHW3HCFT8R372EE2HGXF":74},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":41,"linkOnly":42,"markdownContent":43,"markdownBody":44,"frontMatter":45,"refName":46,"commitSha":47,"skillDirectory":48,"forksCount":49,"repositoryHtmlUrl":50,"repositoryHomepageUrl":6,"ownerHtmlUrl":51,"ownerBlogUrl":52,"ownerDescription":6,"updatedAt":53,"install":54,"resources":67},"01M6H1EHW3HCFT8R372EE2HGXF","review-rust",null,"Perform critical Rust code reviews covering correctness, edition 2024 compliance, error handling, API design, async pitfalls, and dependency hygiene. ALWAYS use this skill when the user wants to review, audit, or critically evaluate Rust code — whether that's a PR diff, a specific crate or module, a cross-cutting concern like error handling, or the whole codebase. This includes requests to \"review my changes\", \"check this code\", \"audit for best practices\", \"look for issues\", \"what's wrong with this\", or \"flag anything that could bite us\". Use it even when the user doesn't say \"review\" explicitly but is asking you to find problems, inconsistencies, or anti-patterns in existing Rust code. Do NOT use for requests to write, fix, refactor, test, explain, or implement code — only for evaluating existing code.","ractive\u002Fhyalo","ractive","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F783861?v=4","01M6H1E120XG8G9XFCVZZAF62C","Jean-Pierre Bergamin","01M6H1E169A4CHQA1DPW0CKZJM",29,"MIT","https:\u002F\u002Fgithub.com\u002Fractive\u002Fhyalo\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Freview-rust\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40],"review","rust","review rust","when","design","2024","my","pitfalls","reviews","you","error","dependency hygiene","critical","dependency","only","anti-patterns","fix","write","api","audit","issues","code","2026-11-10 10:12:30",false,"---\nname: review-rust\ndescription: >\n  Perform critical Rust code reviews covering correctness, edition 2024 compliance, error\n  handling, API design, async pitfalls, and dependency hygiene. ALWAYS use this skill when the\n  user wants to review, audit, or critically evaluate Rust code — whether that's a PR diff,\n  a specific crate or module, a cross-cutting concern like error handling, or the whole\n  codebase. This includes requests to \"review my changes\", \"check this code\", \"audit for best\n  practices\", \"look for issues\", \"what's wrong with this\", or \"flag anything that could bite\n  us\". Use it even when the user doesn't say \"review\" explicitly but is asking you to find\n  problems, inconsistencies, or anti-patterns in existing Rust code. Do NOT use for requests\n  to write, fix, refactor, test, explain, or implement code — only for evaluating existing code.\n---\n\n# Rust Code Review (Edition 2024)\n\nYou are performing a critical code review of Rust code targeting edition 2024. Your job is to\nfind real problems — not to rubber-stamp or nitpick formatting. Focus on correctness, safety,\nidiomatic patterns, and maintainability in that order.\n\n## Determine Review Scope\n\nFirst, figure out what you're reviewing:\n\n- **PR review**: Use `git diff` against the base branch to identify changed files. Focus review\n  on the diff, but read surrounding context to understand impact.\n- **Crate\u002Fmodule review**: Read the specified crate or module top-down. Start with `lib.rs` or\n  `mod.rs` to understand the public API surface, then drill into implementation.\n- **Full codebase review**: Start with `Cargo.toml` (workspace layout, edition, dependencies),\n  then review each crate systematically. Prioritize public API surfaces and core logic.\n\nFor PR reviews, also check:\n- Does the PR title\u002Fdescription match what the code actually does?\n- Are there unrelated changes mixed in?\n- Is the diff a reasonable size, or should it be split?\n\n## Review Process\n\nWork through these categories in order. Not every category applies to every review — skip\nsections that aren't relevant to the code at hand. Spend your time proportional to risk.\n\n### 1. Correctness\n\nThis is the most important category. Bugs ship when reviewers focus on style instead of logic.\n\n- **Logic errors**: Trace the happy path and key error paths mentally. Look for off-by-one,\n  wrong comparison operators, swapped arguments, incorrect boolean logic.\n- **Edge cases**: What happens with empty collections, zero values, `None`, maximum values,\n  concurrent access? Does the code handle them or silently produce wrong results?\n- **Error handling**: Are errors propagated correctly? Watch for `unwrap()` and `expect()` on\n  values that can legitimately fail at runtime. Using `?` is good — but is the error type\n  meaningful to the caller, or does it erase important context?\n- **Resource management**: Are files, connections, locks released properly? Rust's RAII helps,\n  but watch for `std::mem::forget`, leaked `Box::into_raw`, or holding locks across `.await`.\n- **Integer overflow**: Debug builds panic, release builds wrap. If the code does arithmetic on\n  user-provided values, are `checked_*` or `saturating_*` methods used?\n\n### 2. Rust 2024 Edition Compliance\n\nThe 2024 edition (Rust 1.85+) introduced breaking changes. Check that the code is compatible:\n\n- **`unsafe_op_in_unsafe_fn`**: Unsafe operations inside `unsafe fn` now require an explicit\n  `unsafe {}` block. The entire body is no longer implicitly unsafe. Each block should have a\n  `\u002F\u002F SAFETY:` comment.\n- **`unsafe` attributes**: `#[no_mangle]`, `#[export_name]`, and `#[link_section]` must be\n  written as `unsafe(...)` — e.g. `#[unsafe(no_mangle)]`. Flag bare uses.\n- **`unsafe extern` blocks**: `extern` blocks now require `unsafe extern`. Each item inside\n  can be individually marked `safe` if appropriate.\n- **`static mut` references denied**: Taking a reference to a `static mut` is a hard error.\n  Use `Mutex`, `OnceLock`, atomics, or raw pointers instead.\n- **RPIT lifetime capture**: Return-position `impl Trait` now captures ALL in-scope lifetime\n  parameters (not just type params as in 2021). This is the most impactful change. If the\n  hidden type doesn't live long enough, compilation fails. To opt out: `impl Trait + use\u003C>`.\n  Review any `-> impl Trait` signatures for accidental captures.\n- **Newly unsafe functions**: `std::env::set_var`, `std::env::remove_var`, and\n  `CommandExt::before_exec` are now unsafe. Flag bare calls.\n- **Macro fragment specifiers**: `expr` now matches `const {}` and `_` expressions. If a macro\n  relies on the old behavior, it should use `expr_2021`. Missing fragment specifiers are a hard\n  error.\n- **`dyn Trait` required**: Bare trait objects (without `dyn`) are a hard error.\n- **Reserved keywords**: `gen` is reserved. Identifiers using it need `r#gen`.\n  `#\"...\"#` guarded strings and `##` tokens are also reserved.\n- **Prelude additions**: `Future` and `IntoFuture` are in the 2024 prelude. Check for name\n  conflicts with local traits.\n- **Let chains**: `if let Some(x) = a && let Some(y) = b { ... }` is now valid. Prefer this\n  over nested `if let` when it improves readability.\n- **Match ergonomics**: `ref`, `mut`, `ref mut` capture modifiers are disallowed in patterns\n  that use auto-dereferencing (match ergonomics). Flag if encountered.\n- **Temporary scope changes**: Temporaries from tail expressions are now dropped before local\n  variables. Review code that relies on temporaries living until end of block.\n- **Never type coercion**: Changes to how `!` coerces may affect match arms and closures that\n  diverge.\n\n### 3. Ownership, Borrowing, and Lifetimes\n\nThese are where Rust-specific bugs hide that the compiler doesn't always catch at a design level.\n\n- **Unnecessary cloning**: `.clone()` to satisfy the borrow checker is sometimes needed, but\n  often signals a design issue. Can the function take a reference instead? Can the data be\n  restructured to avoid shared ownership?\n- **Lifetime over-constraint**: Are lifetime parameters more restrictive than necessary? A\n  function taking `&'a str` when it could take `&str` (elided) adds complexity without benefit.\n- **`Arc\u003CMutex\u003CT>>` smell**: Sometimes necessary, but often indicates the data ownership model\n  should be rethought. Consider channels, actor patterns, or restructuring.\n- **Returning references to temporaries**: The compiler catches the obvious cases, but complex\n  chains of method calls can obscure them.\n- **`Cow\u003C'_, T>` opportunities**: If code clones conditionally (clone on some paths, borrow on\n  others), `Cow` is the idiomatic pattern.\n\n### 4. API Design\n\nApply the [Rust API Guidelines](https:\u002F\u002Frust-lang.github.io\u002Fapi-guidelines\u002Fchecklist.html)\nwhere relevant:\n\n- **Naming**: Follow Rust conventions — `new()` for constructors, `into_*()` for consuming\n  conversions, `as_*()` for cheap reference conversions, `to_*()` for expensive conversions,\n  `is_*()` \u002F `has_*()` for boolean queries. Iterator-producing methods: `iter()`, `iter_mut()`,\n  `into_iter()`.\n- **Common trait implementations**: Types should derive or implement traits that users expect:\n  `Debug` (almost always), `Clone`, `PartialEq`, `Eq`, `Hash`, `Display` (for user-facing\n  types), `Default` (when a sensible default exists), `Send + Sync` (when possible).\n- **Error types**: Custom errors should implement `std::error::Error`, `Display`, and `Debug`.\n  Use `thiserror` for library errors, `anyhow` for application errors. Error variants should\n  carry enough context to be actionable.\n- **Builder pattern**: For structs with many optional fields, a builder is more ergonomic than\n  a constructor with many parameters. Check that builders validate at build time, not use time.\n- **Sealed traits**: If a trait is not meant to be implemented outside the crate, seal it.\n- **`#[must_use]`**: Functions that return a value where ignoring it is almost certainly a bug\n  (like `Result`) should be `#[must_use]`.\n- **`#[non_exhaustive]`**: Public enums and structs that may gain variants\u002Ffields in future\n  versions should use this to preserve semver compatibility.\n- **Type conversions**: Prefer `From`\u002F`Into` over custom conversion methods. `TryFrom`\u002F`TryInto`\n  for fallible conversions.\n\n### 5. Error Handling Patterns\n\nPoor error handling is the #1 source of production incidents in Rust services.\n\n- **`unwrap()` \u002F `expect()` audit**: Grep the code under review for `.unwrap()` and `.expect()`\n  calls. Every call site should be justified. In library code, they're almost never acceptable.\n  In application code, `expect()` with a descriptive message is tolerable only when the\n  invariant is truly guaranteed. Report each unjustified instance with file and line.\n- **Error context**: Bare `?` loses context. Prefer `.map_err(|e| ...)` or use `anyhow::Context`\n  \u002F `thiserror` to add \"what was being attempted\" to the error chain.\n- **Panicking in libraries**: Libraries should never panic on bad input. Return `Result` or\n  `Option`. Document when a function can panic (e.g., index out of bounds).\n- **Error granularity**: A single catch-all error enum with 20 variants is a smell. Group errors\n  by operation. Callers should be able to match on the variants they care about.\n- **`Box\u003Cdyn Error>`**: Fine for quick prototypes, but in published APIs it prevents callers\n  from matching on specific error types. Prefer concrete error types.\n\n### 6. Async Code\n\nAsync Rust has unique pitfalls beyond what the compiler catches.\n\n- **Holding locks across `.await`**: A `MutexGuard` held across an await point blocks the\n  executor. Use `tokio::sync::Mutex` if you must hold across awaits, or restructure to drop\n  the guard before awaiting.\n- **Blocking in async context**: `std::fs`, `std::thread::sleep`, CPU-heavy computation in\n  async tasks starve the executor. Use `tokio::fs`, `tokio::time::sleep`,\n  `tokio::task::spawn_blocking`.\n- **`Send` bounds**: If the future needs to be `Send` (most executors require this), all types\n  held across await points must be `Send`. Watch for `Rc`, `Cell`, `RefCell`.\n- **Cancellation safety**: When a future is dropped (e.g., in `tokio::select!`), is the\n  operation left in a consistent state? Partial writes, half-sent messages, leaked resources.\n- **Unnecessary `async`**: If a function doesn't actually await anything, it shouldn't be async.\n  The async machinery adds overhead.\n- **Spawning too many tasks**: `tokio::spawn` per request is fine; `tokio::spawn` per item in\n  a large collection might exhaust memory. Consider `FuturesUnordered` or `buffer_unordered`.\n\n### 7. Performance\n\nOnly flag performance issues that are likely to matter. Micro-optimizations in cold paths are\nnoise.\n\n- **Unnecessary allocations**: `String` where `&str` suffices, `Vec\u003Cu8>` where `&[u8]` works,\n  `format!()` in a hot loop.\n- **Iterator misuse**: Collecting into a `Vec` just to iterate again. Prefer chaining iterators.\n  Use `Iterator::size_hint()` and `Vec::with_capacity()` when the size is known.\n- **Large types on the stack**: Structs over ~1KB on the stack can blow it in deep recursion.\n  Box large types.\n- **`to_string()` \u002F `format!()` in Display impls**: Can cause infinite recursion or needless\n  allocation. Write directly to the formatter.\n- **Serialization overhead**: For APIs, check that serde attributes are used correctly —\n  `#[serde(rename_all = \"camelCase\")]`, skip unnecessary fields, use `#[serde(default)]`\n  judiciously.\n\n### 8. Dependencies and Cargo.toml\n\n- **Edition field**: Must be `edition = \"2024\"` in `Cargo.toml`. Flag if missing or outdated.\n- **Dependency versions**: Are versions pinned appropriately? Workspace dependencies should use\n  `workspace = true`. Watch for duplicated dependency specifications across workspace members.\n- **Feature flags**: Are default features disabled for dependencies that don't need them?\n  (`default-features = false`). Are feature flags additive (they should be — a feature should\n  never remove functionality)?\n- **Dev vs runtime dependencies**: Test-only dependencies belong in `[dev-dependencies]`. Build\n  tools in `[build-dependencies]`. Check that heavy deps like `tokio` with `full` feature aren't\n  pulled in unnecessarily.\n- **Duplicate dependencies**: Multiple versions of the same crate inflate compile times and\n  binary size. Flag when visible in `Cargo.lock`.\n- **Crate audit**: Are any dependencies unmaintained, known-vulnerable, or from untrusted\n  sources? Consider `cargo audit` and `cargo deny` checks.\n\n### 9. Testing\n\n- **Coverage of critical paths**: Are the happy path, error paths, and edge cases tested?\n  Untested error handling is as bad as no error handling.\n- **Test isolation**: Do tests depend on external state (network, filesystem, environment\n  variables)? They should be hermetic or clearly marked as integration tests.\n- **Assertion quality**: `assert!(result.is_ok())` loses the error message on failure. Prefer\n  `result.unwrap()` in tests, or pattern match with a descriptive panic message.\n- **Mock boundaries**: If the code uses trait objects or generics for testability, is the\n  boundary at the right level? Too fine-grained mocking tests implementation details, not\n  behavior.\n\n### 10. Documentation\n\nOnly flag missing documentation that would actually help someone. Don't demand docs on every\nprivate helper.\n\n- **Public API**: All `pub` items in library crates should have doc comments explaining what\n  they do, not how they're implemented.\n- **Examples**: Complex APIs benefit from `\u002F\u002F\u002F # Examples` blocks that compile and run as tests.\n- **Safety docs**: Every `unsafe` block must have a `\u002F\u002F SAFETY:` comment explaining why the\n  invariants are upheld. Every `unsafe fn` must document what the caller must guarantee.\n- **Panics section**: If a public function can panic, document when with `\u002F\u002F\u002F # Panics`.\n- **Errors section**: If a function returns `Result`, document the error conditions with\n  `\u002F\u002F\u002F # Errors`.\n\n### 11. Tooling Checks\n\nAs part of the review, run these tools and incorporate their output:\n\n- **`cargo check`**: Verify the code compiles. Report any errors or warnings.\n- **`cargo clippy -- -W clippy::pedantic`**: Run clippy with pedantic lints. Don't blindly\n  report every lint — assess which ones point to real issues vs noise. Key lints to watch:\n  `needless_collect`, `large_enum_variant`, `redundant_allocation`, `manual_map`,\n  `missing_errors_doc`, `missing_panics_doc`.\n- **`cargo test`**: Run the test suite. Report failures. Note if test coverage seems thin for\n  the code under review.\n- **rust-analyzer**: Use the LSP for go-to-definition, find-references, and type information\n  when you need to trace how a type or function is used across the codebase.\n\n## Output Format\n\nStructure your review as follows:\n\n### Summary\n\nOne paragraph: what the code does, overall quality assessment, whether it's ready to ship.\n\n### Critical Issues\n\nProblems that must be fixed before merging. These are bugs, safety issues, or correctness\nproblems. Each item should include:\n- File and line reference\n- What the problem is\n- Why it matters\n- Suggested fix\n\n### Improvements\n\nThings that should be addressed but aren't blocking. Design issues, missing error context,\nsuboptimal patterns. Same format as critical issues.\n\n### Observations\n\nMinor notes, style suggestions, questions for the author. Keep this section short — if you\nhave more than 5 items here, some of them probably aren't worth mentioning.\n\n### Edition 2024 Compliance\n\nOnly include this section if there are actual edition-related findings. Don't include it just\nto say \"everything looks fine.\"\n\n---\n\nKeep the review proportional to the code size. A 50-line change doesn't need a 500-line review.\nFocus on what matters most and skip the rest. If the code is genuinely good, say so briefly and\nmove on — don't manufacture feedback.\n","# Rust Code Review (Edition 2024)\n\nYou are performing a critical code review of Rust code targeting edition 2024. Your job is to\nfind real problems — not to rubber-stamp or nitpick formatting. Focus on correctness, safety,\nidiomatic patterns, and maintainability in that order.\n\n## Determine Review Scope\n\nFirst, figure out what you're reviewing:\n\n- **PR review**: Use `git diff` against the base branch to identify changed files. Focus review\n  on the diff, but read surrounding context to understand impact.\n- **Crate\u002Fmodule review**: Read the specified crate or module top-down. Start with `lib.rs` or\n  `mod.rs` to understand the public API surface, then drill into implementation.\n- **Full codebase review**: Start with `Cargo.toml` (workspace layout, edition, dependencies),\n  then review each crate systematically. Prioritize public API surfaces and core logic.\n\nFor PR reviews, also check:\n- Does the PR title\u002Fdescription match what the code actually does?\n- Are there unrelated changes mixed in?\n- Is the diff a reasonable size, or should it be split?\n\n## Review Process\n\nWork through these categories in order. Not every category applies to every review — skip\nsections that aren't relevant to the code at hand. Spend your time proportional to risk.\n\n### 1. Correctness\n\nThis is the most important category. Bugs ship when reviewers focus on style instead of logic.\n\n- **Logic errors**: Trace the happy path and key error paths mentally. Look for off-by-one,\n  wrong comparison operators, swapped arguments, incorrect boolean logic.\n- **Edge cases**: What happens with empty collections, zero values, `None`, maximum values,\n  concurrent access? Does the code handle them or silently produce wrong results?\n- **Error handling**: Are errors propagated correctly? Watch for `unwrap()` and `expect()` on\n  values that can legitimately fail at runtime. Using `?` is good — but is the error type\n  meaningful to the caller, or does it erase important context?\n- **Resource management**: Are files, connections, locks released properly? Rust's RAII helps,\n  but watch for `std::mem::forget`, leaked `Box::into_raw`, or holding locks across `.await`.\n- **Integer overflow**: Debug builds panic, release builds wrap. If the code does arithmetic on\n  user-provided values, are `checked_*` or `saturating_*` methods used?\n\n### 2. Rust 2024 Edition Compliance\n\nThe 2024 edition (Rust 1.85+) introduced breaking changes. Check that the code is compatible:\n\n- **`unsafe_op_in_unsafe_fn`**: Unsafe operations inside `unsafe fn` now require an explicit\n  `unsafe {}` block. The entire body is no longer implicitly unsafe. Each block should have a\n  `\u002F\u002F SAFETY:` comment.\n- **`unsafe` attributes**: `#[no_mangle]`, `#[export_name]`, and `#[link_section]` must be\n  written as `unsafe(...)` — e.g. `#[unsafe(no_mangle)]`. Flag bare uses.\n- **`unsafe extern` blocks**: `extern` blocks now require `unsafe extern`. Each item inside\n  can be individually marked `safe` if appropriate.\n- **`static mut` references denied**: Taking a reference to a `static mut` is a hard error.\n  Use `Mutex`, `OnceLock`, atomics, or raw pointers instead.\n- **RPIT lifetime capture**: Return-position `impl Trait` now captures ALL in-scope lifetime\n  parameters (not just type params as in 2021). This is the most impactful change. If the\n  hidden type doesn't live long enough, compilation fails. To opt out: `impl Trait + use\u003C>`.\n  Review any `-> impl Trait` signatures for accidental captures.\n- **Newly unsafe functions**: `std::env::set_var`, `std::env::remove_var`, and\n  `CommandExt::before_exec` are now unsafe. Flag bare calls.\n- **Macro fragment specifiers**: `expr` now matches `const {}` and `_` expressions. If a macro\n  relies on the old behavior, it should use `expr_2021`. Missing fragment specifiers are a hard\n  error.\n- **`dyn Trait` required**: Bare trait objects (without `dyn`) are a hard error.\n- **Reserved keywords**: `gen` is reserved. Identifiers using it need `r#gen`.\n  `#\"...\"#` guarded strings and `##` tokens are also reserved.\n- **Prelude additions**: `Future` and `IntoFuture` are in the 2024 prelude. Check for name\n  conflicts with local traits.\n- **Let chains**: `if let Some(x) = a && let Some(y) = b { ... }` is now valid. Prefer this\n  over nested `if let` when it improves readability.\n- **Match ergonomics**: `ref`, `mut`, `ref mut` capture modifiers are disallowed in patterns\n  that use auto-dereferencing (match ergonomics). Flag if encountered.\n- **Temporary scope changes**: Temporaries from tail expressions are now dropped before local\n  variables. Review code that relies on temporaries living until end of block.\n- **Never type coercion**: Changes to how `!` coerces may affect match arms and closures that\n  diverge.\n\n### 3. Ownership, Borrowing, and Lifetimes\n\nThese are where Rust-specific bugs hide that the compiler doesn't always catch at a design level.\n\n- **Unnecessary cloning**: `.clone()` to satisfy the borrow checker is sometimes needed, but\n  often signals a design issue. Can the function take a reference instead? Can the data be\n  restructured to avoid shared ownership?\n- **Lifetime over-constraint**: Are lifetime parameters more restrictive than necessary? A\n  function taking `&'a str` when it could take `&str` (elided) adds complexity without benefit.\n- **`Arc\u003CMutex\u003CT>>` smell**: Sometimes necessary, but often indicates the data ownership model\n  should be rethought. Consider channels, actor patterns, or restructuring.\n- **Returning references to temporaries**: The compiler catches the obvious cases, but complex\n  chains of method calls can obscure them.\n- **`Cow\u003C'_, T>` opportunities**: If code clones conditionally (clone on some paths, borrow on\n  others), `Cow` is the idiomatic pattern.\n\n### 4. API Design\n\nApply the [Rust API Guidelines](https:\u002F\u002Frust-lang.github.io\u002Fapi-guidelines\u002Fchecklist.html)\nwhere relevant:\n\n- **Naming**: Follow Rust conventions — `new()` for constructors, `into_*()` for consuming\n  conversions, `as_*()` for cheap reference conversions, `to_*()` for expensive conversions,\n  `is_*()` \u002F `has_*()` for boolean queries. Iterator-producing methods: `iter()`, `iter_mut()`,\n  `into_iter()`.\n- **Common trait implementations**: Types should derive or implement traits that users expect:\n  `Debug` (almost always), `Clone`, `PartialEq`, `Eq`, `Hash`, `Display` (for user-facing\n  types), `Default` (when a sensible default exists), `Send + Sync` (when possible).\n- **Error types**: Custom errors should implement `std::error::Error`, `Display`, and `Debug`.\n  Use `thiserror` for library errors, `anyhow` for application errors. Error variants should\n  carry enough context to be actionable.\n- **Builder pattern**: For structs with many optional fields, a builder is more ergonomic than\n  a constructor with many parameters. Check that builders validate at build time, not use time.\n- **Sealed traits**: If a trait is not meant to be implemented outside the crate, seal it.\n- **`#[must_use]`**: Functions that return a value where ignoring it is almost certainly a bug\n  (like `Result`) should be `#[must_use]`.\n- **`#[non_exhaustive]`**: Public enums and structs that may gain variants\u002Ffields in future\n  versions should use this to preserve semver compatibility.\n- **Type conversions**: Prefer `From`\u002F`Into` over custom conversion methods. `TryFrom`\u002F`TryInto`\n  for fallible conversions.\n\n### 5. Error Handling Patterns\n\nPoor error handling is the #1 source of production incidents in Rust services.\n\n- **`unwrap()` \u002F `expect()` audit**: Grep the code under review for `.unwrap()` and `.expect()`\n  calls. Every call site should be justified. In library code, they're almost never acceptable.\n  In application code, `expect()` with a descriptive message is tolerable only when the\n  invariant is truly guaranteed. Report each unjustified instance with file and line.\n- **Error context**: Bare `?` loses context. Prefer `.map_err(|e| ...)` or use `anyhow::Context`\n  \u002F `thiserror` to add \"what was being attempted\" to the error chain.\n- **Panicking in libraries**: Libraries should never panic on bad input. Return `Result` or\n  `Option`. Document when a function can panic (e.g., index out of bounds).\n- **Error granularity**: A single catch-all error enum with 20 variants is a smell. Group errors\n  by operation. Callers should be able to match on the variants they care about.\n- **`Box\u003Cdyn Error>`**: Fine for quick prototypes, but in published APIs it prevents callers\n  from matching on specific error types. Prefer concrete error types.\n\n### 6. Async Code\n\nAsync Rust has unique pitfalls beyond what the compiler catches.\n\n- **Holding locks across `.await`**: A `MutexGuard` held across an await point blocks the\n  executor. Use `tokio::sync::Mutex` if you must hold across awaits, or restructure to drop\n  the guard before awaiting.\n- **Blocking in async context**: `std::fs`, `std::thread::sleep`, CPU-heavy computation in\n  async tasks starve the executor. Use `tokio::fs`, `tokio::time::sleep`,\n  `tokio::task::spawn_blocking`.\n- **`Send` bounds**: If the future needs to be `Send` (most executors require this), all types\n  held across await points must be `Send`. Watch for `Rc`, `Cell`, `RefCell`.\n- **Cancellation safety**: When a future is dropped (e.g., in `tokio::select!`), is the\n  operation left in a consistent state? Partial writes, half-sent messages, leaked resources.\n- **Unnecessary `async`**: If a function doesn't actually await anything, it shouldn't be async.\n  The async machinery adds overhead.\n- **Spawning too many tasks**: `tokio::spawn` per request is fine; `tokio::spawn` per item in\n  a large collection might exhaust memory. Consider `FuturesUnordered` or `buffer_unordered`.\n\n### 7. Performance\n\nOnly flag performance issues that are likely to matter. Micro-optimizations in cold paths are\nnoise.\n\n- **Unnecessary allocations**: `String` where `&str` suffices, `Vec\u003Cu8>` where `&[u8]` works,\n  `format!()` in a hot loop.\n- **Iterator misuse**: Collecting into a `Vec` just to iterate again. Prefer chaining iterators.\n  Use `Iterator::size_hint()` and `Vec::with_capacity()` when the size is known.\n- **Large types on the stack**: Structs over ~1KB on the stack can blow it in deep recursion.\n  Box large types.\n- **`to_string()` \u002F `format!()` in Display impls**: Can cause infinite recursion or needless\n  allocation. Write directly to the formatter.\n- **Serialization overhead**: For APIs, check that serde attributes are used correctly —\n  `#[serde(rename_all = \"camelCase\")]`, skip unnecessary fields, use `#[serde(default)]`\n  judiciously.\n\n### 8. Dependencies and Cargo.toml\n\n- **Edition field**: Must be `edition = \"2024\"` in `Cargo.toml`. Flag if missing or outdated.\n- **Dependency versions**: Are versions pinned appropriately? Workspace dependencies should use\n  `workspace = true`. Watch for duplicated dependency specifications across workspace members.\n- **Feature flags**: Are default features disabled for dependencies that don't need them?\n  (`default-features = false`). Are feature flags additive (they should be — a feature should\n  never remove functionality)?\n- **Dev vs runtime dependencies**: Test-only dependencies belong in `[dev-dependencies]`. Build\n  tools in `[build-dependencies]`. Check that heavy deps like `tokio` with `full` feature aren't\n  pulled in unnecessarily.\n- **Duplicate dependencies**: Multiple versions of the same crate inflate compile times and\n  binary size. Flag when visible in `Cargo.lock`.\n- **Crate audit**: Are any dependencies unmaintained, known-vulnerable, or from untrusted\n  sources? Consider `cargo audit` and `cargo deny` checks.\n\n### 9. Testing\n\n- **Coverage of critical paths**: Are the happy path, error paths, and edge cases tested?\n  Untested error handling is as bad as no error handling.\n- **Test isolation**: Do tests depend on external state (network, filesystem, environment\n  variables)? They should be hermetic or clearly marked as integration tests.\n- **Assertion quality**: `assert!(result.is_ok())` loses the error message on failure. Prefer\n  `result.unwrap()` in tests, or pattern match with a descriptive panic message.\n- **Mock boundaries**: If the code uses trait objects or generics for testability, is the\n  boundary at the right level? Too fine-grained mocking tests implementation details, not\n  behavior.\n\n### 10. Documentation\n\nOnly flag missing documentation that would actually help someone. Don't demand docs on every\nprivate helper.\n\n- **Public API**: All `pub` items in library crates should have doc comments explaining what\n  they do, not how they're implemented.\n- **Examples**: Complex APIs benefit from `\u002F\u002F\u002F # Examples` blocks that compile and run as tests.\n- **Safety docs**: Every `unsafe` block must have a `\u002F\u002F SAFETY:` comment explaining why the\n  invariants are upheld. Every `unsafe fn` must document what the caller must guarantee.\n- **Panics section**: If a public function can panic, document when with `\u002F\u002F\u002F # Panics`.\n- **Errors section**: If a function returns `Result`, document the error conditions with\n  `\u002F\u002F\u002F # Errors`.\n\n### 11. Tooling Checks\n\nAs part of the review, run these tools and incorporate their output:\n\n- **`cargo check`**: Verify the code compiles. Report any errors or warnings.\n- **`cargo clippy -- -W clippy::pedantic`**: Run clippy with pedantic lints. Don't blindly\n  report every lint — assess which ones point to real issues vs noise. Key lints to watch:\n  `needless_collect`, `large_enum_variant`, `redundant_allocation`, `manual_map`,\n  `missing_errors_doc`, `missing_panics_doc`.\n- **`cargo test`**: Run the test suite. Report failures. Note if test coverage seems thin for\n  the code under review.\n- **rust-analyzer**: Use the LSP for go-to-definition, find-references, and type information\n  when you need to trace how a type or function is used across the codebase.\n\n## Output Format\n\nStructure your review as follows:\n\n### Summary\n\nOne paragraph: what the code does, overall quality assessment, whether it's ready to ship.\n\n### Critical Issues\n\nProblems that must be fixed before merging. These are bugs, safety issues, or correctness\nproblems. Each item should include:\n- File and line reference\n- What the problem is\n- Why it matters\n- Suggested fix\n\n### Improvements\n\nThings that should be addressed but aren't blocking. Design issues, missing error context,\nsuboptimal patterns. Same format as critical issues.\n\n### Observations\n\nMinor notes, style suggestions, questions for the author. Keep this section short — if you\nhave more than 5 items here, some of them probably aren't worth mentioning.\n\n### Edition 2024 Compliance\n\nOnly include this section if there are actual edition-related findings. Don't include it just\nto say \"everything looks fine.\"\n\n---\n\nKeep the review proportional to the code size. A 50-line change doesn't need a 500-line review.\nFocus on what matters most and skip the rest. If the code is genuinely good, say so briefly and\nmove on — don't manufacture feedback.\n",{"name":5,"description":7},"main","e6ec4173f18cc4a0ed1e36eb19ef6ebdc19b8f02",".claude\u002Fskills\u002Freview-rust",2,"https:\u002F\u002Fgithub.com\u002Fractive\u002Fhyalo","https:\u002F\u002Fgithub.com\u002Fractive","https:\u002F\u002Fractive.ch","2026-11-13 19:09:46",{"source":8,"skillName":5,"commands":55,"prompt":65,"zipAvailable":66},[56,59,62],{"tool":57,"command":58},"npx","npx skills add ractive\u002Fhyalo --skill review-rust",{"tool":60,"command":61},"bunx","bunx skills add ractive\u002Fhyalo --skill review-rust",{"tool":63,"command":64},"pnpm","pnpm dlx skills add ractive\u002Fhyalo --skill review-rust","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fractive\u002Fhyalo\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Freview-rust\u002FSKILL.md",true,[68],{"path":69,"resourceType":70,"resourceTypeDesc":71,"sizeBytes":72,"sourceHtmlUrl":73},"evals\u002Fevals.json","REFERENCE","参考文档",1811,"https:\u002F\u002Fgithub.com\u002Fractive\u002Fhyalo\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Freview-rust\u002Fevals\u002Fevals.json",[75,93,110,125,142,156],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":41},"01M6H1GJ8EK138Y9VRGMD0ZXWC","hyalo-tidy","Audit or tidy a Hyalo knowledgebase for broken links, orphan documents, stale content, and inconsistent metadata.","https:\u002F\u002Fgithub.com\u002Fractive\u002Fhyalo\u002Fblob\u002Fmain\u002Fplugins\u002Fhyalo\u002Fskills\u002Fhyalo-tidy\u002FSKILL.md",[],[82,83,84,85,86,87,88,89,38,90,91,92],"hyalo","hyalo tidy","tidy","for","links","orphan","stale","broken","metadata","content","documents",{"skillNo":94,"name":82,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":41},"01M6H1GNEXF2BA4DDAB7FSGGFE","Search and edit structured markdown knowledgebases with the Hyalo CLI: frontmatter, tags, tasks, links, and document structure.","https:\u002F\u002Fgithub.com\u002Fractive\u002Fhyalo\u002Fblob\u002Fmain\u002Fplugins\u002Fhyalo\u002Fskills\u002Fhyalo\u002FSKILL.md",[],[82,99,100,101,102,103,104,105,106,107,108,86,109],"cli","tasks","search","markdown","edit","document","structure","structured","tags","with","frontmatter",{"skillNo":111,"name":112,"nameZh":6,"description":113,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":114,"categories":115,"keywords":116,"publishedAt":41},"01M6H1GEPA24F7PF5RQFHX3GXY","hyalo-skills","Validate and maintain Agent Skills collections using Hyalo's skills profile, including Codex and Claude skill directories.","https:\u002F\u002Fgithub.com\u002Fractive\u002Fhyalo\u002Fblob\u002Fmain\u002Fplugins\u002Fhyalo\u002Fskills\u002Fhyalo-skills\u002FSKILL.md",[],[117,82,118,119,120,121,122,123,124],"hyalo skills","directories","maintain","collections","codex","validate","profile","claude skill",{"skillNo":126,"name":127,"nameZh":6,"description":128,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":129,"categories":130,"keywords":131,"publishedAt":41},"01M6H1G8ZJJYJW7T7TN9S1VXKZ","hyalo-okf","Maintain Open Knowledge Format vaults with Hyalo's OKF index, log, and conformance commands.","https:\u002F\u002Fgithub.com\u002Fractive\u002Fhyalo\u002Fblob\u002Fmain\u002Fplugins\u002Fhyalo\u002Fskills\u002Fhyalo-okf\u002FSKILL.md",[],[82,132,133,134,135,136,137,138,119,139,140,108,141],"hyalo okf","okf","index","open","knowledge","format","log","vaults","commands","conformance",{"skillNo":143,"name":144,"nameZh":6,"description":145,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":146,"categories":147,"keywords":148,"publishedAt":41},"01M6H1G5SPS4RN422EWZYP5VJX","hyalo-madr","Maintain Markdown Architecture Decision Records with Hyalo's MADR profile and table-of-contents commands.","https:\u002F\u002Fgithub.com\u002Fractive\u002Fhyalo\u002Fblob\u002Fmain\u002Fplugins\u002Fhyalo\u002Fskills\u002Fhyalo-madr\u002FSKILL.md",[],[149,82,150,102,151,152,123,119,140,153,108,154,155],"hyalo madr","architecture decision records","table","decision","records","architecture decision","architecture",{"skillNo":157,"name":158,"nameZh":6,"description":159,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":160,"categories":161,"keywords":162,"publishedAt":41},"01M6H1G17683QH3EZT06SX075Q","hyalo-changelog","Maintain Keep a Changelog files with Hyalo's changelog profile and add\u002Frelease commands.","https:\u002F\u002Fgithub.com\u002Fractive\u002Fhyalo\u002Fblob\u002Fmain\u002Fplugins\u002Fhyalo\u002Fskills\u002Fhyalo-changelog\u002FSKILL.md",[],[163,82,164,119,140,165,166,123,108,167,168],"changelog","hyalo changelog","add","files","release","keep"]