Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsBlogPro
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges
  • Chrome Extension
  • Skill Manager

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Rust Unsafe

ASecurity

Use when writing, reviewing, or auditing unsafe Rust, or understanding raw pointers, transmute, UnsafeCell, and safe abstractions over unsafe code.

54 stars
0 votes
0 copies
0 views
Added 9/20/2026
ai-agentsrustgodocumentation

Security Analysis

A100/100

Pro scans all 3 files and shows the line behind each finding

Scanned 9/20/2026

$npx -y skills add OutlineDriven/outline-driven-development --skill rust-unsafe --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Rust Unsafe?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Rust Unsafe
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/outlinedriven-rust-unsafe-outline-driven-development/badge)](https://www.skillsdirectory.com/skills/outlinedriven-rust-unsafe-outline-driven-development)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
Files
SKILL.md
---
name: rust-unsafe
description: 'Use when writing, reviewing, or auditing unsafe Rust, or understanding raw pointers, transmute, UnsafeCell, and safe abstractions over unsafe code.'
---

# Rust unsafe

## Contract

| Field | Bound contract |
|---|---|
| Trigger | Unsafe Rust code is being written, reviewed, or audited, or a user asks what requires `unsafe`, how to write safe wrappers, or how to use raw pointers, transmute, `UnsafeCell`, or `extern` functions. |
| Authority | Read-only. Chat output only. No remote mutation. |
| Side effect | Emits a structured guidance report and pointers to `references/unsafe-patterns.md`. |
| Done | A report is emitted that identifies the unsafe operations, invariants, audit checks, and recommended safe alternatives. |

## Inputs

1. **Code or diff** (required): the unsafe Rust to review.
2. **Audit focus** (optional): raw pointers, transmute, `UnsafeCell`, FFI, `Send`/`Sync`, or safe abstraction.
3. **Test plan** (optional): whether to run the code under Miri.

## Procedure

The `unsafe` keyword enables five capabilities. Match the code against the table before auditing each one.

| Capability | Example |
|---|---|
| Dereference raw pointers | `*const T`, `*mut T` |
| Call unsafe functions | `extern "C"` functions and `unsafe fn` |
| Access or modify mutable statics | `static mut X` |
| Implement unsafe traits | `unsafe impl Send for MyType` |
| Access union fields | `union` field access |

1. **Identify the unsafe capabilities used.** List which capabilities from the table the code uses. Done when: every `unsafe` capability in the code is named.
2. **Check raw pointer invariants.** For each raw pointer dereference, confirm it is non-null, aligned, points to initialized memory, does not violate aliasing, and is valid for the reference lifetime. Done when: all dereferences have documented invariants.
3. **Check unsafe functions and traits.** Verify each `unsafe fn` has a `/// # Safety` contract, each `unsafe trait` impl upholds the trait invariants, and each `unsafe impl Send`/`Sync` is justified by thread safety. Done when: all unsafe items have documented contracts.
4. **Check transmute and `UnsafeCell`.** Confirm the source and target types have the same size, the value is valid for the target type, and `UnsafeCell` uses are protected against concurrent mutation. Done when: transmute and interior-mutability uses are justified.
5. **Apply the audit checklist.** Use the checklist from `references/unsafe-patterns.md` and mark each item. Done when: the checklist is complete for every `unsafe` block.
6. **Recommend Miri tests.** Suggest `cargo +nightly miri test` for the unsafe code and `MIRIFLAGS="-Zmiri-strict-provenance"` for pointer-heavy code. Done when: a test plan is documented.
7. **Emit the report.** List findings, the relevant invariant, and the fix. Done when: the report is complete.

## Failure and recovery

| Failure class | Behavior |
|---|---|
| Missing `// Safety:` comment | Add one that lists every precondition the caller or caller-side code must uphold. |
| Raw pointer violates aliasing | Restructure to avoid simultaneous `&` and `&mut`, or use `UnsafeCell` with a documented ownership scheme. |
| Transmute creates an invalid value | Use safe conversions such as `TryFrom`, `f32::from_bits`, or `u32::from_ne_bytes`. |
| Manual `Send`/`Sync` impl is unsound | Remove the impl or prove thread safety with a Miri or concurrency test. |
| `unsafe` block is too large | Split it so that each `unsafe` operation has its own safety comment. |

## Output

1. A structured report naming each unsafe operation, its invariants, and any missing documentation.
2. A checklist result for each `unsafe` block.
3. A test plan that names Miri or sanitizer commands.
4. Pointers to `references/unsafe-patterns.md` for raw pointer, `NonNull`, transmute, and stacked borrows patterns.

Attribution

OutlineDrivenOutlineDriven
View sourceSee grades on GitHubMore from OutlineDriven →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Caveman

Terse caveman voice: answer first, fluff gone, every technical fact kept. Use for /caveman, "caveman mode", "talk like caveman", "be brief", "less tokens". Stays on until "stop caveman" or "normal mode".

1100021 votes

Hyperplan

Adversarial multi-agent planning skill. Self-orchestrates 5 hostile category members (unspecified-low, unspecified-high, deep, ultrabrain, artistry) via team-mode for ruthless cross-critique debate, distills only the defensible insights, then MANDATORILY hands the distilled insight bundle to the `plan` agent for executable plan formalization. Use when planning needs maximum rigor and surfacing of weak assumptions, blind spots, and over-engineering. Triggers: 'hyperplan', 'hpp', '/hyperplan', ...

698621 votes

Writing Skills

Create and manage Claude Code skills in HASH repository following Anthropic best practices. Use when creating new skills, modifying skill-rules.json, understanding trigger patterns, working with hooks, debugging skill activation, or implementing progressive disclosure. Covers skill structure, YAML frontmatter, trigger types (keywords, intent patterns), UserPromptSubmit hook, and the 500-line rule. Includes validation and debugging with SKILL_DEBUG. Examples include rust-error-stack, cargo-dep...

3931 votes

Mcp Code Execution

Routes multi-tool workflows through MCP servers for large datasets and pipelines. Use when Bash tool overhead is limiting throughput on data-heavy tasks.

3421 votes

catchup

Recovers the conversation and failed tool calls of a previous Codex, Amp, Claude Code, Antigravity, Cline, Copilot CLI, Cursor, DeepSeek Harness, Grok Build, Kimi, OpenCode, Pi Agent, or ZCode session. Use when the user says "catch up", "what did the last session do", "get me up to speed", "I switched agents", asks to recover/summarize a previous session before continuing, or asks to diagnose or report a catchup failure. Do NOT use for the current conversation, git history, or any non-agent log.

741 votes
View all in ai-agents →