About w-unit
w-unit is a repository skill for writing unit tests around requested behavior, following local test conventions and existing tools. It prioritizes meaningful failure cases over coverage targets and defines a focused-to-package test sequence.
Key features
- 01Follow neighboring tests and conventions
- 02Cover APIs, errors, and regressions
- 03Mock only documented boundaries
- 04Run focused and package tests
- 05Document behavior or command changes
Use cases
- 01Adding tests for a requested change
- 02Checking error paths and regressions
Install
Copy the command and run it in a terminal.
$
npx skills add https:/ / github.com/ blockmatic/ basilic-skills --skill w-unitAfter installing, type/w-unitin Claude Code to confirm it loaded.
Details
From the project READMECover the requested behavior with unit tests. Follow vitest-v5 (or the stack's test skill) and existing file conventions. Do not chase coverage percentage.
- Read neighboring tests and the test skill. Colocate
*.test.tsbeside the implementation. - Test the behavior that can fail: public API, error paths, and the regression this change needs.
- Mock only at documented boundaries. Prefer real types and factories the repo already uses.
- Run the focused file, then the package test script.
- Docs:
/w-docsif behavior or commands changed.
Comments
Markdown supported