Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Generate complete test coverage for any file, component, or module. Covers unit tests, integration tests, edge cases, error handling, and mocking — adapted to whatever testing framework the project uses.
.claude/skills/coco-research-generate-tests/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-13 | ✗→✓ | ▲ Improved | 162% | 0% |
| case-05 | ✓→✗ | ▼ Worse | -51% | 0% |
| case-07 | ✓→✗ | ▼ Worse | -64% | 0% |
| case-08 | ✓→✗ | ▼ Worse | -52% | 0% |
| case-10 | ✓→✗ | ▼ Worse | -15% | 0% |
Generate complete test coverage for any file, component, or module. Covers unit tests, integration tests, edge cases, error handling, and mocking — adapted to whatever testing framework the project uses.
Use when: you want tests generated for a file or component, need to improve test coverage, want edge case coverage, need mocks for external dependencies, or want to bootstrap a test suite for untested code.
Follow every step below. Do NOT generate tests without first analyzing the project's testing setup and the target code.
Before writing any tests, discover the project's testing conventions:
package.json (dependencies/scripts), or config files:jest.config.* / jest key in package.json → Jestvitest.config.* → Vitestcypress.config.* → Cypressplaywright.config.* → Playwrightpytest.ini / pyproject.toml tool.pytest] → pytestgo.mod → Go testingCargo.toml → Rust (#cfg(test)])*.test.*, *.spec.*, test_*.py, *_test.go to understand naming conventions and patterns already in use.test/utils.ts, __mocks__/, conftest.py).test script in package.json (or equivalent) to understand how tests are run, what flags are used, and what coverage tool is configured.Match the project's existing conventions exactly. File naming, import style, assertion style, describe/it vs test, etc.
Read the file or component the user wants tested. Identify:
Before writing code, outline what you'll test:
Follow these principles:
describe("[ModuleName]", () => {
describe("[functionName]", () => {
it("should [expected behavior] when [condition]", () => {
// Arrange
// Act
// Assert
});
});
});expect() calls are fine if they assert one logical thingdescribe — One block per function/method/component behaviorbeforeEach/afterEach for test isolation. Clean up subscriptions, timers, mocks.jest.mock(), vi.mock(), unittest.mock)jest.useFakeTimers() / vi.useFakeTimers()) for time-dependent codeafterEach to prevent test pollutionawait async functions or return the promisewaitFor / findBy for async UI updates (React Testing Library)| Framework | Component Testing | Key Patterns | |-----------|------------------|--------------| | React | React Testing Library | render(), screen.getByRole(), userEvent, waitFor | | Vue | Vue Test Utils | mount(), shallowMount(), wrapper.find(), trigger() | | Angular | TestBed | TestBed.configureTestingModule(), fixture.detectChanges() | | Node.js | Supertest | request(app).get("/api/...").expect(200) | | Python | pytest | @pytest.fixture, monkeypatch, parametrize | | Go | testing | t.Run(), table-driven tests, t.Parallel() |
After generating the tests:
| Priority | Coverage Target | |----------|----------------| | Critical business logic | 90%+ | | Utility functions | 85%+ | | UI components | 80%+ | | Configuration/glue code | 60%+ |
Focus on branch coverage over line coverage — untested else and catch paths are where bugs hide.
Before finishing, verify:
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→fail | 7,471 | 15,291 | +105% | 1 | 1 | 0% | 126 | 1,849 | +1367% | 0 | 0 | — |
case-02 | fail→fail | 8,304 | 10,149 | +22% | 1 | 1 | 0% | 266 | 1,813 | +582% | 0 | 0 | — |
case-03 | fail→fail | 14,788 | 15,012 | +2% | 1 | 1 | 0% | 316 | 1,843 | +483% | 0 | 0 | — |
case-04 | pass→pass | 17,877 | 23,589 | +32% | 1 | 1 | 0% | 3,348 | 5,443 | +63% | 0 | 0 | — |
case-05 | pass→fail | 34,104 | 9,784 | -71% | 1 | 1 | 0% | 3,915 | 1,919 | -51% | 0 | 0 | — |
case-06 | fail→fail | 14,020 | 31,128 | +122% | 1 | 1 | 0% | 2,827 | 5,013 | +77% | 0 | 0 | — |
case-07 | pass→fail | 34,083 | 12,522 | -63% | 1 | 1 | 0% | 5,716 | 2,078 | -64% | 0 | 0 | — |
case-08 | pass→fail | 23,742 | 15,829 | -33% | 1 | 1 | 0% | 3,974 | 1,914 | -52% | 0 | 0 | — |
case-09 | pass→pass | 24,819 | 16,253 | -35% | 1 | 1 | 0% | 3,205 | 5,037 | +57% | 0 | 0 | — |
case-10 | pass→fail | 14,749 | 9,721 | -34% | 1 | 1 | 0% | 2,129 | 1,806 | -15% | 0 | 0 | — |
case-11 | pass→fail | 26,439 | 7,672 | -71% | 1 | 1 | 0% | 3,677 | 1,969 | -46% | 0 | 0 | — |
case-12 | pass→pass | 20,853 | 26,713 | +28% | 1 | 1 | 0% | 3,369 | 6,246 | +85% | 0 | 0 | — |
case-13 | fail→pass | 9,757 | 27,156 | +178% | 1 | 1 | 0% | 1,972 | 5,164 | +162% | 0 | 0 | — |
case-14 | pass→fail | 20,156 | 16,634 | -17% | 1 | 1 | 0% | 3,601 | 1,884 | -48% | 0 | 0 | — |
case-15 | pass→fail | 12,417 | 8,629 | -31% | 1 | 1 | 0% | 2,526 | 2,038 | -19% | 0 | 0 | — |
case-16 | pass→fail | 15,317 | 16,715 | +9% | 1 | 1 | 0% | 3,108 | 1,900 | -39% | 0 | 0 | — |
case-17 | fail→fail | 20,316 | 10,133 | -50% | 1 | 1 | 0% | 3,249 | 1,963 | -40% | 0 | 0 | — |
case-18 | pass→pass | 21,790 | 33,742 | +55% | 1 | 1 | 0% | 3,484 | 8,138 | +134% | 0 | 0 | — |
case-19 | pass→pass | 23,783 | 27,233 | +15% | 1 | 1 | 0% | 4,961 | 5,339 | +8% | 0 | 0 | — |
case-20 | fail→fail | 17,413 | 9,738 | -44% | 1 | 1 | 0% | 2,298 | 1,821 | -21% | 0 | 0 | — |
case-21 | pass→fail | 10,013 | 9,228 | -8% | 1 | 1 | 0% | 1,554 | 1,757 | +13% | 0 | 0 | — |
case-22 | pass→pass | 15,565 | 14,167 | -9% | 1 | 1 | 0% | 2,141 | 3,573 | +67% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted, and 10 counted toward the lift figure. The other 12 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of -36 percentage points is the difference between those two pass rates over the 10 comparable cases. 9 cases got worse with the skill loaded, and they are included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.