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.
Run these steps in order to enforce code quality and style standards:
Run clippy to catch linting issues:
./check.fish --clippy
# (runs: cargo clippy --all-targets)
Review and fix all warnings. For auto-fixable issues:
cargo clippy --all-targets --fix --allow-dirty
Common clippy categories:
Apply these punctuation rules to all comments (not rustdoc /// or //!, but regular // comments) in the git working tree:
Add a period at the end:
// This is a single line comment.
Period ONLY on the last line:
// This is a long line that wraps
// to the next line.
Each gets its own period:
// First independent thought.
// Second independent thought.
Wrapped comments:
Independent comments:
Review all mod.rs files in the git working tree and ensure they follow the patterns from the organize-modules skill:
Check for:
#[cfg(any(test, doc))]If module organization doesn't follow patterns, invoke the organize-modules skill for guidance.
If working with rustdoc comments (/// or //!):
If there are issues, invoke the write-documentation skill (or use /fix-intradoc-links command).
If clippy fixes modify behavior or you're unsure about changes:
./check.fish --test
# (runs: cargo test --all-targets)
Use the Task tool with subagent_type='test-runner' if tests fail.
Run cargo fmt to ensure consistent formatting:
cargo fmt --all
This applies:
After completing all steps, report concisely:
This skill includes additional reference material:
patterns.md - Comprehensive examples of code style patterns including comment punctuation rules (20+ examples), clippy lint categories with fixes, cargo fmt formatting rules, and module organization quick checks. Read this when:check-code-quality - Includes clippy as part of full quality checksorganize-modules - For module organization patternswrite-documentation - For rustdoc link formatting and comprehensive doc formatting/clippy - Explicitly invokes this skill/fix-comments - Focuses on comment punctuation (subset of this skill)clippy-runner - Agent that delegates to this skill