Rust Module Builder skill for Claude and Codex
A complete, idiomatic Rust source file built to an exact list of structs, enums, and function signatures, warning-free under clippy and documented, with unit…
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 a Rust module must be implemented from an exact list of structs, enums, and function signatures as a ready-to-compile file. Do not use for deciding the module's design, reviewing existing Rust code, or optimising it. Related topics: coding, rust.
What it will ask you for
- Module name (free text, e.g. "my_module")
- Purpose (longer free text)
- Public structs (longer free text)
- Public enums (longer free text)
- Functions (longer free text)
- Include unit tests (choose one: Yes, No)
- Visibility (choose one: pub, pub(crate), private)
- Input 8 (choose one: non_exhaustive)
- Input 9 (choose one: cfg(test))
How it works
- Implement each listed struct, enum, and function with the chosen visibility and no extra items.
- Derive Debug on every type and Clone, PartialEq, and Default where the fields allow, with #[non_exhaustive] on enums expected to grow.
- Route failures through a module-level error enum returned as Result rather than panicking.
- Document every public item, and keep parameters borrowed, loops as iterators, and the file clippy-clean at the default level.
- When tests are requested, add a #[cfg(test)] module with a main-path and an error-case test per function.
What you get
One code block containing the full module source, starting with a comment giving the file path, and no text outside the block.
What it watches out for
- Deriving Default on a struct with a field that has no Default impl, which fails to compile.
- Using unwrap on parse or I/O results inside library code, which turns recoverable errors into panics for every caller.
- Taking String parameters where &str would do, which forces every caller to allocate.
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.