unit-test-generator
Installation
SKILL.md
Unit Test Generator
Generate tests that fail when the code is wrong and pass when it's right — not tests that pass because they assert what the code currently does. The purpose of a test is to pin intended behavior, not observed behavior.
Step 1 — Detect the target framework and conventions
Before writing anything, find an existing test file in the project and match it:
| Check | Look for |
|---|---|
| Framework | pytest / unittest (Py), jest / vitest / mocha (JS/TS), JUnit 4/5 / TestNG (Java), go test (Go), xUnit / NUnit (.NET), RSpec / Minitest (Ruby) |
| Assertion style | assert x == y vs assertThat(x).isEqualTo(y) vs expect(x).toBe(y) vs x.should eq(y) |
| File location / naming | tests/test_foo.py, __tests__/foo.test.ts, src/foo_test.go, FooTest.java |
| Mocking library | unittest.mock, jest.fn(), Mockito, gomock, Moq, Sinon |
| Parameterization style | @pytest.mark.parametrize, test.each, @ParameterizedTest, table-driven |
| Fixture / setup idiom | conftest.py, beforeEach, @BeforeEach, TestMain, let(:x) |
If no tests exist at all, ask which framework — or default to the ecosystem standard (pytest, jest, JUnit 5, go test) and say so explicitly in the output.