/base:unit-testingfrom base
Writes unit tests following behavior-driven conventions with vitest. Use when creating tests, adding test coverage, or writing regression tests.
Ships in base. 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.
Read when SKILL.md points to them.
foo.test.ts next to foo.tsdescribe named after the unit under testtest, not itdescribe("createCart", () => {
test("calculates total for multiple items", () => { ... });
test("returns empty items for new cart", () => { ... });
});
import { describe, expect, test, vi } from "vitest";
| API | Use |
|---|---|
describe("group", fn) | Group related tests |
test("desc", fn) | Single test |
test.each([...])("desc %s", fn) | Parameterized |
expect(v).toBe(x) | Strict equality |
expect(v).toEqual(x) | Deep equality |
expect(fn).toThrow() | Assert throws |
vi.fn() | Mock function |
Mock only at system boundaries:
Date.now), randomness (Math.random), file systemNever mock things you control:
If you feel the need to mock an internal module, the code is doing too much or you're testing at the wrong level.
For mocking patterns and DI examples, see references/mocking.md.
When a project has coverage thresholds configured, every file must meet them individually (perFile: true). Write tests that cover all branches and statements — if a file has unreachable code, that's a signal to simplify the implementation rather than lower thresholds.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub kvnwolf/devtools --plugin base9 skills in this plugin
/baseScaffolds a new TypeScript project from scratch. Use when starting a new project, bootstrapping a codebase, or setting up a project from zero./commitWraps up work by syncing documentation, committing, pushing, and opening a pull request. Use when committing code, finishing a task, pushing changes, or creating a PR./create-planPlans development tasks through codebase exploration, exhaustive user interviews, and structured file-based plans. Use when tackling a feature, bug fix, refactor, or any task that benefits from upfront planning. Generates plan files in .agents/plans/ for later execution with /execute-plan./create-skillCreates or modifies agent skills, including single-workflow and multi-workflow (orchestrator) skills. Use when the user wants to create, write, author, scaffold, edit, update, fix, or refactor a skill, or migrate a skill from single to multi-workflow./environment-variablesManages and validates environment variables. Use when adding, modifying, or referencing env vars, working with .env files, or separating client vs. server variables./execute-planExecutes a plan generated by /create-plan. Orchestrates team members in parallel, each working in isolated worktrees. Use when ready to execute a plan from .agents/plans/, resume an interrupted execution, or run a specific plan by ID.Other plugins' skills for the same job