CI / CI configuration security checks (push) Successful in 3s
CI / Capabilities and shell quality (push) Successful in 14s
CI / Python tests and compilation (push) Successful in 26s
CI / QMD unit tests (push) Successful in 5s
CI / Build and inspect generated packages (push) Successful in 14s
CI / PowerShell tests on Ubuntu (push) Successful in 1m4s
CI / Installed client configuration smoke tests (push) Successful in 33s
CI / Bash integration and installation guards (push) Successful in 1m1s
2.0 KiB
2.0 KiB
name, description
| name | description |
|---|---|
| unit-test-write | Use when adding or changing tests for one isolated function, component, or decision. Use integration-test-write when behavior must cross an application or service boundary. |
Unit Test Write
Use when adding or updating tests for one isolated function, component, or decision. When Superpowers test-driven-development applies, it sets the order (failing test first); this skill decides what to test and how to isolate it.
Workflow
- Read the requirement and implementation. Identify the observable result that defines success and the boundary conditions most likely to fail.
- Follow the repository's existing test framework, naming, setup, and assertion style. Avoid new dependencies or fixtures when a small test can express the behavior. If test APIs, mocks, or expected outcomes depend on external behavior, MUST apply the implementation checkpoint in
technical-researchbefore encoding that assumption. - Cover the normal case and the smallest meaningful set of boundary or failure cases. Express a set of inputs that share one rule as a parameterized test (for example xUnit
[Theory], NUnit[TestCase], ortest.each) instead of copied tests. Include a regression case for a reported defect, and confirm it fails without the fix (for example by running it against the unfixed code); if that cannot be shown, state why. - Assert public behavior and useful error outcomes rather than private call order, incidental wording, or internal data layout.
- Keep each test deterministic. Control time, randomness, filesystem state, and external services when they affect the result.
- Run the focused test and report its result. If it cannot run, report why and do not claim it passes. MUST apply the verification checkpoint in
technical-researchto any external claims the result relies on. Broaden verification only when shared behavior or connected components are affected.
Do not add tests that duplicate existing coverage or require production code to expose test-only hooks without a clear reason.