From sc-rust
Enforce Rust design patterns at the right lifecycle stage — design review, code review, or CI. Use when reviewing architecture plans, crate API surfaces, or Rust code for pattern compliance. Complements rust-development (style/guidelines) by focusing on structural design patterns and when to apply them.
How this skill is triggered — by the user, by Claude, or both
Slash command
/sc-rust:rust-best-practicesThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
This skill enforces high-value Rust design patterns at the appropriate stage of the development lifecycle. Its primary purpose is to prevent churn by catching structural issues before they become expensive to fix.
This skill enforces high-value Rust design patterns at the appropriate stage of the development lifecycle. Its primary purpose is to prevent churn by catching structural issues before they become expensive to fix.
This skill covers design patterns — structural choices that affect API surfaces, state machines, error propagation, and crate boundaries. It does not duplicate the style and lint rules in rust-development/guidelines.txt.
Pattern documentation lives in patterns/:
enforcement-strategy.md — Full pattern inventory with enforcement points, cross-language applicability, and agent integration recommendationsAdditional per-pattern implementation plans (referenced from enforcement-strategy.md, added as available):
error-context-recovery-plan.mdtypestate-plan.mdsealed-traits-plan.mdPatterns are enforced at the stage where catching them costs the least:
| Stage | Patterns |
|---|---|
| Design review | Typestate, Sealed Traits, Newtype (new types), Error inventory |
| Code review | Newtype (retrofit), Interior Mutability justification, Infallible |
| Performance review | Cow, allocation hot paths |
| CI / hooks | RefCell in Send+Sync contexts, unwrap() audit |
When reviewing, apply in this order — higher priority patterns have greater churn-reduction impact:
When reviewing an architecture plan or design document:
patterns/enforcement-strategy.mdWhen reviewing Rust code:
patterns/enforcement-strategy.mdRefCell / Cell in Send + Sync contexts → flag with justification requirementunwrap() on Result<T, E> where E is never constructed → suggest InfallibleString, Vec) on hot paths → suggest CowWhen a new crate is being extracted or a public API is being defined:
pub trait: verify object safety if dynamic dispatch is intendedpub trait that must not be externally implemented: verify sealed pattern is appliedThese skills are complementary and should both be active during full design + implementation reviews.
For extended pattern analysis, delegate to existing agents:
rust-architect: Architecture blueprints that incorporate pattern decisionsrust-code-reviewer: Code-level pattern compliance (Infallible, Interior Mutability, Newtype retrofit)rust-code-explorer: Locate existing pattern usage across the codebase before designing new surfacesnpx claudepluginhub randlee/synaptic-canvas --plugin sc-rustProvides behavioral guidelines to reduce common LLM coding mistakes, focusing on simplicity, surgical changes, assumption surfacing, and verifiable success criteria.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.