This tool enforces coding standards, formats code, and verifies compilation for C, C++, and Rust projects.

Install

mkdir -p .claude/skills/lint && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/4165" && unzip -o skill.zip -d .claude/skills/lint && rm skill.zip

Installs to .claude/skills/lint

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Check code quality and formatting before committing changes. Use this to verify your changes meet our coding standards.
119 charsno explicit “when” trigger
Intermediate

Key capabilities

  • Validate C/C++ formatting against .clang-format
  • Apply automatic formatting to C/C++ files
  • Verify C/C++ project compilation with build.sh
  • Execute Rust lint checks via make lint
  • Check and apply Rust formatting
  • Add missing license headers to Rust source files

How it works

The skill executes specific shell commands or make targets to verify formatting and compilation. It uses clang-format for C/C++ and cargo-based tools for Rust linting and license management.

Inputs & outputs

You give it
Modified .c, .h, or Rust source files
You get back
Formatted source code and compilation status report

When to use lint

  • Check C/C++ formatting
  • Run clippy on Rust code
  • Verify project builds
  • Fix formatting issues

About this skill

Lint Skill

Check code quality and formatting before committing changes.

Usage

Run this skill to check for lint errors and formatting issues.

Instructions

C Code

  1. Check C/C++ formatting against .clang-format:

    clang-format --dry-run -Werror <modified .c and .h files>
    
  2. If formatting check fails, apply formatting:

    clang-format -i <modified .c and .h files>
    
  3. Verify the project compiles without warnings-as-errors:

    ./build.sh
    

    The CMake build promotes key warnings to errors (-Werror=incompatible-pointer-types, -Werror=implicit-function-declaration). A successful build confirms these pass.

Rust Code

  1. Run the lint check:

    make lint
    
  2. If clippy reports warnings or errors, fix them before proceeding

  3. Check formatting:

    make fmt CHECK=1
    
  4. If formatting check fails, apply formatting:

    make fmt
    
  5. If license headers are missing, add them:

    (cd src/redisearch_rs && cargo license-fix)   # subshell: custom subcommand, no --manifest-path
    

Common Clippy Fixes

  • Document unsafe blocks: Add // SAFETY: comment explaining why the unsafe code is sound
  • Use #[expect(...)]: Prefer over #[allow(...)] for lint suppressions

Rust-Only Quick Check

cargo clippy --manifest-path src/redisearch_rs/Cargo.toml --all-targets --all-features

When not to use it

  • Projects lacking a build.sh script
  • Non-C/C++/Rust codebases

Prerequisites

clang-formatCMakemakecargo

Limitations

  • Requires specific build scripts like build.sh or make
  • Rust license fixing is restricted to the src/redisearch_rs directory

How it compares

This skill automates project-specific build and linting commands instead of requiring manual execution of individual compiler or formatter flags.

Compared to similar skills

lint side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
lint (this skill)12moReviewIntermediate
rust-tests-guidelines75moNo flagsBeginner
check-rust-coverage55moReviewBeginner
check-code-quality128dReviewAdvanced

Try saying

Example prompts that trigger this skill in your AI assistant.

Search skills

Search the agent skills registry