home / skills / openclaw / skills / ai-coverage-boost

ai-coverage-boost skill

/skills/lxgicstudios/ai-coverage-boost

This skill analyzes test coverage gaps and automatically generates targeted tests to improve code paths and edge-case handling.

npx playbooks add skill openclaw/skills --skill ai-coverage-boost

Review the files below or copy the command above to add this skill to your agents.

Files (2)
SKILL.md
1.1 KB
---
name: coverage-boost
description: Generate tests to hit uncovered code paths
---

# Coverage Boost

Your coverage is at 67% and PM wants 80%. This tool finds uncovered lines and generates tests for them.

## Quick Start

```bash
npx ai-coverage-boost ./src/utils/helpers.ts
```

## What It Does

- Analyzes existing test coverage
- Identifies uncovered code paths
- Generates targeted tests for gaps
- Focuses on edge cases you missed

## Usage Examples

```bash
# Boost coverage for a file
npx ai-coverage-boost ./src/utils/validators.ts

# Target a specific function
npx ai-coverage-boost ./src/api.ts --function processOrder

# Generate Jest tests
npx ai-coverage-boost ./src --framework jest
```

## What It Generates

- Unit tests for uncovered branches
- Edge case tests
- Error handling tests
- Boundary condition tests

## Requirements

Node.js 18+. OPENAI_API_KEY required. Existing coverage report helps.

## License

MIT. Free forever.

---

**Built by LXGIC Studios**

- GitHub: [github.com/lxgicstudios/ai-coverage-boost](https://github.com/lxgicstudios/ai-coverage-boost)
- Twitter: [@lxgicstudios](https://x.com/lxgicstudios)

Overview

This skill generates tests that target uncovered code paths to raise project coverage quickly. It analyzes existing coverage, finds gaps, and produces focused unit tests for edge cases, error handling, and boundary conditions. Use it to accelerate reaching coverage targets with minimal manual test writing.

How this skill works

The tool inspects coverage reports and source files to identify untested branches and lines. It then generates test scaffolds or full tests (Jest by default) that exercise those paths, including edge cases and error scenarios. You can target files, directories, or individual functions and supply an existing coverage report to guide generation.

When to use it

  • When overall test coverage is below a target threshold and you need to raise it fast
  • When specific files or functions show uncovered branches after a test run
  • During sprint wrap-up to automate coverage improvements before release
  • When onboarding developers to quickly create meaningful tests for legacy code
  • When you need error-handling and boundary condition tests added automatically

Best practices

  • Provide an up-to-date coverage report so output focuses on real gaps
  • Run the tool iteratively and review generated tests before committing
  • Target small files or single functions first to validate test quality
  • Prefer generated scaffolds for complex logic and extend them with domain knowledge
  • Keep Node.js 18+ and OPENAI_API_KEY configured for consistent results

Example use cases

  • Boost file-level coverage for a utilities module after refactors
  • Generate tests for a payment processing function that has several error branches
  • Create Jest tests for a directory of API helpers to cover boundary inputs
  • Quickly add edge-case tests to legacy code with no existing tests
  • Automate repetitive test creation during a sprint to meet PM targets

FAQ

Which test frameworks are supported?

It generates Jest tests by default and can be configured for common JS testing frameworks where supported.

Do I need an API key or special runtime?

Yes. Node.js 18+ is required and an OPENAI_API_KEY must be set for generation to work.