Pre-Commit Config Validator for Openclaw

A specialized validation tool for .pre-commit-config.yaml files that enforces 23 distinct rules across structure, hooks, and best practices.

charlie-morrison
v1.0.1
May 1, 2026
0
875
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install pre-commit-config-validator

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install pre-commit-config-validator using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Pre-Commit Config Validator?

The Pre-Commit Config Validator is a professional-grade tool designed to verify the integrity and compliance of .pre-commit-config.yaml files. It acts as a gatekeeper for your Git hooks, ensuring that every repository entry, hook definition, and local script is configured correctly before it enters production. By utilizing this skill from the Openclaw Skills library, developers can prevent broken CI pipelines and maintain a standardized environment for local development.

Beyond basic syntax checking, this validator implements deep inspection of hook schemas, including validation of staging values, language environments, and version pinning. It is an essential utility for teams aiming for high-quality codebase maintenance and automated governance of their development lifecycle through Openclaw Skills.

Pre-Commit Config Validator Use Cases

  • Automated validation of .pre-commit-config.yaml files within CI/CD pipelines to prevent misconfiguration deployments.
  • Auditing large monorepos to ensure consistent hook IDs and repository versions.
  • Troubleshooting local hook definitions for missing entries or unsupported language environments.
  • Migrating legacy pre-commit configurations to follow modern best practices and security standards.

How Pre-Commit Config Validator Works

  1. The user provides one or more YAML configuration files as input to the validation script.
  2. The validator parses the YAML syntax to ensure basic file integrity and structural compliance.
  3. It systematically applies 23 predefined rules divided into categories such as Structure, Repository Entries, and Hook Definitions.
  4. The tool evaluates repository revisions, ensuring that floating branches are identified and semver patterns are recommended.
  5. A comprehensive report is generated in the requested format (text, JSON, or summary), providing actionable diagnostics for any identified issues.

Pre-Commit Config Validator Setup

To start using this skill from Openclaw Skills, ensure you have Python 3 installed and the validator script available in your local path. Use the following commands to validate your configuration:

# Standard validation of the local config
python3 scripts/precommit_validator.py validate .pre-commit-config.yaml

# Run only best practices linting
python3 scripts/precommit_validator.py lint .pre-commit-config.yaml

# Use strict mode to fail on warnings
python3 scripts/precommit_validator.py validate .pre-commit-config.yaml --strict

Pre-Commit Config Validator Data Schema & Taxonomy

The validator organizes its findings across five distinct rule categories, providing a clear taxonomy for diagnostics:

Category Rule Count Focus Area
Structure (S) 5 YAML syntax, top-level keys, and required root keys.
Repository (R) 6 Repo URLs, rev pinning (SHA/tag), and hook list integrity.
Hooks (H) 6 Hook IDs, valid stages, argument lists, and additional dependencies.
Local (L) 3 Requirements for local repo types, including entry points and languages.
Best Practices (B) 4 Duplicate URLs, meta-hook usage, and semver pattern matching.

Pre-Commit Config Validator Advanced Features

  • Multi-file support: Validate multiple configuration files in a single command execution for complex project structures.
  • Machine-readable output: Generate JSON diagnostic arrays to integrate results with third-party monitoring tools or custom dashboards.
  • Rule-based filtering: Target specific validation domains such as repository metadata or hook definitions independently.
  • Strict enforcement: Configure exit codes to treat warnings as errors, ensuring your Openclaw Skills workflow adheres to the highest standards.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*