rust-coding-rules

Applies canonical Rust coding rules for safety, ownership, errors, async, tests, and coverage.

Updated Oct 15, 2019
One-click install
npx skills add https://github.com/kkkaoru/dotfiles --skill rust-coding-rules-kkkaoru
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rust-coding-rules
Source: https://github.com/kkkaoru/dotfiles/tree/main/.agents/skills/rust-coding-rules
Command: npx skills add https://github.com/kkkaoru/dotfiles --skill rust-coding-rules-kkkaoru

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Rust projects often accumulate inconsistent style, duplicated rule documents, and uneven quality gates across contributors. This Skill provides a single normative, deduplicated rule set (RS01-RS31) that agents and developers apply whenever planning, writing, testing, or reviewing Rust code. ## Core Features & Use Cases - Canonical Rule Set: One authoritative English reference covering repository setup, safety, ownership, concurrency, error handling, testing, and coverage, with each requirement assigned exactly one Rule ID. - Quality Gates: Enforces rustfmt, Clippy, structured Result errors, per-file coverage thresholds (90% when none configured), and bans allow attributes or skipped tests without approval. - Bilingual References: Ships an English normative version plus a Japanese translation for human readers, loaded only on explicit request. - Use Case: When editing a Rust service, the agent reads the rule reference, plans the implementation (RS28), writes code following ownership and error-propagation rules, updates tests, and self-reviews against the rule set (RS31) before finishing. ## Quick Start Ask the agent to review or modify a Rust source file while following the rust-coding-rules skill, and it will load the normative rule reference and apply it automatically.

Frequently Asked Questions about rust-coding-rules

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

FAQPage Schema
How do I enforce consistent Rust coding standards across a project?

Use a single normative rule set where each requirement has one Rule ID and appears once. This Skill loads references/rust.md as the canonical source, covering safety, ownership, errors, tests, and coverage, and requires a self-review against the rules after implementation.

What Rust rules cover error handling and unsafe code?

Rule RS04 requires avoiding unsafe or minimizing its scope with documented invariants, and RS05 requires structured Result errors with ? propagation instead of unwrap, expect, or panic-driven control flow in production paths.

Does this rule set require rustfmt and Clippy?

Yes, RS02 requires running the configured formatting, compilation, Clippy, and test commands after each logical change, using rustfmt and Clippy together when they are the configured quality tools, and resolving every failure before completion.

What test coverage threshold does the Rust rule set require?

RS25 requires meeting the configured per-file coverage threshold without lowering it. If no threshold exists and coverage tooling is available, every changed source file must reach at least 90 percent coverage.

Is there a Japanese version of the Rust coding rules?

Yes, references/rust.ja.mdx is a Japanese translation intended for human readers. Agents should load only the English normative version unless the user explicitly requests Japanese, to avoid loading both language versions.