بنقرة واحدة
design-philosophy
// Core design principles for the codebase - cognitive load, progressive disclosure, type safety, abstraction worth. Use when designing APIs, modules, or data structures.
// Core design principles for the codebase - cognitive load, progressive disclosure, type safety, abstraction worth. Use when designing APIs, modules, or data structures.
Apply private modules with public re-exports (barrel export) pattern for clean API design. Includes conditional visibility for docs and tests. Use when creating modules, organizing mod.rs files, or before creating commits.
Run comprehensive Rust code quality checks including compilation, linting, documentation, and tests. Use after completing code changes and before creating commits.
Write and format Rust documentation correctly. Apply proactively when writing code with rustdoc comments (//! or ///). Covers voice & tone, prose style (opening lines, explicit subjects, verb tense), structure (inverted pyramid), intra-doc links (crate:: paths, reference-style), constant conventions (binary/byte literal/decimal), and formatting (cargo rustdoc-fmt). Also use retroactively via /fix-intradoc-links, /fix-comments, or /fix-md-tables commands.
Run clippy linting, enforce comment punctuation rules, format code with cargo fmt, and verify module organization patterns. Use after code changes and before creating commits.
Publish a crate release to crates.io with changelog, git tag, and GitHub release. Use when releasing a new version of any workspace crate.
Analyze log files by stripping ANSI escape sequences first. Use when asked to process, handle, read, or analyze log files that may contain terminal escape codes.
| name | design-philosophy |
| description | Core design principles for the codebase - cognitive load, progressive disclosure, type safety, abstraction worth. Use when designing APIs, modules, or data structures. |
Apply these principles when writing or reviewing code.
Code should be easy to understand without loading too much into working memory.
Guidelines:
Reveal complexity only when needed.
Guidelines:
Use the type system to prevent bugs at compile time.
Guidelines:
Index instead of usize)check-bounds-safety skill for exemplary patternsAn abstraction should reduce cognitive load, not add to it.
Guidelines:
patterns.md - Detailed patterns with good/bad examplescheck-bounds-safety - Type-safe Index/Length patterns (exemplar of principle #3)organize-modules - Module organization for encapsulation (supports principle #1)write-documentation - Inverted pyramid documentation (supports principle #2)