rust-development

A guide for building Rust applications and libraries with Cargo, Rust’s project and dependency tool. It covers error handling, asynchronous code with Tokio, unsafe code, testing, performance checks, and public APIs.

In plain words
What is it for?
Use it when starting or structuring a Rust project, configuring Cargo, writing async code, reviewing unsafe code, handling errors, testing, or checking performance.
Why use it?
It gives developers established patterns and checks for common Rust decisions, so they do not have to work out project structure, errors, testing, and safety practices from scratch.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/navikt/copilot/rust-development
Any agent
npx skills add navikt/copilot --skill rust-development
Clone the repo
git clone --depth 1 https://github.com/navikt/copilot

Made for: Claude Code, Codex.

Per session 27 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,803 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00027 $0.02803
Opus 5 $0.00014 $0.01401
Sonnet 5 $0.00005 $0.00561
Haiku 4.5 $0.00003 $0.00280

Measured 2d ago against content hash 1b98a4c1653e, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

rust-development scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/rust-development/SKILL.md · 451 lines

How it starts

The opening of the file, as written. The whole thing — 451 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Rust Development Skill

Patterns, templates, and procedures for building high-quality Rust applications and libraries. Based on Microsoft Pragmatic Rust Guidelines and Rust API Guidelines.

When to Use

  • Setting up a new Rust project or workspace
  • Configuring Cargo.toml with recommended lints and dependencies
  • Implementing error handling (library vs application)
  • Writing async code with tokio
  • Reviewing or writing unsafe code
  • Optimizing performance with benchmarks
  • Structuring a crate for public API quality

Procedure: New Project Setup

1. Initialize

cargo init <project-name>
cd <project-name>

2. Configure Cargo.toml

[package]
name = "my-service"
version = "0.1.0"
edition = "2024"
rust-version = "1.85"

[dependencies]
anyhow = "1"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
tokio = { version = "1", features = ["full"] }
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter", "json"] }

[dev-dependencies]
proptest = "1"

[lints.rust]
missing_debug_implementations = "warn"
redundant_imports = "warn"
trivial_numeric_casts = "warn"
unsafe_op_in_unsafe_fn = "warn"
unused_lifetimes = "warn"

[lints.clippy]
cargo = { level = "warn", priority = -1 }
complexity = { level = "warn", priority = -1 }
correctness = { level = "warn", priority = -1 }
pedantic = { level = "warn", priority = -1 }
perf = { level = "warn", priority = -1 }
style = { level = "warn", priority = -1 }
suspicious = { level = "warn", priority = -1 }
undocumented_unsafe_blocks = "warn"
clone_on_ref_ptr = "warn"
map_err_ignore = "warn"

3. Configure rustfmt

Create rustfmt.toml:

edition = "2024"
max_width = 100
use_field_init_shorthand = true

4. Set up CI checks

Minimum verification pipeline:

cargo fmt --check
cargo clippy -- -W clippy::pedantic
cargo test
cargo doc --no-deps
cargo audit

Read the full file on GitHub · 451 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 451 lines · 27 tokens per session scan A 1b98a4c1653e

Subscribe to this mod's changes

rust-development is a skill published in the GitHub repository navikt/copilot (54 stars, last pushed 2d ago), licensed MIT. It adds 27 tokens to every session and 2,803 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

loom-rust

Rust language expertise for idiomatic, production-quality code. Use for ownership and lifetimes, error handling with anyhow/thiserror, async/await with tokio, cargo workspace management, CLI tools with clap, and serialization with serde. Primary language of the Loom project.

cosmix/loom · 58 tokens

loom-concurrency

Concurrency and parallelism patterns for multi-threaded and async code. Use when implementing async/await, parallel processing, thread safety, worker pools, channels, or debugging race conditions and deadlocks across Rust (tokio), Python (asyncio), TypeScript, and Go.

cosmix/loom · 59 tokens

rust-development

You MUST activate this skill when working on Rust projects.

sammcj/agentic-coding · 13 tokens

skill-guide

Design, write, and review SKILL.md files using proven patterns. Use when creating, improving, or reviewing agent skills, choosing a design pattern (Tool Wrapper, Generator, Reviewer, Inversion, Pipeline), structuring progressive disclosure, writing skill descriptions, or composing patterns. Also trigger for 'skill…

AndyElessar/skills · 102 tokens

microsoft-webui

Microsoft WebUI Framework expertise — a language-agnostic server-side rendering framework where templates compile to a binary protocol and interactive Web Components hydrate as islands. Use when authoring, reviewing, or debugging WebUI components (.html + .css + .ts triplets), wiring up routes, hydrating with…

AndyElessar/skills · 212 tokens

plugin-creator

Guide AI agents through creating GitHub Copilot CLI and Claude Code plugins and plugin marketplaces — from scaffolding plugin directories and writing plugin.json manifests to building marketplace.json registries and testing installations. Use this skill whenever the user wants to create, scaffold, configure, package…

AndyElessar/skills · 181 tokens