Token导航 LogoToken导航

Agent Skill · 研究检索

test-gap-analyzer(测试间隙分析仪)

用于辅助测试设计、自动化测试、用例整理和回归验证。它适合让 Agent 编写单元测试、端到端测试、测试计划或根据失败日志定位问题。使用时需要确认项目测试框架、运行命令和夹具数据,避免为了通过测试而改坏真实逻辑;涉及浏览器或外部服务时,应区分本地模拟、测试环境和生产环境。

test-gap-analyzer 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为权限未标注;许可证为 MIT,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 31,463。

总安装 2,696周安装 108GitHub Stars 55下载 873核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/rysweet/amplihack --skill test-gap-analyzer

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

用于辅助测试设计、自动化测试、用例整理和回归验证。适合让 Agent 编写单元测试、端到端测试、测试计划或根据失败日志定位问题。使用时需要确认项目测试框架、运行命令和夹具数据,避免为了通过测试而改坏真实逻辑。涉及浏览器或外部服务时,应区分本地模拟、测试环境和生产环境。

安装方式:github,需通过 npx skills add 命令从指定仓库添加。

来源仓库内路径:skills/test-gap-analyzer

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/rysweet/amplihack --skill test-gap-analyzer;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    权限没有明确标注,第一次使用时只给一个无关紧要的任务,观察它到底读了哪些文件和网络。

常见问题

6 条

test-gap-analyzer 怎么安装?

在终端执行 npx skills add https://github.com/rysweet/amplihack --skill test-gap-analyzer。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

test-gap-analyzer 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

test-gap-analyzer 需要什么权限?

权限级别没有明确标注。第一次使用时建议只给无关紧要的任务,观察它实际读写了哪些内容。

test-gap-analyzer 是免费的吗?

来源标注的许可证是 MIT。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

test-gap-analyzer 用的人多吗?

公开数据是累计安装 2,696 次,近一周安装 108 次,下载 873 次,GitHub 55 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

test-gap-analyzer 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 3 个目录同时收录,说明这个 Skill 流传比较广。
  • 许可证明确为 MIT,商用和分发边界好判断。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。
  • 需要许可证清楚、并且有第三方扫描结果的团队项目。

不太适合

  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
test-gap-analyzer

测试间隙分析仪 · 本页

2,69655权限未标注MIT通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Test Gap Analyzer Skill

Purpose

This skill automatically analyzes codebases to identify untested functions, low coverage areas, and missing edge case tests. It generates actionable test suggestions organized by priority and risk impact, following amplihack's testing pyramid (60% unit, 30% integration, 10% E2E).

When to Use This Skill

  • Code review: Before merging PRs, identify test gaps
  • Test planning: Prioritize what to test next based on risk
  • Coverage improvement: Target low-coverage areas systematically
  • Edge case discovery: Find untested failure modes and boundaries
  • New modules: Ensure comprehensive test coverage before release
  • Legacy code: Incrementally improve test coverage
  • Refactoring: Verify coverage before and after changes

Core Concepts

Testing Pyramid in Amplihack

Tests should follow this distribution:

  • 60% Unit Tests: Individual function/method behavior with mocked dependencies
  • 30% Integration Tests: Multiple components working together
  • 10% E2E Tests: Full user workflows end-to-end

This skill helps balance tests across these layers while prioritizing coverage.

Gap Analysis Categories

The skill identifies gaps in these areas:

  1. Untested Functions/Methods: Functions with zero test coverage
  2. Low Coverage Areas: Modules/functions below target threshold (85%+)
  3. Missing Edge Cases: Boundary conditions, error paths, null checks
  4. Integration Gaps: Component interactions not tested
  5. Error Path Coverage: Exception handling and failure modes

Analysis Process

Step 1: Codebase Scanning

The analyzer:

  1. Discovers all source code files in specified directory
  2. Identifies all functions, methods, and classes
  3. Maps code structure and dependencies
  4. Determines current test coverage (if available)

Step 2: Coverage Analysis

For each function/method:

  1. Check if tests exist
  2. Calculate line coverage if coverage data available
  3. Identify untested branches and paths
  4. Note error handling coverage

Step 3: Gap Identification

Classify gaps by:

  1. Risk Level: High/Medium/Low based on function complexity and criticality
  2. Type: Untested, partial coverage, missing edge cases
  3. Effort: Estimate time to write adequate tests
  4. Impact: How important this function is to system reliability

Step 4: Test Suggestion Generation

For each gap, generate:

  1. Specific test case descriptions
  2. Test templates with example code
  3. Edge cases to cover
  4. Expected behaviors
  5. Error conditions to test

Step 5: Prioritization

Organize suggestions by:

  1. Risk impact (critical functions first)
  2. Test pyramid distribution
  3. Effort required
  4. Dependency relationships

Skill Capabilities

Code Analysis

  • Scans Python, JavaScript, TypeScript, Go codebases
  • Identifies all public and private functions
  • Detects complex functions needing more tests
  • Maps function dependencies
  • Finds unused parameters and dead code paths

Coverage Detection

  • Parses .coverage files (Python)
  • Analyzes coverage.json reports
  • Identifies uncovered branches
  • Finds partially tested functions
  • Detects coverage threshold violations

Test Gap Discovery

  • Functions with zero tests
  • Branches never executed
  • Error paths untested
  • Boundary conditions missed
  • Integration points not covered
  • Timeout scenarios missing
  • Resource exhaustion cases

Edge Case Identification

  • Null/None inputs
  • Empty collections
  • Boundary values (0, max_int, etc.)
  • Unicode/multibyte strings
  • Concurrency issues
  • Resource limits
  • Type mismatches
  • Async/await patterns

Test Template Generation

Provides ready-to-use test templates for:

  • Unit tests (mocked dependencies)
  • Integration tests (real components)
  • E2E tests (full workflows)
  • Parametrized tests
  • Property-based tests
  • Performance tests

Usage Examples

Example 1: Analyze Python Project

User: Analyze test coverage gaps in my src/ directory

Claude:
1. Scans src/ for all Python files
2. Reads .coverage or uses ast analysis
3. Identifies untested functions
4. Generates gap report with suggestions

Output:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Test Gap Analysis Report
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Summary:
- Total functions: 145
- Untested: 23 (16%)
- Low coverage (< 85%): 34 (23%)

CRITICAL GAPS (High Risk):
1. payment_processor.py::process_payment()
   - Untested | Handles money | 15 min effort
   - Suggested tests:
     - Valid payment processing
     - Insufficient funds error
     - Payment timeout
     - Currency conversion

MEDIUM GAPS:
2. user_service.py::validate_email()
   - 40% coverage | Missing edge cases
   - Suggested tests:
     - Unicode characters
     - Long email addresses
     - Special characters

LOW GAPS:
3. utils.py::format_date()
   - 60% coverage
   - Suggested tests:
     - Timezone handling
     - Daylight saving transitions

Example 2: Get Test Templates

User: Generate test templates for my untested auth module

Claude:
Creates templates organized by testing pyramid:

Unit Tests (60%):
- test_token_validation_valid()
- test_token_validation_expired()
- test_token_validation_invalid_signature()

Integration Tests (30%):
- test_auth_flow_with_database()
- test_multi_user_concurrent_auth()

E2E Tests (10%):
- test_user_login_to_protected_resource()
- test_session_persistence_across_requests()

Example 3: Coverage Improvement Plan

User: Help me improve test coverage from 65% to 85%

Claude:
1. Analyzes current coverage
2. Identifies gaps blocking 85% threshold
3. Prioritizes by impact
4. Estimates effort

Output:
To reach 85% coverage:
- 12 quick wins (< 2 hours each)
- 3 medium tasks (2-4 hours each)
- 2 complex tasks (4+ hours each)

Recommended order:
1. Add error case tests (5 tests, 3 hours) -> +8%
2. Cover auth edge cases (8 tests, 4 hours) -> +6%
3. Add integration tests (12 tests, 6 hours) -> +7%

Analysis Checklist

Coverage Inspection

  • Identify all source files in target directory
  • Determine current coverage percentage
  • Find all untested functions
  • Locate functions below 85% coverage
  • Map branch coverage gaps

Gap Classification

  • Categorize by risk level (high/med/low)
  • Estimate effort for each gap
  • Identify critical path functions
  • Find dependency relationships
  • Prioritize by impact

Test Suggestion Generation

  • Generate unit test templates
  • Generate integration test templates
  • Suggest edge cases
  • Provide error scenario tests
  • Include parametrized test examples

Report Generation

  • Summary statistics
  • Gap listing by priority
  • Test templates for each gap
  • Estimated effort total
  • Recommended testing order

Output Format

Standard Report Structure

# Test Gap Analysis Report

## Summary

- Total functions: N
- Untested functions: N (X%)
- Functions < 85%: N (X%)
- Average coverage: X%

## Critical Gaps (Must Test)

1. Function name | Type | Priority | Effort
   Suggested tests: [list]

## Medium Priority Gaps

[Similar structure]

## Low Priority Gaps

[Similar structure]

## Testing Pyramid Distribution

Current:

- Unit: X% | Target: 60%
- Integration: X% | Target: 30%
- E2E: X% | Target: 10%

## Test Templates

[Ready-to-use test code]

## Effort Estimate

- Quick wins: N hours
- Medium tasks: N hours
- Complex work: N hours
- Total: N hours

Test Template Examples

Unit Test Template

def test_function_name_happy_path():
    """Test function with valid inputs."""
    # Arrange
    input_data = {...}
    expected = {...}

    # Act
    result = function_name(input_data)

    # Assert
    assert result == expected

Error Case Template

def test_function_name_invalid_input():
    """Test function raises ValueError on invalid input."""
    with pytest.raises(ValueError, match="Expected error message"):
        function_name(invalid_input)

Edge Case Template

def test_function_name_edge_case():
    """Test function handles edge case correctly."""
    # Test boundary conditions
    result = function_name(boundary_value)
    assert result is not None

Integration Test Template

def test_user_service_with_database(test_db):
    """Test user service with real database."""
    user_service = UserService(test_db)
    user = user_service.create_user("test@example.com")
    assert user.id is not None

Philosophy Alignment

Ruthless Simplicity

  • Focus on essential tests, not comprehensive coverage
  • 85% coverage is sufficient (diminishing returns beyond)
  • Avoid testing implementation details
  • Test behavior, not code structure

Zero-BS Implementation

  • All test templates work out of the box
  • No placeholder tests or TODO comments
  • Tests provide real value
  • Edge cases are specific, not generic

Testing Pyramid

  • Prioritize unit tests (fast, isolated)
  • Add integration tests (verify contracts)
  • Minimal E2E tests (verify user flows)
  • Balanced distribution prevents brittleness

Integration with Other Skills

Works With

  • code-quality-analyzer: Identifies complexity
  • module-spec-generator: Aligns tests with specs
  • refactor-advisor: Plans test changes
  • type-safety-checker: Tests type contracts

Feeds Into

  • CI Validation: Ensures tests pass before merge
  • Documentation: Demonstrates module usage
  • Regression Prevention: Protects against regressions

Common Patterns

Pattern 1: Fast Gap Discovery

User: Quick test coverage review of api/

Claude:
- Scans directory
- Identifies top 5 gaps
- Provides quick recommendations
- Total time: < 2 minutes

Pattern 2: Systematic Coverage Improvement

User: Plan test coverage improvement from 60% to 85%

Claude:
- Analyzes gaps
- Creates phased improvement plan
- Prioritizes by risk
- Provides effort estimates
- Generates all test templates

Pattern 3: New Module Test Planning

User: Generate complete test plan for new auth module

Claude:
- Analyzes module structure
- Maps public functions
- Creates test suggestions
- Balances testing pyramid
- Provides all templates

Quality Checks

After analysis, verify:

  • Gap identification is accurate
  • Test templates are ready to use
  • Effort estimates are realistic
  • Prioritization follows risk analysis
  • Testing pyramid is balanced
  • Edge cases are specific, not generic
  • Integration points are identified
  • Error paths are covered

Common Pitfalls to Avoid

❌ Over-Testing Implementation

Test behavior, not how the code works. Details can change.

❌ Generic Edge Cases

Be specific: "Test empty string" not "Test edge cases"

❌ Ignoring Integration

Don't just test functions in isolation. Test how they work together.

❌ Missing Error Paths

Every error condition should have at least one test.

❌ Untested Dependencies

Mock external systems, but test the integration points.

Success Criteria

A good test gap analysis:

  • Identifies all untested functions
  • Prioritizes by risk and impact
  • Provides ready-to-use test templates
  • Balances testing pyramid
  • Estimates effort realistically
  • Includes edge case suggestions
  • Maps integration gaps
  • Provides actionable recommendations

Tips for Effective Test Planning

  1. Start with critical functions: Money, security, data integrity
  2. Use test templates: Don't write from scratch
  3. Balance the pyramid: Don't over-test edge cases
  4. Test contracts, not implementations: Behavior matters, details don't
  5. Include happy path and error cases: Both are important
  6. Automate coverage tracking: Catch regressions early
  7. Iterative improvement: 85% coverage is realistic, 100% is overkill
  8. Document why tests exist: Future maintainers should understand intent

Tools and Commands

For Python Projects

# Generate coverage report
coverage run -m pytest
coverage json  # Creates coverage.json

# Analyze gaps with this skill
Claude: Analyze test gaps in my project using coverage.json

For TypeScript/JavaScript

# Generate coverage report
jest --coverage

# Analyze gaps
Claude: Analyze test gaps in my TypeScript project

Real-World Example

Before Analysis

Project Stats:
- 156 functions
- 52% test coverage
- Unknown untested functions
- Scattered test files

After Analysis

Gap Report:
- 24 untested functions (15%)
- 34 functions < 85% (22%)
- 12 critical gaps (high impact)
- 45 medium gaps (medium impact)
- 40 low gaps (low priority)

Recommendations:
1. Focus on critical gaps (payment, auth, data)
2. Add error case tests (20 tests, 8 hours)
3. Cover edge cases (15 tests, 6 hours)
4. Integration tests (12 tests, 10 hours)

Result after implementing:
- 89% test coverage
- All critical functions tested
- Balanced testing pyramid
- Improved confidence in refactoring

Next Steps

After gap analysis:

  1. Review Report: Understand current state
  2. Prioritize Gaps: Focus on critical functions first
  3. Use Templates: Implement suggested tests
  4. Run Tests: Verify new tests pass
  5. Track Coverage: Monitor improvement
  6. Iterate: Gradually increase coverage

Success Metrics

Effective test gap analysis results in:

  • Clear picture of coverage status
  • Actionable improvement plan
  • 85%+ test coverage achieved
  • Balanced testing pyramid
  • Improved developer confidence
  • Faster debugging and refactoring
  • Fewer production issues

平台分布

Claude Code

29.2%
按下载量换算255

OpenCode

24.87%
按下载量换算217

Antigravity

18.66%
按下载量换算163

Gemini CLI

12.32%
按下载量换算108

windsurf

8.9%
按下载量换算78

Cursor

3.74%
按下载量换算33

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

权限未标注

当前来源未能明确判断权限范围,默认进入异常复核队列。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

继续浏览同类 Skills