Skip to content
Agentmart
Submit a tool

rust

Use before you write or change Rust code, add a crate or a dependency to a Cargo workspace, write or move a Rust test, define or map an error type, or add a…

Skill by futex-ai

IndexedMIT★ 1
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/futex-ai-rust

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Use before you write or change Rust code, add a crate or a dependency to a Cargo workspace, write or move a Rust test, define or map an error type, or add a trait, a mock, or diagnostics, when you reach for unwrap, expect, panic, anyhow, or println in library code, when a Rust file passes 200 lines, and when cargo fmt, clippy, or a Rust lint reports a problem.

Use cases: testing, writing

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/rust

What's inside

Skill name
rust
Description
Use before you write or change Rust code, add a crate or a dependency to a Cargo workspace, write or move a Rust test, define or map an error type, or add a trait, a mock, or diagnostics, when you reach for unwrap, expect, panic, anyhow, or println in library code, when a Rust file passes 200 lines, and when cargo fmt, clippy, or a Rust lint reports a problem.
License
MIT
Instructions
76 lines in SKILL.md · view on GitHub

Files (5)

  • SKILL.md
  • architecture.md · references/
  • errors.md · references/
  • files-and-modules.md · references/
  • testing.md · references/

SKILL.md (first lines)

# Rust

These rules apply to every Rust edit. The references hold the full contract
with examples and take precedence when the two differ in detail:

- [references/architecture.md](references/architecture.md): crates, traits
  and `dyn` dispatch, generics, typing, mocking, diagnostics, panics, unsafe.
- [references/errors.md](references/errors.md): the `thiserror` error
  contract.
- [references/testing.md](references/testing.md): test layout and snapshots.
- [references/files-and-modules.md](references/files-and-modules.md): file
  size, imports, visibility, modules, doc comments, drops.

## Workspace and tooling

- Use a workspace with multiple crates to split the code into concrete
  units. Every crate has its own `README.md`; see the `documentation` skill.
- Run `cargo fmt --all -- --check` after Rust changes. If it fails, run
  `cargo fmt --all` and re-run the check. Run `cargo clippy` after any
  change.
- Add external dependencies with `cargo add` without a version. Add
  workspace internal crates manually with `dependency = { workspace = true }`.
- Prefer `clap` for CLI parsing and `diesel` for database access.

## Architecture

- Model all non-pure behaviour behind traits and consume it through
  `dyn Trait`, with `Arc<dyn Trait + Send + Sync>` for shared runtime
  dependencies. Prefer `dyn` dispatch over parametric generics. Only small
  pure free functions and pure value types are exempt.
- Use `unimock` to mock trait boundaries in unit tests, including same-crate
  traits with one implementation. Unit tests must not use real disk IO,
  databases, Docker, subprocesses, clocks, or network calls.
- Use `tracing` for diagnostics in libraries, servers, and workers; never
  `println!`, `eprintln!`, or `dbg!` there. Direct terminal output is only
  for CLI results, prompts, raw data output, REPL messages, build-script
  directives, tests, examples, and developer task output.
- Prefer enums and structs over raw strings and `serde_json::Value`. Fully
  type domain, service, and interface code.
- Types that cross to a TypeScript or JavaScript frontend are generated
  from the Rust types. See the `shared-types` skill.

## Files and modules

- Every module has a module-level doc comment and every public item has a
  doc comment. Avoid inline comments.
- Rust files have a 300-line hard cap. Target 200 lines, split into
  modules, and never use `include!` to get around it.
- Order imports std, external crates, `crate::`, then `self::` and
  `super::`. Declare them at the top of the file, never rename with `as`,
  and prefer imports over inline `crate::` paths.
- Use the narrowest visibility that works. Keep `lib.rs`, `mod.rs`, and
  `bin.rs` as thin module roots. Use `#[path]` only for test modules. Use
  `#[expect(dead_code, reason = "...")]` rather than a silent `allow`.
- Do not call `drop` unless absolutely necessary; end a borrow with a scope.

## Tests

- Keep tests out of production files. Put them in a `_tests_` directory
  beside the source and declare them with
  `#[cfg(test)] #[path = "_tests_/<name>_tests.rs"] mod <name>_tests;`.
- Use file-based `insta` snapshots only.

## Errors and panics

- Never use `panic!()`, `unwrap()`, or `expect()` in production code. Test
  code may use them.
- Avoid `unsafe` except for FFI. Keep it minimal, isolate it, and add a
  safety comment.
- Define errors as `thiserror` enums per crate or module with `[crate/mod]`
  message prefixes, typed variants that callers branch on, and
  `Internal(#[from] InternalError)` as the fallback. Propagate with `?`.
  Never use `anyhow`, `eyre`, `#[error(transparent)]`, `Other(String)`,
  string matching on errors, or `map_err` in production code.

From futex-ai/skills, MIT.

More from futex-ai/skills

Signals

Stars
1
Forks
0
Open issues
0
Last commit (this folder)
Oct 19, 2026 (9 days ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from futex-ai

Cite this page

rust skill. Agent Mart. https://agentmart.dev/skills/futex-ai-rust (last updated 2026-10-24)