Test Coverage logo

Test Coverage

Community
luongnv89
test-coverage

Generate unit tests for untested branches and edge cases. Use when coverage is low, CI flags gaps, or a release needs hardening. Not for integration/E2E suites, framework migrations, or fixing production bugs.

Overview

Publisherluongnv89
Repositoryskills
Skill nametest-coverage
Stars
124
Forks
18
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by luongnv89 on GitHub. Read the source before you install it.

Installation

Install the Test Coverage AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/luongnv89/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/skills/test-coverage .claude/skills/test-coverage
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Test Coverage in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Test Coverage on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Test Coverage is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Test Coverage Expander

Expand unit test coverage by targeting untested branches and edge cases.

When to Use

  • User asks to "increase test coverage", "add more tests", "expand unit tests", or "cover edge cases"
  • A CI pipeline reports low coverage and the user wants it improved
  • A code review flags untested error paths or boundary conditions
  • The user wants to identify and fill gaps in an existing test suite before a release

Stack (detect before Step 1 of Workflow)

Detect the project's language from its manifest file and use the matching commands throughout the Workflow below:

ManifestStackCoverage commandTest framework
package.jsonJavaScript/TypeScriptnpx jest --coverage or npx vitest --coverageJest, Vitest, Mocha
pyproject.tomlPythonpytest --cov=. --cov-report=term-missingpytest, unittest
go.modGogo test -coverprofile=coverage.out ./...testing, testify
Cargo.tomlRustcargo tarpaulin or cargo llvm-covbuilt-in test framework

If none of these manifests is found, see Edge Cases — "No test framework detected".

Repo Sync Before Edits (mandatory)

Before creating/updating/deleting files in an existing repository, sync the current branch with remote:

bash
branch="$(git rev-parse --abbrev-ref HEAD)"
git fetch origin
git pull --rebase origin "$branch"

If the working tree is not clean, stash first, sync, then restore:

bash
git stash push -u -m "pre-sync"
branch="$(git rev-parse --abbrev-ref HEAD)"
git fetch origin && git pull --rebase origin "$branch"
git stash pop

If origin is missing, pull is unavailable, or rebase/stash conflicts occur, stop and ask the user before continuing.

Workflow

0. Create Feature Branch

Before making any changes:

  1. Check the current branch - if already on a feature branch for this task, skip
  2. Check the repo for branch naming conventions (e.g., feat/, feature/, etc.)
  3. Create and switch to a new branch following the repo's convention, or fallback to: feat/test-coverage

1. Analyze Coverage

Run the coverage command for the detected Stack above.

From the report, identify:

  • Untested branches and code paths
  • Low-coverage files/functions (prioritize files below 60%)
  • Missing error handling tests

2. Identify Test Gaps

Review code for:

  • Logical branches (if/else, switch)
  • Error paths and exceptions
  • Boundary values (min, max, zero, empty, null)
  • Edge cases and corner cases
  • State transitions and side effects

3. Write Tests

Use the test framework for the detected Stack above.

Target scenarios:

  • Error handling and exceptions
  • Boundary conditions
  • Null/undefined/empty inputs
  • Concurrent/async edge cases

4. Verify Improvement

Run coverage again and confirm measurable increase. Report:

  • Before/after coverage percentages
  • Number of new test cases added
  • Files with the biggest coverage gains

Expected Output

After a successful run on a Python project, the final verification report shows:

Coverage before: 61% (47/77 statements)
Coverage after:  84% (65/77 statements)

New tests added: 9
Files improved:
  - src/parser.py        52% → 91%  (+7 tests: null input, empty string, unicode overflow)
  - src/auth.py          71% → 88%  (+2 tests: expired token, missing header)

All 56 tests passing. No regressions.

Acceptance Criteria

A run passes when all of the following are true:

  • Coverage report exists from a runnable command for the detected stack (e.g., jest --coverage, pytest --cov, go test -cover).
  • Post-run total coverage is strictly higher than the pre-run baseline — no test additions that fail to move the metric.
  • New tests target previously-untested branches, error paths, or boundary values — not duplicates of existing assertions.
  • The full test suite passes locally before committing (npm test, pytest, go test ./..., etc.).
  • All new tests live on a feature branch (e.g., feat/test-coverage), never on main/master.
  • Commit message records the before/after coverage percentages and the files newly covered.

Edge Cases

  • No test framework detected: Skill checks package.json, pyproject.toml, Cargo.toml, or go.mod for test dependencies; if none found, asks the user which framework to use before writing any tests.
  • Coverage tool not installed: Installs the appropriate tool (pytest-cov, nyc, cargo tarpaulin, etc.) and retries rather than failing silently.
  • Existing tests are already failing: Does not add new tests until existing failures are resolved; reports the failing tests to the user first.
  • 100% coverage already reached: Reports this to the user and exits — no tests are added unnecessarily.
  • Generated code or vendored files in coverage report: Excludes auto-generated and third-party directories from analysis to avoid writing tests for code the project does not own.
  • Async / concurrent code paths: Uses framework-appropriate async test utilities (e.g., pytest-asyncio, jest fakeTimers) rather than bare sync wrappers.

Step Completion Reports

After completing each major step, output a status report in this format:

◆ [Step Name] ([step N of M] — [context])
··································································
  [Check 1]:          √ pass
  [Check 2]:          √ pass (note if relevant)
  [Check 3]:          × fail — [reason]
  [Check 4]:          √ pass
  [Criteria]:         √ N/M met
  ____________________________
  Result:             PASS | FAIL | PARTIAL

Adapt the check names to match what the step actually validates. Use for pass, × for fail, and to add brief context. The "Criteria" line summarizes how many acceptance criteria were met. The "Result" line gives the overall verdict.

Branch Setup phase checks: Feature branch created, Base coverage measured

Analysis phase checks: Coverage report parsed, Gaps identified, Priority ranked

Test Writing phase checks: Tests written, Edge cases covered, Framework conventions followed

Verification phase checks: Tests pass, Coverage improved, No regressions

Guidelines

  • Follow existing test patterns and naming conventions
  • Place test files alongside source or in the project's existing test directory
  • Group related test cases logically
  • Use descriptive test names that explain the scenario
  • Do not mock what you do not own — prefer integration tests for external boundaries

Frequently asked questions

What does the Test Coverage AI skill do?

Generate unit tests for untested branches and edge cases. Use when coverage is low, CI flags gaps, or a release needs hardening. Not for integration/E2E suites, framework migrations, or fixing production bugs.

Why use Test Coverage on TypingMind?

Because you install it once and use it with any model. Test Coverage is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Test Coverage in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/luongnv89/skills/tree/main/skills/test-coverage. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Test Coverage?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Test Coverage?

As many as you like. As long as a model supports skills, you can use Test Coverage with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Test Coverage AI skill free?

Yes. It is published on GitHub by luongnv89 under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇