code-quality

Enforce Rust formatting, linting, builds, and tests across the workspace.

Updated Dec 20, 2025
One-click install
npx skills add https://github.com/davidkelley/searchlite --skill code-quality-davidkelley
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: code-quality
Source: https://github.com/davidkelley/searchlite/tree/main/.codex/skills/code-quality
Command: npx skills add https://github.com/davidkelley/searchlite --skill code-quality-davidkelley

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill provides guardrails to keep the Searchlite Rust workspace compliant with formatting, linting, building, testing, and performance expectations; ensuring changes are reviewable, reproducible, and safe.

Core Features & Use Cases

  • Enforces formatting, linting, building, and testing across the repository with --all-features to ensure a consistent baseline.
  • Guides changes to core indexing code, storage/durability, CLI flags, HTTP endpoints, and feature-gated areas (vectors, gpu, zstd, ffi, wasm) to keep PRs safe and auditable.
  • Keeps artifacts in sync with contracts by updating openapi.yaml, search-request.schema.json, and example documents when APIs change.

Quick Start

Use the code-quality skill to validate a PR by running the canonical checks:

  • cargo fmt --all
  • cargo clippy --all --all-features -- -D warnings
  • cargo build --all --all-features
  • cargo test --all --all-features If you touch API or schema, also run and update openapi.yaml and search-request.schema.json and provide updated examples in docs.

Frequently Asked Questions about code-quality

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enforce Rust linting and formatting across a workspace before a PR?

Enforce Rust linting and formatting across a workspace by running cargo fmt --all and cargo clippy --all --all-features -- -D warnings. This ensures a consistent baseline, making changes reviewable, reproducible, and safe for the repository.

What's the best way to validate builds and tests with all feature flags in a Rust project?

Validate builds and tests with all feature flags by running cargo build --all --all-features and cargo test --all --all-features. This checks feature-gated areas like vectors, gpu, zstd, ffi, and wasm to keep pull requests auditable.

How do I keep openapi.yaml and schema files in sync when changing HTTP endpoints?

Keep openapi.yaml and search-request.schema.json in sync by updating these artifacts and providing updated example documents in docs when APIs or contracts change. This maintains compliance between code and API definitions.

Does the code-quality skill work with feature-gated Rust areas like ffi and wasm?

Yes, the code-quality skill works with feature-gated Rust areas like ffi, wasm, vectors, gpu, and zstd. It guides changes to these areas by running canonical Rust toolchain steps using the --all-features flag to ensure safety and auditability.

Why does cargo clippy fail with warnings during Rust CI checks?

Cargo clippy fails during Rust CI checks when warnings are present because the canonical command uses the -D warnings flag to strictly deny them. This enforces zero-warning linting across the entire workspace to maintain code quality.

How do I run canonical Rust toolchain steps to check indexing code and CLI flags?

Run canonical Rust toolchain steps to check indexing code, storage, CLI flags, and HTTP endpoints by executing cargo fmt, cargo clippy, cargo build, and cargo test with the --all --all-features arguments to enforce formatting and testing compliance.