@brainervirus/workit-cursor 2.7.0 → 2.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.cursor-plugin/plugin.json +1 -1
- package/commands/wk-bdd.md +7 -0
- package/commands/wk-test-audit.md +7 -0
- package/dist/cursor-session-start.js +3 -2
- package/dist/workit-hook.js +3 -2
- package/package.json +3 -3
- package/skills/workit-bdd/SKILL.md +42 -0
- package/skills/workit-behavioral-tdd/SKILL.md +2 -0
- package/skills/workit-test-audit/SKILL.md +43 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# /wk-bdd
|
|
2
|
+
|
|
3
|
+
Load and apply the bundled `workit-bdd` skill to turn the requirement into Given/When/Then scenarios, agreed seams and test names.
|
|
4
|
+
|
|
5
|
+
Write scenarios first, test at the highest agreed seam, run each slice RED then GREEN with `workit check test` (workit-behavioral-tdd), mock only at system boundaries, and take expected values from the scenario.
|
|
6
|
+
|
|
7
|
+
Extra context: $ARGUMENTS
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# /wk-test-audit
|
|
2
|
+
|
|
3
|
+
Load and apply the bundled `workit-test-audit` skill to find tautological and low-value tests.
|
|
4
|
+
|
|
5
|
+
Run `workit test-audit`, triage each finding with "Name the Break" (replace with an independent oracle proven on a planted bug, keep with a reason, or remove only assertion-free/duplicate tests), check with `workit test-audit --mutate --diff`, and finish with `workit check test` green.
|
|
6
|
+
|
|
7
|
+
Extra context: $ARGUMENTS
|
|
@@ -13543,8 +13543,9 @@ target result; a local commit alone is not evidence of a requested remote push.
|
|
|
13543
13543
|
Skill routing: slash aliases /wk-* load on demand. Use workit-steer for a
|
|
13544
13544
|
substantial interruption or change of direction, workit-deslop when relevant
|
|
13545
13545
|
to a PR-ready endpoint, workit-green-run for failing CI, workit-blast-radius
|
|
13546
|
-
when impact is uncertain,
|
|
13547
|
-
choices
|
|
13546
|
+
when impact is uncertain, workit-challenge for genuinely open consequential
|
|
13547
|
+
choices, workit-bdd to turn acceptance criteria into Given/When/Then tests, and
|
|
13548
|
+
workit-test-audit to check tests for tautologies. Load workit-plan when dependencies or handoff need durable next actions.
|
|
13548
13549
|
Load the skill; never act from memory of it.
|
|
13549
13550
|
`.trim();
|
|
13550
13551
|
var init_methods = __esm(() => {
|
package/dist/workit-hook.js
CHANGED
|
@@ -13545,8 +13545,9 @@ target result; a local commit alone is not evidence of a requested remote push.
|
|
|
13545
13545
|
Skill routing: slash aliases /wk-* load on demand. Use workit-steer for a
|
|
13546
13546
|
substantial interruption or change of direction, workit-deslop when relevant
|
|
13547
13547
|
to a PR-ready endpoint, workit-green-run for failing CI, workit-blast-radius
|
|
13548
|
-
when impact is uncertain,
|
|
13549
|
-
choices
|
|
13548
|
+
when impact is uncertain, workit-challenge for genuinely open consequential
|
|
13549
|
+
choices, workit-bdd to turn acceptance criteria into Given/When/Then tests, and
|
|
13550
|
+
workit-test-audit to check tests for tautologies. Load workit-plan when dependencies or handoff need durable next actions.
|
|
13550
13551
|
Load the skill; never act from memory of it.
|
|
13551
13552
|
`.trim();
|
|
13552
13553
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brainervirus/workit-cursor",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.8.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Workit Cursor plugin — shared MCP transport, native hooks, and fourteen method skills",
|
|
6
6
|
"keywords": [
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
"build": "bun scripts/build.ts"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@brainervirus/workit-core": "^2.
|
|
48
|
-
"@brainervirus/workit-mcp": "^2.
|
|
47
|
+
"@brainervirus/workit-core": "^2.8.0",
|
|
48
|
+
"@brainervirus/workit-mcp": "^2.8.0"
|
|
49
49
|
},
|
|
50
50
|
"engines": {
|
|
51
51
|
"node": ">=24"
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: workit-bdd
|
|
3
|
+
description: Use when turning a requirement, issue or acceptance criterion into tests, or when tests should read as behavior (Given/When/Then, BDD, scenarios, acceptance tests, test names and seams)
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Behavior first: Given/When/Then
|
|
7
|
+
|
|
8
|
+
Write each acceptance criterion as Given/When/Then before any code, then let
|
|
9
|
+
it name the test and pick the seam. This skill shapes the scenarios; the
|
|
10
|
+
RED/GREEN loop itself is workit-behavioral-tdd.
|
|
11
|
+
|
|
12
|
+
## Method
|
|
13
|
+
|
|
14
|
+
1. Write the scenarios. One behavior per scenario, in the user's or caller's
|
|
15
|
+
words: `Given <state>, When <action>, Then <observable result>`. Include the
|
|
16
|
+
unhappy paths a caller depends on (denied, empty, invalid, timeout).
|
|
17
|
+
2. Agree the seams. Pick the highest stable interface the scenario can be
|
|
18
|
+
observed through: a CLI verb, a public function, an HTTP route. Ideally one
|
|
19
|
+
seam per feature. Write the seams down; do not test at an unagreed seam.
|
|
20
|
+
3. Name the tests after the scenarios. The test name is the Given/When/Then
|
|
21
|
+
sentence; the body is arrange (Given), act (When), assert (Then). Expected
|
|
22
|
+
values come from the scenario (a literal from a worked example or the
|
|
23
|
+
spec), never from the code.
|
|
24
|
+
4. Use Gherkin only where the repo already does (`.feature` files with
|
|
25
|
+
playwright-bdd, cucumber, jest-cucumber). Otherwise plain test names carry
|
|
26
|
+
the scenario; do not add a BDD framework.
|
|
27
|
+
5. Build in vertical slices, one scenario at a time, with
|
|
28
|
+
workit-behavioral-tdd: run `workit check test` RED for the new scenario,
|
|
29
|
+
make the smallest change, run `workit check test` GREEN, then the next.
|
|
30
|
+
6. Mock only at system boundaries: network, clock, randomness, other
|
|
31
|
+
processes, sometimes the filesystem. Never the unit or its internal
|
|
32
|
+
collaborators; use the real thing or an in-memory adapter behind a port.
|
|
33
|
+
|
|
34
|
+
## Completion
|
|
35
|
+
|
|
36
|
+
Every acceptance criterion maps to a named test at an agreed seam, each was
|
|
37
|
+
seen RED then GREEN through `workit check test`, and the new tests have no
|
|
38
|
+
tautologies:
|
|
39
|
+
|
|
40
|
+
```sh
|
|
41
|
+
workit test-audit --diff && workit check test
|
|
42
|
+
```
|
|
@@ -39,6 +39,8 @@ Use this method when assessment selects the `testing` dimension.
|
|
|
39
39
|
ghost loops (assert inside a possibly-empty loop), smoke-only renders,
|
|
40
40
|
type-only or CSS-class coupling. If the test still passes when every
|
|
41
41
|
imported function returns undefined, rewrite the assertion or delete it.
|
|
42
|
+
`workit test-audit --diff` flags these; triage them with workit-test-audit.
|
|
43
|
+
Turning acceptance criteria into scenarios and seams is workit-bdd.
|
|
42
44
|
|
|
43
45
|
Run RED/GREEN through `workit check`, which records the observed result on the
|
|
44
46
|
current task; shared `evidence` operations are for notes and non-test evidence.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: workit-test-audit
|
|
3
|
+
description: Use when tests may be tautological, low-value or noisy, before trusting a green suite, when reviewing tests an agent wrote, or when asked to clean up, prune or strengthen tests
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Audit tests for tautologies
|
|
7
|
+
|
|
8
|
+
A tautological test recomputes its expected value the way the code does, so it
|
|
9
|
+
passes by construction and can never disagree with the code. Find those and
|
|
10
|
+
other low-value tests and triage each one. The audit is advice: never delete
|
|
11
|
+
or weaken a test to make it quiet.
|
|
12
|
+
|
|
13
|
+
## Method
|
|
14
|
+
|
|
15
|
+
1. Run the audit on the change (or the paths you were asked about):
|
|
16
|
+
`workit test-audit --diff --json` or `workit test-audit <paths> --json`.
|
|
17
|
+
Each finding has file:line, rule, severity, confidence, why and a fix.
|
|
18
|
+
Prose checks are `info`; add `--min-severity info` to see them.
|
|
19
|
+
2. Triage every finding with "Name the Break": which wrong production change
|
|
20
|
+
should make this test fail? Then choose one, and say which:
|
|
21
|
+
- Replace: keep the behavior, fix the oracle. Assert the public result
|
|
22
|
+
against an independent expected value (a literal from a worked example,
|
|
23
|
+
the spec, an external contract). Plant the bug you named, watch the new
|
|
24
|
+
test fail, then revert the plant.
|
|
25
|
+
- Keep with a reason: the value is an external contract or the finding is
|
|
26
|
+
wrong. Mark it `// workit-test-audit-ignore <rule> -- <reason>`.
|
|
27
|
+
- Remove: only `assertion-free` or `duplicate-body` tests, and only after
|
|
28
|
+
checking that no other test loses unique behavior with it.
|
|
29
|
+
3. Check the replacements catch real breaks: `workit test-audit --mutate --diff`
|
|
30
|
+
(pass `--test-cmd "<runner> {files}"` to run only the related tests). A
|
|
31
|
+
surviving mutant names a change no test notices; add the missing case.
|
|
32
|
+
4. Leave untouched tests outside the diff alone; propose that cleanup as its
|
|
33
|
+
own change.
|
|
34
|
+
|
|
35
|
+
## Completion
|
|
36
|
+
|
|
37
|
+
Every finding is triaged (replaced with a test that failed on a planted bug,
|
|
38
|
+
kept with an ignore comment and reason, or removed as above) and the configured
|
|
39
|
+
tests are green:
|
|
40
|
+
|
|
41
|
+
```sh
|
|
42
|
+
workit check test
|
|
43
|
+
```
|