Skip to main content
skill CX Codex

w-unit — Claude Code skill: tests and installation

The w-unit skill for Claude Code adds unit tests for the current change using the repository’s testing conventions. It checks public APIs, error paths, and related regressions.

MIT 647 installs ★ 1 updated 2026-10-02

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add blockmatic-icebox/basilic-skills --skill w-unit -a claude-code
Open on GitHub

What w-unit does

w-unit guides an agent through writing unit tests for a requested change. It starts by reading nearby tests and the repository’s testing skill, then places *.test.ts beside the implementation. The skill follows vitest-v5 or the test stack used by the project.

Tests cover public APIs, error handling, and the regression tied to the change. Mocks are limited to documented boundaries; existing project types and factories are preferred. The agent runs the focused test file first, followed by the package test script. If behavior or commands change, it calls /w-docs. Automatic invocation is disabled, so the skill requires an explicit request.

What it helps with

  • add tests for behavior introduced by a change
  • cover public API error paths
  • write a regression test for a fix
  • place tests beside their implementation

Example prompts for the agent

  • Add unit tests for the current change using the project’s conventions.
  • Test the changed public API and its error paths.
  • Cover the regression with a test, then run the package tests.

How to install w-unit

1Skills CLI (Vercel)

npx skills add blockmatic-icebox/basilic-skills --skill w-unit -a claude-code

2Manually: put the files in place

~/.claude/skills/w-unit/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/w-unit/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about w-unit

How do I install w-unit in Claude Code?

Run npx skills add blockmatic-icebox/basilic-skills --skill w-unit -a claude-code. The skill file is at ~/.claude/skills/w-unit/SKILL.md.

What does w-unit do?

It guides the agent in adding unit tests for a change, covering public APIs, error paths, and related regressions. Tests go next to the implementation.

How does w-unit run tests?

It runs the focused test file first, then the package test script. The test skill and existing repository conventions guide its choices.

Source text

SKILL.md · MIT
---
name: w-unit
description: Add unit tests for the current change using the repo test skill and colocated files.
disable-model-invocation: true
---

Cover the requested behavior with unit tests. Follow `vitest-v5` (or the stack's test skill) and existing file conventions. Do not chase coverage percentage.

1. Read neighboring tests and the test skill. Colocate `*.test.ts` beside the implementation.
2. Test the behavior that can fail: public API, error paths, and the regression this change needs.
3. Mock only at documented boundaries. Prefer real types and factories the repo already uses.
4. Run the focused file, then the package test script.
5. Docs: `/w-docs` if behavior or commands changed.

© blockmatic-icebox · MIT · blockmatic-icebox/basilic-skills

Similar skills

All skills for Testing and QA →
unit-test-generator patricio0312rev unit-test-generator generates unit test suites using the Arrange-Act-Assert pattern for functions, classes, and React components. Useful when you need test coverage for edge cases and errors. CX Codex +1 379installs testing-unit OrchestKit The testing-unit skill provides patterns for unit tests, HTTP mocks, fixtures, and test data in Vitest, Jest, and pytest. It applies while writing tests or setting up test doubles. CX Codex +1 116installs vitest-unit-testing-cursorrules-prompt-file PatrickJS vitest-unit-testing-cursorrules-prompt-file is a Cursor rule that configures AI to write Vitest unit tests in TypeScript or JavaScript. It runs on project files, mocks dependencies before imports, and groups tests in describe blocks. CX Codex +1 ★ 41,178repo stars vitest-unit-testing przeprogramowani vitest-unit-testing is a Claude Code rule for writing Vitest unit tests. It guides module mocking and React component test structure. CX Codex +1 ★ 267repo stars testing-changes riekelt testing-changes defines test requirements for code changes, enforcing regression tests for bug fixes, edge-case coverage, and strict checks against empty test diffs. CX Codex +1 25,600installs unit-test-boundary-conditions giuseppe-trisciuoglio unit-test-boundary-conditions — a skill for Claude Code, Codex, Cursor and three other platforms that generates JUnit 5 tests for boundary values, null inputs and arithmetic overflow. Kicks in when you are editing .java test files. CX Codex +1 4,300installs

From the same set45

The whole set →
w-release w-release is a Claude Code skill that reviews release impact, changelog changes, and template contracts. Invoke it manually; automatic invocation is disabled. CX Codex +1 647installs w-security w-security is a Claude Code skill that checks code changes or a repository tree against its security docs and existing checks. Run it to review a change for security defects. CX Codex +1 647installs w-review w-review — a skill for Claude Code checks changes for evidenced defects and risks. Run it on a diff, branch, PR, or working tree without asking it to edit code. CX Codex +1 647installs w-api-test The w-api-test Claude Code skill adds API tests that check public HTTP behavior through the project’s existing harness. It runs on request to test an API. CX Codex +1 647installs w-tdd The w-tdd Claude Code skill guides implementation through red-green-refactor. It activates when a developer requests TDD or the repository requires it. CX Codex +1 647installs w-test w-test — a skill for Claude Code that executes project test commands and resolves failure causes step by step until the suite turns green. CX Codex +1 647installs w-yolo The w-yolo Claude Code skill fixes failing local checks on request. It reruns the failing command or a check for the changes, without publishing them. CX Codex +1 647installs w-lint The w-lint Claude Code skill runs project linters and applies small fixes. It requires an explicit invocation because automatic invocation is disabled. CX Codex +1 647installs

Project sponsors

Companies that keep this analytics open