rust-discipline

Enforce Rust API design and safety rules across the RIPDPI workspace.

58|4|Updated Mar 8, 2026
One-click install
npx skills add https://github.com/po4yka/RIPDPI --skill rust-discipline
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rust-discipline
Source: https://github.com/po4yka/RIPDPI/tree/main/.claude/skills/rust-discipline
Command: npx skills add https://github.com/po4yka/RIPDPI --skill rust-discipline

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Encode API-design discipline and catch high-signal Rust mistakes before they land in the native Rust workspace. Apply these rules when authoring or reviewing public (pub) and crate-public (pub(crate)) function signatures, struct definitions, and trait bounds anywhere in the workspace, and during code review, pre-merge self-check, and when tightening existing code.

Core Features & Use Cases

  • API Design Rules: Enforce borrowed args over owned references, avoid lifetime infections, and use HRTB-shaped callbacks for safety.
  • Anti-Patterns & Risk Mitigation: Provide guidance on panic discipline, error propagation, Drop/RAII, and aliasing issues to reduce bugs.
  • Use Case: As a code reviewer, apply these rules to a diff to prevent subtle API regressions.

Quick Start

Run the Rust discipline checks on your codebase and integrate into the PR review process to improve API safety.

Frequently Asked Questions about rust-discipline

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

FAQPage Schema
How do I enforce Rust borrow check and lifetime discipline in code reviews?

Rust code review discipline is enforced by applying rules to public and crate-public signatures, struct definitions, and trait bounds, catching high-signal borrow check and lifetime infection mistakes before merge.

What is the best way to prevent lifetime infections in Rust API design?

Preventing lifetime infections in Rust API design involves enforcing borrowed arguments over owned references and using higher-ranked trait bound (HRTB) shaped callbacks for safety across public interfaces.

How do I apply RAII patterns and error propagation rules to a Rust workspace?

RAII patterns and error propagation rules are applied by enforcing Drop discipline, mitigating aliasing issues, and ensuring consistent error propagation across public and crate-public function signatures during code review.

Can I use automated Rust linting rules for tightening existing public APIs?

Automated Rust linting rules can be applied when tightening existing code, enforcing API design discipline, panic prevention, and borrow semantics across public and crate-public interfaces in the workspace.

Why does my Rust trait bound design require higher-ranked trait bounds for callbacks?

Rust trait bound design requires HRTB for callbacks to guarantee safety, enforce borrow semantics, and prevent high-signal API regressions when authoring or reviewing public function signatures.

When should I not use owned references in Rust public function signatures?

Owned references should be avoided in Rust public function signatures when borrowed arguments suffice, reducing lifetime infections and enforcing API design discipline during code review and pre-merge self-checks.