Get the FREE Ultimate OpenClaw Setup Guide →

quality-hooks

Scanned
npx machina-cli add skill a5c-ai/babysitter/quality-hooks --openclaw
Files (1)
SKILL.md
1.8 KB

quality-hooks

You are quality-hooks -- the quality pipeline skill for Pilot Shell.

Overview

This skill defines the language-specific quality tool chains that run as PostToolUse hooks in Pilot Shell. It auto-detects the project language and applies the appropriate linter, formatter, and type checker with auto-fix support.

Tool Chains

Python

ruff check --fix .         # Lint with auto-fix
ruff format .              # Format
pyright .                  # Type check

TypeScript / JavaScript

npx eslint --fix .         # Lint with auto-fix
npx prettier --write .     # Format
npx tsc --noEmit           # Type check

Go

golangci-lint run --fix    # Lint with auto-fix
gofmt -w .                 # Format
go vet ./...               # Type/static check

Auto-Fix Convergence Loop

When quality checks fail:

  1. Apply all auto-fixable issues
  2. Re-run quality checks
  3. Repeat up to 3 times
  4. Report remaining unfixable issues

Quality Scoring

Composite score = weighted average:

  • Lint: 25%
  • Format: 15%
  • Typecheck: 25%
  • Tests: 35%

Target: 85/100 (configurable via targetQuality)

Hook Integration Points

Pilot Shell HookQuality Action
PostToolUse (Edit/Write)Run file_checker on modified files
PostToolUse (file creation)Run full pipeline on new files
Pre-mergeRun full pipeline on all changes

Source

git clone https://github.com/a5c-ai/babysitter/blob/main/plugins/babysitter/skills/babysit/process/methodologies/pilot-shell/skills/quality-hooks/SKILL.mdView on GitHub

Overview

quality-hooks is a language-specific quality pipeline for Pilot Shell. It auto-detects the project language and runs the appropriate linter, formatter, and type checker with auto-fix support, operating as PostToolUse hooks to keep code clean.

How This Skill Works

The tool auto-detects the project language and executes the corresponding chain: Python uses ruff check --fix, ruff format, and pyright; TypeScript/JavaScript uses npx eslint --fix, npx prettier --write, and npx tsc --noEmit; Go uses golangci-lint run --fix, gofmt -w, and go vet ./.... If quality checks fail, it enters an auto-fix convergence loop: apply fixes, re-run checks, repeat up to 3 times, then report remaining issues. It computes a composite score using weighted categories (Lint 25%, Format 15%, Typecheck 25%, Tests 35%), with targetQuality configurable (default 85).

When to Use It

  • After editing Python, TypeScript/JavaScript, or Go files to catch issues early
  • Before merging changes to ensure clean diffs
  • When CI reports lint/format/typecheck failures in a PR
  • During PostToolUse hooks to auto-fix and recheck modified files
  • When adding new files to automatically apply quality checks from the start

Quick Start

  1. Step 1: Install/enable quality-hooks in Pilot Shell and ensure required tools (ruff, pyright, eslint, prettier, tsc, golangci-lint) are available
  2. Step 2: Configure targetQuality in your settings (default 85)
  3. Step 3: Make code changes; quality-hooks will auto-fix, re-check, and report remaining issues up to 3 iterations

Best Practices

  • Enable auto-fix where safe to minimize manual edits
  • Run the full pipeline on new or modified files before commits or merges
  • Tune targetQuality to match your project's quality bar
  • Review the final report to address unfixable issues
  • Keep all tooling up to date (ruff, pyright, eslint, prettier, tsc, golangci-lint)

Example Use Cases

  • A Python project auto-fixes lint errors with ruff and formats code with ruff format, then type-checks with pyright
  • A TypeScript project runs eslint --fix, formats with prettier, and type-checks with tsc
  • A Go project lints with golangci-lint --fix, formats with gofmt, and runs go vet
  • A PR pre-merge triggers the full pipeline across all changes for consistency
  • New files trigger a complete quality pass to establish a clean baseline from day one

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers