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.
npx skills add https://github.com/coco-research/coco --skill generate-tests
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:
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.
Use when implementation is complete, all tests pass, and you need to decide how to integrate the work - guides completion of development work by presenting structured options for merge, PR, or cleanup
Use when implementing any feature or bugfix, before writing implementation code
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes
Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always
Expert guidance for systematic backtesting of trading strategies. Use when developing, testing, stress-testing, or validating quantitative trading strategies. Covers "beating ideas to death" methodology, parameter robustness testing, slippage modeling, bias prevention, and interpreting backtest results. Applicable when user asks about backtesting, strategy validation, robustness testing, avoiding overfitting, or systematic trading development.
Cloud laboratory platform for automated protein testing and validation. Use when designing proteins and needing experimental validation including binding assays, expression testing, thermostability measurements, enzyme activity assays, or protein sequence optimization. Also use for submitting experiments via API, tracking experiment status, downloading results, optimizing protein sequences for better expression using computational tools (NetSolP, SoluProt, SolubleMPNN, ESM), or managing protein design workflows with wet-lab validation.
This skill should be used for time series machine learning tasks including classification, regression, clustering, forecasting, anomaly detection, segmentation, and similarity search. Use when working with temporal data, sequential patterns, or time-indexed observations requiring specialized algorithms beyond standard ML approaches. Particularly suited for univariate and multivariate time series analysis with scikit-learn compatible APIs.
Take coco-research/generate-tests from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.