agentleFS
drafaeldrafael/coding-harness/skills/test-coverage/SKILL.md

test-coverage

Skill1 starsChanged 7 months agoMITView on GitHub

Analyze and improve test coverage. Use when reviewing coverage gaps, writing missing tests, setting up coverage tooling, or improving branch/line/statement coverage for any language or framework.

13 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use instinct-export, instinct-import and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • TheKREATORSSkill

    instinct-export

    Export instincts from project/global scope to a file

    Also in 3 projects that use this

  • TheKREATORSSkill

    instinct-import

    Import instincts from file or URL into project/global scope

    Also in 3 projects that use this

  • diego-tobalinaSkill

    build-fix

    Fix build and compilation errors systematically. Run when build fails.

    Also in 3 projects that use this

  • WorldFlowAISkill

    eval-harness

    Also in 4 projects that use this

  • Microsoft AzureSkill

    iterative-retrieval

    Max-3-cycle protocol for agent sub-tasks with WHY context and coordinator validation. Use when spawning sub-agents to complete scoped work.

    Also in 3 projects that use this

  • qtzx06Skill

    eval

    Evaluate trained YOLO model accuracy with mAP metrics and per-class error analysis. Identifies failure cases for targeted improvement. Use after training.

    Also in 3 projects that use this

  • +1 more from TheKREATORS

The file

Show its rules and text

We split this skill into the rules it gives an agent

37 rules. 0 are common, 37 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 12 edited versions we read keep these.

  • 37

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Follow this systematic approach to analyze and improve test coverage:

    line 13
  2. Distinctive:

    Run existing tests with coverage reporting

    line 26
  3. Distinctive:

    Document current coverage percentages:

    line 28
  4. Distinctive:

    Write unit tests for uncovered business logic

    line 58
  5. Distinctive:

    Add integration tests for uncovered workflows

    line 59
  6. Distinctive:

    Create tests for error conditions and edge cases

    line 60
  7. Distinctive:

    Test configuration and environment-specific code

    line 61
  8. Distinctive:

    Add regression tests for bug-prone areas

    line 62
  9. Distinctive:

    Test both true and false conditions

    line 66
  10. Distinctive:

    Test exception handling paths

    line 68
  11. Distinctive:

    Verify loop conditions and iterations

    line 69
  12. Distinctive:

    Test boundary conditions and limits

    line 72
  13. Distinctive:

    Test null, empty, and invalid inputs

    line 73
  14. Distinctive:

    Test timeout and network failure scenarios

    line 74
  15. Distinctive:

    Test resource exhaustion conditions

    line 75
  16. Distinctive:

    Test concurrent access and race conditions

    line 76
  17. Distinctive:

    Use dependency injection for testability

    line 81
  18. Distinctive:

    Create test doubles for external services

    line 82
  19. Distinctive:

    Ensure tests actually verify behavior, not just execution

    line 86
  20. Distinctive:

    Check for meaningful assertions in tests

    line 87
  21. Distinctive:

    Avoid testing implementation details

    line 88
  22. Distinctive:

    Test API endpoints and HTTP status codes

    line 95
  23. Distinctive:

    Test form validation and user input handling

    line 96
  24. Distinctive:

    Test authentication and authorization flows

    line 97
  25. Distinctive:

    Test error pages and user feedback

    line 98
  26. Distinctive:

    Test different screen sizes and orientations

    line 102
  27. Distinctive:

    Test offline and network connectivity scenarios

    line 103
  28. Distinctive:

    Test database operations and transactions

    line 107
  29. Distinctive:

    Test message queue processing

    line 108
  30. Distinctive:

    Test caching and performance optimizations

    line 109
  31. Distinctive:

    Test service integrations and API calls

    line 110
  32. Distinctive:

    Document reasons for coverage exclusions

    line 122
  33. Distinctive:

    Avoid excluding code that should be tested

    line 124
  34. Distinctive:

    Use mutation testing tools specific to your language

    line 130
  35. Distinctive:

    Use characterization tests for complex legacy systems

    line 135
  36. Distinctive:

    Add tests before making changes to legacy code

    line 137
  37. Distinctive:

    Document known limitations and technical debt

    line 138

“Common” is measured: kept by at least 6 in 10 of the 12 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Test Coverage

Analyze and report test coverage: $ARGUMENTS

Instructions

Follow this systematic approach to analyze and improve test coverage:

  1. Coverage Tool Setup
    • Identify and configure appropriate coverage tools:
      • JavaScript/Node.js: Jest, NYC, Istanbul
      • Python: Coverage.py, pytest-cov
      • Java: JaCoCo, Cobertura
      • C#: dotCover, OpenCover
      • Ruby: SimpleCov
    • Configure coverage reporting formats (HTML, XML, JSON)
    • Set up coverage thresholds and quality gates
  2. Baseline Coverage Analysis
    • Run existing tests with coverage reporting
    • Generate comprehensive coverage reports
    • Document current coverage percentages:
      • Line coverage
      • Branch coverage
      • Function coverage
      • Statement coverage
    • Identify uncovered code areas
  3. Coverage Report Analysis
    • Review detailed coverage reports by file and directory
    • Identify critical uncovered code paths
    • Analyze branch coverage for conditional logic
    • Find untested functions and methods
    • Examine coverage trends over time
  4. Critical Path Identification
    • Identify business-critical code that lacks coverage
    • Prioritize high-risk, low-coverage areas
    • Focus on public APIs and interfaces
    • Target error handling and edge cases
    • Examine security-sensitive code paths
  5. Test Gap Analysis
    • Categorize uncovered code:
      • Business logic requiring immediate testing
      • Error handling and exception paths
      • Configuration and setup code
      • Utility functions and helpers
      • Dead or obsolete code to remove
  6. Strategic Test Writing
    • Write unit tests for uncovered business logic
    • Add integration tests for uncovered workflows
    • Create tests for error conditions and edge cases
    • Test configuration and environment-specific code
    • Add regression tests for bug-prone areas
  7. Branch Coverage Improvement
    • Identify uncovered conditional branches
    • Test both true and false conditions
    • Cover all switch/case statements
    • Test exception handling paths
    • Verify loop conditions and iterations
  8. Edge Case Testing
    • Test boundary conditions and limits
    • Test null, empty, and invalid inputs
    • Test timeout and network failure scenarios
    • Test resource exhaustion conditions
    • Test concurrent access and race conditions
  9. Mock and Stub Strategy
    • Mock external dependencies for better isolation
    • Stub complex operations to focus on logic
    • Use dependency injection for testability
    • Create test doubles for external services
    • Implement proper cleanup for test resources
  10. Coverage Quality Assessment
    • Ensure tests actually verify behavior, not just execution
    • Check for meaningful assertions in tests
    • Avoid testing implementation details
    • Focus on testing contracts and interfaces
    • Review test quality alongside coverage metrics
  11. Framework-Specific Coverage Enhancement

    For Web Applications:

    • Test API endpoints and HTTP status codes
    • Test form validation and user input handling
    • Test authentication and authorization flows
    • Test error pages and user feedback

    For Mobile Applications:

    • Test device-specific functionality
    • Test different screen sizes and orientations
    • Test offline and network connectivity scenarios
    • Test platform-specific features

    For Backend Services:

    • Test database operations and transactions
    • Test message queue processing
    • Test caching and performance optimizations
    • Test service integrations and API calls
  12. Continuous Coverage Monitoring
    • Set up automated coverage reporting in CI/CD
    • Configure coverage thresholds to prevent regression
    • Generate coverage badges and reports
    • Monitor coverage trends and improvements
    • Alert on significant coverage decreases
  13. Coverage Exclusion Management
    • Properly exclude auto-generated code
    • Exclude third-party libraries and dependencies
    • Document reasons for coverage exclusions
    • Regularly review and update exclusion rules
    • Avoid excluding code that should be tested
  14. Mutation Testing (Advanced)
    • Implement mutation testing to validate test quality
    • Identify tests that don't catch actual bugs
    • Improve test assertions and edge case coverage
    • Use mutation testing tools specific to your language
    • Balance mutation testing cost with quality benefits
  15. Legacy Code Coverage Strategy
    • Prioritize high-risk legacy code for testing
    • Use characterization tests for complex legacy systems
    • Refactor for testability where possible
    • Add tests before making changes to legacy code
    • Document known limitations and technical debt

Sample Coverage Commands:

# JavaScript with Jest
npm test -- --coverage --coverage-reporters=html,text,lcov

# Python with pytest
pytest --cov=src --cov-report=html --cov-report=term

# Java with Maven
mvn clean test jacoco:report

# .NET Core
dotnet test --collect:"XPlat Code Coverage"

Remember that 100% coverage is not always the goal — focus on meaningful coverage that actually improves code quality and catches bugs.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.