# Lisa Nightly Add Test Coverage

> Nightly direct-execution skill…

- Skill: `codyswanngt/lisa-nightly-add-test-coverage` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add codyswanngt/lisa-nightly-add-test-coverage`
- Raw SKILL.md: https://api.skillmd.com/api/skills/codyswanngt/lisa-nightly-add-test-coverage/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: codyswanngt (https://skillmd.com/u/codyswanngt)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/codyswanngt/lisa-nightly-add-test-coverage

---


# Nightly Test Coverage Improvement

The caller provides pre-computed context:
- **Package manager** (`npm`, `yarn`, or `bun`)
- **Thresholds file** path (vitest.thresholds.json or jest.thresholds.json)
- **Current thresholds** (statements, branches, functions, lines percentages)
- **Proposed thresholds** (each metric increased by the coverage increment, capped at 90%)
- **Metrics being bumped** (which metrics are below target)

## Instructions

### Phase 1: Identify gaps

1. Run the project's coverage script with the provided package manager (e.g., `npm run test:cov`, `yarn test:cov`, or `bun run test:cov`) to get the coverage report -- identify gaps BEFORE reading any source files
2. Parse the coverage output to identify the specific files and lines with the lowest coverage. Prioritize files with the most uncovered lines/branches.
3. Read ONE existing test file to learn the project's testing patterns (mocks, imports, assertions). Do not read more than one.

### Phase 2: Write tests incrementally — one file at a time

For each source file with low coverage (starting with the lowest):

4. Read only the uncovered sections of the source file using the coverage report line numbers -- do not explore the codebase broadly
5. Write a test file targeting the uncovered branches/lines for that source file
6. Run the test file in isolation (e.g., `npx vitest run tests/my-new-test.test.ts`) to verify it passes before moving on
7. If the test fails, fix it immediately. Do not move to the next file until the current test passes.
8. Repeat steps 4-7 for the next source file. Stop once you estimate the proposed thresholds will be met.

### Phase 3: Verify and ship

9. Run the full coverage script to verify the new thresholds pass
10. Update the thresholds file with the proposed new threshold values
11. Re-run the coverage script to confirm the updated thresholds pass
12. Commit all changes (new tests + updated thresholds file) with conventional commit messages
13. Create a PR with `gh pr create` with a title like "test: increase test coverage: [metrics being bumped]" summarizing coverage improvements

