feat(skills): reworked skills and rules
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
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
This commit is contained in:
1 parent
29632ff0ce
commit
f5d8f6f11b
124 files changed
+1250
-8138
No files matched your search
@@ -5,15 +5,15 @@ description: Use when adding or changing tests for one isolated function, compon
|
||||
|
||||
# Unit Test Write
|
||||
|
||||
Use when adding or updating tests for one isolated function, component, or decision.
|
||||
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
|
||||
|
||||
1. Read the requirement and implementation. Identify the observable result that defines success and the boundary conditions most likely to fail.
|
||||
2. 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-research` before encoding that assumption.
|
||||
3. Cover the normal case and the smallest meaningful set of boundary or failure cases. Include a regression case for a reported defect.
|
||||
3. 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]`, or `test.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.
|
||||
4. Assert public behavior and useful error outcomes rather than private call order, incidental wording, or internal data layout.
|
||||
5. Keep each test deterministic. Control time, randomness, filesystem state, and external services when they affect the result.
|
||||
6. Run the focused test and report its result. MUST apply the verification checkpoint in `technical-research` to any external claims the result relies on. Broaden verification only when shared behavior or connected components are affected.
|
||||
6. 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-research` to 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.
|
||||
@@ -22,6 +22,7 @@
|
||||
"expected_output": "Should include a regression test for the reported defect (multiple spaces collapse to a single hyphen). Should not duplicate existing coverage for 'Hello World' or the empty string. Should add a small set of meaningful boundary cases (e.g. leading/trailing punctuation stripped, punctuation runs). Should follow pytest style. Should assert the public return value.",
|
||||
"assertions": [
|
||||
"Includes a regression test for \"Hello World\" returning \"hello-world\"",
|
||||
"Confirms the regression test fails without the fix, or states why that could not be shown",
|
||||
"References the reported defect (#318) or names the test as a regression case",
|
||||
"Does not re-add tests for \"Hello World\" or the empty string",
|
||||
"Adds at least one meaningful boundary case such as leading or trailing separators",
|
||||
@@ -42,6 +43,17 @@
|
||||
"Controls external collaborators such as payment or stock services rather than private internals"
|
||||
],
|
||||
"files": []
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"prompt": "Write a test that proves our `POST /api/orders` endpoint actually saves the order to PostgreSQL and that the unique constraint on `order_number` rejects duplicates with a 409.",
|
||||
"expected_output": "The behavior crosses the API and database boundary and depends on a real database constraint, so a mocked unit test cannot prove it. Should route to integration-test-write instead of writing unit tests with a mocked repository.",
|
||||
"assertions": [
|
||||
"Identifies that the behavior crosses the API to database boundary",
|
||||
"Uses or recommends integration-test-write",
|
||||
"Does not claim a mocked unit test proves the unique constraint"
|
||||
],
|
||||
"files": []
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in new issue
Block a user