$npx -y skills add alexei-led/cc-thingz --skill improving-testsFollow the base skill. This Claude overlay only defines tool use and execution details.
| 1 | # Test Improvement |
| 2 | |
| 3 | Follow the base skill. This Claude overlay only defines tool use and execution details. |
| 4 | |
| 5 | Improve tests through public behavior seams. Treat suite latency as a quality |
| 6 | attribute. Do not inflate coverage with low-value assertions. Do not change |
| 7 | production behavior unless the selected TDD slice requires it. |
| 8 | |
| 9 | ## Arguments |
| 10 | |
| 11 | - `review`: find weak, duplicate, brittle, missing, slow, or flaky tests. |
| 12 | - `refactor`: simplify tests without changing covered behavior. |
| 13 | - `coverage`: add useful tests for uncovered business behavior or error paths. |
| 14 | - `tdd`: one red-green-refactor slice at a time. |
| 15 | - `performance`: measure slow tests and remove speed waste without weakening behavior. |
| 16 | - `full`: review, refactor, performance, and add coverage. |
| 17 | |
| 18 | If mode is missing, use `AskUserQuestion` with those options. Ask before adding a |
| 19 | new test framework. |
| 20 | |
| 21 | Use `TaskCreate` and `TaskUpdate` when the session has more than two steps: |
| 22 | |
| 23 | 1. Choose mode and scope. |
| 24 | 2. Inspect test structure and project conventions. |
| 25 | 3. Select behavior seam. |
| 26 | 4. Apply one cluster or one TDD slice. |
| 27 | 5. Verify and report. |
| 28 | |
| 29 | ## Tool order |
| 30 | |
| 31 | 1. Use `Read`, `Grep`, `Glob`, and `LS` to find tests, fixtures, helpers, and nearby patterns. |
| 32 | 2. Load only matching language references. For `performance` mode or slow-suite work, also load the matching `references/<language>-performance.md` when present. |
| 33 | 3. Run the narrow test or coverage command only when it helps the selected mode. |
| 34 | 4. Use `Edit` for existing tests and `Write` only for new files. |
| 35 | 5. Run the relevant verification before final output. |
| 36 | |
| 37 | Use direct reads/search for small scopes. Spawn read-only agents only for broad or |
| 38 | mixed-language audits. |
| 39 | |
| 40 | ## Command discipline |
| 41 | |
| 42 | Use only commands supported by the repo and available tools. Examples: |
| 43 | |
| 44 | ```bash |
| 45 | go test ./pkg -run TestName |
| 46 | go test ./... |
| 47 | go tool cover -func=/tmp/coverage.out |
| 48 | golangci-lint run ./... |
| 49 | vitest run path/to/file.test.ts |
| 50 | jest path/to/file.test.ts --runInBand |
| 51 | pytest -q --maxfail=1 --tb=short |
| 52 | pytest -q --durations=10 --durations-min=0.5 |
| 53 | uv run pytest -q --maxfail=1 --tb=short |
| 54 | bun test |
| 55 | bun run tsc --noEmit |
| 56 | npm test |
| 57 | npx playwright test --list |
| 58 | bunx playwright test --list |
| 59 | ``` |
| 60 | |
| 61 | If a referenced command is unavailable, report it as skipped with the exact reason. |
| 62 | Do not install a test framework or tool without user approval. |
| 63 | |
| 64 | ## TDD mode |
| 65 | |
| 66 | For `tdd`, write one failing test for one behavior, confirm it fails for the expected |
| 67 | reason, implement the smallest passing code, then refactor only while green. Do not |
| 68 | write a bulk suite for imagined future behavior. |
| 69 | |
| 70 | ## Scope control |
| 71 | |
| 72 | - Test through public module, package, API, CLI, component, or service boundaries. |
| 73 | - Mock only system boundaries. |
| 74 | - Remove real sleeps, external I/O, broad discovery, repeated setup, and coverage-on-default before reducing checks. |
| 75 | - Delete shallow duplicates only after stronger public-boundary tests cover them. |
| 76 | - Do not force table-driven, parametrized, or `it.each` consolidation when separate tests make distinct behavior clearer. |
| 77 | - If no safe behavior seam exists, use `BLOCKED` or `Proposed Changes`. |