Analyze test coverage and add tests to improve coverage
Analyzes test coverage and adds new test cases to improve coverage without changing implementation.
/plugin marketplace add teliha/dev-workflows/plugin install dev-workflows@dev-workflowsAnalyze test coverage and add new test cases to improve coverage without changing implementation.
This command uses the Test Coverage Improvement Expert skill for analysis and test generation.
/improve-coverage
The improve-coverage skill automatically:
| DO | DON'T |
|---|---|
| Add new test cases | Modify implementation code |
| Follow existing patterns | Refactor existing tests |
| Use descriptive names | Change production behavior |
| Ensure all tests pass | Skip verification |
| Area | Target |
|---|---|
| Critical paths | 100% |
| Business logic | 90%+ |
| Utilities | 80%+ |
| UI components | 70%+ |
| Project | Coverage Command |
|---|---|
| Foundry | forge coverage --report summary |
| Jest | jest --coverage |
| Vitest | vitest --coverage |
function test_RevertWhen_Unauthorized() public {
vm.prank(unauthorizedUser);
vm.expectRevert(MyContract.Unauthorized.selector);
myContract.protectedFunction();
}
it('should return 401 when unauthorized', async () => {
const res = await request(app).get('/api/users');
expect(res.status).toBe(401);
});
name: Improve Coverage
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * 0" # Weekly
jobs:
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- run: npm ci
- uses: teliha/dev-workflows/.github/actions/improve-coverage@main
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
github_token: ${{ secrets.GITHUB_TOKEN }}