Token导航 LogoToken导航TokenDH.com
研究检索只读github未标认证来源可访问clear审计异常

rust-quality-checkerRust quality checker 搜索

Agent Skill

rust-quality-checker 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

326

周安装

14

GitHub Stars

21

下载量

114
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:rust-quality-checker(Rust quality checker 搜索)
来源仓库:https://github.com/matteocervelli/llms
仓库路径:skills/rust-quality-checker
安装命令:
npx skills add https://github.com/matteocervelli/llms --skill rust-quality-checker
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/matteocervelli/llms --skill rust-quality-checker

简介

Rust quality checker 搜索用于查找、检索和筛选相关信息。

  • 适用于 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果的任务。
  • 通过 npx skills add 命令从指定 GitHub 仓库安装,需结合原始 README 核验具体用法。
  • 安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写操作。
  • 该技能适合在质量检查与标准验证类研究任务中使用。

SKILL.md

Rust Quality Checker Skill

Purpose

This skill provides comprehensive Rust code quality validation including formatting (rustfmt), linting (clippy), compilation checks (cargo check), testing (cargo test), security analysis (cargo audit), and best practices validation. Ensures code meets Rust idioms and project standards.

When to Use

  • Validating Rust code quality before commit
  • Running pre-commit quality checks
  • CI/CD quality gate validation
  • Code review preparation
  • Ensuring idiomatic Rust code
  • Security vulnerability detection
  • Performance optimization validation

Quality Check Workflow

1. Environment Setup

Verify Rust Toolchain:

# Check Rust version
rustc --version

# Check Cargo version
cargo --version

# Check rustfmt
rustfmt --version

# Check clippy
cargo clippy --version

Install/Update Components:

# Update Rust toolchain
rustup update

# Install rustfmt (if not present)
rustup component add rustfmt

# Install clippy (if not present)
rustup component add clippy

# Install cargo-audit for security checks
cargo install cargo-audit

# Install cargo-tarpaulin for coverage
cargo install cargo-tarpaulin

Deliverable: Rust toolchain ready


2. Code Formatting Check (rustfmt)

Check Formatting:

# Check if code is formatted
cargo fmt -- --check

# Check with edition
cargo fmt --edition 2021 -- --check

# Check specific files
rustfmt --check src/main.rs

# Check with verbose output
cargo fmt --verbose -- --check

Auto-Format Code:

# Format all code
cargo fmt

# Format with specific edition
cargo fmt --edition 2021

# Format specific file
rustfmt src/main.rs

Configuration (rustfmt.toml):

# rustfmt.toml
edition = "2021"
max_width = 100
hard_tabs = false
tab_spaces = 4
newline_style = "Unix"
use_small_heuristics = "Default"
reorder_imports = true
reorder_modules = true
remove_nested_parens = true
fn_single_line = false
where_single_line = false
imports_granularity = "Crate"
group_imports = "StdExternalCrate"

Deliverable: Formatting validation report


3. Compilation Check (cargo check)

Fast Compilation Check:

# Basic check
cargo check

# Check with all features
cargo check --all-features

# Check workspace
cargo check --workspace

# Check specific package
cargo check --package my-package

# Check with verbose output
cargo check --verbose

Full Compilation:

# Build project
cargo build

# Build in release mode
cargo build --release

# Build with all features
cargo build --all-features

# Build all targets
cargo build --all-targets

Deliverable: Compilation status report


4. Linting (clippy)

Run Clippy:

# Basic clippy check
cargo clippy

# Deny all warnings
cargo clippy -- -D warnings

# Pedantic mode (strictest)
cargo clippy -- -W clippy::pedantic

# All clippy lints
cargo clippy -- -W clippy::all

# Nursery lints (unstable but useful)
cargo clippy -- -W clippy::nursery

# Check workspace
cargo clippy --workspace

Clippy with Auto-Fix:

# Fix clippy suggestions
cargo clippy --fix

# Fix with deny warnings
cargo clippy --fix -- -D warnings

Configuration (clippy.toml or.clippy.toml):

# clippy.toml
msrv = "1.70"  # Minimum Supported Rust Version

# Allow certain lints
allow = [
    "clippy::module_name_repetitions",
]

# Warn on these
warn = [
    "clippy::all",
    "clippy::pedantic",
    "clippy::cargo",
]

# Deny these
deny = [
    "clippy::unwrap_used",
    "clippy::expect_used",
    "clippy::panic",
]

Deliverable: Clippy lint report


5. Testing (cargo test)

Run Tests:

# Run all tests
cargo test

# Run with verbose output
cargo test -- --nocapture

# Run specific test
cargo test test_name

# Run tests in specific module
cargo test module::test_name

# Run doc tests only
cargo test --doc

# Run with all features
cargo test --all-features

Test with Coverage:

# Install tarpaulin
cargo install cargo-tarpaulin

# Generate coverage
cargo tarpaulin --out Html --out Xml

# Coverage with threshold
cargo tarpaulin --fail-under 80

# Coverage for workspace
cargo tarpaulin --workspace

Deliverable: Test execution and coverage report


6. Security Analysis (cargo audit)

Dependency Security Check:

# Install cargo-audit
cargo install cargo-audit

# Run security audit
cargo audit

# Audit with JSON output
cargo audit --json

# Audit and fix vulnerabilities
cargo audit fix

# Check for yanked crates
cargo audit --deny yanked

Update Dependencies:

# Install cargo-outdated
cargo install cargo-outdated

# Check for outdated dependencies
cargo outdated

# Update dependencies
cargo update

# Update specific dependency
cargo update -p dependency-name

Deliverable: Security audit report


7. Dependency Analysis

Check Dependency Tree:

# Show dependency tree
cargo tree

# Show dependencies for specific package
cargo tree --package my-package

# Show duplicates
cargo tree --duplicates

# Show dependencies with specific features
cargo tree --features feature-name

# Invert tree (show reverse dependencies)
cargo tree --invert

Check Unused Dependencies:

# Install cargo-udeps
cargo install cargo-udeps

# Find unused dependencies
cargo +nightly udeps

Deliverable: Dependency analysis report


8. Code Quality Checks

Check for Unsafe Code:

# Find unsafe blocks
grep -r "unsafe" src/

# Count unsafe blocks
grep -r "unsafe" src/ | wc -l

# Use cargo-geiger for unsafe usage report
cargo install cargo-geiger
cargo geiger

Check Documentation:

# Build documentation
cargo doc

# Check for missing docs
cargo rustdoc -- -D missing_docs

# Check documentation tests
cargo test --doc

Deliverable: Code quality assessment


9. Performance Analysis

Benchmark Tests:

# Run benchmarks
cargo bench

# Run specific benchmark
cargo bench benchmark_name

# Use criterion for better benchmarks
# Add to Cargo.toml:
# [dev-dependencies]
# criterion = "0.5"
cargo bench

Performance Profiling:

# Build with release mode
cargo build --release

# Use flamegraph
cargo install flamegraph
cargo flamegraph

# Use perf (Linux)
perf record --call-graph dwarf ./target/release/binary
perf report

Deliverable: Performance analysis report


10. Comprehensive Quality Check

Run All Checks:

#!/bin/bash
# scripts/quality-check.sh

set -e  # Exit on first error

echo "=== Rust Quality Checks ==="

echo "1. Code Formatting (rustfmt)..."
cargo fmt -- --check

echo "2. Compilation Check..."
cargo check --workspace

echo "3. Linting (clippy)..."
cargo clippy --workspace -- -D warnings

echo "4. Testing..."
cargo test --workspace

echo "5. Documentation Check..."
cargo doc --no-deps --document-private-items

echo "6. Security Audit..."
cargo audit

echo "7. Unused Dependencies..."
cargo +nightly udeps || true  # Don't fail build

echo "=== All Quality Checks Passed ✅ ==="

Makefile Integration:

# Makefile
.PHONY: check fmt lint test quality

check:
	cargo check --workspace

fmt:
	cargo fmt

fmt-check:
	cargo fmt -- --check

lint:
	cargo clippy --workspace -- -D warnings

test:
	cargo test --workspace

quality: fmt-check check lint test
	@echo "All quality checks passed ✅"

Deliverable: Comprehensive quality report


Quality Standards

Code Formatting

  • All code formatted with rustfmt
  • Consistent use of Rust style guide
  • Proper module organization
  • Imports properly grouped
  • Line length ≤ 100 characters

Compilation

  • Code compiles without errors
  • No compiler warnings
  • All features compile
  • Documentation builds
  • All targets build

Linting

  • No clippy warnings (with -D warnings)
  • Pedantic lints addressed
  • No unwrap/expect in production code
  • Proper error handling
  • No panic! in library code

Testing

  • All tests passing
  • Coverage ≥ 80%
  • Doc tests passing
  • Integration tests passing
  • No ignored tests (without reason)

Security

  • No known vulnerabilities
  • Dependencies up to date
  • No yanked crates
  • Minimal unsafe code
  • Unsafe code documented

Code Quality

  • Idiomatic Rust code
  • Proper lifetime annotations
  • Efficient error handling
  • Documentation complete
  • Examples provided

Quality Check Matrix

CheckToolThresholdAuto-Fix
FormattingrustfmtMust passYes
Compilationcargo check0 errorsNo
Lintingclippy0 warningsPartial
Testingcargo testAll passNo
Coveragetarpaulin≥ 80%No
Securitycargo audit0 criticalPartial
Unsafe codecargo geigerMinimizeNo

Pre-commit Integration

Setup Git Hooks:

#!/bin/bash
# .git/hooks/pre-commit

echo "Running Rust quality checks..."

# Format check
if ! cargo fmt -- --check; then
    echo "❌ Code not formatted. Run: cargo fmt"
    exit 1
fi

# Clippy
if ! cargo clippy -- -D warnings; then
    echo "❌ Clippy warnings found"
    exit 1
fi

# Tests
if ! cargo test --quiet; then
    echo "❌ Tests failed"
    exit 1
fi

echo "✅ All pre-commit checks passed"

Make hook executable:

chmod +x .git/hooks/pre-commit

Deliverable: Pre-commit hooks configured


CI/CD Integration

GitHub Actions Example:

# .github/workflows/rust-quality.yml
name: Rust Quality Checks

on: [push, pull_request]

env:
  CARGO_TERM_COLOR: always

jobs:
  quality:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3

      - name: Install Rust toolchain
        uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: stable
          components: rustfmt, clippy
          override: true

      - name: Cache cargo registry
        uses: actions/cache@v3
        with:
          path: ~/.cargo/registry
          key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}

      - name: Check formatting
        run: cargo fmt -- --check

      - name: Check compilation
        run: cargo check --workspace

      - name: Run clippy
        run: cargo clippy --workspace -- -D warnings

      - name: Run tests
        run: cargo test --workspace --verbose

      - name: Check documentation
        run: cargo doc --no-deps --document-private-items

      - name: Security audit
        run: |
          cargo install cargo-audit
          cargo audit

      - name: Generate coverage
        run: |
          cargo install cargo-tarpaulin
          cargo tarpaulin --out Xml --fail-under 80

      - name: Upload coverage
        uses: codecov/codecov-action@v3
        with:
          files: ./cobertura.xml

Deliverable: CI/CD quality pipeline


Quality Check Troubleshooting

rustfmt Formatting Failures

# Check what would change
cargo fmt -- --check

# Apply formatting
cargo fmt

# Check specific file
rustfmt --check src/main.rs

Compilation Errors

# Check with verbose output
cargo check --verbose

# Clean and rebuild
cargo clean
cargo check

# Check dependencies
cargo tree

Clippy Warnings

# Show detailed warnings
cargo clippy -- -W clippy::all

# Auto-fix suggestions
cargo clippy --fix

# Ignore specific warning (last resort)
#[allow(clippy::warning_name)]

Test Failures

# Run with verbose output
cargo test -- --nocapture

# Run specific test
cargo test test_name -- --exact

# Show test output
cargo test -- --show-output

Quality Report Template

# Rust Quality Check Report

## Summary
- **Status**: ✅ All checks passed
- **Date**: 2024-01-15
- **Project**: my-rust-project

## Checks Performed

### Formatting (rustfmt)
- **Status**: ✅ PASS
- **Files Checked**: 42
- **Issues**: 0

### Compilation (cargo check)
- **Status**: ✅ PASS
- **Workspace**: All packages compile
- **Warnings**: 0

### Linting (clippy)
- **Status**: ✅ PASS
- **Warnings**: 0
- **Pedantic**: Enabled

### Testing (cargo test)
- **Status**: ✅ PASS
- **Tests**: 156 passed
- **Doc Tests**: 23 passed

### Coverage (tarpaulin)
- **Status**: ✅ PASS
- **Coverage**: 87% (target: 80%)

### Security (cargo audit)
- **Status**: ✅ PASS
- **Vulnerabilities**: 0
- **Yanked Crates**: 0

### Documentation
- **Status**: ✅ PASS
- **Docs Build**: Success
- **Missing Docs**: 0

## Details

All Rust quality checks passed successfully. Code is well-formatted, compiles cleanly, passes all lints, has good test coverage, and is secure.

## Recommendations

- Continue maintaining high test coverage
- Keep dependencies updated
- Document all public APIs
- Minimize unsafe code usage

Integration with Code Quality Specialist

Input: Rust codebase quality check request Process: Run all Rust quality tools and analyze results Output: Comprehensive quality report with pass/fail status Next Step: Report to code-quality-specialist for consolidation


Best Practices

Development

  • Run cargo fmt on save (IDE integration)
  • Enable clippy in IDE for real-time feedback
  • Use cargo watch for continuous checking
  • Fix warnings immediately

Pre-Commit

  • Run full quality check script
  • Ensure all tests pass
  • Verify no clippy warnings
  • Check documentation builds

CI/CD

  • Run quality checks on every PR
  • Fail build on warnings
  • Generate coverage reports
  • Track quality metrics over time
  • Cache dependencies for speed

Code Review

  • Verify quality checks passed
  • Review clippy suggestions
  • Check test coverage
  • Validate unsafe code usage

Supporting Resources


Success Metrics

  • All code formatted with rustfmt
  • Compilation passes with no warnings
  • Zero clippy warnings
  • All tests passing
  • Coverage ≥ 80%
  • No security vulnerabilities
  • Documentation complete

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Gemini CLI

27.62%
按下载量换算31

Claude Code

22.93%
按下载量换算26

Antigravity

16.12%
按下载量换算18

OpenCode

10.63%
按下载量换算12

Codex

7.76%
按下载量换算9

windsurf

3.28%
按下载量换算4

安全审计

Gen Agent Trust Hub

未通过

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。

来源信息

继续浏览同类 Skills