Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

test-coverage

БесплатноБез исполняемых скриптовНе проверен

Analyze test coverage reports, identify gaps by priority, and recommend test improvements with trend tracking

jmaglyот jmagly★ 233 звезды на GitHub

Об этом скилле

test-coverage

Analyze test coverage, identify gaps, and recommend test improvements.

Triggers

Alternate expressions and non-obvious activations (primary phrases are matched automatically from the skill description):

  • "lcov" / "istanbul" / "c8" → coverage tool-specific queries
  • "coverage holes" in testing context → gap analysis
  • "what's not tested" → coverage gap discovery

Purpose

This skill provides comprehensive test coverage analysis by:

  • Parsing coverage reports from multiple formats
  • Identifying coverage gaps by priority
  • Mapping coverage to requirements
  • Recommending test additions
  • Tracking coverage trends over time

Behavior

When triggered, this skill:

  1. Locates coverage data:

    • Find coverage reports (lcov, cobertura, istanbul, etc.)
    • Identify test directories and conventions
    • Load historical coverage data
  2. Analyzes coverage metrics:

    • Line coverage percentage
    • Branch coverage percentage
    • Function coverage percentage
    • File-level breakdown
  3. Identifies critical gaps:

    • Untested critical paths
    • Low-coverage high-change files
    • Untested public APIs
    • Missing edge case coverage
  4. Maps to requirements:

    • Cross-reference with traceability data
    • Identify untested requirements
    • Flag coverage by priority
  5. Generates recommendations:

    • Prioritized list of tests to add
    • Estimated effort per test
    • Coverage improvement projection
  6. Tracks trends:

    • Coverage over time
    • Coverage by component
    • Impact of recent changes

Coverage Metrics

Line Coverage

line_coverage:
  description: Percentage of code lines executed by tests
  calculation: (lines_executed / total_lines) * 100
  targets:
    excellent: ">= 90%"
    good: ">= 80%"
    acceptable: ">= 70%"
    poor: "< 70%"

Branch Coverage

branch_coverage:
  description: Percentage of decision branches executed
  calculation: (branches_taken / total_branches) * 100
  targets:
    excellent: ">= 85%"
    good: ">= 75%"
    acceptable: ">= 65%"
    poor: "< 65%"
  importance: Critical for logic paths

Function Coverage

function_coverage:
  description: Percentage of functions called by tests
  calculation: (functions_called / total_functions) * 100
  targets:
    excellent: ">= 95%"
    good: ">= 90%"
    acceptable: ">= 80%"
    poor: "< 80%"

Statement Coverage

statement_coverage:
  description: Percentage of statements executed
  calculation: (statements_executed / total_statements) * 100
  note: Similar to line coverage but counts multi-statement lines

Coverage Report Format

# Test Coverage Analysis Report

**Date**: 2025-12-08
**Project**: User Service
**Analyzer**: test-coverage skill

## Executive Summary

| Metric | Current | Target | Status |
|--------|---------|--------|--------|
| Line Coverage | 78.5% | 80% | ⚠️ Below Target |
| Branch Coverage | 72.3% | 75% | ⚠️ Below Target |
| Function Coverage | 91.2% | 90% | ✅ Meets Target |
| Files with 0% | 3 | 0 | ❌ Action Required |

**Overall Assessment**: Coverage below targets in 2 of 4 metrics. Focus on branch coverage and untested files.

## Coverage by Component

| Component | Lines | Branches | Functions | Trend |
|-----------|-------|----------|-----------|-------|
| src/auth/ | 92% | 88% | 100% | ↑ +2% |
| src/user/ | 85% | 78% | 95% | → 0% |
| src/api/ | 76% | 68% | 88% | ↓ -3% |
| src/utils/ | 65% | 55% | 82% | → 0% |
| src/db/ | 58% | 45% | 75% | ↓ -5% |

## Critical Gaps

### Priority 1: Untested Files

Files with 0% coverage that require immediate attention:

| File | Lines | Risk | Action |
|------|-------|------|--------|
| src/db/migrations.ts | 145 | High | Add migration tests |
| src/api/webhooks.ts | 89 | High | Add webhook handler tests |
| src/utils/retry.ts | 42 | Medium | Add retry logic tests |

### Priority 2: Low-Coverage Critical Paths

Business-critical code with insufficient coverage:

| File | Current | Target | Gap | Critical Path |
|------|---------|--------|-----|---------------|
| src/auth/oauth.ts | 55% | 90% | 35% | User authentication |
| src/api/payments.ts | 62% | 90% | 28% | Payment processing |
| src/user/permissions.ts | 68% | 85% | 17% | Authorization |

### Priority 3: Branch Coverage Gaps

Files with low branch coverage (complex logic undertested):

| File | Branch % | Uncovered Branches | Example |
|------|----------|-------------------|---------|
| src/api/router.ts | 45% | 12 | Error handling paths |
| src/utils/validator.ts | 52% | 8 | Edge case validations |
| src/db/query-builder.ts | 48% | 15 | Query variations |

## Uncovered Code Analysis

### src/auth/oauth.ts (55% line coverage)

Lines not covered:

  • 45-67: Token refresh error handling
  • 89-112: OAuth provider fallback logic
  • 134-145: Session invalidation edge cases

Recommended tests:

  1. Test token refresh with expired token
  2. Test provider unavailable fallback
  3. Test concurrent sessio
Полный SKILL.md на GitHub

Установить test-coverage в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл test-coverage?

Analyze test coverage reports, identify gaps by priority, and recommend test improvements with trend tracking

Как установить скилл test-coverage?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл test-coverage запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить test-coverage с