🦀
QualityRust

Rust Design Patterns

by rtk-ai

Rust Design Patterns is a Quality skill for Claude Code, published by rtk-ai in rtk.

75.9K stars4.8K forkson rtk-ai/rtkAdded 2026/08/13Repository updated 2026/08/13
agentic-codingai-codinganthropicclaude-codeclicommand-line-toolcost-reductiondeveloper-toolsllmopen-sourceproductivityrusttoken-optimization
Install in seconds
Install Rust Design Patterns
Copy Rust Design Patterns into your Claude Code skills folder. Run the command in your terminal, or review the source on GitHub before installing.
terminal
npx degit https://github.com/rtk-ai/rtk/tree/develop/.claude/skills/design-patterns ~/.claude/skills/design-patterns

Requires Node.js. Downloads this skill only — not the rest of the repository — into your Claude Code skills folder.

Without Node.js

git clone https://github.com/rtk-ai/rtk.git

Clones the whole repository, then copy the skill’s own directory into your skills folder yourself.

In this catalog

Source file
.claude/skills/design-patterns/SKILL.md in rtk-ai/rtk
Installs to
~/.claude/skills/design-patterns
Collection
One of 12 skills cataloged from this repository
Category
Quality1354 skills

What Rust Design Patterns does

Rust Design Patterns documents idiomatic Rust patterns (Newtype, Builder, State Machine, Trait Object, RAII, Strategy, Extension Trait) for RTK's CLI filter modules. Use when designing new modules or refactoring existing filter code.

Rust Design Patterns is cataloged under Quality on DirSkills. Rust Design Patterns comes from a repository tagged agentic-coding, ai-coding, anthropic, claude-code and cli.

Documentation

README

RTK Rust Design Patterns

Patterns that apply to RTK's filter module architecture. Focused on CLI tool patterns, not web/service patterns.

Pattern 1: Newtype (Type Safety)

Use when: wrapping primitive types to prevent misuse (command names, paths, token counts).

// Without Newtype — easy to mix up
fn track(input_tokens: usize, output_tokens: usize) { ... }
track(output_tokens, input_tokens);  // Silent bug!

// With Newtype — compile error on swap
pub struct InputTokens(pub usize);
pub struct OutputTokens(pub usize);
fn track(input: InputTokens, output: OutputTokens) { ... }
track(OutputTokens(100), InputTokens(400));  // Compile error ✅

This is the opening of the README. Read the full README on GitHub.

Frequently asked about Rust Design Patterns

  • What else does rtk-ai publish alongside Rust Design Patterns?

    Rust Design Patterns is one of 12 skills that DirSkills catalogs from rtk-ai/rtk, the repository it ships in. Its siblings there include Code Simplifier, Issue Triage and PR Review. Each one is a separate skill with its own page in this directory, installs the same way Rust Design Patterns does, and is maintained by rtk-ai in that same repository. The rest of the collection is listed on the rtk-ai/rtk page.

  • How does Rust Design Patterns compare to other Quality skills?

    Rust Design Patterns ranks #39 by stars among the 1354 Quality skills in this catalog. The most-starred ones next to it are Benchmark, Benchmark Optimization Loop and API Design Patterns. DirSkills ranks by the star count of the repository each skill ships in, so that order reflects how popular those repositories are rather than any review of Rust Design Patterns against them. Open each page to compare what they document and how they install.

More from rtk-ai/rtk

Rust Design Patterns is one of 12 skills cataloged on DirSkills from rtk-ai/rtk.

See all 12 skills
🧹
3w ago

Code Simplifier

Code Simplifier reviews Rust code for idiomatic simplification patterns, reducing over-engineering and unnecessary allocations without changing behavior. Use it to apply Rust idioms like iterator chains, early returns, and Option/Result chaining while respecting project constraints.
Quality
75.9K4.8K
🔍
3w ago

Issue Triage

Issue Triage audits open issues, categorizes them, detects duplicates, cross-references pull requests, assesses risk, and posts comments. Use it to triage issues manually or proactively when many open issues need attention.
Automation
75.9K4.8K
🔍
3w ago

PR Review

PR Review batches open pull requests in order of complexity, checks merge readiness (conflicts, CLA, reviews), reads diffs, and asks for explicit approval before merging. It also posts comments on blocked PRs.
Quality
75.9K4.8K
🔍
3w ago

PR Triage

PR Triage audits open pull requests, flags risks, and helps choose which PRs need deeper review. It can draft and post review comments, with language handling for French or English.
Quality
75.9K4.8K
⏱️
3w ago

Performance

Performance analyzes RTK CLI startup time, memory usage, and token savings to detect and fix performance regressions. Use it after filter changes, dependency additions, or before release to verify the CLI meets <10ms startup, <5MB memory, and 60-90% token savings targets.
Quality
75.9K4.8K
🧪
3w ago

RTK TDD

RTK TDD enforces a Red-Green-Refactor test-driven development workflow for Rust projects, auto-triggering on implementation, testing, refactoring, and bug fixing tasks. It provides Rust-idiomatic testing patterns using anyhow/thiserror, cfg(test), and Arrange-Act-Assert.
Quality
75.9K4.8K