Install any skill in seconds. Free to start, no credit card required.
Get Started Free →hashgraph-online/rust-unsafe-boundaries
Isolate and review unsafe Rust behind small, documented, testable boundaries with explicit invariants.
Passed 19 of 22 test cases with the skill, and 11 of 22 without it.
and 6 more in the full report
9 fixed10 passed either way2 still failing1 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 9 test cases the skill fixed. Same model, same prompt, with and without the skill.
I am writing a Rust function `free_raw_node<T>(ptr: *mut Node<T>)` that reclaims memory allocated by `Box::into_raw`. Provide the function definition including doc comments and internal memory deallocation.
| Checked | Without skill | With skill |
|---|---|---|
| The function doc comment includes a # Safety section detailing pointer ownership and allocator origin. | Passed | Passed |
| The Box::from_raw call is wrapped in an explicit unsafe block with a // SAFETY: comment. | Missed | Passed |
The instructions your model reads when the skill loads.
Use this skill to isolate unsafe Rust behind small, documented, testable boundaries. Unsafe code is acceptable only when a safe API cannot express the needed operation with acceptable correctness and performance.
// SAFETY: comment immediately before each unsafe block explaining
why every unsafe operation inside is valid.unsafe fn only when callers must uphold extra conditions.
Document those conditions in a # Safety section.unsafe_op_in_unsafe_fn; unsafe operations inside unsafe
functions should still be wrapped in explicit unsafe blocks.Read references/safety-invariants.md before adding or approving unsafe code.
MaybeUninit<T> over deprecated or ad hoc uninitialized memory
patterns.set_len, pointer arithmetic, or from_raw_parts without proving
capacity, initialization, and ownership.static mut; prefer OnceLock, LazyLock, atomics, or locked state.test cases passed, vs 11 / 22 without
More skills from the same source and nearby in the registry, with their headline benchmark lift.