W Unit

blockmatic/basilic-skills/skills/workflow/w-unit

by blockmatic7e05e2abd052dc6b526e8a28e36d102d42bfd635No license1 starsListed Oct 9, 2026Updated Oct 9, 2026Repository updated 6 days ago

Add unit tests for the current change using the repo test skill and colocated files.

Instructions onlySoftware Development
AI-generated overview

Guides adding unit tests for a change, colocated with the implementation and following repo test conventions.

What it does
This skill provides a short procedure for covering a requested behavior with unit tests. It directs reading neighboring tests and the repository's test skill, colocating test files beside the implementation, testing public API and error paths, mocking only at documented boundaries, and running the focused file followed by the package test script. It also notes updating docs when behavior or commands change.
When to use it
Use it when a code change needs unit test coverage and the repository has an established test skill and file conventions. It fits adding tests for new behavior, error paths, or a specific regression.
Requirements
No scripts are shipped; it is instructions only. It expects a repository with an existing test skill (for example vitest-v5) and a package test script.

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.

Source and attribution

Source:blockmatic/basilic-skillsinskills/workflow/w-unitat commit7e05e2a

License: No license

Content belongs to its original authors. SourceWeft indexes it from a public repository.

Report or request removal