Claude Code Plugins

Community-maintained marketplace

Feedback

test-coverage-analyst

@MUmerRazzaq/fast-next-todo
0
0

Guides on analyzing and improving test coverage for Python (pytest-cov) and JavaScript (c8) projects. Use when a user asks to set up test coverage, generate coverage reports, understand why coverage is low, or improve their test coverage.

Install Skill

1Download skill
2Enable skills in Claude

Open claude.ai/settings/capabilities and find the "Skills" section

3Upload to Claude

Click "Upload skill" and select the downloaded ZIP file

Note: Please verify skill by going through its instructions before using it.

SKILL.md

name test-coverage-analyst
description Guides on analyzing and improving test coverage for Python (pytest-cov) and JavaScript (c8) projects. Use when a user asks to set up test coverage, generate coverage reports, understand why coverage is low, or improve their test coverage.

Test Coverage Analyst

Overview

This skill provides a structured workflow for analyzing and improving test coverage in Python and JavaScript projects. It covers configuration, report generation, and strategies for increasing coverage.

Workflow

Follow these steps to help a user with test coverage.

1. Identify Project Type and Tools

First, determine the project's language and package manager.

  • Python: Look for requirements.txt, pyproject.toml, or a venv directory. The primary coverage tool is pytest-cov.
  • JavaScript: Look for package.json. The recommended coverage tool is c8.

2. Check for Existing Configuration

Before adding new configurations, inspect existing files for coverage setup.

  • For Python, check pyproject.toml, setup.cfg, or .coveragerc.
  • For JavaScript, check the "c8" key or scripts in package.json, or a .nycrc.json file.

3. Configure and Install Tools

If coverage tools are not set up, guide the user through installation and configuration.

  • For Python (pytest-cov):

  • For JavaScript (c8):

4. Run Coverage and Generate Reports

Execute the coverage tool to run tests and generate a report. The most useful reports are the terminal summary and the interactive HTML report.

  • Terminal Report: Provides a quick summary of coverage percentages.
  • HTML Report: Provides a detailed, line-by-line view of code coverage, which is essential for identifying untested code.
  • XML/LCOV Report: These are for integrating with third-party CI services like Codecov.

Refer to the language-specific guides for exact commands.

5. Analyze the Report and Formulate a Strategy

  • Interpret the results: Explain the difference between line and branch coverage. Use the HTML report to pinpoint exactly which lines and branches are not covered.
  • Develop an improvement plan: Based on the report, create a plan to improve coverage.
  • For a deep dive into analysis and strategies, consult the Test Coverage Improvement Strategies guide.

6. Continuous Integration (CI)

For ongoing coverage monitoring, help the user integrate coverage checks into their CI pipeline.

  • This usually involves generating a report (XML or LCOV) and uploading it to a service like Codecov.
  • For example configurations, see the CI Integration for Coverage guide.

Resources

This skill includes the following reference guides: