Validate changes

From FlorianBruniaux/claude-code-plugins · View interactive version

Validate changes is an AI agent skill from the GitHub repository FlorianBruniaux/claude-code-plugins. Evaluate staged changes with the output-evaluator agent (LLM-as-a-Judge) and return an APPROVE, NEEDS_REVIEW, or REJECT verdict before committing. Use before committing significant or security-sensitive changes.

How to use this skill

Skill file

Validate changes before commit

Evaluate staged git changes using the output-evaluator agent to catch issues before committing.

Process

Step 1: Check for staged changes

Run git diff --cached --stat to see what's staged. If nothing is staged, inform the user and exit.

Step 2: Get the full diff

Run git diff --cached to get the complete diff of all staged changes.

Step 3: Invoke the evaluator

Use the Agent tool to launch the output-evaluator subagent (examples/agents/output-evaluator.md; it must be installed in .claude/agents/) with the diff:

Evaluate these staged changes for correctness, completeness, and safety.
Return a JSON verdict with scores and issues.

Changes:
[paste the git diff here]

Step 4: Parse and act on verdict

Based on the evaluation result:

If APPROVE:

If NEEDS_REVIEW:

If REJECT:

Step 5: Commit (if approved)

If user confirms, create the commit using the standard commit flow.

Usage examples

/validate-changes

Output:

Evaluating 3 staged files...

VERDICT: NEEDS_REVIEW

Scores:
  Correctness:  8/10
  Completeness: 6/10
  Safety:       9/10

Issues Found:
  [MEDIUM] src/api/handler.ts:45
    Missing error handling for network failures

  [LOW] src/utils/format.ts:12
    Consider adding input validation

Suggestion: Add try-catch around the fetch call in handler.ts

How would you like to proceed?
  1. Fix issues and re-evaluate
  2. Commit anyway (1 medium issue)
  3. Abort

Cost awareness

This skill invokes an LLM evaluation, which uses API tokens:

When to use

When to skip

Integration with git hooks

For automatic evaluation on every commit, see pre-commit-evaluator.sh hook.

This skill is the manual alternative when you want control over when evaluation runs.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.