Review Rust code for advanced architectural patterns — capability mixins, typed commands, concurrency model choice, smart pointer/interior mutability selection, error-handling architecture, and memory layout. Use when the user asks to review system architecture, suggest broad design improvements, or evaluate trait composition and shared-state strategy in a Rust project. For ports-and-adapters layering specifically, prefer `hexagonal_review`.
Review a Rust codebase for hexagonal architecture compliance — dependency direction, port shape, adapter grouping, error boundaries, feature-flag placement, and testability. Use when the user asks to review architecture, audit layering, check ports-and-adapters discipline, or evaluate whether a Rust project's structure is sound.
Refactor Rust code toward idiomatic patterns — generics vs dyn, associated vs generic trait parameters, enum dispatch, extension traits, closure bounds, iterator combinators, API ergonomics (Into/AsRef/Cow), and clean error propagation. Use when the user asks to make code more idiomatic, clean up a function, choose between dispatch strategies, or tighten an API surface.
Guide an incremental migration of an existing Rust codebase toward ports-and-adapters / hexagonal architecture. Use when the user wants to refactor a tangled service, extract a domain core, introduce port traits, or split a monolithic module into domain/port/adapter layers without a big-bang rewrite.