test-writer
/test-writer
Write meaningful automated tests for JavaScript/TypeScript (Vitest, Jest, Testing Library, Playwright) and Python (pytest) that follow the project's existing conventions. Use whenever the user asks to add tests, improve coverage, "bikin test", "buat unit test", test a function/component/endpoint, or after implementing a feature that has no tests.
- Author
- KILN-skills ↗
- Repository
- kiln ↗
- Licence
- MIT
- Last repository change
- 09.11.2026
Assessment and security
- Files in this package
- 2
- Scripts
- 1
- HTML comments
- 0
- URLs in SKILL.md
- 0
No signals detected. Repository changed on 09.11.2026, without references to retired models or APIs.
MIT, open: use and modify while retaining author attribution.
- 1 scripts in this package. Review them before installing, as Claude may execute them.
Scripts: scripts/detect_test_setup.sh
What it does and when to use it
Write meaningful automated tests for JavaScript/TypeScript (Vitest, Jest, Testing Library, Playwright) and Python (pytest) that follow the project's existing conventions. Use whenever the user asks to add tests, improve coverage, "bikin test", "buat unit test", test a function/component/endpoint, or after implementing a feature that has no tests.
Triggers from the description
Original author description
Write meaningful automated tests for JavaScript/TypeScript (Vitest, Jest, Testing Library, Playwright) and Python (pytest) that follow the project's existing conventions. Use whenever the user asks to add tests, improve coverage, "bikin test", "buat unit test", test a function/component/endpoint, or after implementing a feature that has no tests.
How it works
- 1. Detect the setup — never assume
- 2. Decide what to test
- 3. Write the tests
- 4. Prove the tests are real
- 5. Report
SKILL.md preview
---
name: test-writer
description: Write meaningful automated tests for JavaScript/TypeScript (Vitest, Jest, Testing Library, Playwright) and Python (pytest) that follow the project's existing conventions. Use whenever the user asks to add tests, improve coverage, "bikin test", "buat unit test", test a function/component/endpoint, or after implementing a feature that has no tests.
---
# Test Writer
Good tests fail when behavior breaks and pass when it doesn't. They're not coverage padding.
## 1. Detect the setup — never assume
Run `scripts/detect_test_setup.sh` from the project root. It reports the framework, test command, and where existing tests live.
Then open 1–2 existing test files near the target code and copy their conventions: file naming (`*.test.ts` vs `*.spec.ts`, `test_*.py`), folder (`__tests__/`, `tests/`, colocated), imports, fixtures/factories, mocking style. Consistency beats your preferences.
If there is no test setup at all, propose one (Vitest for Vite/TS projects, Jest otherwise; pytest for Python) and ask before installing.
## 2. Decide what to test
Read the target code and list behaviors, not lines:
- **Happy path** — the main expected use
- **Edge cases** — empty input, zero, negative, very large, unicode, `null`/`None`/`undefined`, duplicate items
- **Error paths** — invalid input raises/rejects with the right error
- **Boundaries** — exactly at limits (`<` vs `<=`)
- **State/side effects** — what gets written, called, emitted
Prioritize by risk: business logic and data transforms first; trivial getters last or never.
## 3. Write the tests
Principles:
- One behavior per test, named as a sentence: `it("returns empty list when no users match")`, `def test_returns_empty_list_when_no_users_match()`.
- Arrange / Act / Assert, visibly separated.
- Assert on outputs and observable effects, not on internal implementation details.
- Mock only at the edges (network, time, filesystem, randomness, external APIs). Don't mock the code under test.
- Deterministic: freeze time (`vi.useFakeTimers()`, `freezegun`/`time-machine`), seed randomness, no real network.
- Use parametrization for input tables: `it.each` / `test.each`, `@pytest.mark.parametrize`.
- React components: Testing Library, query by role/label text (`getByRole("button", { name: /simpan/i })`), use `userEvent`, not implementation selectors.
- Python async: `pytest-asyncio` if the project uses it.
- API endpoints: FastAPI `TestClient` / Django test client / supertest for Express.
## 4. Prove the tests are real
1. Run the new tests — they must pass.
2. **Mutation check**: temporarily break the code under test (flip a condition, return early) and confirm at least one new test fails. Revert. A test that can't fail is worthless.
3. Run the whole related suite to make sure nothing else broke.
## 5. Report
Briefly list: which behaviors are now covered, anything deliberately skipped (and why), and any bugs the tests uncovered — report those to the user rather than silently "fixing" the test to match buggy behavior.
Files in this package (2)
- SKILL.md 3 KB
- scripts/detect_test_setup.sh 2 KB
Versions
| Repository | Score | Licence |
|---|---|---|
| This page · KILN-skills/kiln | 90 | MIT |
| miniidealab/openlogos | 100 | Apache-2.0 |
| sofetizm/test-writer | 100 | MIT |
| anchildress1/awesome-ai | 100 | MIT |
| hamzafarooq/claude-code-starter | 100 | MIT |
| smykla-skalski/sai | 90 | MIT |
| toss/react-simplikit | 90 | MIT |
Database snapshot: 13.11.2026 · package version d74c60d816a1 (SHA-256 digest of the entire package)
Downloads in the last 30 days: 5 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 100test-generator
Generate unit, integration, and end-to-end tests for existing code. Use when a user asks to write tests, add test coverage, create unit tests, generate integration tests, build e2e tests, improve code coverage, write specs, or add testing to a project. Supports Jest, Vitest,… - 100testing
Unit, integration, E2E, load, and a11y tests: pytest, vitest/jest, Playwright, fixtures, mocks, coverage. Use for adding tests or fixing flaky suites. - 100testing-patterns
pytest with moto, Jest/Vitest with React Testing Library, Playwright E2E patterns. Use when writing or reviewing tests, setting up test infrastructure, or debugging test failures. - 91javascript-testing-patterns
Implement comprehensive testing strategies using Jest, Vitest, and Testing Library for unit tests, integration tests, and end-to-end testing with mocking, fixtures, and test-driven development. Use when writing JavaScript/TypeScript tests, setting up test infrastructure, or… - 100nextjs-testing
Write Jest or Vitest unit tests with React Testing Library and Playwright E2E tests for Next.js projects. Use when testing components with RTL, mocking APIs with MSW, or creating Playwright user flow tests. - 100react-testing
Test React components with RTL and Jest/Vitest. Use when writing React component tests with React Testing Library, Jest, or Vitest.