# Gate Diff Only Test Coverage On Changed Lines Before Merging With Diff Cover

> Compare coverage reports against a git diff so an agent can flag newly changed lines that still lack tests before merge.

- Skill: `agentskillexchange/gate-diff-only-test-coverage-on-changed-lines-before-merging` (Agent Skill)
- Install (CLI): `npx skillmds@latest add agentskillexchange/gate-diff-only-test-coverage-on-changed-lines-before-merging`
- Raw SKILL.md: https://api.skillmd.com/api/skills/agentskillexchange/gate-diff-only-test-coverage-on-changed-lines-before-merging/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: agentskillexchange (https://skillmd.com/u/agentskillexchange)
- Updated: 2026-09-08
- Page: https://skillmd.com/skills/agentskillexchange/gate-diff-only-test-coverage-on-changed-lines-before-merging

---


# Gate Diff Only Test Coverage On Changed Lines Before Merging With Diff Cover

Compare coverage reports against a git diff so an agent can flag newly changed lines that still lack tests before merge.

## Prerequisites

Git, supported XML or LCov coverage report, Python 3, pip

## Installation

Use the upstream install or setup path that matches your environment:
- pip install diff-cover
- git clone https://github.com/Bachmann1234/diff-cover.git
- make a pull request from your fork.
- pip install poetry

Requirements and caveats from upstream:
- Currently, diff-cover requires that:
- coverage.py__ (Python)
- poetry manages a python virtual environment and organizes dependencies. It also

Basic usage or getting-started notes:
- ------------
- To install the latest release:
- .. code:: bash

- Source: https://github.com/Bachmann1234/diff_cover
- Extracted from upstream docs: https://raw.githubusercontent.com/Bachmann1234/diff_cover/HEAD/README.rst

## Documentation

- https://github.com/Bachmann1234/diff_cover

## Source

- [Agent Skill Exchange](https://agentskillexchange.com/skills/gate-diff-only-test-coverage-on-changed-lines-before-merging-with-diff-cover/)

