- Home
- Skills
- Testing & Debugging
- Diff Coverage: Test the Lines You Changed
Diff Coverage: Test the Lines You Changed
Measure test coverage of only the lines a change adds, then get a plan of the missing tests with code and hints. Cobertura XML and coverage.py JSON, thresholds, CI recipes, offline scripts and 25 tests.
$7
What it does
- Calculates the exact percentage of new or changed code covered by your tests
- Lists every new line of code that was not executed during your last test run
- Provides a test plan that suggests what kind of test each missing line needs
- Identifies files that were skipped or not measured in your report
- Creates a formatted summary ready to be pasted into a code review or pull request
Who it's for
Developers fixing bugs or adding features
Ensure every new line of code you write is actually tested before you merge it.
Try asking: “Check the test coverage for the changes in this patch file.”
Code reviewers and tech leads
Stop guessing if a pull request is safe and see exactly which new lines are missing tests.
Try asking: “List the uncovered lines in this diff and tell me what tests they need.”
Teams setting up quality gates
Set a minimum coverage rule for new code without needing to fix the whole legacy project at once.
Try asking: “Calculate the diff coverage for this change and tell me if it stays above 80 percent.”
Diff Coverage: Test the Lines You Changed
Example session with this skill installed
I have a patch file called bugfix.patch and a coverage report called coverage.xml. Can you check the coverage for my changes and tell me what is missing?
- Read your context and instructions
- Compiled the diff coverage
I will analyze your code changes and the coverage report to see what is tested.
I have checked bugfix.patch against your coverage.xml report. Your change adds 12 executable lines of code.
Coverage Results
- Total New Lines: 12
- Covered Lines: 9
- Diff Coverage: 75.0%
This is below the common 80% goal. Here are the gaps you need to fill:
File: src/auth.py
- Line 45:
return False— Needs a test for the error path when the token is expired. - Line 52:
logger.error("Connection failed")— Needs a test that simulates a network timeout.
File: src/utils.py
- Line 89:
for item in items:— Needs a test with an empty list to verify the loop behavior.
Next Steps
You should add tests that trigger these specific lines. Once you run them and update the coverage file, I can check the numbers again for you. Would you like me to suggest the specific test code for one of these lines?
Connects securely to your tools. The creator never sees your data.
About this skill
When you change code, it is easy to miss testing a new edge case or an error path. This skill helps you focus only on the lines you just added or changed. Instead of looking at the coverage for your whole project, which can be messy and distracting, it looks at your specific changes and tells you exactly what is not tested yet.
It reads your code changes and your test reports to find the gaps. It then creates a clear plan showing the specific lines of code that need attention and the type of test you should write for them, like an error check or a loop test.
How it works
- Give your AI agent a file showing your code changes and a recent test coverage report.
- The skill identifies which of your new lines were actually run during the tests.
- It calculates a percentage score for just your new changes.
- It lists every new line that was missed, including the code itself and a hint on how to test it.
- You use the plan to write the missing tests and verify the fix.
What you get: A detailed report of untested new code and a step-by-step plan to reach your coverage goals.
Only works with Cobertura XML or coverage.py JSON reports. It does not run git or your tests for you.
This skill uses Python scripts to parse unified diffs and coverage reports (Cobertura XML or coverage.py JSON). It maps line numbers from the diff to the execution data in the report to calculate 'patch coverage'. It includes templates for PR comments and CI configurations. It does not require network or git access as it operates entirely on provided local files.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 1 day ago
- Software
Python
Git
Permissions
What's inside
Frequently Asked Questions
New in Testing & Debugging
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Testing & Debugging.