
Description
design-patterns is an agent skill with Rust design patterns for the RTK project, a command-line tool whose filter modules are the main place these patterns are applied. It focuses on CLI tool patterns rather than web or service patterns. The skill covers the newtype pattern for type safety, the builder pattern, RAII for resource cleanup, trait objects for swapping implementations, and a state machine for filter stages. Its newtype example shows the problem it solves: two plain usize arguments can be passed in the wrong order without a compiler error, while wrapping each count in its own type, such as InputTokens and OutputTokens, makes a swapped call fail to compile. Each pattern is described with the situation in which it applies, so an assistant can choose one rather than adding abstractions by default. The skill is for contributors who are designing a new module or reviewing how a module is structured, and it helps keep the code consistent with the existing filters. It passes Gen Agent Trust Hub, Socket and Snyk on skills.sh. Install it with npx skills add https://github.com/rtk-ai/rtk --skill design-patterns.…
Highlights
- Newtype pattern for type-safe values such as token counts
- Builder, RAII, trait object and state machine patterns
- Patterns applied to RTK's CLI filter modules
- Each pattern tied to when it should be used
Ratings & Reviews
No ratings yet
Be the first to rate design-patterns.
People also visit

github-multi-repo
Multi-repository coordination, synchronization, and architecture management
design-patterns FAQ
What patterns does it cover?
Newtype for type safety, the builder pattern, RAII, trait objects and a state machine.
Who is it for?
Contributors to RTK who design new filter modules or review how existing modules are built.
What does the newtype example show?
Wrapping token counts in separate types, so swapping the input and output counts becomes a compile error instead of a silent bug.
How do I install it?
Run npx skills add https://github.com/rtk-ai/rtk --skill design-patterns.
Which security audits does it have?
On skills.sh, Gen Agent Trust Hub, Socket and Snyk all pass.
What are the best design-patterns alternatives?
Popular alternatives to design-patterns include prisma-compute, code-simplifier and rtk-tdd. See all design-patterns alternatives






