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
npx skills add blockmatic-icebox/basilic-skills --skill w-unit -a claude-codeWhat 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-code2Manually: put the files in place
~/.claude/skills/w-unit/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/w-unit/
1Skills CLI (Vercel)
npx skills add blockmatic-icebox/basilic-skills --skill w-unit -a codex2Manually: put the files in place
.agents/skills/w-unit/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add blockmatic-icebox/basilic-skills --skill w-unit -a cursor2Manually: put the files in place
.cursor/skills/w-unit/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install blockmatic-icebox/basilic-skills skills/workflow/w-unit2Manually: put the files in place
.github/skills/w-unit/SKILL.md1Skills CLI (Vercel)
npx skills add blockmatic-icebox/basilic-skills --skill w-unit -a gemini-cli2Platform CLI
gemini skills install https://github.com/blockmatic-icebox/basilic-skills --path skills/workflow/w-unitManually: put the files in place
.devin/skills/w-unit/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add blockmatic-icebox/basilic-skills --skill w-unit -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
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