Writes and updates unit tests for new or changed code following the project's existing framework and style, covering happy, error, and boundary paths, then runs them with coverage and fixes failures.
Ships in engineering-core. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Every behavior you added or changed gets a unit test that would fail if that behavior broke. Test through the unit's public interface, match the tests already in the project, and treat coverage as a map of what you missed, never as the goal.
Not for: deciding unit vs integration vs end-to-end, test doubles across a whole system, or flaky tests. Use the test-strategy skill for those. When you finish, run the verify-before-done skill.
vitest.config.*, jest.config.*, "test" in package.json, *.test.ts / *.spec.ts.pytest.ini, [tool.pytest.ini_options] in pyproject.toml, conftest.py, test_*.py.*_test.go next to the code.src/test/java, JUnit 5 or Kotest dependencies.*.Tests.csproj with xUnit, NUnit or MSTest.#[cfg(test)] mod tests in the file, or tests/.
Open the tests nearest to the code you changed. Copy their file location, naming, fixtures, factories, helpers and assertion style. Never add a second test framework.null / undefined / None; empty string, whitespace, Unicode; duplicates; date and time edges (month end, leap day, time zones).rejects_expired_coupon, "returns 0 for an empty cart"). Use Arrange-Act-Assert. Use table-driven tests for many input/output pairs (example below). Assert on outputs and visible effects, not on which private helpers were called.| Stack | Command | Needs |
|---|---|---|
| Vitest | npx vitest run --coverage | a coverage provider package, such as @vitest/coverage-v8 |
| Jest | npx jest --coverage | built in |
| pytest | pytest --cov=<package> --cov-report=term-missing | pytest-cov |
| Go | go test -coverprofile=cover.out ./... then go tool cover -func=cover.out | built in |
| Maven | mvn test jacoco:report (report in target/site/jacoco/) | jacoco-maven-plugin configured with prepare-agent |
| Gradle | ./gradlew test jacocoTestReport | the jacoco plugin applied |
| .NET | dotnet test --collect:"XPlat Code Coverage" | the coverlet.collector package in the test project |
| Rust | cargo llvm-cov | the cargo-llvm-cov tool installed |
If the project already has a coverage script (for example npm run test:coverage), use it instead. Adding a coverage package or tool changes the project, so ask the user first.
The same pattern exists in every framework (it.each / test.each, @pytest.mark.parametrize, Go table tests, JUnit @ParameterizedTest, xUnit [Theory]).
import pytest
from shop.pricing import discount_for
@pytest.mark.parametrize(
"total, expected",
[
(0, 0), # empty cart
(99.99, 0), # just below threshold
(100, 10), # exactly at threshold
(250, 25), # typical
],
)
def test_discount_for_totals(total, expected):
assert discount_for(total) == expected
def test_discount_rejects_negative_total():
with pytest.raises(ValueError, match="negative"):
discount_for(-1)
When a unit test fails after a change, decide which side is wrong before touching anything:
| Situation | Action |
|---|---|
| The behavior changed on purpose (new requirement) | Update the test to the new behavior, and say so in your report |
| The behavior changed by accident | Fix the code; leave the test as it is |
| The test relied on internals that were refactored | Rewrite the test against the public behavior |
| A snapshot changed | Read the diff line by line; update only if every change is intended |
| You can't tell which is right | Stop and ask the user, showing the old and new behavior |
Never delete, skip or loosen a failing test just to get green.
expect(helper).toHaveBeenCalledTimes(3)) instead of results.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/engineering-core:unit-testingfrom engineering-core
npx claudepluginhub reddygopalkrishna/developer-agent-skills --plugin engineering-core14 skills in this plugin
/codebase-onboardingMaps an unfamiliar repository before changing it - stack, build/test/run commands, entry points, data flow, conventions and how changes ship - and writes a short map. Use when starting work in a repo you have not seen, when asked to explain how a codebase works, onboard to a project, find where something lives, or before a first change in a large or legacy codebase. Not for reviewing a specific diff./code-review-changesReviews code changes (a pull request, merge request or diff) like a senior engineer - finds real bugs, security holes, data risks and breaking changes, verifies each one, and reports it with file:line, a concrete failure scenario and a suggested fix. Use when asked to review a PR, merge request, diff, branch, staged changes or patch, or to check code before merging. Also covers responding to review comments on your own PR./dependency-upgradesUpgrades libraries, frameworks and toolchains safely - inventory outdated and vulnerable packages, read changelogs and migration guides, upgrade one major version at a time, regenerate and review lockfiles, test, and keep a one-commit rollback. Use when bumping dependencies, fixing security advisories or Dependabot and Renovate PRs, resolving version conflicts or peer dependency errors, or upgrading a framework, SDK or runtime version. Not for moving to a different framework or language (use large-scale-migrations)./design-docsWrites and reviews technical design documents (RFCs) and Architecture Decision Records (ADRs) with goals and non-goals, real alternatives, risks, security, rollout, rollback and observability. Use when planning a new system, service or major feature, choosing between architectures or technologies, recording an architectural decision, writing an RFC or ADR, or reviewing someone else's design doc. Not for user-facing documentation or API reference docs./git-workflowUses Git safely and cleanly - atomic commits with clear messages, branching, rebase vs merge, conflict resolution, pull request descriptions, and recovering from mistakes such as lost commits, bad merges, commits on the wrong branch, or a committed secret. Use when committing, writing commit messages, branching, rebasing, merging, resolving conflicts, preparing a pull request, undoing changes, cleaning history, or when someone says they broke their repository./incident-responseGuides production incident handling - assess severity, mitigate first (roll back, disable a flag, scale, fail over), then diagnose from recent changes, metrics, logs and traces, keep a timestamped timeline, draft status updates, and write a blameless postmortem with owned action items. Use when production is down or degraded, errors or latency spike, an alert fires, users report an outage, or the user asks for an incident review or postmortem. Not for debugging in local or development environments.Other plugins' skills for the same job