sequenzia/agent-alchemy/analyze-coverage
Claude Code and agent skill by sequenzia/agent-alchemy
- community
- ext:[{"type":"config","description":"Configuration overrides"}]
Checking that the SKILL.md file is still in the repository.
Analyze test coverage and identify gaps with actionable recommendations
Install
npx vskill@latest install sequenzia/agent-alchemy/analyze-coverageSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as sequenzia/agent-alchemy/analyze-coverage.
Analyze Coverage Skill
Analyze test coverage for any project by running real coverage tools, parsing results into structured reports, and identifying gaps with actionable recommendations. Optionally maps coverage against spec acceptance criteria to find untested requirements.
CRITICAL: Complete ALL 6 phases. The workflow is not complete until Phase 6: Suggest Next Steps is finished. After completing each phase, immediately proceed to the next phase without waiting for user prompts.
Core Principles
- Real coverage data -- Run actual coverage tools (pytest-cov, istanbul/c8) via Bash. Never estimate or guess coverage percentages.
- Standalone operation -- This skill works on any project. It does not require the SDD pipeline, specs, or any other skill to function.
- Actionable output -- Every coverage gap should include a specific suggestion for what test to write, not just a percentage.
- Graceful degradation -- If coverage tools are not installed, detect and inform the user with install commands. If a spec is invalid, skip spec mapping and proceed with coverage-only analysis.
AskUserQuestion is MANDATORY
IMPORTANT: You MUST use the AskUserQuestion tool for ALL questions to the user. Never ask questions through regular text output.
- Clarifying questions about project structure -> AskUserQuestion
- Framework/tool selection -> AskUserQuestion
- Threshold confirmation -> AskUserQuestion
Text output should only be used for presenting information, summaries, reports, and progress updates.
NEVER do this (asking via text output):
ALWAYS do this (using AskUserQuestion tool):
Phase 1: Detect Environment
Goal: Auto-detect the project's test framework, coverage tool, and source package.
Parse Arguments
Analyze $ARGUMENTS to extract optional parameters:
- Project path: Directory to analyze (default: current working directory)
- `--spec <path>`: Spec file for acceptance criteria mapping
- `--threshold <percentage>`: Coverage threshold override (default: 80%)
Detect Project Type
Determine the project type by checking for language-specific files:
Python detection (check in order):
pyproject.tomlexists -> Python projectsetup.pyorsetup.cfgexists -> Python projectrequirements.txtexists -> Python project*.pyfiles in source directories -> Python project
TypeScript/JavaScript detection (check in order):
package.jsonexists -> TypeScript/JavaScript projecttsconfig.jsonexists -> TypeScript project*.tsor*.tsxfiles in source directories -> TypeScript project
If both Python and TypeScript indicators are found, prefer the one with more signals. If ambiguous, prompt the user:
Detect Coverage Tool
Read the coverage patterns reference for framework-specific detection:
Python: pytest-cov
Check for pytest-cov in the following locations (stop at first match):
pyproject.toml-> look for "pytest-cov" in dependenciesrequirements.txt/requirements-dev.txt-> look for "pytest-cov" linesetup.py/setup.cfg-> look for "pytest-cov" in install_requires or extras_require- Run
pip list 2>/dev/null | grep -i pytest-cov
TypeScript: istanbul / c8
Check package.json for coverage tool packages:
devDependencies-> look forc8,@vitest/coverage-v8,@vitest/coverage-istanbuldevDependencies-> look forjest(Jest has built-in istanbul coverage)- Check if c8 binary is available:
npx c8 --version 2>/dev/null
Detect Test Runner
Python:
pyproject.tomlwith[tool.pytest.ini_options]-> pytestpytest.iniorconftest.pyexists -> pytest
TypeScript:
vitest.config.*exists -> Vitestjest.config.*exists -> Jestpackage.jsonwithvitestin devDependencies -> Vitestpackage.jsonwithjestin devDependencies -> Jest
Detect Source Package
Identify the main source package/directory to measure coverage for:
Python:
- Check
pyproject.toml[tool.coverage.run] sourcesetting - Check
.coveragerc[run] sourcesetting - Look for directories containing
__init__.py - Exclude
tests/,test/,docs/,.venv/,venv/ - If multiple candidates, prompt the user
TypeScript:
- Check
vitest.config.*orjest.config.*forcollectCoverageFromorcoverage.include - Default to
src/if it exists - If
src/does not exist, look for the main directory frompackage.jsonmainormodulefield - If ambiguous, prompt the user
Detect Test Directories
Locate test files and directories:
Python:
TypeScript:
Handle Missing Coverage Tool
If the coverage tool is not detected:
Python -- pytest-cov not found:
TypeScript -- no coverage tool found:
For Vitest projects:
For Jest projects:
After presenting the install command, stop the workflow. Do not attempt to run coverage without the tool installed.
Handle No Test Files
If no test files are found in the project:
- Report:
No test files detected. Coverage: 0% - Recommend:
Use /generate-tests to create an initial test suite based on your source code - If a spec path was provided, report ALL acceptance criteria as untested
- Skip Phase 2 (Run Coverage) and Phase 3 (Parse Results) -- proceed directly to Phase 4 (Analyze Gaps) if spec provided, or Phase 5 (Generate Report) if no spec
Handle No Source Files
If no source files are found in the project path:
Stop the workflow after this error.
Phase 2: Run Coverage
Goal: Execute the coverage tool and capture output.
Build Coverage Command
Based on the detected environment, construct the appropriate coverage command.
Python (pytest-cov):
If specific test directories were detected:
TypeScript (Vitest with coverage):
TypeScript (Jest):
TypeScript (standalone c8):
Execute Coverage Command
Run the coverage command via Bash:
Capture both stdout and stderr for analysis.
Handle Coverage Tool Failure
If the coverage command exits with a non-zero status:
- Check the error output for common issues:
- Package path not matching:
No data was collected-> verify--cov={package}matches the importable package name - Module not found:
Module X was never imported-> check that the package is importable - Missing dependencies: Suggest
pip installornpm install - Configuration errors: Point to the relevant config file
- Report the error with diagnostic info:
- If the terminal output still contains a coverage summary (some tools return non-zero when tests fail but still produce coverage), attempt to parse it and proceed with a warning.
Phase 3: Parse Results
Goal: Parse the JSON coverage report into structured data.
Locate Report File
Python (pytest-cov):
- Default location:
coverage.jsonin the project root - Custom location: check
--cov-report=json:{path}if specified
TypeScript (istanbul/c8):
- Default location:
coverage/coverage-final.json - Custom location: check
coverage.reportsDirectoryin vitest config orcoverageDirectoryin jest config
Read the JSON coverage report file.
Parse Python Report (coverage.py format)
Extract from coverage.json:
- Per-file data from the
filesobject:
- File path (key)
summary.num_statements-- total executable statementssummary.covered_lines-- statements executed during testssummary.missing_lines-- statements not executedsummary.percent_covered-- coverage percentage (0-100)summary.num_branches-- total branches (if branch coverage enabled)summary.covered_branches-- branches taken during testsmissing_lines-- array of line numbers not covered
- Project totals from the
totalsobject:
percent_covered-- overall coverage percentagecovered_lines/num_statements-- line coverage ratiocovered_branches/num_branches-- branch coverage ratio
Parse TypeScript Report (istanbul format)
Extract from coverage-final.json:
- Per-file data (keys are absolute file paths):
- Compute statement coverage:
covered = Object.values(s).filter(n => n > 0).length,total = Object.keys(s).length - Compute branch coverage:
covered = sum of b[id].filter(n => n > 0).length,total = sum of b[id].length - Compute function coverage:
covered = Object.values(f).filter(n => n > 0).length,total = Object.keys(f).length - Identify uncovered lines from
statementMapwheres[id] === 0 - Identify uncovered functions from
fnMapwheref[id] === 0
- Project totals: Sum across all files
Group Uncovered Lines into Ranges
For readable reporting, group consecutive uncovered line numbers into ranges:
[15, 16, 17, 22, 23]->lines 15-17, 22-23[5]->line 5[10, 11, 12, 13, 14, 15]->lines 10-15
Check Against Threshold
Compare coverage against the configured threshold:
- Threshold source (in precedence order):
--thresholdargument.claude/agent-alchemy.local.mdtdd.coverage-threshold- Default: 80%
- Per-file check: Flag files below the threshold, sorted by coverage (lowest first)
- Project-wide check: Compare overall percentage against threshold
Phase 4: Analyze Gaps
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingclaude/tdd-tools/skills/analyze-coverage/SKILL.md
Popularity
- Repository stars
- 38
- Repository forks
- 7
- 7-day trend score
- 18
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 15 Oct 2026, a month ago.
Extension points
configConfiguration overrides
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/sequenzia/agent-alchemy/analyze-coverage)