diff-eval

Compare generated patches to ground-truth PR diffs and report scoring.

3|2|Updated Mar 14, 2026
One-click install
npx skills add https://github.com/wzh4464/claude-skills --skill diff-eval
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: diff-eval
Source: https://github.com/wzh4464/claude-skills/tree/main/diff-eval
Command: npx skills add https://github.com/wzh4464/claude-skills --skill diff-eval

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Evaluates agent-generated code changes against human-approved PRs using a formal rubric, diff analysis, and auto-generated file filtering to ensure alignment with ground truth.

Core Features & Use Cases

  • Structured diff comparison: compare local agent changes (relative to PR base) with the ground-truth PR diff, while filtering out auto-generated files.
  • Dual analysis: perform data-based coverage on file-level changes and semantic checks on functional intent.
  • Scoring and reporting: produce a formal evaluation report based on functional correctness, completeness, and behavioral equivalence.
  • Use cases: pre-merge validation of AI-generated patches, benchmarking code generation tools, and artifacting evaluation results for audits.

Quick Start

Compute the base commit, derive the generated patch, compare it against the PR diff, and generate a full evaluation report.

Frequently Asked Questions about diff-eval

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

FAQPage Schema
How do I evaluate AI agent code patches against human-approved PRs?

You can evaluate AI-generated patches by comparing them against ground-truth PR diffs while filtering out auto-generated files. This process produces a structured evaluation report detailing data-based and semantic coverage against a formal scoring rubric.

What is structured diff comparison for pre-merge validation?

Structured diff comparison is the process of comparing local agent changes relative to a PR base commit with the ground-truth PR diff. It performs data-based coverage on file-level changes and semantic checks on functional intent to ensure alignment with ground truth.

How do I score code generation tools using a formal rubric?

Score code generation tools by determining the PR base commit and head, computing the generated patch, and comparing it to the ground-truth PR diff. This produces a formal evaluation report based on functional correctness, completeness, and behavioral equivalence.

Does the evaluation exclude auto-generated files from PR diff analysis?

Yes, the evaluation excludes auto-generated files from the PR diff analysis. It compares the generated patch to the ground-truth PR diff while actively filtering out auto-generated files to ensure accurate measurement of functional intent and data-based coverage.

Can I use diff analysis for benchmarking code generation tools?

Yes, you can use diff analysis for benchmarking code generation tools by comparing their output patches against human-approved PRs. The evaluation artifacts the results for audits, measuring functional correctness and behavioral equivalence against a formal rubric.

What are the limitations of semantic checks in patch evaluation?

Semantic checks in patch evaluation are limited to verifying functional intent and behavioral equivalence against the ground-truth PR diff. The evaluation relies on comparing computed patches relative to the base commit and does not account for changes outside the defined PR scope.