一键导入
unsafe-review
Review Rust unsafe blocks for SAFETY comments (what/why/invariants). Use when writing or reviewing unsafe Rust.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Review Rust unsafe blocks for SAFETY comments (what/why/invariants). Use when writing or reviewing unsafe Rust.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Draft or refresh a Hugging Face model card (MODEL_CARD.md / README model section). Use when publishing BitNet/trit/HF checkpoints or training runs.
Run a minimal train/import smoke for ML crates (Rust or Python HF). Use before claiming a training path works.
Run the standard Rust local gate (fmt, clippy -D warnings, build, test). Use before commits/PRs on Rust crates.
Prepare code for git commit by running format checks, lints, tests, and generating a commit message. Use before committing changes.
Detect drift from tzervas fleet standards (workflows, badges, issue tiers, Copilot off). Use when auditing a repo or filing fleet-gap issues.
Two-pass pull request review — triage by size/risk, then grounded file:line checklist. Use when reviewing PRs or before merge.
| name | unsafe-review |
| description | Review Rust unsafe blocks for SAFETY comments (what/why/invariants). Use when writing or reviewing unsafe Rust. |
| metadata | {"author":"tz-forge","version":"1.0","source":"adapted from SpectreOS skills/unsafe-review (genericized)"} |
| allowed-tools | Bash(rg:*) Bash(git:*) |
Ensure every unsafe block documents why it is sound.
unsafe blocksunsafeEvery unsafe block MUST have a SAFETY: comment covering:
// SAFETY: `ptr` came from Box::into_raw on a T allocated in this module.
// Caller guarantees exclusive access until from_raw; alignment matches T.
// See module docs §Ownership.
unsafe {
let _ = Box::from_raw(ptr);
}
// SAFETY: this is fine
unsafe {
*p = 1;
}
rg -n "unsafe\s*(\{|fn|impl|trait|extern)" --type rust
For each hit, check:
SAFETY: (or equivalent) immediately aboveunsafe than neededCommon patterns:
bytemuck / safe castsUnsafe review
=============
Blocks found: N
Missing/weak SAFETY: (file:line …)
OK: (file:line …)
Verdict: pass | needs-work