test-writer
/test-writer
Pisze sensowne testy automatyczne dla JavaScriptu, TypeScriptu (Vitest, Jest, Testing Library, Playwright) i Pythona (pytest), zgodnie z konwencjami projektu.
- Autor
- KILN-skills ↗
- Repozytorium
- kiln ↗
- Licencja
- MIT
- Ostatnia zmiana repozytorium
- 09.11.2026
Ocena i bezpieczeństwo
- Pliki w paczce
- 2
- Skrypty
- 1
- Komentarze HTML
- 0
- Adresy URL w SKILL.md
- 0
Brak sygnałów. Repozytorium zmienione 09.11.2026, bez odwołań do wycofanych modeli i API.
MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.
- 1 skrypt w paczce. Przejrzyj je przed instalacją, bo Claude może je uruchomić.
Skrypty: scripts/detect_test_setup.sh
Co robi i kiedy
Pisze sensowne testy automatyczne dla JavaScriptu, TypeScriptu (Vitest, Jest, Testing Library, Playwright) i Pythona (pytest), zgodnie z konwencjami projektu.
Wyzwalacze z opisu
Oryginalny opis (EN)
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.
Jak działa
- 1. Detect the setup — never assume
- 2. Decide what to test
- 3. Write the tests
- 4. Prove the tests are real
- 5. Report
Podgląd SKILL.md
---
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.
Pliki w paczce (2)
- SKILL.md 3 KB
- scripts/detect_test_setup.sh 2 KB
Wersje
| Repozytorium | Wynik | Licencja |
|---|---|---|
| Ta strona · 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 |
Migawka bazy z 13.11.2026 · wersja paczki d74c60d816a1 (skrót SHA-256 całej paczki)
Pobrania w ostatnich 30 dniach: 1 · ranking
Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.
Podobne skille
- 100test-generator
Generuje testy jednostkowe, integracyjne i end-to-end dla istniejącego kodu w Jest, Vitest, Pytest, Playwright, React Testing Library i Cypress, z asercjami, przypadkami brzegowymi i mockami. - 100testing
Pisze testy jednostkowe, integracyjne, E2E, obciążeniowe i a11y w pytest, vitest, jest i Playwright, z fixtures i mockami. - 100testing-patterns
Opisuje wzorce pytest z moto, Jest i Vitest z React Testing Library oraz Playwright E2E, także przy debugowaniu porażek. - 91javascript-testing-patterns
Buduje strategie testów w JavaScript i TypeScript przez Jest, Vitest i Testing Library, z mockowaniem, fixture i TDD. - 100nextjs-testing
Pisze testy jednostkowe Jest lub Vitest z React Testing Library oraz testy E2E Playwright dla projektów Next.js, w tym mockowanie API przez MSW. - 100react-testing
Testuje komponenty React z React Testing Library oraz Jest lub Vitest.