
Write Tests
Automatically extend test coverage for uncommitted or latest-commit code changes without rewriting existing tests.
Overview
write-tests is an agent skill most often used in Ship (also Build) that orchestrates coverage-focused test creation for local git changes without modifying existing tests.
Install
npx skills add https://github.com/neolabhq/context-engineering-kit --skill write-testsWhat is this skill?
- Targets git diff (uncommitted, including untracked) or latest commit when the tree is clean
- Orchestrates specialized review and development agents for multi-file or complex logic changes
- Adds tests only—preserves existing tests and focuses on critical business logic, not line-level vanity coverage
- Complexity gate: 2+ changed files or one complex file → agent orchestration only; single simple file may be authored dir
- Optional focus via argument-hint for modules or scenarios to prioritize
- Orchestration required when 2+ changed files or one file with complex logic
Adoption & trust: 531 installs on skills.sh; 1.1k GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
You finished a feature or refactor but lack tests that exercise the new business logic in your current diff.
Who is it for?
Builders with a git repo, recent local changes, and a test suite who want additive coverage aligned to the diff.
Skip if: Greenfield projects with no test harness yet, or changes where you need to rewrite or delete legacy tests rather than only add new ones.
When should I use this skill?
After implementing new features or refactoring, add test coverage for uncommitted changes or the latest commit; optional $ARGUMENTS to focus modules.
What do I get? / Deliverables
New tests land around critical paths in changed files so you can merge with clearer regression signal, using agents when the change set is too large to hand-write safely.
- New test files or cases covering changed business logic
- Coverage-oriented scope notes for what was included or deferred
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Canonical shelf is Ship because the skill’s goal is coverage for changes ready to merge or recently committed, right before safe release. Subphase testing matches systematic test addition and coverage analysis rather than code review or security scanning.
Where it fits
After adding API handlers, delegate test authoring while you keep editing other modules.
Before opening a PR, cover the latest commit’s business rules with new tests only.
Pair with review by proving changed logic has targeted tests in the same branch.
How it compares
A diff-scoped test orchestration workflow, not a one-shot “generate unit tests for whole repo” snippet.
Common Questions / FAQ
Who is write-tests for?
Solo developers and indie teams using agentic coding workflows who want systematic tests tied to what they just changed, especially on multi-file features.
When should I use write-tests?
In Build after implementing features or refactors, and in Ship during testing prep before PR or release, whenever local diff or latest commit lacks adequate business-logic tests.
Is write-tests safe to install?
It implies git and filesystem access to read diffs and write test files; confirm repo trust and review the Security Audits panel on this Prism page before install.
SKILL.md
READMESKILL.md - Write Tests
# Cover Local Changes with Tests ## User Arguments User can provide a what tests or modules to focus on: ``` $ARGUMENTS ``` If nothing is provided, focus on all changes in current git diff that not commited. If everything is commited, then will cover latest commit. ## Context After implementing new features or refactoring existing code, it's critical to ensure all business logic changes are covered by tests. This command orchestrates automated test creation for local changes using coverage analysis and specialized agents. ## Goal Achieve comprehensive test coverage for all critical business logic in local code changes. ## Important Constraints - **Focus on critical business logic** - not every line needs 100% coverage - **Preserve existing tests** - only add new tests, don't modify existing ones - "Analyse complexity of changes" - - if there 2 or more changed files, or one file with complex logic, then **Do not write tests yourself** - only orchestrate agents! - if there is only one changed file, and it's a simple change, then you can write tests yourself. ## Workflow Steps ### Preparation 1. **Read sadd skill if available** - If available, read the sadd skill to understand best practices for managing agents 2. **Discover test infrastructure** - Read @README.md and package.json (or equivalent project config) - Identify commands to run tests and coverage reports - Understand project structure and testing conventions 3. **Run all tests** - Execute full test suite to establish baseline ### Analysis Do steps 4-5 in parallel using haiku agents: 4. **Verify single test execution** - Choose any passing test file - Launch haiku agent with instructions to find proper command to run this only test file - Ask him to iterate until you can reliably run individual tests - After he complete try running a specific test file if it exists - This ensures agents can run tests in isolation 5. **Analyze local changes** - Run `git status -u` to identify all changed files (including untracked files) - If there no uncommited changes, then run `git show --name-status` to get the list of files that were changed in the latest commit. - Filter out non-code files (docs, configs, etc.) - Launch separate haikue agent per changed file to analyze file itself, and the complexity of the changes, and prepare short summary of it. - Extract list of files with actual logic changes ### Test Writing #### Simple Single File Flow If there is only one changed file, and it's a simple change, then you can write tests yourself. Following this guidline: 1. Read TDD skill for best practices on writing tests 2. Read the target file {FILE_PATH} and understand the logic 3. Review existing test files for patterns and style, if not exists then create it. 4. Analyse which tests cases should be added to cover the changes. 5. Create comprehensive tests for all identified cases 6. Run the test command identified before. 7. Iterate and fix any issues until all tests pass Ensure tests are: - Clear and maintainable - Follow project conventions - Test behavior, not implementation - Cover edge cases and error paths #### Multiple Files or Complex File Flow If there are multiple changed files, or one file with complex logic, then you need to use specialized agents to cover the changes. Following this guidline: 6. **Launch `review:test-coverage-reviewer` agents (parallel)** (Sonnet or Opus models) - Launch one coverage-reviewer agent per changed file - Provide each agent with: - **Context**: What changed in this file (git diff) - **Target**: Which specific file to analyz