dist/codex/plugins/dev-flow/skills/improving-tests/SKILL.md
Improve test design, speed, and coverage with behavior-focused tests, useful seams, characterization tests, TDD, and test refactoring. Use when improving tests, optimizing slow suites, adding coverage, refactoring brittle tests, removing test waste, or working test-first. NOT for fixing production bugs (use fixing-code), production-code refactors (use refactoring-code), or reviewing non-test code quality (use reviewing-code).
npx skillsauth add alexei-led/claude-code-config improving-testsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Improve tests so they catch real behavior regressions without blocking safe code changes. Suite latency is a quality attribute. Coverage is a signal, not the goal.
Detect capability from tools:
Use an interactive question tool when available for mode selection, missing scope, missing framework approval, or unsafe test-stack choices.
Do not use this for:
fixing-coderefactoring-codereviewing-codebrowser-automationDetect languages from files in scope and read only the matching reference:
references/csharp.mdreferences/go.md; for slow-suite or feedback-loop work, also read references/go-performance.mdreferences/java-kotlin.mdreferences/python.md; for slow-suite or feedback-loop work, also read references/python-performance.mdreferences/typescript.md; for slow-suite or feedback-loop work, also read references/typescript-performance.mdreferences/rust.mdreferences/web.mdUse generic rules only for unsupported languages.
review: find weak, duplicate, brittle, missing, slow, or flaky testsrefactor: simplify tests without changing covered behaviorcoverage: add tests for uncovered business behavior or error pathstdd: one red-green-refactor slice at a timeperformance: measure test latency and remove speed waste without weakening behaviorfull: review, refactor, performance, and add coverageIf mode is missing, ask one question with these options.
Test through the contract that users or adjacent modules rely on:
Use graph tools only when available and when they help choose the seam or risk:
For performance mode or any slow-suite work:
Prefer focused deterministic checks during edits and the broader relevant suite before final output. Do not hide failures, delete edge cases, or skip important fast tests to make a number look better.
TDD:
Characterization tests:
Look for:
Prefer each language's table-driven or parameterized pattern from references/<lang>.md when cases share setup and assertions. Do not force consolidation when separate tests make distinct behavior clearer.
Run the relevant project command after changes, for example pytest -q --maxfail=1 --tb=short. Exact commands per language live in references/<lang>.md.
Use coverage commands only when coverage mode or review needs them. Report skipped checks with exact reasons.
Engineer:
TEST IMPROVEMENT COMPLETE
=========================
Mode: review | refactor | coverage | tdd | performance | full
Tests changed: N
Waste removed: N
Coverage: before → after | not measured
Performance: baseline → after | not measured
Status: CLEAN | NEEDS ATTENTION
Key improvements:
- path:line — change
Verification:
- <command> — pass/fail/skipped with reason
Reviewer or blocked:
## Proposed Changes | BLOCKED
Blocker:
- <missing artifact, framework, tool, permission, or safe seam>
### Change 1: <brief description>
File: `path/to/test_file`
Action: CREATE | MODIFY | DELETE
Code: <complete test code or changed region with enough context>
Rationale: <weak, missing, brittle, slow, or duplicate test this fixes>
Verification: <command the applier should run>
If no test framework exists, ask before adding one. Do not claim clean without a passing check or an explicit skipped-check reason.
tools
Use when planning, executing, checkpointing, finishing, or inspecting lightweight spec-driven work. Runs one task at a time using `.spec/` markdown files and the bundled `specctl` helper. NOT for broad product discovery beyond a short requirement interview. NOT for generic implementation planning that does not read or write `.spec/` files.
development
Simple web development with HTML, CSS, JS, and HTMX. Use when working with .html, .css, or .htmx files, web templates, stylesheets, or vanilla JS scripts. NOT for React/Vue/Angular (use writing-typescript) or Node.js backends.
tools
Idiomatic TypeScript development. Use when writing TypeScript code, Node.js services, React apps, or TypeScript design advice. Emphasizes strict typing, boundary validation, composition, fast feedback, behavior tests, and project-configured tooling. NOT for Go, Python, Rust, plain HTML/CSS/JS, or server-rendered templates (use writing-web).
tools
Idiomatic shell development for POSIX sh, Bash, Zsh, Fish, hooks, CI shell steps, and scriptable CLI glue. Use when writing or changing `.sh`, `.bash`, `.zsh`, `.fish`, `.bats`, shell functions, shell pipelines, CI `run:` shell bodies, or command-runner recipes. Emphasizes portability, quoting, safe filesystem/process handling, non-TUI CLI tools, ShellCheck, shfmt, Bats, and ShellSpec. NOT for Python, Rust, TypeScript, Go, web code, or GitHub Actions workflow/job/permissions semantics; use operating-infra.