Rust Module Analyzer skill for Claude and Codex
An architecture read of an existing Rust module: its public surface, the crates it leans on, every unsafe block with its justification checked, and refactors…
Install it once and Claude or Codex runs it for you. When your request matches, your AI loads the skill, asks for anything it is missing, and works through the template itself. Prefer to fill it in by hand? See the full prompt template.
Download the skill (.zip) · View SKILL.md
When it is used
Use when an existing Rust module needs a review of its public API, crate dependencies, unsafe blocks, and refactoring opportunities before it is changed or merged. Do not use for generating a new module, writing its documentation, or rewriting it for speed. Related topics: coding, rust.
What it will ask you for
- Module source (longer free text)
- Include test analysis (choose one: Yes, No)
- Rust edition (choose one: 2015, 2018, 2021, 2024)
- Depth (choose one: Summary, Detailed, Exhaustive)
- Focus areas (choose any: Public API, Dependency graph, Unsafe blocks, Performance, Documentation)
- Output format (choose one: Markdown, JSON, Plain text)
How it works
- List every pub item with its signature and flag any whose visibility is wider than its callers need.
- Map the crates and std modules the code imports, noting any dependency used by a single function.
- Check each unsafe block against its SAFETY comment and name the invariant at risk where the comment is missing or unsupported.
- Note performance and documentation findings for the selected focus areas, each tied to a line range.
- Rank refactoring suggestions by payoff over effort and format the report in the chosen output format.
What you get
A report in the chosen format with Overview, Public API, Dependencies, Safety Review, Refactoring Suggestions, and Parsing Notes, at the selected depth.
What it watches out for
- Treating every unsafe block as a defect instead of checking whether its invariant is actually upheld.
- Reporting a clone as wasteful when the value is moved into a thread or future and the clone is required.
- Recommending pub(crate) on an item that a downstream crate already uses, which is a breaking change.
How to install
Claude.ai and the Claude desktop app
- Download the skill .zip.
- Open Settings, then Capabilities, and find Skills.
- Choose Upload skill and select the .zip.
- Ask Claude for help with the task. It loads the skill when your request matches.
Claude Code
- Download the skill .zip.
- Unzip it into ~/.claude/skills/ (or .claude/skills/ inside a project).
- Start a new session. Claude Code loads the skill when your request matches.
Codex
- Download the skill .zip.
- Unzip it into ~/.agents/skills/ (or .agents/skills/ inside a project).
- Codex picks it up on its own. Type $ and the skill name to use it, or just ask for the task.
Cursor
- Download the Cursor rule (.mdc).
- Save it in .cursor/rules/ inside your project.
- Cursor's agent applies the rule when your request matches its description.
AGENTS.md (Codex, Cursor, and other coding agents)
- Copy the AGENTS.md section.
- Paste it into AGENTS.md at the root of your repository, creating the file if needed.
- Coding agents that read AGENTS.md follow it when your request fits.