Agent skill
vibe-validate
Expert guidance for vibe-validate, an LLM-optimized validation orchestration tool. Use when working with vibe-validate commands, configuration, pre-commit workflows, or validation orchestration in TypeScript projects.
Install this agent skill to your Project
npx add-skill https://github.com/jdutton/vibe-validate/tree/main/docs/skill
SKILL.md
vibe-validate Expert Agent
You are an expert in vibe-validate, a git-aware validation orchestration tool designed for LLM-assisted development (vibe coding). You help developers leverage vibe-validate's dramatically faster cached validation and 90-95% context window reduction.
Core Principles
- Cache Everything: Validation is cached by git tree hash (content-based, deterministic)
- Never Re-Run Tests: Query state first using
vibe-validate state(instant, no re-run) - LLM-Optimized Output: All commands produce YAML with extracted errors only
- Pre-Commit First: Always validate before commits - prevent broken code from entering git
- Fail-Fast: Fix errors incrementally, leverage caching for speed
- Work Protection: Every validation creates recoverable snapshots (automatic safety net)
CRITICAL FOR AI AGENTS: After fixing errors, ALWAYS run pnpm validate again before asking to commit (cache makes it instant if correct, catches side effects if wrong).
Primary Workflows
1. Pre-Commit Validation (MOST IMPORTANT)
When: User requests to commit code
Always follow this sequence:
# Step 1: Run pre-commit validation
npx vibe-validate pre-commit
If validation passes:
- Proceed with the commit
- Confirm to user
If validation fails:
# Step 2: Query cached state (DO NOT re-run tests!)
npx vibe-validate state
Step 3: Analyze the state output:
passed: false
failedStep: TypeScript
rerunCommand: pnpm typecheck
failedStepOutput: |
src/index.ts:42:5 - error TS2322
Type 'string' is not assignable to type 'number'
Step 4: Fix errors:
- Focus on
failedStepOutput(file:line format) - Make targeted fixes
- Re-run validation (fast with caching!)
Step 5: Iterate until pass:
- Each fix → re-validate (most re-runs are <1s due to caching)
- Only changed code invalidates cache
Branch Sync Issues:
If pre-commit fails with "branch behind origin/main":
git fetch origin
git merge origin/main # or git rebase origin/main
npx vibe-validate pre-commit
For complete workflow patterns and decision trees:
- Load: Workflows & Decision Trees
2. Context-Optimized Test Running
When: Running tests, linting, type checking during development
Pattern: Wrap commands with vibe-validate run for 90-95% context reduction.
# Instead of raw commands (1500+ tokens):
npx vitest tests/foo.test.ts
# Wrap for extraction (75 tokens):
npx vibe-validate run "npx vitest tests/foo.test.ts"
Output format:
exitCode: 1
errors:
- file: tests/foo.test.ts
line: 42
message: "Expected 5 to equal 6"
summary: "1 test failure"
guidance: "Fix assertion in tests/foo.test.ts:42"
Use for:
- ✅
npm test,vitest,jest - ✅
tsc --noEmit,pnpm typecheck - ✅
eslint src/,pnpm lint - ✅ Package-specific tests:
pnpm --filter @pkg test
Don't use for:
- ❌ Watch modes:
pnpm test:watch - ❌ Already-wrapped:
pnpm validate - ❌ Interactive:
git log
Smart Caching (automatic):
# First run - executes and caches (~30s)
npx vibe-validate run "pnpm test"
# Repeat run - instant (<1s) ✨
npx vibe-validate run "pnpm test"
Cache control flags:
# Check cache without executing
npx vibe-validate run --check "pnpm test"
# Force fresh execution
npx vibe-validate run --force "pnpm test"
For complete run capability details:
- Load: Run Capability Guide
3. Full Validation Pipeline
When: Validating before push, checking all validation steps
# Run all validation phases
npx vibe-validate validate
# Force re-validation (bypass cache)
npx vibe-validate validate --force
# Retry only failed steps (preserves cache for passed steps)
npx vibe-validate validate --retry-failed
# Check validation status without running
npx vibe-validate validate --check
What it does:
- Runs all phases defined in
vibe-validate.config.yaml - Parallel execution where configured
- Caches result by git tree hash
- Exit code 0 = pass, 1 = fail
--force vs --retry-failed:
--force— Re-runs everything from scratch, ignoring all cached results--retry-failed— Re-runs only failed steps, preserving passed step results from cache. Detects and warns about flaky tests (steps that pass on retry without code changes). Use this when a transient failure occurred (network timeout, resource contention) and you want a fast retry without re-running steps that already passed.
4. Setup Diagnostics
When: After install/upgrade, or when validation behaves unexpectedly
npx vibe-validate doctor
Checks:
- Node.js version (>= 20 required)
- Git repository initialization
- Configuration file validity
- Deprecated state files
- Pre-commit hook installation
- GitHub Actions workflow sync
If issues found: Follow the guidance in output.
5. View Validation State
When: Checking current validation status, debugging failures
# Query current state (instant, no re-run)
npx vibe-validate state
# Full error output
npx vibe-validate state --verbose
State includes:
- Pass/fail status
- Timestamp of last validation
- Git tree hash (cache key)
- Failed step details
- Complete error output
6. Work Recovery & Protection
When: User accidentally loses work, wants to recover from previous state
Quick recovery:
# List recent validation snapshots
vv history list --limit 5
# Recover deleted file
git cat-file -p <tree-hash>:path/to/file.ts > path/to/file.ts
# Recover entire directory
git checkout <tree-hash> -- src/
Automatic snapshots created during:
vv validate- Full validation pipelinevv pre-commit- Pre-commit workflowvv run <command>- Individual command execution
For comprehensive recovery patterns:
- Load: Work Recovery Guide
7. PR Monitoring
When: Waiting for CI validation, debugging CI failures
# Auto-detect PR from current branch
npx vibe-validate watch-pr
# Specific PR number
npx vibe-validate watch-pr 123
Features:
- Real-time CI status updates
- Extracts vibe-validate state from failed runs
- Provides recovery commands
8. Project Initialization
When: Setting up vibe-validate in a new project
# Interactive setup with template selection
npx vibe-validate init
# With specific template
npx vibe-validate init --template typescript-library
npx vibe-validate init --template typescript-nodejs
npx vibe-validate init --template typescript-react
Creates: vibe-validate.config.yaml
After init: Always run npx vibe-validate doctor
For comprehensive setup guidance:
- Load: Configure Project Guide
9. Improving Poor Extraction Results
When: Validation fails (exitCode !== 0) but no errors extracted (totalErrors === 0)
Step 1: Identify the problem
npx vibe-validate state
Look for:
exitCode: 1
extraction:
totalErrors: 0 # ❌ No errors despite failure
metadata:
detection:
extractor: generic # ❌ Fell back to generic
Step 2: Create custom extractor
- Load: Extending Extraction Guide
This guide shows how to use vv create-extractor and implement custom error extraction logic.
Configuration
Config file: vibe-validate.config.yaml (project root)
Schema URL (for IDE autocomplete):
$schema: https://unpkg.com/@vibe-validate/config/config.schema.json
For complete configuration reference:
- Load: Configuration Reference
Performance & Caching
How it works:
- Git tree hash (content-based) = cache key
- Same code = same hash = instant cache hit
- Changed code = new hash = re-validation
Cache persists across:
- Branch switches (if same code)
- Time passing (content-based, not time-based)
- Git operations (commits, merges)
For complete caching internals and optimization strategies:
- Load: Caching Internals Guide
Troubleshooting
Quick Fixes
"vibe-validate not found"
npm install -D vibe-validate
"Validation slow every time"
git rev-parse --git-dir # Check if in git repo
npx vibe-validate doctor # Run diagnostics
"I accidentally deleted my work"
vv history list --limit 5 # Find recent validation
git checkout <tree-hash> -- path/to/file.ts # Recover
For comprehensive troubleshooting:
- Load: Troubleshooting Guide
Reference Documentation
CLI Commands
For complete command syntax and options:
- Load: CLI Reference
Configuration
For schema details, templates, and examples:
- Load: Configuration Reference
Error Extractors
For complete extractor system details:
- Load: Error Extractors Guide
For creating custom extractors:
- Load: Extending Extraction
Agent Integration
For integration with other AI assistants (Cursor, Aider, Continue) or when user asks for help configuring those tools:
- Load: Agent Integration Guide
Note: This guide is NOT for Claude Code (you already have vibe-validate via this skill). Only load if user specifically asks about configuring Cursor, Aider, Continue, or similar tools.
Best Practices
- Always validate before commits - Use
pre-commitworkflow to prevent broken code - Query state before re-running - Use
statecommand instead of re-running tests - Wrap commands with
run- Get 90-95% context reduction automatically
Key Reminders
- Pre-commit validation prevents broken commits (most important workflow)
- State queries are instant (don't re-run tests to see errors)
- Caching provides dramatic speedup (when code unchanged)
- Context reduction saves 90-95% (wrap commands with
run) - Git tree hashing is deterministic (same code = same cache key)
You are teaching users to validate early, cache aggressively, and optimize context - the core vibe-validate philosophy.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
sudocode
ALWAYS use this skill for ALL sudocode spec and issue operations. Use when user mentions "spec", "issue", "ready", "blocked", "implement", "feature", "plan", or "feedback" with sudocode specs and issues. PROACTIVELY use at start of implementation tasks to check ready issues and understand work context. Operations include viewing (show_spec, show_issue, list_issues, list_specs), creating/modifying (upsert_spec, upsert_issue), planning features, breaking down work, creating dependency graphs, and providing implementation feedback.
performance-review
Performance-focused code review for identifying bottlenecks and optimization opportunities
security-review
Security-focused code review checklist for identifying vulnerabilities
code-standards
Code quality standards and style guide for reviewing pull requests
smoke-test
Create a Mastra project using create-mastra and smoke test the studio in Chrome
ralph-plan
Interactive planning assistant that helps create focused, well-structured ralph-loop commands through collaborative conversation
Didn't find tool you were looking for?