run-clippy

1
0
Source

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.

Install

mkdir -p .claude/skills/run-clippy && curl -L -o skill.zip "https://mcp.directory/api/skills/download/7670" && unzip -o skill.zip -d .claude/skills/run-clippy && rm skill.zip

Installs to .claude/skills/run-clippy

About this skill

Clippy Fixes and Code Style Enforcement

When to Use

  • After making code changes
  • Fixing clippy warnings
  • Ensuring comment punctuation consistency
  • Enforcing module organization patterns
  • Before creating commits
  • When user says "run clippy", "fix style", "format code", "check lints", etc.

Instructions

Run these steps in order to enforce code quality and style standards:

Step 1: Run Clippy

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:

  • Correctness: Potential bugs and logic errors (must fix)
  • Performance: Inefficient code patterns (should fix)
  • Style: Idiomatic Rust patterns (should fix)
  • Pedantic: Opinionated style (optional, review case-by-case)
  • Complexity: Overly complex code (refactor if excessive)

Step 2: Enforce Comment Punctuation

Apply these punctuation rules to all comments (not rustdoc /// or //!, but regular // comments) in the git working tree:

Rule 1: Single-line Standalone Comments

Add a period at the end:

// This is a single line comment.

Rule 2: Multi-line Wrapped Comments (One Logical Sentence)

Period ONLY on the last line:

// This is a long line that wraps
// to the next line.

Rule 3: Multiple Independent Single-line Comments

Each gets its own period:

// First independent thought.
// Second independent thought.

How to Identify Wrapped vs Independent

Wrapped comments:

  • The second line continues the grammatical structure of the first
  • Reads as one sentence if combined

Independent comments:

  • Each line could stand alone as a complete thought
  • Separate sentences with distinct subjects

Step 3: Verify Module Organization

Review all mod.rs files in the git working tree and ensure they follow the patterns from the organize-modules skill:

Check for:

  • ✅ Private modules with public re-exports (preferred pattern)
  • ✅ Conditional visibility for docs/tests where needed: #[cfg(any(test, doc))]
  • ✅ Rustfmt skip directive if manual formatting is needed
  • ✅ Flat public API (avoid exposing internal structure)

If module organization doesn't follow patterns, invoke the organize-modules skill for guidance.

Step 4: Verify Documentation Quality

If working with rustdoc comments (/// or //!):

  1. Reference-style links: Ensure backticked symbols use reference-style intra-doc links
  2. Link placement: All reference-style links at bottom of comment block
  3. Table formatting: Markdown tables properly aligned

If there are issues, invoke the write-documentation skill (or use /fix-intradoc-links command).

Step 5: Run Tests if Needed

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.

Step 6: Final Code Formatting

Run cargo fmt to ensure consistent formatting:

cargo fmt --all

This applies:

  • Consistent indentation (4 spaces)
  • Line length limits (100 chars default)
  • Spacing around operators and braces
  • Import organization

Reporting Results

After completing all steps, report concisely:

  • ✅ All checks passed → "Code style and linting checks passed!"
  • ⚠️ Clippy warnings → Summarize warning categories and counts
  • 🔧 Auto-fixed → Report what was automatically corrected
  • 📝 Manual fixes needed → List what requires developer attention

Supporting Files in This Skill

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:
    • Need examples of proper comment punctuation (wrapped vs independent)
    • Understanding clippy lint categories (correctness, performance, style)
    • See good vs bad examples for specific lints
    • Quick module organization checks
    • Understanding cargo fmt rules (indentation, line length, imports)

Related Skills

  • check-code-quality - Includes clippy as part of full quality checks
  • organize-modules - For module organization patterns
  • write-documentation - For rustdoc link formatting and comprehensive doc formatting

Related Commands

  • /clippy - Explicitly invokes this skill
  • /fix-comments - Focuses on comment punctuation (subset of this skill)

Related Agents

  • clippy-runner - Agent that delegates to this skill

analyze-performance

r3bl-org

Establish performance baselines and detect regressions using flamegraph analysis. Use when optimizing performance-critical code, investigating performance issues, or before creating commits with performance-sensitive changes.

122

design-philosophy

r3bl-org

Core design principles for the codebase - cognitive load, progressive disclosure, type safety, abstraction worth. Use when designing APIs, modules, or data structures.

40

check-bounds-safety

r3bl-org

Apply type-safe bounds checking patterns using Index/Length types instead of usize. Use when working with arrays, buffers, cursors, viewports, or any code that handles indices and lengths.

00

write-documentation

r3bl-org

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.

10

check-code-quality

r3bl-org

Run comprehensive Rust code quality checks including compilation, linting, documentation, and tests. Use after completing code changes and before creating commits.

10

analyze-log-files

r3bl-org

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.

10

You might also like

flutter-development

aj-geddes

Build beautiful cross-platform mobile apps with Flutter and Dart. Covers widgets, state management with Provider/BLoC, navigation, API integration, and material design.

9521,094

drawio-diagrams-enhanced

jgtolentino

Create professional draw.io (diagrams.net) diagrams in XML format (.drawio files) with integrated PMP/PMBOK methodologies, extensive visual asset libraries, and industry-standard professional templates. Use this skill when users ask to create flowcharts, swimlane diagrams, cross-functional flowcharts, org charts, network diagrams, UML diagrams, BPMN, project management diagrams (WBS, Gantt, PERT, RACI), risk matrices, stakeholder maps, or any other visual diagram in draw.io format. This skill includes access to custom shape libraries for icons, clipart, and professional symbols.

845846

ui-ux-pro-max

nextlevelbuilder

"UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 8 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient."

570697

godot

bfollington

This skill should be used when working on Godot Engine projects. It provides specialized knowledge of Godot's file formats (.gd, .tscn, .tres), architecture patterns (component-based, signal-driven, resource-based), common pitfalls, validation tools, code templates, and CLI workflows. The `godot` command is available for running the game, validating scripts, importing resources, and exporting builds. Use this skill for tasks involving Godot game development, debugging scene/resource files, implementing game systems, or creating new Godot components.

548492

nano-banana-pro

garg-aayush

Generate and edit images using Google's Nano Banana Pro (Gemini 3 Pro Image) API. Use when the user asks to generate, create, edit, modify, change, alter, or update images. Also use when user references an existing image file and asks to modify it in any way (e.g., "modify this image", "change the background", "replace X with Y"). Supports both text-to-image generation and image-to-image editing with configurable resolution (1K default, 2K, or 4K for high resolution). DO NOT read the image file first - use this skill directly with the --input-image parameter.

671464

fastapi-templates

wshobson

Create production-ready FastAPI projects with async patterns, dependency injection, and comprehensive error handling. Use when building new FastAPI applications or setting up backend API projects.

512280

Stay ahead of the MCP ecosystem

Get weekly updates on new skills and servers.