What problem does it solve? Rust developers routinely guess when deciding between borrowed and owned data at API boundaries, or when clone cost drives a data-structure choice. Wrong guesses cause silent allocation blowups, lifetime-infected structs, quadratic version histories, and HashMap lookups that miss present keys. This Skill replaces guessing with measured allocation counts, decision tables, and verification checks. ## Core Features & Use Cases - Cow decision routing: Decision tables route you to the right pattern for Cow<str> in return or argument position, to_mut() misuse, Cow struct fields, and the borrowed-half parameter rule, each backed by measured allocation counts. - Borrow and ToOwned contract repair: Diagnoses and fixes HashMap::get misses caused by Hash/Eq/Borrow contract violations, E0283 ambiguity, E0119 ToOwned conflicts, and unsized newtype pairs like CiStr/CiString. - Persistent collection selection: Compares Vec against im, imbl, and rpds with a measured cost table, covers the rpds Send trap and the 585x write-cost API split, and gates the dependency tree with cargo-deny or cargo audit. - Use Case: You are about to return String from a normalize function where 95% of inputs change nothing. The Skill shows Cow<', str> cuts allocations from 1000 to 50, warns that one caller-side .into_owned() cancels the win, and gives you a counting allocator to verify on your own workload. ## Quick Start Ask the agent to apply the rust-copy-on-write skill to review whether a function returning String should return Cow<', str> instead, and to verify the allocation savings on real input.