unsafe-audit

Audit unsafe blocks in the Moon codebase for soundness and safety comments.

2|Updated Mar 26, 2026
One-click install
npx skills add https://github.com/pilotspace/moon --skill unsafe-audit
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: unsafe-audit
Source: https://github.com/pilotspace/moon/tree/main/.claude/skills/unsafe-audit
Command: npx skills add https://github.com/pilotspace/moon --skill unsafe-audit

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill audits all unsafe blocks in the Moon codebase to assess soundness, missing SAFETY comments, and potential undefined behavior.

Core Features & Use Cases

  • Identify every unsafe block and verify SAFETY: comments are present and accurate.
  • Validate type invariants, pointer arithmetic bounds, and proper Drop order.
  • Produce a severity-ranked report highlighting new unsafe blocks vs main.

Quick Start

Run the audit across the Moon source to locate unsafe blocks and generate a severity-ranked report.

Frequently Asked Questions about unsafe-audit

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I audit unsafe Rust blocks for soundness and undefined behavior?

Auditing unsafe Rust blocks requires verifying type invariants, pointer arithmetic bounds, and proper Drop order to assess soundness and prevent undefined behavior. This process checks safety attributes and invariants across storage, IO, and runtime code.

What is a SAFETY comment in Rust and when do I need it for an unsafe block?

A SAFETY comment documents why an unsafe Rust block is sound and upholds the required invariants to prevent undefined behavior. You need it for every unsafe block to validate safety attributes and ensure proper drop order is maintained.

How do I check for new unsafe blocks introduced in my Rust codebase changes?

Checking for new unsafe Rust blocks involves comparing current code changes against the main branch to identify newly introduced unsafe code. This produces a severity-ranked report highlighting new blocks and verifying their safety comments and invariants.

Does this static analysis tool work with Rust storage and IO runtime modules?

Yes, this static analysis targets Rust storage, IO, and runtime code changes across source directories and related modules. It audits unsafe blocks within these areas to verify type invariants, pointer arithmetic bounds, and proper Drop order.

What is the best way to verify pointer arithmetic bounds and Drop order in Rust?

The best way to verify pointer arithmetic bounds and Drop order is a static analysis audit of unsafe Rust blocks. This validates type invariants and ensures proper destruction sequence to prevent undefined behavior in storage and IO operations.