Token导航 LogoToken导航TokenDH.com
研究检索执行命令github未标认证来源可访问clear审计异常

coverage-analyzer覆盖分析器

Agent Skill

coverage-analyzer 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

261

周安装

11

GitHub Stars

8

下载量

92
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:coverage-analyzer(覆盖分析器)
来源仓库:https://github.com/kanopi/cms-cultivator
仓库路径:skills/coverage-analyzer
安装命令:
npx skills add https://github.com/kanopi/cms-cultivator --skill coverage-analyzer
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/kanopi/cms-cultivator --skill coverage-analyzer

简介

用于查找、检索和筛选相关信息。

  • 适合根据关键词快速定位候选结果。
  • 可结合来源仓库和 README 核验具体用法。
  • 安装命令:npx skills add https://github.com/kanopi/cms-cultivator --skill coverage-analyzer。
  • 建议确认权限范围与维护状态。

SKILL.md

Coverage Analyzer

Automatically analyze test coverage and identify untested code.

Philosophy

Knowing what's tested gives confidence to refactor and prevents regressions.

Core Beliefs

  1. Visibility Drives Action: Can't improve what you can't measure
  2. Not All Code Needs 100% Coverage: Prioritize critical paths over getters/setters
  3. Coverage ≠ Quality: 100% coverage doesn't guarantee bug-free code
  4. Gap Analysis Guides Testing: Knowing what's untested helps prioritize test writing

Why Coverage Analysis Matters

  • Identify Risks: Find critical code without test protection
  • Prioritize Effort: Focus testing where it matters most
  • Prevent Regressions: Tests catch bugs before they reach users
  • Enable Refactoring: Good coverage allows confident code changes

When to Use This Skill

Activate this skill when the user:

  • Asks "what code isn't tested?"
  • Mentions "test coverage" or "coverage report"
  • Says "which tests are missing?"
  • Shows code and asks "is this tested?"
  • References "untested code paths"
  • Asks "what's my coverage percentage?"

Decision Framework

Before analyzing coverage, consider:

What's the Goal?

  1. Find coverage gaps → Identify untested code
  2. Measure current coverage → Run coverage tools and report percentages
  3. Prioritize testing → Focus on critical paths first
  4. Improve coverage → Recommend specific tests to write

What's the Scope?

  • Specific file - User shows code → Analyze that file's coverage
  • Component/module - User mentions feature → Check component tests
  • Recent changes - User says "my code" → Check coverage of git diff
  • Entire project - User says "overall coverage" → Run project-wide analysis

What Test Types Exist?

Check for:

  • PHPUnit tests (PHP) → Run phpunit --coverage-text
  • Jest tests (JavaScript) → Run jest --coverage
  • Cypress tests (E2E) → Integration coverage only
  • Manual test documentation → Note gaps

What Coverage Metrics Matter?

Primary metrics:

  • Line coverage - Percentage of lines executed
  • Branch coverage - Percentage of decision branches taken
  • Function coverage - Percentage of functions called

Priority order:

  1. Critical paths (auth, payments, data writes)
  2. Public APIs
  3. Security-sensitive code
  4. Business logic
  5. Getters/setters (lowest priority)

What's a Good Target?

  • Critical code - Aim for 90%+ coverage
  • Business logic - Aim for 80%+ coverage
  • Overall project - Aim for 70%+ coverage
  • Getters/setters - Can skip, focus on behavior

Decision Tree

User asks about coverage
    ↓
Determine scope (file/component/project)
    ↓
Check for existing test files
    ↓
Run coverage tool (PHPUnit/Jest/Cypress)
    ↓
Analyze gaps (prioritize critical paths)
    ↓
Report coverage with recommendations
    ↓
Suggest specific tests for gaps

Quick Coverage Analysis

1. Check if Tests Exist

PHP (PHPUnit):

# Check for test files
find tests/ -name "*Test.php"

# Check specific class
test -f "tests/src/Unit/DataProcessorTest.php" && echo "Tests exist"

JavaScript (Jest):

# Check for test files
find . -name "*.test.js" -o -name "*.spec.js"

2. Run Coverage Analysis

PHP:

# Generate coverage report
vendor/bin/phpunit --coverage-text

# For Kanopi projects
ddev exec vendor/bin/phpunit --coverage-text

JavaScript:

# Jest coverage
npm run test -- --coverage

# Or directly
npx jest --coverage

3. Identify Gaps

Common untested areas:

  • Error handling (catch blocks)
  • Edge cases (empty input, null values)
  • Private methods (test via public interface)
  • Complex conditionals
  • New features without tests

Response Format

## Test Coverage Analysis

### Summary
- **Overall Coverage**: 72%
- **Files Analyzed**: 45
- **Tested**: 32 files
- **Untested**: 13 files

### Coverage by Type
- Classes: 85% (34/40)
- Methods: 68% (156/230)
- Lines: 72% (2,340/3,250)
- Branches: 58% (89/153)

### 🔴 Critical Gaps (No Tests)

**1. PaymentProcessor.php** - 0% coverage
- **Risk**: High - handles money
- **Methods untested**: processPayment(), refund(), validate()
- **Recommendation**: Add unit tests immediately

**2. AuthenticationService.php** - 0% coverage
- **Risk**: Critical - security component
- **Methods untested**: authenticate(), validateToken()
- **Recommendation**: Add security tests ASAP

### 🟡 Partial Coverage

**3. UserManager.php** - 45% coverage
- ✅ Tested: getUser(), createUser()
- ❌ Untested: deleteUser(), updatePermissions()
- **Recommendation**: Add tests for delete and permission methods

### ✅ Well Tested

- DataProcessor.php - 95%
- EmailService.php - 88%
- ValidationHelper.php - 100%

### Suggested Actions

1. **Immediate** (Critical):
   - Add tests for PaymentProcessor
   - Add tests for AuthenticationService

2. **This Sprint**:
   - Complete UserManager tests
   - Add integration tests for checkout flow

3. **Next Sprint**:
   - Increase overall coverage to 80%
   - Add E2E tests for critical paths

Detailed Analysis

Method-Level Coverage

## DataProcessor.php Coverage

| Method | Tested? | Coverage | Priority |
|--------|---------|----------|----------|
| processData() | ✅ Yes | 100% | - |
| validateInput() | ✅ Yes | 90% | Low |
| handleError() | ❌ No | 0% | High |
| formatOutput() | ⚠️ Partial | 60% | Medium |

### Untested Code Paths

**handleError() method:**

public function handleError($error) { // Line 45: No test coverage if ($error instanceof ValidationException) { return $this->formatValidationError($error); } // Line 49: No test coverage if ($error instanceof DatabaseException) { return $this->formatDatabaseError($error); } // Line 53: Tested return $this->formatGenericError($error); }


**Missing test cases:**

- ValidationException handling
- DatabaseException handling
- Edge case: null error

**Suggested test:**

public function testHandleValidationException(): void { $exception = new ValidationException('Invalid input'); $result = $this->processor->handleError($exception); $this->assertStringContains('validation error', $result); }

Integration with /test-coverage Command

  • This Skill: Quick coverage checks

- "Is this function tested?" - "What's missing tests?" - Single file/class analysis

  • /test-coverage Command: Comprehensive coverage analysis

- Full project coverage report - Trend analysis over time - CI/CD integration - Detailed HTML reports

Coverage Goals

Industry Standards

  • Minimum: 70% coverage
  • Good: 80% coverage
  • Excellent: 90%+ coverage

But remember: 100% coverage ≠ bug-free code

What to Focus On

High Priority:

  • Authentication/authorization
  • Payment processing
  • Data validation
  • Security-sensitive code
  • Critical business logic

Medium Priority:

  • API endpoints
  • Form handlers
  • Data transformations
  • Email notifications

Low Priority:

  • Simple getters/setters
  • Configuration classes
  • View rendering
  • Logging statements

Quick Commands

PHP (PHPUnit)

# Text coverage report
vendor/bin/phpunit --coverage-text

# HTML coverage report
vendor/bin/phpunit --coverage-html coverage/

# Coverage for specific test
vendor/bin/phpunit --coverage-text tests/Unit/DataProcessorTest.php

# Kanopi projects
ddev exec vendor/bin/phpunit --coverage-html coverage/

JavaScript (Jest)

# Terminal coverage
npm test -- --coverage

# HTML report
npm test -- --coverage --coverageReporters=html

# Watch mode with coverage
npm test -- --coverage --watch

# Coverage for specific file
npm test -- --coverage DataProcessor.test.js

Common Gaps & Solutions

Gap 1: Error Handling

Untested:

try {
  $this->processData($data);
} catch (Exception $e) {
  // Untested catch block
  $this->logger->error($e->getMessage());
}

Solution:

public function testProcessDataWithException(): void {
  $this->expectException(ProcessingException::class);
  $this->processor->processData([]);
}

Gap 2: Edge Cases

Untested:

  • Empty arrays
  • Null values
  • Maximum values
  • Boundary conditions

Solution: Add tests for each edge case

Gap 3: Integration Points

Untested:

  • Database interactions
  • API calls
  • File system operations

Solution: Add integration tests or use mocks

Coverage Best Practices

  1. Test behavior, not coverage - Don't chase 100% blindly
  2. Focus on critical paths - Test important code thoroughly
  3. Test edge cases - Empty, null, min, max values
  4. Test error paths - Exceptions and error handling
  5. Keep tests fast - Slow tests won't run
  6. Update tests with code - Keep tests current

Resources

适合场景

01

研究助手

02

事实核查

03

知识库问答

04

带来源的搜索总结

能力概览

能力 1

组合搜索和大模型调用

能力 2

支持多来源检索和总结

能力 3

强调引用来源和事实核查

能力 4

适合研究型 Agent 流程

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Cursor

34.63%
按下载量换算32

Codex

29.32%
按下载量换算27

Claude Code

17.48%
按下载量换算16

Antigravity

8.21%
按下载量换算8

安全审计

Gen Agent Trust Hub

未通过

Socket

通过

Snyk

通过

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/kanopi/cms-cultivator --skill coverage-analyzer;npx skills add kanopi/cms-cultivator --skill "coverage-analyzer" 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。

来源信息

继续浏览同类 Skills