@brainervirus/workit-codex 4.0.0 → 5.0.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/.codex-plugin/plugin.json +1 -1
- package/README.md +2 -2
- package/dist/launch-mcp.js +6 -5
- package/dist/workit-hook.js +76 -95
- package/package.json +3 -3
- package/skills/workit-bdd/SKILL.md +35 -29
- package/skills/workit-continue/SKILL.md +53 -0
- package/skills/workit-debug/SKILL.md +41 -36
- package/skills/workit-deslop/SKILL.md +35 -25
- package/skills/workit-fanout/SKILL.md +62 -0
- package/skills/workit-fanout/references/brief.md +56 -0
- package/skills/workit-implement/SKILL.md +48 -44
- package/skills/workit-review/SKILL.md +42 -51
- package/skills/workit-review/references/impact.md +24 -0
- package/skills/workit-shape/SKILL.md +71 -0
- package/skills/workit-shape/references/diagrams.md +17 -0
- package/skills/workit-shape/references/knowledge.md +58 -0
- package/skills/workit-shape/references/mockups.md +15 -0
- package/skills/workit-shape/references/slicing.md +42 -0
- package/skills/workit-ship/SKILL.md +52 -0
- package/skills/workit-test-audit/SKILL.md +10 -2
- package/skills/workit-verify-app/SKILL.md +63 -0
- package/skills/workit-verify-app/references/template.md +49 -0
- package/skills/workit-babysit/SKILL.md +0 -37
- package/skills/workit-behavioral-tdd/SKILL.md +0 -56
- package/skills/workit-blast-radius/SKILL.md +0 -26
- package/skills/workit-challenge/SKILL.md +0 -47
- package/skills/workit-diagram/SKILL.md +0 -27
- package/skills/workit-green-run/SKILL.md +0 -24
- package/skills/workit-handoff/SKILL.md +0 -37
- package/skills/workit-mockup/SKILL.md +0 -23
- package/skills/workit-plan/SKILL.md +0 -45
- package/skills/workit-steer/SKILL.md +0 -39
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
[](https://github.com/BrainerVirus/workit/actions/workflows/ci.yml)
|
|
4
4
|
[](../../LICENSE)
|
|
5
5
|
|
|
6
|
-
Workit plugin for Codex CLI and desktop — native manifest, documented hooks, the shared MCP transport, and
|
|
6
|
+
Workit plugin for Codex CLI and desktop — native manifest, documented hooks, the shared MCP transport, and eleven method skills. Reads run over MCP; mutations run CLI-driven, because caller-unattested MCP cannot attest effects.
|
|
7
7
|
|
|
8
8
|
## Requirements
|
|
9
9
|
|
|
@@ -26,4 +26,4 @@ node_modules/.bin/workit <family> <action> --json --confirm # mutations (CLI-d
|
|
|
26
26
|
workit writer acquire --actor <session-id> # bind a writer to this session explicitly
|
|
27
27
|
```
|
|
28
28
|
|
|
29
|
-
The hook honors exactly the bound session and nothing else. Arbitrary-question receipts and attested writer delegation are unavailable on this host by design.
|
|
29
|
+
The hook honors exactly the bound session and nothing else. Arbitrary-question receipts and attested writer delegation are unavailable on this host by design. The package ships the eleven `workit-*` method skills in `skills/`, generated at build time from `packages/workit-core/skills`.
|
package/dist/launch-mcp.js
CHANGED
|
@@ -21341,13 +21341,13 @@ function evaluateClosure(requestedOutcome, view) {
|
|
|
21341
21341
|
|
|
21342
21342
|
// packages/workit-core/src/core/methods.ts
|
|
21343
21343
|
var METHODS = {
|
|
21344
|
-
"workit-
|
|
21345
|
-
"workit-
|
|
21344
|
+
"workit-shape": { dimensions: ["challenge", "decisions", "artifacts", "continuity"] },
|
|
21345
|
+
"workit-bdd": { dimensions: ["testing"] },
|
|
21346
21346
|
"workit-review": { dimensions: ["review"], ruleIds: ["fresh-context-review", "self-review"] },
|
|
21347
|
-
"workit-
|
|
21348
|
-
"workit-
|
|
21347
|
+
"workit-implement": { ruleIds: ["mechanical-existing-checks"] },
|
|
21348
|
+
"workit-fanout": { dimensions: ["delegation"] },
|
|
21349
21349
|
"workit-debug": {},
|
|
21350
|
-
"workit-
|
|
21350
|
+
"workit-continue": {},
|
|
21351
21351
|
"workit-deslop": { ruleIds: ["pre-pr-cleanup"] }
|
|
21352
21352
|
};
|
|
21353
21353
|
var methodMatches = (definition, requirement) => definition.dimensions?.includes(requirement.dimension) === true || definition.ruleIds?.includes(requirement.ruleId) === true;
|
|
@@ -27985,6 +27985,7 @@ var signals = new Map;
|
|
|
27985
27985
|
var cache = new Map;
|
|
27986
27986
|
// packages/workit-core/src/hooks/handle.ts
|
|
27987
27987
|
var offered = new Set;
|
|
27988
|
+
var CLAUDE_JUDGES = new Set(["workit:verifier", "workit:reviewer"]);
|
|
27988
27989
|
// packages/workit-core/src/hooks/hosts/fields.ts
|
|
27989
27990
|
var SHELLS = new Set(["sh", "bash", "zsh", "dash", "pwsh", "powershell", "cmd"]);
|
|
27990
27991
|
|
package/dist/workit-hook.js
CHANGED
|
@@ -30,13 +30,13 @@ import path15 from "node:path";
|
|
|
30
30
|
|
|
31
31
|
// packages/workit-core/src/core/methods.ts
|
|
32
32
|
var METHODS = {
|
|
33
|
-
"workit-
|
|
34
|
-
"workit-
|
|
33
|
+
"workit-shape": { dimensions: ["challenge", "decisions", "artifacts", "continuity"] },
|
|
34
|
+
"workit-bdd": { dimensions: ["testing"] },
|
|
35
35
|
"workit-review": { dimensions: ["review"], ruleIds: ["fresh-context-review", "self-review"] },
|
|
36
|
-
"workit-
|
|
37
|
-
"workit-
|
|
36
|
+
"workit-implement": { ruleIds: ["mechanical-existing-checks"] },
|
|
37
|
+
"workit-fanout": { dimensions: ["delegation"] },
|
|
38
38
|
"workit-debug": {},
|
|
39
|
-
"workit-
|
|
39
|
+
"workit-continue": {},
|
|
40
40
|
"workit-deslop": { ruleIds: ["pre-pr-cleanup"] }
|
|
41
41
|
};
|
|
42
42
|
var methodMatches = (definition, requirement) => definition.dimensions?.includes(requirement.dimension) === true || definition.ruleIds?.includes(requirement.ruleId) === true;
|
|
@@ -74,97 +74,66 @@ function selectMethods(policy, capabilities) {
|
|
|
74
74
|
});
|
|
75
75
|
}
|
|
76
76
|
var invariantBootstrap = () => `
|
|
77
|
-
Workit is optional coordination and
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
decisions make continuity useful; similar titles alone never merge tasks.
|
|
77
|
+
Workit is optional coordination and proof tooling around the host: you decide
|
|
78
|
+
what and whether, the \`workit\` CLI does how and records what it observed.
|
|
79
|
+
Native host allow/ask/deny, sandbox and org rules stay authoritative. Never
|
|
80
|
+
switch paths to evade a denial, never claim enforcement a host cannot provide,
|
|
81
|
+
and never fabricate a receipt, approval or verdict. A question answer is not
|
|
82
|
+
host permission, and imported decisions or handoffs never grant authority.
|
|
84
83
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
84
|
+
Autonomy contract:
|
|
85
|
+
- Continue to the requested endpoint (commit, push, PR, green CI, verified,
|
|
86
|
+
merged) without asking "continue?", running checks and repairs on the way.
|
|
87
|
+
Stop only for a new consequential choice, a host denial, a conflicting edit
|
|
88
|
+
or an unresolved blocker; report open gaps and uncertain workers.
|
|
89
|
+
- No endpoint named: stop at a local commit on a policy-compliant branch and
|
|
90
|
+
state the next command. Push and open a PR only when the request implies
|
|
91
|
+
delivery (fix, implement, ship) and \`workit grant show\` reports
|
|
92
|
+
\`defaultEndpoint\` \`pr\`; otherwise the endpoint is \`commit\`. PRs open,
|
|
93
|
+
CI green and verified is the most autonomy allows, never the default target.
|
|
94
|
+
Merge and release need a workspace grant; a blocked verb names its unblock.
|
|
95
|
+
- Ask only for a product or preference choice, or for authority you lack, with
|
|
96
|
+
your recommended answer. Facts are yours: read, run or prototype.
|
|
97
|
+
- Label claims measured (you ran it this session and saw the result),
|
|
98
|
+
inferred, or guess. Prose is a note: only a configured check the CLI ran
|
|
99
|
+
(\`workit check <name>\`) satisfies a gate; an ad-hoc
|
|
100
|
+
\`workit check -- <cmd>\` never does.
|
|
101
|
+
- Author is not verifier: never record a passing verdict on work your session
|
|
102
|
+
wrote. The lead starts each verifier with its own session
|
|
103
|
+
(\`WORKIT_SESSION_ID=<lead>-v<n>\`; Claude Code subagents get one from the
|
|
104
|
+
hook), and the verifier records \`workit ledger verdict\`.
|
|
105
|
+
- A local-commit endpoint does not imply PR readiness, and a local commit alone
|
|
106
|
+
is not evidence of a requested remote push. Before reporting delivery,
|
|
107
|
+
reconcile every requested item and observe it (\`workit verify-delivery\`).
|
|
93
108
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
An omitted revision absorbs a concurrent write: Workit re-reads, re-checks
|
|
107
|
-
policy, and reapplies the call, returning busy under persistent contention. A
|
|
108
|
-
revision_conflict means a revision you passed is stale: re-read the record
|
|
109
|
-
before deciding whether to retry.
|
|
110
|
-
A solo edit does not need writer acquisition; use it when concurrent checkout
|
|
111
|
-
writers need coordination. Record only observed facts and checks. Close-time
|
|
112
|
-
testing and verification gates accept only a configured check the CLI ran:
|
|
113
|
-
\`workit check <name>\` (\`npx -y @brainervirus/workit-cli check <name>\` when
|
|
114
|
-
\`workit\` is not on PATH); a recorded check result is a note and an ad-hoc
|
|
115
|
-
\`workit check -- <cmd>\` never satisfies a gate. Evidence can become stale when its bound candidate or tree changes; reconcile findings against the
|
|
116
|
-
current candidate before recording completion.
|
|
109
|
+
CLI first: if a step has one right answer, use the \`workit\` verb instead of
|
|
110
|
+
hand-running git, gh or glab: check, git, pr, ci, stack, verify-delivery,
|
|
111
|
+
ledger, handoff, test-audit (\`workit help <verb>\`; without \`workit\` on
|
|
112
|
+
PATH, \`npx -y @brainervirus/workit-cli\`). \`busy\` is retryable
|
|
113
|
+
(\`workit doctor --fix-lock\` clears a dead lock); \`blocked\` names its unblock.
|
|
114
|
+
The task families (task, policy, evidence, finding, decision, worker, writer,
|
|
115
|
+
state) are optional continuity for tracked work; each branch has one implicit
|
|
116
|
+
task that the first recording creates, and a solo edit needs no task or writer.
|
|
117
|
+
Omit revisions; a revision_conflict means one you passed is stale, so re-read.
|
|
118
|
+
Across repositories, bind each item to its checkout, branch and endpoint,
|
|
119
|
+
resolve competing targets before a mutation, and reconcile an uncertain
|
|
120
|
+
external effect before retrying it.
|
|
117
121
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
state. The task directory is coordination state, not a boundary on which
|
|
121
|
-
repository may be changed. Use an action-time cwd target where a managed
|
|
122
|
-
Git/hosting action supports it; a non-Git directory remains valid for OS work.
|
|
123
|
-
GitHub/GitLab use the active gh/glab CLI identity; YouTrack uses its own token.
|
|
124
|
-
Preserve uncertain external outcomes and reconcile repository/provider state
|
|
125
|
-
before retrying. Internal reservations prevent duplicate or ambiguous effects;
|
|
126
|
-
they are not permission tickets for every edit.
|
|
122
|
+
Mid-task input: answer a quick question in place, fold an adjustment in, and
|
|
123
|
+
never silently drop or resume an objective (workit-continue).
|
|
127
124
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
evidence and a recommendation, then continue toward the requested delivery
|
|
141
|
-
endpoint: investigation, implementation, branch/commit/push, PR/MR-ready,
|
|
142
|
-
merge, or release. Run
|
|
143
|
-
applicable checks and safe repairs without repeated continuation questions;
|
|
144
|
-
stop for missing host authority, a new consequential choice, a conflicting edit,
|
|
145
|
-
or an unresolved blocker. A tracked record may close when actual evidence
|
|
146
|
-
supports its outcome; no final human closure ceremony is required.
|
|
147
|
-
|
|
148
|
-
A completed native subagent run stops its bound worker by itself; if a worker
|
|
149
|
-
strands in cancelling with its run verifiably over, repeat worker.cancel to
|
|
150
|
-
confirm the stop. Preserve unresolved requirements, gaps, and uncertain workers.
|
|
151
|
-
When context changes, distinguish a quick question, same-task adjustment, and
|
|
152
|
-
separate request. Answer a quick question without pausing/resuming task state;
|
|
153
|
-
park a concise checkpoint only when substantial work needs to continue later.
|
|
154
|
-
For work spanning repositories, bind each unfinished item to its actual checkout,
|
|
155
|
-
branch, requested deliverables, and delivery endpoint. Preserve held items with
|
|
156
|
-
an explicit resume condition. Resolve competing plausible targets before a
|
|
157
|
-
mutation; ask only when available context cannot settle that consequential choice.
|
|
158
|
-
Before reporting delivery, reconcile every requested item and observe the actual
|
|
159
|
-
target result; a local commit alone is not evidence of a requested remote push.
|
|
160
|
-
|
|
161
|
-
Skill routing: slash aliases /wk-* load on demand. Use workit-steer for a
|
|
162
|
-
substantial interruption or change of direction, workit-deslop when relevant
|
|
163
|
-
to a PR-ready endpoint, workit-green-run for failing CI, workit-blast-radius
|
|
164
|
-
when impact is uncertain, workit-challenge for genuinely open consequential
|
|
165
|
-
choices, workit-bdd to turn acceptance criteria into Given/When/Then tests, and
|
|
166
|
-
workit-test-audit to check tests for tautologies. Load workit-plan when dependencies or handoff need durable next actions.
|
|
167
|
-
Load the skill; never act from memory of it.
|
|
125
|
+
Skills: load the skill, never act from memory of it (slash aliases /wk-<name>).
|
|
126
|
+
- brainstorm, plan, spec, grill, should we: workit-shape
|
|
127
|
+
- implement, build, add a feature: workit-implement
|
|
128
|
+
- review, blast radius: workit-review
|
|
129
|
+
- bug, broken, flaky, regression: workit-debug
|
|
130
|
+
- ship, babysit, CI, merge: workit-ship
|
|
131
|
+
- resume, pick up, handoff, interruption: workit-continue
|
|
132
|
+
- BDD, TDD, acceptance criteria, Given/When/Then: workit-bdd
|
|
133
|
+
- test audit, tautology, weak tests: workit-test-audit
|
|
134
|
+
- deslop, slop, dead code: workit-deslop
|
|
135
|
+
- fan out, parallelize, parallel agents, swarm: workit-fanout
|
|
136
|
+
- verify the app, smoke test, prove it works: workit-verify-app
|
|
168
137
|
`.trim();
|
|
169
138
|
|
|
170
139
|
// packages/workit-core/src/core/task-contract.ts
|
|
@@ -17115,7 +17084,16 @@ var usable2 = (value) => value === "native" || value === "partial";
|
|
|
17115
17084
|
var NONE2 = { kind: "none" };
|
|
17116
17085
|
var offered = new Set;
|
|
17117
17086
|
var CLAUDE_WORKTREE_IMPLEMENTER = "workit:implementer";
|
|
17118
|
-
var
|
|
17087
|
+
var CLAUDE_JUDGES = new Set(["workit:verifier", "workit:reviewer"]);
|
|
17088
|
+
var subagentSession = (session, agentId) => [session, agentId].filter((part) => Boolean(part)).join(":").replace(/[^A-Za-z0-9_.:@/+-]/g, "-").slice(0, 128);
|
|
17089
|
+
var subagentStartText = (host, session, descriptor, event) => {
|
|
17090
|
+
if (host === "claude_code" && event.agentType === CLAUDE_WORKTREE_IMPLEMENTER)
|
|
17091
|
+
return `Workit observed ${descriptor.label} subagent ${event.agentId} (${event.agentType}) working in its own git worktree: it may edit and commit there, within its brief's scope. Before the first commit, switch to a policy-compliant branch with \`workit git branch <branch> --base <base>\` (e.g. feature/<slug>); branch policy hooks still deny protected or non-compliant branches. Never record a verdict on your own work. Never push, open a PR, or merge unless the brief asks for it.`;
|
|
17092
|
+
const readOnly = `Workit observed ${descriptor.label} subagent ${event.agentId} (${event.agentType}) as read-only/agent-guided; writer delegation is unavailable.`;
|
|
17093
|
+
if (host === "claude_code" && event.agentType && CLAUDE_JUDGES.has(event.agentType) && event.agentId)
|
|
17094
|
+
return `${readOnly} Its own Workit session is ${subagentSession(session, event.agentId)}: record verdicts with \`workit ledger verdict <result> --session ${subagentSession(session, event.agentId)} ...\` so the ledger tells it apart from the author.`;
|
|
17095
|
+
return readOnly;
|
|
17096
|
+
};
|
|
17119
17097
|
function handleHook(input, deps) {
|
|
17120
17098
|
const { descriptor } = deps;
|
|
17121
17099
|
const event = input.event;
|
|
@@ -17141,7 +17119,10 @@ function handleHook(input, deps) {
|
|
|
17141
17119
|
case "shell.pre":
|
|
17142
17120
|
return usable2(descriptor.shellPolicy.deny) ? shellPolicy(input.cwd, event.command) : NONE2;
|
|
17143
17121
|
case "subagent.start":
|
|
17144
|
-
return {
|
|
17122
|
+
return {
|
|
17123
|
+
kind: "context",
|
|
17124
|
+
text: subagentStartText(input.host, input.session.id ?? null, descriptor, event)
|
|
17125
|
+
};
|
|
17145
17126
|
case "compact.pre":
|
|
17146
17127
|
return {
|
|
17147
17128
|
kind: "notice",
|
|
@@ -17695,7 +17676,7 @@ var codexAdapter = {
|
|
|
17695
17676
|
};
|
|
17696
17677
|
},
|
|
17697
17678
|
render: render2,
|
|
17698
|
-
addendum: (input) => `<workit-codex-mutations>Codex MCP is read-only: unattested callers cannot mutate. Run the workit CLI
|
|
17679
|
+
addendum: (input) => `<workit-codex-mutations>Codex MCP is read-only: unattested callers cannot mutate. Run workit verbs with the workit CLI on the shell (node_modules/.bin/workit, or npx -y @brainervirus/workit-cli): check, git branch|commit|push, pr, ci, stack, ledger, handoff; task-family mutations take --json --confirm${input.session.id ? `; bind the writer to this session with node_modules/.bin/workit writer acquire --task <id> --revision <rev> --actor ${input.session.id} --confirm` : ""}. A verifier or reviewer records workit ledger verdict under a session the lead assigns (WORKIT_SESSION_ID=<lead>-v<n>), never the author's. Merge and release need a workspace grant; a question answer is not host permission.</workit-codex-mutations>`
|
|
17699
17680
|
};
|
|
17700
17681
|
|
|
17701
17682
|
// packages/workit-core/src/hooks/hosts/cursor.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brainervirus/workit-codex",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Workit Codex CLI/desktop plugin — shared MCP transport, hooks, and sixteen method skills",
|
|
6
6
|
"keywords": [
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"build": "bun scripts/build.ts"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@brainervirus/workit-core": "^
|
|
42
|
-
"@brainervirus/workit-mcp": "^
|
|
41
|
+
"@brainervirus/workit-core": "^5.0.0",
|
|
42
|
+
"@brainervirus/workit-mcp": "^5.0.0"
|
|
43
43
|
},
|
|
44
44
|
"engines": {
|
|
45
45
|
"node": ">=24"
|
|
@@ -1,41 +1,47 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: workit-bdd
|
|
3
|
-
description:
|
|
3
|
+
description: Turn requirements into Given/When/Then scenarios, agree the test seam, and work test-first in vertical RED/GREEN slices. Use for BDD, TDD, acceptance criteria, scenarios, Given/When/Then, write a test first.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Behavior first: Given/When/Then
|
|
7
7
|
|
|
8
|
-
Write
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
5.
|
|
28
|
-
|
|
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
|
|
8
|
+
1. **Write the scenarios.** One behavior each, in the caller's words:
|
|
9
|
+
`Given <state>, When <action>, Then <observable result>`. Include the
|
|
10
|
+
unhappy paths callers depend on (denied, empty, invalid, timeout).
|
|
11
|
+
2. **Agree the seam.** The highest stable interface the scenario can be
|
|
12
|
+
observed through: a CLI verb, a public function, an HTTP route; ideally one
|
|
13
|
+
per feature. Do not test at a seam nobody agreed to.
|
|
14
|
+
3. **Name tests after scenarios.** The name is the Given/When/Then sentence;
|
|
15
|
+
the body is arrange, act, assert. Expected values come from the scenario (a
|
|
16
|
+
literal from a worked example, the spec, an external contract), never from
|
|
17
|
+
the code under test.
|
|
18
|
+
4. **Build in vertical slices.** Write one vertical RED slice that fails for
|
|
19
|
+
the missing behavior and run it through the CLI so the failure is observed:
|
|
20
|
+
`workit check test`. Make the smallest change, run the same check GREEN,
|
|
21
|
+
then take the next scenario. Any edit makes the observation stale; re-run
|
|
22
|
+
before you claim it. A recorded "tests pass" is a note, and an ad-hoc
|
|
23
|
+
`workit check -- <cmd>` never satisfies the gate: only the configured
|
|
24
|
+
`test` check does. No `test` detected? Create `workit.checks.json`, copying
|
|
25
|
+
in every check the repo already runs: once it exists it replaces the
|
|
26
|
+
detected defaults.
|
|
27
|
+
5. **Mock only at system boundaries:** network, clock, randomness, other
|
|
28
|
+
processes, sometimes the filesystem. Never the unit or its own
|
|
32
29
|
collaborators; use the real thing or an in-memory adapter behind a port.
|
|
30
|
+
6. **Gherkin only where the repo already uses it** (`.feature` files with
|
|
31
|
+
playwright-bdd, cucumber, jest-cucumber). Otherwise test names carry it.
|
|
33
32
|
|
|
34
|
-
|
|
33
|
+
Reject noise: version-pin assertions, tests that mirror private structure,
|
|
34
|
+
assertions inside a possibly-empty loop, smoke-only renders, duplicates. If a
|
|
35
|
+
test still passes when every imported function returns `undefined`, rewrite it
|
|
36
|
+
(workit-test-audit finds these).
|
|
35
37
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
38
|
+
## Example
|
|
39
|
+
|
|
40
|
+
Bad: `test("calculateTotal works", () => expect(calculateTotal(items)).toBe(items.reduce((s, i) => s + i.price, 0)))`
|
|
41
|
+
|
|
42
|
+
Good: `test("Given two items of 5 and 10, When totalled, Then the total is 15", () => expect(calculateTotal([{ price: 5 }, { price: 10 }])).toBe(15))`
|
|
43
|
+
|
|
44
|
+
## Check
|
|
39
45
|
|
|
40
46
|
```sh
|
|
41
47
|
workit test-audit --diff && workit check test
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: workit-continue
|
|
3
|
+
description: Keep work on track across interruptions and sessions - sort new input, checkpoint, hand off with a resume brief, and pick up by verifying inherited claims. Use for resume, pick up, handoff, new session, interruption, change of direction.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Continue without losing the thread
|
|
7
|
+
|
|
8
|
+
## New input mid-task
|
|
9
|
+
|
|
10
|
+
- **Quick question:** answer it; change nothing else.
|
|
11
|
+
- **Same-task adjustment:** update the affected constraint and next step, then
|
|
12
|
+
keep going.
|
|
13
|
+
- **Separate request:** do not silently resume an old objective, and do not
|
|
14
|
+
drop the current one. Checkpoint it (below) if it must continue later, then
|
|
15
|
+
start the new work. Held items stay parked with their resume condition until
|
|
16
|
+
the user resumes them.
|
|
17
|
+
|
|
18
|
+
## Checkpoint and hand off
|
|
19
|
+
|
|
20
|
+
```sh
|
|
21
|
+
workit git commit -m "wip: <state>" --all # nothing lives only in your context
|
|
22
|
+
workit handoff --note "<state in one line>" --next "<next command>" --record
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
The brief carries the branch, HEAD, dirty state, check freshness, verdict,
|
|
26
|
+
rulings and the next command. Add only what it cannot know: choices still
|
|
27
|
+
open, approaches that failed and why. Work spanning repos gets one brief per
|
|
28
|
+
checkout, each with its branch and delivery endpoint.
|
|
29
|
+
|
|
30
|
+
## Pick up
|
|
31
|
+
|
|
32
|
+
1. In the checkout: `workit handoff`, then `workit ledger list` and
|
|
33
|
+
`git log --oneline -10`.
|
|
34
|
+
2. Trust the trail, verify the claims: re-run the checks the brief calls
|
|
35
|
+
stale, and confirm each "done" item against the goal on the real artifact
|
|
36
|
+
(a pushed SHA, a PR state, a running feature). Do not re-derive settled
|
|
37
|
+
decisions.
|
|
38
|
+
3. Continue to the recorded endpoint with the brief's next command.
|
|
39
|
+
|
|
40
|
+
## Example
|
|
41
|
+
|
|
42
|
+
Bad: a new session re-reads the whole codebase, re-asks the user which
|
|
43
|
+
approach to take, and redoes a finished slice.
|
|
44
|
+
|
|
45
|
+
Good: "`workit handoff`: feature/usage at 4be1, `test` stale, verdict none,
|
|
46
|
+
next `workit check test`. Re-ran it: exit 0. The brief says PR #42 is open:
|
|
47
|
+
`workit pr status` confirms, CI pending. Continuing with workit-ship."
|
|
48
|
+
|
|
49
|
+
## Check
|
|
50
|
+
|
|
51
|
+
```sh
|
|
52
|
+
workit handoff # read: "next command" is set and no check is listed as stale
|
|
53
|
+
```
|
|
@@ -1,40 +1,45 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: workit-debug
|
|
3
|
-
description:
|
|
3
|
+
description: Find a root cause before patching - start from a red-capable deterministic repro, rank hypotheses, bisect regressions, fix at the root with a regression test. Use for bug, broken, failing, flaky, regression, error, why does.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# Debug
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
6
|
+
# Debug from a red loop
|
|
7
|
+
|
|
8
|
+
## Steps
|
|
9
|
+
|
|
10
|
+
1. **Build the loop before any hypothesis.** One command that is red for the
|
|
11
|
+
user's exact symptom, deterministic, fast and runnable by you:
|
|
12
|
+
`workit check -- <repro>`. Shrink it until it fails in seconds. If the
|
|
13
|
+
symptom only shows on the running app, drive it with the project's
|
|
14
|
+
verify-<app> skill. No loop yet? Building it is the task; do not guess-patch.
|
|
15
|
+
2. **Read the failure, not the summary:** the full error, the failing value,
|
|
16
|
+
and every caller on its path.
|
|
17
|
+
3. **Rank three to five falsifiable hypotheses**, likeliest first. Test one at
|
|
18
|
+
a time with the loop or a tagged log line (`[DEBUG-<id>]`, removed at the
|
|
19
|
+
end with one grep). Keep a short hypothesis log so a dead idea stays dead.
|
|
20
|
+
4. **Regression? Bisect it:** `git bisect start <bad> <good>` then
|
|
21
|
+
`git bisect run <repro>`. The first bad commit names the cause.
|
|
22
|
+
5. **Fix at the root**, the one place every failing caller passes through.
|
|
23
|
+
Add a regression test at a seam that exercises the real bug pattern; if no
|
|
24
|
+
such seam exists, report that as a finding.
|
|
25
|
+
6. **Stop rule:** after three dead hypotheses, write down what is measured and
|
|
26
|
+
what is inferred, widen the loop, or ask for the one fact only the user has.
|
|
27
|
+
|
|
28
|
+
Every shipped line traces to evidence from the loop. A "might help" retry or
|
|
29
|
+
guard is a hypothesis, not a fix.
|
|
30
|
+
|
|
31
|
+
## Example
|
|
32
|
+
|
|
33
|
+
Bad: "Probably a race; added a retry." (no repro, nothing measured)
|
|
34
|
+
|
|
35
|
+
Good: "Repro: `workit check -- bun test lock.test.ts -t stale` red 10/10.
|
|
36
|
+
H1 dead pid not reclaimed - confirmed: `kill(pid, 0)` throws EPERM for another
|
|
37
|
+
user's pid and we treated it as dead. Fix: EPERM means alive. Loop green 10/10;
|
|
38
|
+
regression test pins the EPERM case."
|
|
39
|
+
|
|
40
|
+
## Check
|
|
41
|
+
|
|
42
|
+
```sh
|
|
43
|
+
workit check -- <repro> # red before the fix, green after
|
|
44
|
+
workit check test
|
|
45
|
+
```
|
|
@@ -1,31 +1,41 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: workit-deslop
|
|
3
|
-
description:
|
|
3
|
+
description: Remove AI slop before a PR - dead code, comments that restate the code, filler prose - with a minimal diff and identical behavior. Use for deslop, clean up, slop, tidy before PR, remove dead code, trim the PR body.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Deslop code and prose
|
|
7
7
|
|
|
8
|
-
Throughput without quality is slop.
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
3.
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
8
|
+
Throughput without quality is slop. Deslop only removes; it never changes
|
|
9
|
+
behavior. A change that wants new behavior is its own change.
|
|
10
|
+
|
|
11
|
+
1. **Find it with tools first.** The repo's dead-code and lint tools on the
|
|
12
|
+
branch diff (for example `knip`, `ts-prune`, `vulture`, `cargo udeps`, or
|
|
13
|
+
the linter's unused rules), then read the diff:
|
|
14
|
+
`git diff <base>...HEAD`.
|
|
15
|
+
2. **Code.** Delete unused helpers and exports, stub references, debug
|
|
16
|
+
leftovers (`[DEBUG-` tags, stray logs), and comments that restate the next
|
|
17
|
+
line. Keep comments that say *why* (a constraint, a workaround with its
|
|
18
|
+
link), license headers and tool directives.
|
|
19
|
+
3. **Prose** (PR body, spec, docs): cut filler and hedging, keep real symbol
|
|
20
|
+
names and before-to-after numbers. One doc, one purpose.
|
|
21
|
+
4. **Minimal diff.** Deslop removes lines; it never moves logic. A removed
|
|
22
|
+
validator that changes behavior is not deslop.
|
|
23
|
+
5. **Re-run the checks** and report lines removed, not lines written. Nothing
|
|
24
|
+
to clean is a valid result: say what you checked ("0 removals; ran knip and
|
|
25
|
+
read the diff"). When a tracked task lists a `pre-pr-cleanup` requirement,
|
|
26
|
+
record this result as its evidence.
|
|
27
|
+
|
|
28
|
+
## Example
|
|
29
|
+
|
|
30
|
+
Bad: deleting `// retry: the gateway drops the first request after idle (#412)`
|
|
31
|
+
because "comments die".
|
|
32
|
+
|
|
33
|
+
Good: deleting `// increment the counter` above `count += 1`, an unused
|
|
34
|
+
`formatLegacyDate` export reported by knip, and two hedging paragraphs from the
|
|
35
|
+
PR body: "-34 lines, behavior unchanged, `workit check test` exit 0".
|
|
36
|
+
|
|
37
|
+
## Check
|
|
38
|
+
|
|
39
|
+
```sh
|
|
40
|
+
workit check test && git diff --stat <base>...HEAD
|
|
41
|
+
```
|