@brainervirus/workit-core 4.0.0 → 6.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/README.md +1 -1
- package/package.json +1 -1
- 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/src/autonomy.ts +309 -44
- package/src/core/context-read.ts +144 -0
- package/src/core/methods.ts +71 -98
- package/src/core/skill-manifests.ts +49 -25
- package/src/core/store-lock.ts +1 -1
- package/src/core/task-context.ts +1 -1
- package/src/core/task-contract.ts +8 -130
- package/src/core/task-engine.ts +57 -879
- package/src/core/task-evaluation.ts +63 -5
- package/src/core/task-store.ts +2 -107
- package/src/core/workers.ts +12 -158
- package/src/core/workspaces.ts +15 -0
- package/src/core/youtrack-writes.ts +92 -0
- package/src/core.ts +2 -79
- package/src/forge/pr-ops.ts +2 -2
- package/src/hooks/handle.ts +29 -5
- package/src/hooks/hosts/claude-code.ts +0 -8
- package/src/hooks/hosts/codex.ts +2 -11
- package/src/hooks/hosts/cursor.ts +0 -8
- package/src/hooks/hosts/opencode.ts +0 -8
- package/src/hooks/hosts/pi.ts +0 -10
- package/src/ledger.ts +19 -10
- package/templates/plan-template.md +17 -18
- package/templates/spec-template.md +4 -3
- package/templates/workit-contract.md +3 -2
- 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/src/core/authority.ts +0 -1033
- package/src/core/auto-approval.ts +0 -338
- package/src/core/external-action-effects.ts +0 -2441
- package/src/core/external-action.ts +0 -1204
- package/templates/execution-contract.md +0 -40
package/src/forge/pr-ops.ts
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
// The merge call carries the head SHA (GitHub `sha=`, GitLab `sha=`), so a
|
|
16
16
|
// head that moves after the gates refuses instead of merging unverified code.
|
|
17
17
|
// --delete-branch deletes with a lease on that same SHA.
|
|
18
|
-
import { requireGrant } from "../autonomy";
|
|
18
|
+
import { requireGrant, type AutonomySource } from "../autonomy";
|
|
19
19
|
import { isProtectedTarget } from "../core/branch";
|
|
20
20
|
import { vcsConfig } from "../core/vcs-config";
|
|
21
21
|
import { deleteRemoteBranch } from "../git/ops";
|
|
@@ -257,7 +257,7 @@ export type MergeOutcome = {
|
|
|
257
257
|
method: MergeMethod;
|
|
258
258
|
mergeSha: string | null;
|
|
259
259
|
verdict: { required: boolean; accepted: boolean; verdictId: string | null };
|
|
260
|
-
grant: { source:
|
|
260
|
+
grant: { source: AutonomySource };
|
|
261
261
|
deletedBranch: boolean | { error: string };
|
|
262
262
|
recorded: { id: string } | { error: string };
|
|
263
263
|
};
|
package/src/hooks/handle.ts
CHANGED
|
@@ -17,14 +17,35 @@ const offered = new Set<string>();
|
|
|
17
17
|
* `workit:implementer` is ours: a bare or other-plugin `implementer` is not. */
|
|
18
18
|
const CLAUDE_WORKTREE_IMPLEMENTER = "workit:implementer";
|
|
19
19
|
|
|
20
|
+
/** The plugin's read-only judges: each records verdicts as its own session. */
|
|
21
|
+
const CLAUDE_JUDGES: ReadonlySet<string> = new Set(["workit:verifier", "workit:reviewer"]);
|
|
22
|
+
|
|
23
|
+
/** `<lead session>:<agent id>`, safe for the ledger's session grammar. */
|
|
24
|
+
const subagentSession = (session: string | null, agentId: string): string =>
|
|
25
|
+
[session, agentId]
|
|
26
|
+
.filter((part): part is string => Boolean(part))
|
|
27
|
+
.join(":")
|
|
28
|
+
.replace(/[^A-Za-z0-9_.:@/+-]/g, "-")
|
|
29
|
+
.slice(0, 128);
|
|
30
|
+
|
|
20
31
|
const subagentStartText = (
|
|
21
32
|
host: HookInput["host"],
|
|
33
|
+
session: string | null,
|
|
22
34
|
descriptor: HostDescriptor,
|
|
23
35
|
event: Extract<HookInput["event"], { kind: "subagent.start" }>,
|
|
24
|
-
): string =>
|
|
25
|
-
host === "claude_code" && event.agentType === CLAUDE_WORKTREE_IMPLEMENTER
|
|
26
|
-
|
|
27
|
-
|
|
36
|
+
): string => {
|
|
37
|
+
if (host === "claude_code" && event.agentType === CLAUDE_WORKTREE_IMPLEMENTER)
|
|
38
|
+
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.`;
|
|
39
|
+
const readOnly = `Workit observed ${descriptor.label} subagent ${event.agentId} (${event.agentType}) as read-only/agent-guided.`;
|
|
40
|
+
if (
|
|
41
|
+
host === "claude_code" &&
|
|
42
|
+
event.agentType &&
|
|
43
|
+
CLAUDE_JUDGES.has(event.agentType) &&
|
|
44
|
+
event.agentId
|
|
45
|
+
)
|
|
46
|
+
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.`;
|
|
47
|
+
return readOnly;
|
|
48
|
+
};
|
|
28
49
|
|
|
29
50
|
export function handleHook(input: HookInput, deps: HookDeps): HookDecision {
|
|
30
51
|
const { descriptor } = deps;
|
|
@@ -50,7 +71,10 @@ export function handleHook(input: HookInput, deps: HookDeps): HookDecision {
|
|
|
50
71
|
case "shell.pre":
|
|
51
72
|
return usable(descriptor.shellPolicy.deny) ? shellPolicy(input.cwd, event.command) : NONE;
|
|
52
73
|
case "subagent.start":
|
|
53
|
-
return {
|
|
74
|
+
return {
|
|
75
|
+
kind: "context",
|
|
76
|
+
text: subagentStartText(input.host, input.session.id ?? null, descriptor, event),
|
|
77
|
+
};
|
|
54
78
|
case "compact.pre":
|
|
55
79
|
return {
|
|
56
80
|
kind: "notice",
|
|
@@ -60,14 +60,6 @@ export const CLAUDE_CODE_DESCRIPTOR: HostDescriptor = {
|
|
|
60
60
|
shellAvailable: "native",
|
|
61
61
|
perEventCost: "low",
|
|
62
62
|
capabilities: [
|
|
63
|
-
{
|
|
64
|
-
name: "interactive_decision",
|
|
65
|
-
surface: "AskUserQuestion",
|
|
66
|
-
refs: ["AskUserQuestion"],
|
|
67
|
-
requires: [],
|
|
68
|
-
assurance: "agent_guided",
|
|
69
|
-
reason: "Claude Code hooks expose no native question answer receipt",
|
|
70
|
-
},
|
|
71
63
|
{
|
|
72
64
|
name: "known_product_writes",
|
|
73
65
|
surface: "PreToolUse",
|
package/src/hooks/hosts/codex.ts
CHANGED
|
@@ -77,14 +77,6 @@ export const CODEX_DESCRIPTOR: HostDescriptor = {
|
|
|
77
77
|
shellAvailable: "native",
|
|
78
78
|
perEventCost: "low",
|
|
79
79
|
capabilities: [
|
|
80
|
-
{
|
|
81
|
-
name: "interactive_decision",
|
|
82
|
-
surface: "Question",
|
|
83
|
-
refs: ["Question"],
|
|
84
|
-
requires: [],
|
|
85
|
-
assurance: "agent_guided",
|
|
86
|
-
reason: "Codex hooks expose no native arbitrary-question answer receipt",
|
|
87
|
-
},
|
|
88
80
|
{
|
|
89
81
|
name: "known_product_writes",
|
|
90
82
|
surface: "PreToolUse",
|
|
@@ -111,7 +103,7 @@ export const CODEX_DESCRIPTOR: HostDescriptor = {
|
|
|
111
103
|
requires: ["event:subagent.start", "event:subagent.stop"],
|
|
112
104
|
observed: ["subagent.start", "subagent.stop"],
|
|
113
105
|
assurance: "agent_guided",
|
|
114
|
-
reason: "Codex reports stable child identities, but cannot block creation
|
|
106
|
+
reason: "Codex reports stable child identities, but cannot block creation",
|
|
115
107
|
unavailableReason: "Codex subagent lifecycle hooks are untrusted or incomplete",
|
|
116
108
|
},
|
|
117
109
|
{
|
|
@@ -292,7 +284,6 @@ export const codexAdapter: HostAdapter = {
|
|
|
292
284
|
};
|
|
293
285
|
},
|
|
294
286
|
render,
|
|
295
|
-
// Without a session id there is no actor to bind a writer to.
|
|
296
287
|
addendum: (input) =>
|
|
297
|
-
`<workit-codex-mutations>Codex MCP is read-only: unattested callers cannot mutate. Run the workit CLI
|
|
288
|
+
`<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${input.session.id ? ` --actor ${input.session.id}` : ""}. 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 (workit grant show); a question answer is not host permission.</workit-codex-mutations>`,
|
|
298
289
|
};
|
|
@@ -78,14 +78,6 @@ export const CURSOR_DESCRIPTOR: HostDescriptor = {
|
|
|
78
78
|
// Every hook spawns `npx -y --prefer-online …@latest`: a registry round-trip per event.
|
|
79
79
|
perEventCost: "npx-network",
|
|
80
80
|
capabilities: [
|
|
81
|
-
{
|
|
82
|
-
name: "interactive_decision",
|
|
83
|
-
surface: "AskQuestion",
|
|
84
|
-
refs: ["AskQuestion"],
|
|
85
|
-
requires: [],
|
|
86
|
-
assurance: "agent_guided",
|
|
87
|
-
reason: "Cursor does not expose AskQuestion answers to Workit hooks or MCP",
|
|
88
|
-
},
|
|
89
81
|
{
|
|
90
82
|
name: "known_product_writes",
|
|
91
83
|
surface: "preToolUse",
|
|
@@ -40,14 +40,6 @@ export const OPENCODE_DESCRIPTOR: HostDescriptor = {
|
|
|
40
40
|
shellAvailable: "native",
|
|
41
41
|
perEventCost: "low",
|
|
42
42
|
capabilities: [
|
|
43
|
-
{
|
|
44
|
-
name: "interactive_decision",
|
|
45
|
-
surface: "question",
|
|
46
|
-
refs: ["question"],
|
|
47
|
-
requires: ["interaction.questions"],
|
|
48
|
-
assurance: "enforced",
|
|
49
|
-
reason: "native question answers are observed by tool.execute.after and consumed once",
|
|
50
|
-
},
|
|
51
43
|
{
|
|
52
44
|
name: "known_product_writes",
|
|
53
45
|
surface: "edit/shell",
|
package/src/hooks/hosts/pi.ts
CHANGED
|
@@ -49,16 +49,6 @@ export const PI_DESCRIPTOR: HostDescriptor = {
|
|
|
49
49
|
reason:
|
|
50
50
|
"Pi exposes a before-tool boundary for known built-in write tools; it enforces project trust while file targets stay host-policy.",
|
|
51
51
|
},
|
|
52
|
-
{
|
|
53
|
-
name: "interactive_decision",
|
|
54
|
-
surface: "ui.confirm",
|
|
55
|
-
refs: ["ui.confirm"],
|
|
56
|
-
requires: ["interaction.questions"],
|
|
57
|
-
observed: ["ui"],
|
|
58
|
-
assurance: "enforced",
|
|
59
|
-
reason: "Pi supplies a native confirmation receipt when dialog UI is available.",
|
|
60
|
-
unavailableReason: "Pi is running without dialog UI, so required decisions need user input.",
|
|
61
|
-
},
|
|
62
52
|
{
|
|
63
53
|
name: "arbitrary_shell_write",
|
|
64
54
|
surface: "bash",
|
package/src/ledger.ts
CHANGED
|
@@ -1071,6 +1071,12 @@ export function recordVerdict(
|
|
|
1071
1071
|
surface?: string | null;
|
|
1072
1072
|
self?: boolean;
|
|
1073
1073
|
evidenceRefs?: string[];
|
|
1074
|
+
/**
|
|
1075
|
+
* A role id derived from another session (`--as`): the session it was
|
|
1076
|
+
* derived from. `null` means it was derived from no session, which makes
|
|
1077
|
+
* the verdict self. An author's derived id is refused like the author.
|
|
1078
|
+
*/
|
|
1079
|
+
derivedFrom?: string | null;
|
|
1074
1080
|
},
|
|
1075
1081
|
): LedgerResult<VerdictRow> {
|
|
1076
1082
|
if (!(VERDICT_RESULTS as readonly string[]).includes(input.result))
|
|
@@ -1105,19 +1111,22 @@ export function recordVerdict(
|
|
|
1105
1111
|
);
|
|
1106
1112
|
const session = context.actor.session;
|
|
1107
1113
|
const selfReason: SelfReason | null =
|
|
1108
|
-
input.self === true ? "flag" : session ? null : "no_session";
|
|
1114
|
+
input.self === true ? "flag" : session && input.derivedFrom !== null ? null : "no_session";
|
|
1109
1115
|
const self = selfReason !== null;
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
)
|
|
1116
|
-
)
|
|
1116
|
+
const authors = authorSessions(context.cwd, ledger.value.rows, branch, {
|
|
1117
|
+
base: key.base,
|
|
1118
|
+
head: key.head,
|
|
1119
|
+
});
|
|
1120
|
+
const authoring = [session, input.derivedFrom].find(
|
|
1121
|
+
(candidate): candidate is string => typeof candidate === "string" && authors.has(candidate),
|
|
1122
|
+
);
|
|
1123
|
+
if (!self && authoring)
|
|
1117
1124
|
return err(
|
|
1118
1125
|
"blocked",
|
|
1119
|
-
`author_verdict: session ${
|
|
1120
|
-
|
|
1126
|
+
`author_verdict: session ${authoring} authored ${branch}; a verdict must come from a different session`,
|
|
1127
|
+
input.derivedFrom === undefined
|
|
1128
|
+
? 'have a non-author session record the verdict, or pass --self (a self verdict is never accepted by merge:"verified")'
|
|
1129
|
+
: "run the verifier as a separate session: the lead spawns it with its own WORKIT_SESSION_ID (Claude Code: subagents get one from the SubagentStart hook)",
|
|
1121
1130
|
);
|
|
1122
1131
|
const link = checkSupersede(context, "verdict", self);
|
|
1123
1132
|
if (!link.ok) return link;
|
|
@@ -1,27 +1,26 @@
|
|
|
1
|
-
# <Feature>
|
|
1
|
+
# <Feature> plan
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Spec: `docs/<slug>/spec.md` · Goal: <one sentence>
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
A plan records decisions, not code: per slice the branch, what it touches, its
|
|
6
|
+
acceptance, how it is verified, and what it depends on (workit-shape
|
|
7
|
+
`references/slicing.md`). Independent slices fan out (workit-fanout);
|
|
8
|
+
dependent ones stack (`workit stack plan <bottom> … <top>`).
|
|
7
9
|
|
|
8
|
-
|
|
10
|
+
## Global constraints
|
|
9
11
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
- Each task lands exactly one contiguous non-empty commit range (`base..head`): fix rounds append commits to that range and never rewrite/amend an active review range; record the real base..head shas in task progress.
|
|
13
|
-
- The final task closes the lead Workit task with `workit_task` `action: "close"` (CLI: `workit task close --payload … [--confirm]`) once requirements are satisfied and repository verification passes — never finish while the task is still `active` or `paused`.
|
|
14
|
-
- <project-wide requirements, one line each>
|
|
12
|
+
- <project-wide requirement, one line each>
|
|
15
13
|
|
|
16
14
|
---
|
|
17
15
|
|
|
18
|
-
###
|
|
19
|
-
|
|
20
|
-
- [ ] **Step 1: <action>**
|
|
16
|
+
### S1 <type>/<slug> (base: main)
|
|
21
17
|
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
Touches: <areas, not line numbers>
|
|
19
|
+
Acceptance:
|
|
20
|
+
- Given <state>, When <action>, Then <observable result>
|
|
21
|
+
Verify: `workit check test`; verify-<app> "<feature>"
|
|
22
|
+
Decisions: <ledger refs or one-line rulings>
|
|
24
23
|
|
|
25
|
-
|
|
|
26
|
-
| --- | --- |
|
|
27
|
-
|
|
|
24
|
+
| Slice | Branch | Depends on | Status |
|
|
25
|
+
| --- | --- | --- | --- |
|
|
26
|
+
| S1 | <type>/<slug> | — | pending |
|
|
@@ -19,14 +19,15 @@ no durable agreement: `Spec: none (<reason>)`, no file.)
|
|
|
19
19
|
|
|
20
20
|
## Architecture
|
|
21
21
|
|
|
22
|
-
<!--
|
|
23
|
-
|
|
22
|
+
<!-- Optional: only when a diagram argues a decision (workit-shape
|
|
23
|
+
references/diagrams.md); otherwise delete this section. -->
|
|
24
24
|
```mermaid
|
|
25
25
|
flowchart TD
|
|
26
26
|
A[Start] --> B[Step]
|
|
27
27
|
```
|
|
28
28
|
|
|
29
|
-
<!--
|
|
29
|
+
<!-- Optional: a UI choice still open gets an ASCII sketch (workit-shape
|
|
30
|
+
references/mockups.md). -->
|
|
30
31
|
```text
|
|
31
32
|
┌──────────────┐
|
|
32
33
|
│ Header │
|
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Workit keeps one accountable lead and one shared task state. Inspect current
|
|
4
4
|
task state before acting; use only the shared operations for task, policy,
|
|
5
|
-
evidence, finding, decision, worker,
|
|
5
|
+
evidence, finding, decision, worker, and state changes. Authority is
|
|
6
6
|
bounded by the requested scope, current revision, caller/session provenance, and
|
|
7
|
-
observed capabilities
|
|
7
|
+
observed capabilities; delivery is bounded by the workspace autonomy grants
|
|
8
|
+
(`workit grant show`). Never claim host enforcement or evidence that the host
|
|
8
9
|
cannot provide. Preserve unresolved requirements, gaps, and uncertain workers.
|
|
9
10
|
|
|
10
11
|
Focused methods are loaded only when the resolved policy requires them. A method
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: workit-babysit
|
|
3
|
-
description: Use when the user asks to babysit a PR or explicitly opts in to PR follow-up
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Babysit a PR to PR-ready
|
|
7
|
-
|
|
8
|
-
PR creation does not start babysitting. `babysit:true` opts into this skill;
|
|
9
|
-
omission means no follow-up. A PR URL by itself is not an instruction to drive
|
|
10
|
-
it. When the user asks to babysit a URL from a route Workit did not enforce,
|
|
11
|
-
help without claiming the Workit route was enforced. Never mutate PR topology
|
|
12
|
-
(no rebase strategy changes, no force-push).
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
## Method
|
|
16
|
-
|
|
17
|
-
1. Default to drive mode for an explicit babysit request: resolve conflicts,
|
|
18
|
-
address review threads, and get checks green. Watch reports status only;
|
|
19
|
-
threads-only addresses review threads. Ask about mode only when the choice
|
|
20
|
-
materially changes the work.
|
|
21
|
-
2. Work toward PR-ready in order: conflicts → review threads → CI. Keep a brief
|
|
22
|
-
checkpoint when continuity needs it; task progress is optional.
|
|
23
|
-
3. Classify CI before retry: flake (rerun once) vs stale base (verify with
|
|
24
|
-
`git merge-base --is-ancestor` before updating) vs real failure (fix).
|
|
25
|
-
4. Triage bot findings skeptically: reproduce or quote code before acting;
|
|
26
|
-
invalid bots get a reasoned dismissal, never silent ignore.
|
|
27
|
-
5. Batch fixes into one push wave; re-verify green after every push.
|
|
28
|
-
6. Stop at PR-ready. A PR creation or babysit request does not authorize merge
|
|
29
|
-
or release. Continue to merge or release only when the user explicitly sets
|
|
30
|
-
that delivery endpoint and host authority allows the action.
|
|
31
|
-
|
|
32
|
-
## Completion
|
|
33
|
-
|
|
34
|
-
Report PR-ready status with evidence for fixes, or a brief blocker report. If
|
|
35
|
-
the user explicitly authorized merge, honor the configured strategy only after
|
|
36
|
-
checks and required approval. After a squash merge, re-record evidence against
|
|
37
|
-
the new base commit before closing tracked work.
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: workit-behavioral-tdd
|
|
3
|
-
description: Use when policy identifies behavior, side effects, permissions, or data handling that may change and a regression boundary is needed
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Behavioral TDD
|
|
7
|
-
|
|
8
|
-
Test the observable behavior at a stable boundary, not the implementation shape.
|
|
9
|
-
Use this method when assessment selects the `testing` dimension.
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
## Method
|
|
13
|
-
|
|
14
|
-
1. Inspect the task requirement, current candidate, intended behavior, and real
|
|
15
|
-
verification entry point with shared `task`, `policy`, and `evidence` operations.
|
|
16
|
-
2. State one behavior and its observable result. Choose the narrowest stable
|
|
17
|
-
boundary a caller or user depends on; avoid private helpers and incidental
|
|
18
|
-
representations.
|
|
19
|
-
3. Write one vertical RED slice that fails for the missing behavior and run it
|
|
20
|
-
through the CLI so the failure is observed: `workit check test` (the repo's
|
|
21
|
-
configured `test` check; `npx -y @brainervirus/workit-cli check test` when
|
|
22
|
-
`workit` is not on PATH). Implement the smallest change, then run the same
|
|
23
|
-
check GREEN. Close accepts only a fresh passing run of the configured check
|
|
24
|
-
that `workit check` observed; a recorded "tests pass" is a note, and an
|
|
25
|
-
ad-hoc `workit check -- <cmd>` never satisfies the gate. If no `test` check
|
|
26
|
-
is configured or detected, add `workit.checks.json` (committed) with it.
|
|
27
|
-
4. Add only another slice for a distinct behavior or risk. Any edit makes the
|
|
28
|
-
observed check stale: re-run `workit check test` before closing.
|
|
29
|
-
|
|
30
|
-
## Reject noisy tests
|
|
31
|
-
|
|
32
|
-
- A dependency/version-pin assertion is not behavioral evidence.
|
|
33
|
-
- A test that mirrors branches, private calls, or exact implementation structure
|
|
34
|
-
is coupled to internals; replace it with the public effect.
|
|
35
|
-
- Duplicate assertions and tests that add no distinct failure signal are noise;
|
|
36
|
-
delete them.
|
|
37
|
-
- Do not claim a passing test satisfies a different requirement.
|
|
38
|
-
- Banned: tautologies (asserts what the code says, not what it must do),
|
|
39
|
-
ghost loops (assert inside a possibly-empty loop), smoke-only renders,
|
|
40
|
-
type-only or CSS-class coupling. If the test still passes when every
|
|
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.
|
|
44
|
-
|
|
45
|
-
Run RED/GREEN through `workit check`, which records the observed result on the
|
|
46
|
-
current task; shared `evidence` operations are for notes and non-test evidence.
|
|
47
|
-
Do not add a second lifecycle, approval chain, or test workflow outside the
|
|
48
|
-
current task state.
|
|
49
|
-
|
|
50
|
-
## Common mistakes
|
|
51
|
-
|
|
52
|
-
| Mistake | Correction |
|
|
53
|
-
| --- | --- |
|
|
54
|
-
| "The pin changed, so assert the new string" | Exercise the affected consumer behavior. |
|
|
55
|
-
| "The code is obvious" | A small vertical slice still proves the contract. |
|
|
56
|
-
| Keeping a passing test after the boundary moved | Re-run `workit check test` on the current tree. |
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: workit-blast-radius
|
|
3
|
-
description: Use when a small-looking change could break something else, before close or merge
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Blast radius beyond the diff
|
|
7
|
-
|
|
8
|
-
A small diff is not a small risk. Prove the one fact it is safe because of,
|
|
9
|
-
with runnable proof — not assertion.
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
## Method
|
|
13
|
-
|
|
14
|
-
1. List what the change touches: callers, shared state, contracts, config,
|
|
15
|
-
migrations. Grep every caller of each touched function.
|
|
16
|
-
2. For each: state the one fact it is safe because of (type boundary,
|
|
17
|
-
existing test, unreachable path) plus how to run the proof.
|
|
18
|
-
3. Run the proofs. Unproven claims stay labeled UNPROVEN in findings —
|
|
19
|
-
never silently treated as safe.
|
|
20
|
-
4. Fix at the shared root (one guard where all callers route through),
|
|
21
|
-
not per caller.
|
|
22
|
-
|
|
23
|
-
## Completion
|
|
24
|
-
|
|
25
|
-
Blast-radius note in evidence or review: each risk with fact + proof
|
|
26
|
-
command, or an UNPROVEN finding for what could not be proven.
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: workit-challenge
|
|
3
|
-
description: Use when requirements or consequences leave a real decision open
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Challenge open choices with evidence
|
|
7
|
-
|
|
8
|
-
Skip this method for a precise, settled request.
|
|
9
|
-
|
|
10
|
-
## Method
|
|
11
|
-
|
|
12
|
-
1. Ground the outcome, constraints, evidence, and important unknowns. Inspect
|
|
13
|
-
code and project docs before asking about facts they can answer.
|
|
14
|
-
2. Separate observations, inferences, and proposals. Test assumptions that
|
|
15
|
-
could change the recommendation.
|
|
16
|
-
3. When viable alternatives exist, present two or three genuinely different
|
|
17
|
-
approaches. Recommend one; for each, give its benefit, cost or risk, when it
|
|
18
|
-
fits, and the smallest useful validation. Do not invent a weak alternative.
|
|
19
|
-
4. Ask only consequential questions, in dependency order. Group independent
|
|
20
|
-
choices into one small round. If an authorized reversible default works,
|
|
21
|
-
state it and proceed.
|
|
22
|
-
5. Record a settled choice once in the existing conversation or task context.
|
|
23
|
-
A discussion decision is knowledge; never fabricate a native permission
|
|
24
|
-
receipt or reopen it without new evidence.
|
|
25
|
-
6. Create durable documentation only when requested or when the decision needs
|
|
26
|
-
a future reader. Brainstorming alone does not require a spec.
|
|
27
|
-
|
|
28
|
-
Say directly when evidence shows a proposal is weak, overcomplicated, or solves
|
|
29
|
-
the wrong problem. Raise a counter-case only when it adds a real constraint.
|
|
30
|
-
|
|
31
|
-
## Guardrails
|
|
32
|
-
|
|
33
|
-
- Do not create a universal spec, plan, approval chain, or second lifecycle.
|
|
34
|
-
- Unknowns that affect an action remain unresolved until evidence or a user
|
|
35
|
-
decision closes them.
|
|
36
|
-
- Use shared operations for tracked state and provenance; never write task
|
|
37
|
-
metadata directly.
|
|
38
|
-
- An in-session counter-case is not fresh-context review.
|
|
39
|
-
|
|
40
|
-
## Common mistakes
|
|
41
|
-
|
|
42
|
-
| Mistake | Correction |
|
|
43
|
-
| --- | --- |
|
|
44
|
-
| Asking what code or docs already answer | Ground first; the user owns choices, not lookups. |
|
|
45
|
-
| Listing every hypothetical objection | Raise only objections that can change the decision. |
|
|
46
|
-
| Asking for agreement without a recommendation | Recommend an option and explain the tradeoff. |
|
|
47
|
-
| Treating a discussion decision as permission | Record it as knowledge; preserve native host authority. |
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: workit-diagram
|
|
3
|
-
description: Use when a spec or plan needs a flow or architecture diagram
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Mermaid when needed, never by default
|
|
7
|
-
|
|
8
|
-
Tables first, ASCII trees second, mermaid only when a flow or architecture
|
|
9
|
-
needs it. Flowchart, sequence, state, or ER only. No renderer, no network.
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
## Syntax rules (mermaid v11)
|
|
13
|
-
|
|
14
|
-
- Fence as ` ```mermaid `, no surrounding prose inside the fence.
|
|
15
|
-
- Quote node labels containing punctuation: `A["input (x, y)"]`.
|
|
16
|
-
- One direction per diagram (`TD` or `LR`); keep nodes under twelve.
|
|
17
|
-
- Name actors exactly as the codebase names them (real symbols only).
|
|
18
|
-
|
|
19
|
-
## Verify
|
|
20
|
-
|
|
21
|
-
Re-read the fence before commit: balanced quotes/brackets, every node
|
|
22
|
-
reachable, labels match spec terms. If it cannot be verified by reading,
|
|
23
|
-
delete it.
|
|
24
|
-
|
|
25
|
-
## Completion
|
|
26
|
-
|
|
27
|
-
One diagram that argues a decision, or nothing. Never a diagram suite.
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: workit-green-run
|
|
3
|
-
description: Use to drive a red CI pipeline back to green, usually inside babysit
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# The CI loop
|
|
7
|
-
|
|
8
|
-
Watch, classify, fix, push once, re-verify. Host-native (`gh` / GitLab);
|
|
9
|
-
never invent CI APIs.
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
## Method
|
|
13
|
-
|
|
14
|
-
1. Read the failing checks, not the summary. Quote the failing log lines.
|
|
15
|
-
2. Classify each: flake (rerun once, note it) / stale base (update after
|
|
16
|
-
merge-base check) / real failure (reproduce locally, then fix).
|
|
17
|
-
3. Fix at root cause with a regression test; push one wave.
|
|
18
|
-
4. Re-verify the same checks green on the new head. A fix without a
|
|
19
|
-
green re-run is not a fix.
|
|
20
|
-
|
|
21
|
-
## Completion
|
|
22
|
-
|
|
23
|
-
Green pipeline on the merge head, or an escalated finding with the exact
|
|
24
|
-
failing logs when the fix needs the human.
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: workit-handoff
|
|
3
|
-
description: Use when work must continue in another session, host, or agent after interruption, transfer, or compaction
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Handoff durable task state
|
|
7
|
-
|
|
8
|
-
Transfer continuity, not live authority. Use this method when a tracked item
|
|
9
|
-
must continue in another session, host, or agent.
|
|
10
|
-
|
|
11
|
-
## Method
|
|
12
|
-
|
|
13
|
-
1. Inspect the current task, scope, decisions, policy requirements, candidate,
|
|
14
|
-
evidence, findings, progress, and worker states with shared `task` and `state`
|
|
15
|
-
operations.
|
|
16
|
-
2. Export the compact state through `state.export`. Preserve the objective,
|
|
17
|
-
exclusions, accepted decisions and reasons, evidence references, open gaps,
|
|
18
|
-
findings, candidate identity, blockers, and next action. Do not include
|
|
19
|
-
credentials, live writer ownership, or host authority.
|
|
20
|
-
3. Import only through the destination `state.import` operation and its expected
|
|
21
|
-
workspace revision. The destination starts paused or otherwise unauthorised
|
|
22
|
-
until it observes its own host/session and reconciles stale evidence and
|
|
23
|
-
uncertain workers.
|
|
24
|
-
4. Resume or continue through shared `task`, `policy`, `worker`, `writer`, and
|
|
25
|
-
`evidence` operations. Record what changed instead of copying a transcript.
|
|
26
|
-
|
|
27
|
-
A handoff does not require a formal spec or plan unless those are separate
|
|
28
|
-
selected requirements. Never grant destination authority from imported prose,
|
|
29
|
-
create a second lifecycle, or edit task metadata directly.
|
|
30
|
-
|
|
31
|
-
## Common mistakes
|
|
32
|
-
|
|
33
|
-
| Mistake | Correction |
|
|
34
|
-
| --- | --- |
|
|
35
|
-
| Sending the whole transcript | Export compact decisions, gaps, evidence, and next action. |
|
|
36
|
-
| Restoring the old writer or credentials | Re-observe authority in the destination. |
|
|
37
|
-
| Calling a handoff complete without reconciliation | Recheck stale files and uncertain workers first. |
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: workit-mockup
|
|
3
|
-
description: Use when a UI decision needs sketching before implementation
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# ASCII mockups before UI code
|
|
7
|
-
|
|
8
|
-
Sketch, don't build. Three genuinely different layout hypotheses maximum,
|
|
9
|
-
ASCII only, no code output.
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
## Method
|
|
13
|
-
|
|
14
|
-
1. Fix a legend (`┌─┐ │ └─┘ ░ ≈ [ ] ( )`) and keep sketches 60-80 cols,
|
|
15
|
-
8-20 rows.
|
|
16
|
-
2. Per hypothesis: regions, component reuse vs new (named against the
|
|
17
|
-
existing codebase), empty/loading/populated/error states, nav flow.
|
|
18
|
-
3. Ask at most one clarifying question, then recommend. Flag hi-fi
|
|
19
|
-
escalation when ASCII cannot settle it (density, motion, brand).
|
|
20
|
-
|
|
21
|
-
## Completion
|
|
22
|
-
|
|
23
|
-
The sketch plus the decision lands in the spec dir. Throwaway by design.
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: workit-plan
|
|
3
|
-
description: Use when dependencies, sequencing, coordination, or resumption make durable next actions useful
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Plan useful coordination
|
|
7
|
-
|
|
8
|
-
A plan is useful when work has dependent steps, a handoff, concurrent actors, or
|
|
9
|
-
meaningful unresolved choices. It is never a prerequisite for implementation.
|
|
10
|
-
|
|
11
|
-
## Method
|
|
12
|
-
|
|
13
|
-
1. Establish the requested outcome, constraints, dependencies, and important
|
|
14
|
-
unknowns from the available code, docs, and configuration before asking.
|
|
15
|
-
2. Record only the useful sequence: objective, dependency, bounded outcome,
|
|
16
|
-
evidence needed, and next action. Reuse the project's existing format.
|
|
17
|
-
3. Start a tracked record only when handoff, dependent steps, coordination, or
|
|
18
|
-
durable decisions need continuity. Infer observable facts instead of asking
|
|
19
|
-
the user to fill redundant protocol fields.
|
|
20
|
-
4. Create a spec when a durable behavior contract or interface is requested or
|
|
21
|
-
will help a future reader. Use an ADR for a consequential trade-off and a
|
|
22
|
-
glossary for stable terms. A small fix needs no document.
|
|
23
|
-
5. If the user authorized implementation, proceed through the agreed endpoint
|
|
24
|
-
and applicable checks. Do not ask for a separate plan approval or repeat
|
|
25
|
-
"continue?". Stop for a new consequential choice, host denial, conflict, or
|
|
26
|
-
blocker that cannot be resolved safely.
|
|
27
|
-
6. Update a checkpoint at meaningful boundaries when another session may need
|
|
28
|
-
to resume. Keep settled decisions, changed files, actual checks, blockers,
|
|
29
|
-
and the next action; omit transcript and process trivia.
|
|
30
|
-
|
|
31
|
-
## Shape
|
|
32
|
-
|
|
33
|
-
Plan slices as small end-to-end outcomes with explicit dependencies and checks.
|
|
34
|
-
Keep repo policy and native host authority separate. Preserve the user's branch
|
|
35
|
-
and commit conventions. Do not prescribe one commit per step or create a second
|
|
36
|
-
approval chain unless the user asked for that delivery format.
|
|
37
|
-
|
|
38
|
-
## Common mistakes
|
|
39
|
-
|
|
40
|
-
| Mistake | Correction |
|
|
41
|
-
| --- | --- |
|
|
42
|
-
| Writing a packet for a bounded reversible change | Leave the change undocumented. |
|
|
43
|
-
| Asking what repository state or code can answer | Inspect it first. |
|
|
44
|
-
| Treating the plan as authority | Follow the user's scope and native host permissions. |
|
|
45
|
-
| Copying a transcript into the plan | Keep decisions, evidence, gaps, and next action only. |
|