@workit-dev/opencode 0.0.0-stage → 1.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.
Files changed (34) hide show
  1. package/README.md +37 -2
  2. package/assets/skills/workit-architecture/SKILL.md +72 -0
  3. package/assets/skills/workit-architecture/agents/openai.yaml +3 -0
  4. package/assets/skills/workit-architecture/references/instruction-files.md +52 -0
  5. package/assets/skills/workit-architecture/references/vocabulary.md +53 -0
  6. package/assets/skills/workit-bdd/SKILL.md +53 -0
  7. package/assets/skills/workit-continue/SKILL.md +54 -0
  8. package/assets/skills/workit-debug/SKILL.md +45 -0
  9. package/assets/skills/workit-deslop/SKILL.md +58 -0
  10. package/assets/skills/workit-fanout/SKILL.md +71 -0
  11. package/assets/skills/workit-fanout/references/brief.md +141 -0
  12. package/assets/skills/workit-fanout/references/orchestration.md +169 -0
  13. package/assets/skills/workit-implement/SKILL.md +71 -0
  14. package/assets/skills/workit-retro/SKILL.md +72 -0
  15. package/assets/skills/workit-retro/agents/openai.yaml +3 -0
  16. package/assets/skills/workit-retro/references/sources.md +35 -0
  17. package/assets/skills/workit-retro/references/steering.md +39 -0
  18. package/assets/skills/workit-review/SKILL.md +66 -0
  19. package/assets/skills/workit-review/references/impact.md +24 -0
  20. package/assets/skills/workit-shape/SKILL.md +71 -0
  21. package/assets/skills/workit-shape/references/diagrams.md +17 -0
  22. package/assets/skills/workit-shape/references/knowledge.md +61 -0
  23. package/assets/skills/workit-shape/references/mockups.md +15 -0
  24. package/assets/skills/workit-shape/references/slicing.md +44 -0
  25. package/assets/skills/workit-ship/SKILL.md +71 -0
  26. package/assets/skills/workit-ship/references/changelog.md +44 -0
  27. package/assets/skills/workit-ship/references/pr-body.md +32 -0
  28. package/assets/skills/workit-ship/references/release.md +39 -0
  29. package/assets/skills/workit-test-audit/SKILL.md +54 -0
  30. package/assets/skills/workit-verify-app/SKILL.md +68 -0
  31. package/assets/skills/workit-verify-app/references/template.md +51 -0
  32. package/dist/plugin.js +30118 -0
  33. package/index.ts +1 -0
  34. package/package.json +47 -4
@@ -0,0 +1,169 @@
1
+ # Running a fanout
2
+
3
+ How the lead picks models, keeps workers flowing, retries, races, verifies
4
+ and fans in. Workit records and checks; the host's own subagents run the work.
5
+
6
+ ## TIER to model
7
+
8
+ TIER is a field of each slice and of its brief. Role models come from the
9
+ workspace (`models.roles`; `fanout.tierModels` still feeds the implementer
10
+ tiers) and, on Claude Code, built-in defaults: the brief has a `model:` line
11
+ (with `effort:` when set) under TIER and a `verifier:` line; `workit fanout
12
+ status` names the model next to each spawnable slice; `workit models show
13
+ [--role r] [--host h] --json` lists every role (decider, implementer tiers,
14
+ verifier, reviewer, explore, babysit). Pass exactly that `model` (and `effort`
15
+ where the host's spawn call takes one) on the spawn call: a subagent that
16
+ passes none inherits your model. Scouting and PR babysitting use the `explore`
17
+ and `babysit` roles. A role with no model (other hosts without config) runs
18
+ on the host's model, and TIER only sizes the timebox and decides whether to
19
+ race. Claude Code's built-in defaults, when nothing is configured:
20
+
21
+ | Role or TIER | `model` on the Agent call |
22
+ | --- | --- |
23
+ | decider | `fable`, effort `high` |
24
+ | hard | `opus` |
25
+ | standard | `sonnet` |
26
+ | mundane | `haiku` |
27
+ | verifier | `sonnet` |
28
+ | reviewer | `opus` |
29
+ | explore, babysit | `haiku` |
30
+
31
+ Claude Code and OpenCode also get the role's model set on the spawn by
32
+ Workit; a configured one beats a `model` you pass unless
33
+ `models.allowLeadOverride` is true. A general spawn takes
34
+ `models.roles.default`, or the role its prompt's `ROLE: <role>` line names.
35
+ `models.lead` (your own model) is advisory. `workit models show` marks each
36
+ role `enforced` or `advisory` per host: on advisory, pass the model.
37
+
38
+ ## Rolling window
39
+
40
+ Keep 4-6 workers in flight on Claude Code; elsewhere as many as the host runs
41
+ in the background, never more than 6. Do not wait for a whole wave: when one
42
+ worker finishes (its notification, or a new head or PR in `workit fanout
43
+ status`), verify it, then spawn the next slice from `spawnable` in the same
44
+ status output. A slice whose dependencies landed, or a stacked child whose
45
+ parent is verified, appears there by itself.
46
+
47
+ ## Retry, then escalate
48
+
49
+ A slice is retried when it is STUCK, its worker exits without meeting
50
+ ACCEPTANCE, or its verdict fails. Stop the worker and observe that it exited.
51
+ Release its worktree: `workit fanout worktree release <slice>` (it records
52
+ `git status` first), and create it again for the retry. Then spawn one fresh
53
+ worker with `workit fanout brief <slice> --mode resume`: same branch, and the
54
+ brief points at its head and its ledger rows (last report, verdicts,
55
+ rulings). If the retry fails too, escalate instead of a third worker:
56
+ re-slice it smaller (`workit fanout plan` again), take it over yourself, or
57
+ report the gap to the user.
58
+
59
+ ## Stuck calls: the decider
60
+
61
+ A failed review gets one fix round and one recheck (the changed hunks only).
62
+ If the recheck fails, or a worker and a reviewer disagree, spawn a decider
63
+ instead of a third round. A decider is a fresh read-only agent, not the author
64
+ or the reviewer. It returns three things: the options, a pick by
65
+ reversibility (the option cheapest to undo wins a tie), and the exact change
66
+ list. The fixer applies that list once, then one focused recheck follows.
67
+
68
+ - Hard call (shared contract, security, migration): two deciders on different
69
+ models (Claude Code, OpenCode, Cursor: the `decider` role model and a
70
+ different `model` on the spawn, kept on a configured decider role only with
71
+ `models.allowLeadOverride`; Codex and Pi: one decider). If they disagree, you take the
72
+ more reversible option.
73
+ - Record it: `workit ledger decision "<pick>" --by decider --why "<why it is
74
+ the more reversible>" --view "<decider A: view>" --view "<decider B: view>"`.
75
+ The row is listed as a decider call; it is never the user's answer to a
76
+ product choice and never a verdict.
77
+ - A product choice, or authority nobody here has, is not a decider's call:
78
+ ask the user with your recommendation.
79
+
80
+ ## Race a hard slice
81
+
82
+ When a hard slice has an uncertain approach and a cheap VERIFY, run 2-3
83
+ attempts at once instead of retrying in series. `workit fanout brief <slice>
84
+ --attempt <n>` gives each attempt its own branch (`<branch>-try<n>`), session
85
+ and scratch dir. Each attempt needs its own worktree, and `fanout worktree
86
+ create` makes only the slice's own one, so run the attempts one after another
87
+ there on every host.
88
+ Verify every attempt, keep the one with the best verdict (accepted first,
89
+ then the fewest changed files, then the earliest), point the slice branch at
90
+ it (`git branch <branch> <winner>`), have the verifier record the verdict on
91
+ `<branch>` (same head), and delete the losing attempt branches.
92
+
93
+ ## Verification
94
+
95
+ Follow the workspace `verification` setting (`workit grant show`); the
96
+ worker never records a verdict on its own work.
97
+
98
+ - `self` (the default): a verifier that wrote none of the slices records the
99
+ verdicts. A lead that authored none of the slices may record them in its
100
+ own session.
101
+ - `independent`, and any slice at high risk: a separate verifier session
102
+ records them, never the lead's own; at high risk one verifier per slice,
103
+ plus a review panel (below). This is doctrine, not enforced: the ledger
104
+ only tells a branch's authors from everyone else, and a lead that wrote
105
+ none of it counts as independent.
106
+
107
+ Which session id a verdict carries, per host:
108
+
109
+ - Claude Code: subagents inherit your `WORKIT_SESSION_ID`, so the
110
+ SubagentStart hook names each `verifier` and `reviewer` its own session
111
+ (`<lead>:<agent id>`) and a token only that subagent sees, passed exactly as
112
+ `--session` and `--token`: the hook records the ids it issues, and only
113
+ those, with their token, are accepted. An `implementer` is issued
114
+ none: it keeps your id in its env for its workit commands and commits.
115
+ - Codex: the `workit-verifier` and `workit-reviewer` agents get the same
116
+ issued `--session` and `--token` from SubagentStart; any other verifier passes
117
+ `--as verifier`.
118
+ - OpenCode: a child session's shell already has
119
+ `WORKIT_SESSION_ID=<lead>:<child>`; Pi: a supervised worker's shell has
120
+ `<lead>:<worker session>`. Set nothing for a verifier there.
121
+ - Cursor (no session id in the shell): the brief sets the verifier's
122
+ `WORKIT_SESSION_ID=<lead>:verifier-<random hex>`, a fresh suffix per
123
+ verifier. Cursor cannot check it: it is declared, not derived.
124
+ - A worker's commits: on Claude Code the lead's `WORKIT_SESSION_ID` already in
125
+ its env (SubagentStart issues no implementer id; no export, so the
126
+ lead authored those commits: a verifier or reviewer records the verdict, not
127
+ the lead); on OpenCode, Pi and Codex the id the host already
128
+ puts in its shell; on Cursor, CI and a plain terminal the brief's
129
+ `export WORKIT_SESSION_ID=<lead>-w-<slice>` (see `brief.md`, "Identity and
130
+ git rules per host"). A verdict under an id you made up (`<lead>-v1`,
131
+ `<lead>:v1`) is refused as `forged_session` on Claude Code, Codex,
132
+ OpenCode and Pi.
133
+
134
+ A batch verifier takes several slices on one surface in one session: for
135
+ each branch it checks out the head, runs that slice's VERIFY, and records its
136
+ own `workit ledger verdict <result> --branch <b> --how "<evidence>"`. Every
137
+ verdict is keyed to that branch's head SHA; a slice whose head moves after
138
+ it needs a new one. Batch at most what fits one context, about 4 slices.
139
+
140
+ ## Review panel (high risk only)
141
+
142
+ At risk=high only, 2-3 fresh reviewers (call the skill tool with `workit-review`), each on a model
143
+ other than the author's (Claude Code: a different `model`), each records
144
+ `workit ledger verdict <result> --kind review --branch <b> --how "<findings>"`.
145
+ Land only when every panel verdict passes. Below high risk a panel costs
146
+ more than it finds.
147
+
148
+ ## Integration-branch fan-in (one PR)
149
+
150
+ Only when the user wants one PR for the whole fanout:
151
+
152
+ 1. Cut the integration branch (`workit git branch <integration> --base
153
+ <trunk>`) and plan with `"fanIn": "integration"` and `--trunk
154
+ <integration>`. Planning refuses integration mode on origin's default
155
+ branch.
156
+ 2. Every brief then tells the worker to merge the integration tip into its
157
+ branch before reporting (the fast-forward rule). That merge is the only
158
+ one a worker makes, and only in this mode.
159
+ 3. Land each verified slice with `git merge --ff-only <slice-branch>` in the
160
+ integration checkout. Not a fast-forward (the tip moved since the worker
161
+ merged)? Resume the worker to merge again; never a merge commit of your own.
162
+ 4. `workit fanout check` gates against the integration branch; a slice whose
163
+ tip is on it reads as landed. When all have landed, ship the integration
164
+ branch as one PR (call the skill tool with `workit-ship`).
165
+
166
+ ## Stacks
167
+
168
+ For stacked slices (`dependsOn` one parent): `workit stack plan <bottom> …
169
+ <top>` once, then `workit stack sync` and `workit stack land`.
@@ -0,0 +1,71 @@
1
+ ---
2
+ name: workit-implement
3
+ description: Build a requested change in small verified steps - follow local patterns, run real checks with workit check, prove it on the running app, hand verification to a non-author. Use for implement, build, add a feature, make the change, code it.
4
+ ---
5
+
6
+ # Implement and prove it works
7
+
8
+ ## Steps
9
+
10
+ 1. Read before writing: the files you will touch, their callers, and one
11
+ neighbour that already does something similar. Copy its patterns, names and
12
+ error handling. Repo rules (AGENTS.md, CLAUDE.md, lint config) win.
13
+ 2. On the default branch? Branch first: `workit git branch --kind feature --slug <s>` (host note: a Claude Code host-isolated worktree uses plain `git switch -c`).
14
+ Tracking it? Judge once: `workit policy assess --judge risk=normal behavior=yes
15
+ product-choice=no plan=no` (trivial and no for a mechanical fix). Already
16
+ judged? Cite the plan with `--ref <path>` or record the decision; don't re-judge.
17
+ 3. Small steps that each leave the tree green. Behavior change: write the
18
+ acceptance as Given/When/Then and see a test fail first (call the skill tool with `workit-bdd`).
19
+ Mechanical change: the existing checks are enough. No tautological tests:
20
+ a test must fail if the behavior breaks, never restate the implementation.
21
+ 4. Run the real checks, local-first: the targeted test or check for the file
22
+ you touched while you work, then the full configured set once at the end
23
+ (`workit check test`, plus `lint` and `typecheck` when the repo has them),
24
+ not after every edit. Heavy work runs under one machine-wide lease: an ad-hoc
25
+ suite is `workit check --heavy -- <cmd>`, never a hand-made flock; a busy
26
+ lease waits and names its holder (`workit lock status`). A tool warning is a finding: fix it in this PR in the right layer, or record the false positive with evidence; pre-existing ones get their own PR.
27
+ 5. Prove the feature on its real surface with the project's `verify-<app>`
28
+ skill; none yet? Write one (call the skill tool with `workit-verify-app`). Tests show branch behavior,
29
+ not that the feature works. The report carries what you observed: a UI
30
+ change a screenshot or console/network check (chrome devtools or
31
+ agent-browser), an API a quoted real response. App not runnable? Say so
32
+ plainly, never claim success.
33
+ 6. Commit: `workit git commit -m "<type>: <what>" -- <paths>` (or `--all`); Co-Authored-By goes in with `--trailer "Co-Authored-By: <name> <email>"`. Host note: a Workit worktree (`workit fanout worktree create`) takes `workit git --cwd <worktree> …`; a Claude Code host-isolated one (`.claude/worktrees/agent-<id>`) takes plain git (its SubagentStart text: isolation refuses a git wrapper). One file holding two changes: stage one change's hunks with `workit git stage --patch <file>` (a `git diff -- <file>` cut to them), then `workit git commit -m "<msg>" --staged` (exactly the index); a path staged in part commits only its staged hunks (`--whole` takes the file).
34
+ No endpoint named? Stop here and state the next command. Hand delivery to
35
+ ship, which pushes and opens the PR with its body shape (call the skill tool with `workit-ship`), only
36
+ when that was requested, or the request implies delivery and the effective
37
+ endpoint in `workit grant show` is `pr`, `green` or `merged`; `green` and
38
+ `merged` keep babysitting. Otherwise it is `commit`.
39
+ 7. Verify as far as the review lane asks (`workit policy assess`, `workit pr
40
+ status`). Lane none: no verdict. Lane self: after `workit check test` passes,
41
+ record `workit ledger verdict tests-verified --self --how "<what you ran>"`;
42
+ it reads self-reviewed, never verified, and is enough. Focused, full, high
43
+ risk or `verification: self|independent` merges: one fresh verifier per PR after the last push, its own host-derived session (Claude Code: the `verifier` agent with the `model` (and `effort`) of `workit models show --role verifier`; Codex:
44
+ the `verifier` agent; OpenCode: a child session; Pi: a supervised worker),
45
+ never a hand-minted id. Before saying done, reconcile
46
+ every named deliverable against the target checkout and observe it (for a push:
47
+ `workit verify-delivery push`).
48
+
49
+ Independent slices that could run in parallel: fan them out (call the skill tool with `workit-fanout`).
50
+ One `implementer` slice: `workit fanout worktree create <slice>` before spawning,
51
+ then `workit fanout brief <slice>`; no host isolation (Workit's hooks confine it).
52
+
53
+ Stay inline by default (workspace `delegation: inline-first`). Hand work off
54
+ only past the thresholds: an explorer after about 3 tool calls or 10k tokens
55
+ of searching, parallel writers for 2 or more disjoint units of about 100+
56
+ lines each.
57
+
58
+ ## Example
59
+
60
+ Bad: "Done - added the --since flag, tests pass." (no check ran this turn; the
61
+ flag was never invoked)
62
+
63
+ Good: "Added `--since`. measured: `workit check test` exit 0;
64
+ `mytool log --since 2d` printed 3 entries against the fixture repo. inferred:
65
+ the GitLab path behaves the same (not run). Handed to the verifier agent."
66
+
67
+ ## Check
68
+
69
+ ```sh
70
+ workit check test # then, when the endpoint was a push or beyond: workit verify-delivery push
71
+ ```
@@ -0,0 +1,72 @@
1
+ ---
2
+ name: workit-retro
3
+ description: Find repeated friction in recent sessions; propose cited fixes ranked by enforcer strength, never applied. Use for retro.
4
+ disable-model-invocation: true
5
+ ---
6
+
7
+ # Retro: turn repeated friction into enforcers
8
+
9
+ User-invoked: offer it, never start it yourself. Run it after a session, PR,
10
+ stack or fan-in, including ones that went well; a smooth session still shows
11
+ where agents searched too long, worked around a tool or re-ran a check. Retro
12
+ proposes and stops. Nothing changes until the user approves.
13
+
14
+ 1. **Scope.** Default: this repository's work since the last retro (its
15
+ `retro:` row in `workit ledger list --type decision`), else the last ~10
16
+ sessions. State the window in one line.
17
+ 2. **Read through workit, cheapest first.** Every finding cites these:
18
+ - `workit ledger list --last 200`: rulings, failed/self verdicts, handoffs,
19
+ check runs, CI reruns, `skill.loaded` rows (skipped skills: routing).
20
+ - `workit pr status --pr <n>` for each recent PR: threads, failing checks.
21
+ - `git log --oneline -50`, plus reverts and fixups after review.
22
+ - `workit knowledge lint`: today's AGENTS.md and need-based files.
23
+ - Session transcripts **only if the user opts in**, and only this
24
+ workspace's (`references/sources.md`). Never read other projects.
25
+
26
+ Cite by location (ledger row, PR, commit, session file and line). Never
27
+ copy secrets, tokens or personal data from any source into the report.
28
+ 3. **Group into classes.** Navigation cost (many searches before the right
29
+ file, a stale doc followed), repeated mistakes, workarounds (a hand-run
30
+ command where a verb exists, a skipped step), unstable checks (the same
31
+ `workit check <name>` red then green with no change). A class needs **2 or
32
+ more cited occurrences**; a one-off is not a learning.
33
+ 4. **Name the strongest enforcer that works**, strongest first: architecture
34
+ or types (the mistake cannot be written) > lint rule > configured check
35
+ (`.workit/checks.json`, `workit check <name>`) or CI job > test >
36
+ `CODING_STANDARDS.md` (judgment the reviewer reads) > AGENTS.md pointer
37
+ (navigation only). A mechanical rule gets a check, not prose: a check can
38
+ fail, a sentence cannot. From types to test, the proof is that the new
39
+ enforcer fails on the cited past mistake. A rule whose mistake can no
40
+ longer happen is deleted.
41
+ 5. **Upstream.** Friction a workit skill, verb or hook caused, or a rule for
42
+ agent behaviour, becomes an issue or PR on BrainerVirus/workit, not a host
43
+ memory (one host reads it). Never fork a local copy. Use a minimal synthetic
44
+ repro: no private repo name, path, code, ledger text, PR, thread or transcript.
45
+ Show the exact draft; once approved: `workit issue create --repo BrainerVirus/workit`.
46
+ 6. **Bloat guards.** AGENTS.md stays within 8 KB: each addition names what it
47
+ removes. Create `CODING_STANDARDS.md` or `GLOSSARY.md` only in the same
48
+ edit as its first real entry, never as a scaffold. Edit steering text by
49
+ `references/steering.md`; `workit knowledge lint` passes after the slice.
50
+ 7. **Report one ranked list, then stop** (save it under `workit dir retros`):
51
+ Accepted (proposed), Backlog, Dropped, each with its citations, enforcer
52
+ and reason. Each approved item becomes a slice to build (call the skill tool with `workit-implement`)
53
+ and ship (call the skill tool with `workit-ship`), a tracker issue, or `.out-of-scope/<concept>.md` when
54
+ rejected and likely to return. Record the user's answer so the next retro
55
+ starts there: `workit ledger decision "retro: <accepted ids>" --why "<window>"`.
56
+
57
+ ## Example
58
+
59
+ Bad: "Agents seem lost in the build. Added 'read the build docs carefully' to
60
+ AGENTS.md." One vague occurrence, no citation, a no-op line, auto-applied.
61
+
62
+ Good: "Navigation, 3 occurrences (rulings 12, 19; PR #88 thread): agents sought
63
+ check names in package.json, missing `.workit/checks.json`. Enforcer: AGENTS.md
64
+ pointer, +74 bytes, minus the stale Commands paragraph (-210). Unstable check,
65
+ 2 occurrences (ledger rows 31, 44: `e2e` red then green on one SHA): a debug
66
+ slice to fix the check. Approve?"
67
+
68
+ ## Check
69
+
70
+ ```sh
71
+ workit knowledge lint # exit 0 before and after each approved slice
72
+ ```
@@ -0,0 +1,3 @@
1
+ # Codex: user-invoked only (the counterpart of disable-model-invocation).
2
+ policy:
3
+ allow_implicit_invocation: false
@@ -0,0 +1,35 @@
1
+ # Session transcripts (opt-in, this workspace only)
2
+
3
+ Transcripts are the most expensive source and can hold private material. Read
4
+ them only after the user says yes to a question such as "Also read the last 10
5
+ session transcripts for this workspace? (local files, read-only)". The default
6
+ is no: the ledger, `pr status` and git are enough for most retros.
7
+
8
+ ## Where they live
9
+
10
+ Typical locations; confirm each exists. Resolve the path from this workspace's
11
+ absolute path, never with a wildcard across projects. If a host's layout
12
+ differs from the one below, say so and skip it rather than search wider.
13
+
14
+ | Host | Location |
15
+ | --- | --- |
16
+ | Claude Code | `~/.claude/projects/<folder>/*.jsonl`, one folder per path from `git worktree list`: the absolute path with every `/` and `.` replaced by `-`. Compute each folder name; never glob for it |
17
+ | Codex | `~/.codex/sessions/YYYY/MM/DD/rollout-*.jsonl`. To filter, parse only line 1 (`session_meta`) and read only its `cwd` field; skip files whose `cwd` is not this workspace without reading or reporting anything else from them |
18
+ | Cursor | `~/.cursor/projects/<workspace slug>/agent-transcripts/` |
19
+ | Pi | `~/.pi/agent/sessions/--<workspace path, / replaced by ->--/*.jsonl` |
20
+ | OpenCode | this project's sessions from `opencode session list`, read with `opencode export <id>` |
21
+
22
+ Linked worktrees of the same repository count as this workspace; other
23
+ repositories never do.
24
+
25
+ ## How to read them
26
+
27
+ - Newest first, at most the agreed number of sessions.
28
+ - On a host with subagents, one read-only analyst per lens, each returning
29
+ only cited occurrences (session file plus line or message index):
30
+ - navigation: searches and reads before the right file was found, stale docs
31
+ followed;
32
+ - tool economy: hand-run commands where a `workit` verb exists, repeated
33
+ reads of the same file, long outputs nobody used;
34
+ - repeated work: the same fix or check redone, a step undone later;
35
+ - request conflicts: instructions the agent had to reconcile or ask about.
@@ -0,0 +1,39 @@
1
+ # Editing steering text (AGENTS.md, CODING_STANDARDS.md, skills)
2
+
3
+ Steering text is paid for on every session that reads it. Each line must
4
+ change what an agent does; everything else is cost.
5
+
6
+ ## Write
7
+
8
+ - **Point, do not copy.** Link the file or name the command; never paste its
9
+ content. A pointer says when to follow it: "Read before editing a hook:
10
+ `docs/agents/hosts.md`".
11
+ - **Say what done looks like.** "Run `bun run check`; it must exit 0" beats
12
+ "make sure everything works".
13
+ - **Concrete over adjectives.** A command, a path, a number. Prefer the action
14
+ to take over a list of things to avoid.
15
+ - **One rule, one home.** A rule with an enforcer (type, lint, check, test)
16
+ appears in steering text at most as a pointer to that enforcer. The same
17
+ sentence in AGENTS.md and CODING_STANDARDS.md is a defect
18
+ (`duplicate-rule`).
19
+ - **Judgment goes to CODING_STANDARDS.md**, which the reviewer reads; only
20
+ navigation goes to AGENTS.md.
21
+
22
+ ## Cut
23
+
24
+ - **No-ops.** Delete lines that would not change any behavior if removed:
25
+ "be thorough", "write clean code", "keep it concise", "follow best
26
+ practices".
27
+ - **Session residue.** No notes about one session, no implementation detail
28
+ the code already shows, no `path:line` references (they go stale).
29
+ - **Dead rules.** A rule whose mistake can no longer happen (a type or check
30
+ now prevents it) is deleted, not kept "for context".
31
+
32
+ ## Budget
33
+
34
+ - AGENTS.md stays within 8 KB (`workit knowledge lint`, rule
35
+ `agents-budget`). A proposal that adds text names what it removes, or shows
36
+ the byte count still holds.
37
+ - A need-based file (`CODING_STANDARDS.md`, `GLOSSARY.md`) is created in the
38
+ same edit as its first real entry. Headers-only or "TBD" files fail the lint
39
+ (`scaffold-file`).
@@ -0,0 +1,66 @@
1
+ ---
2
+ name: workit-review
3
+ description: Independent review of a diff, branch or PR - intent fidelity and standards as separate axes, test quality, blast radius - recorded as a non-author verdict. Use for review, code review, check this PR or MR, is this safe, blast radius.
4
+ ---
5
+
6
+ # Review independently
7
+
8
+ Review the candidate, never the author's summary of it. A session that wrote a
9
+ commit on the branch cannot record a passing verdict: if that is you, hand the
10
+ review to a fresh agent with its own host-derived session: Claude Code and
11
+ Codex, the `reviewer` or `verifier` agent (`--session` and `--token` from SubagentStart);
12
+ OpenCode, a child session; Pi, a supervised worker. On Claude Code pass the
13
+ `model` and `effort` of `workit models show --role <verifier|reviewer>`. Never hand-mint one such
14
+ as `<lead>-v1`: it is refused as `forged_session`.
15
+ An author's `--self` verdict reads self-reviewed and never counts as
16
+ independent; `type-check-only` never proves a behavior change.
17
+ Depth follows the review lane in `workit pr status`: focused reads the diff and
18
+ runs its tests; full also drives the real surface (verify-<app>). Review once
19
+ per PR after its last push; a second pass on an unchanged head is waste.
20
+ A stale verdict showing `reverify: focused (<files>)` in `workit pr status`: re-check only
21
+ those files since the judged head and reuse green CI there (no fresh install, no full suite).
22
+
23
+ 1. Pin the candidate: `git rev-parse HEAD`, the base, `git diff <base>...HEAD`;
24
+ for a PR, `workit pr status --json` (checks, unresolved threads).
25
+ 2. Find the intent: acceptance criteria, spec, PR body, and the recorded
26
+ choices (`workit ledger list --type decision`).
27
+ 3. Judge two axes separately, never merged or re-ranked:
28
+ - **Spec:** does the diff do what the acceptance says? Missing, creep or
29
+ wrong; quote the line.
30
+ - **Standards:** repo rules first (`CODING_STANDARDS.md` when present),
31
+ then a smell baseline (unclear name, long function, duplicated logic,
32
+ leaky abstraction). Judgment only; lint owns nits.
33
+ 4. **Tests:** run suites under the heavy-check lease (`workit check test`,
34
+ `workit check --heavy -- <cmd>`); `workit test-audit --diff`. Would each new test fail if the
35
+ behavior broke? Triage the findings (call the skill tool with `workit-test-audit`). Every configured check (`packaging`
36
+ too) needs a run or green CI on the head, or `verified` is refused: see `pr status`.
37
+ 5. **Blast radius:** for each touched contract, caller, config or migration,
38
+ state the one fact it is safe because of and run the proof. Anything
39
+ unproven is labeled UNPROVEN, never assumed safe: `references/impact.md`.
40
+ 6. Each finding: file:line, severity (blocker, major, minor, nit), evidence
41
+ (hunk, test or command output), concrete fix. Introduced issues get fixed;
42
+ pre-existing ones become follow-ups; inconclusive ones escalate.
43
+ 7. Record the verdict:
44
+ `workit ledger verdict verified|failed|blocked --kind review --branch <b> --how "<what you ran and read>"`
45
+ under your own session (the one the lead or the hook gave you).
46
+ 8. **Bound the loop.** A failed verdict gets one fix round and one recheck of
47
+ the changed hunks. Still failing, or stuck: no third round; the lead spawns
48
+ a decider (call the skill tool with `workit-fanout`). A product choice goes to the user.
49
+ 9. **Harness note** (optional): friction caused by the repo or harness, not
50
+ the change (a flaky fixture, a missing check, a misleading doc or skill
51
+ line), goes on its own `Harness note:` line in the report and any PR
52
+ comment, never as a finding or in the verdict, so a later retro finds it.
53
+
54
+ ## Example
55
+
56
+ Bad: "Error handling could be improved." (no place, no consequence, no proof)
57
+
58
+ Good: "blocker - src/pay.ts:88: `catch {}` swallows the gateway's 402, so the
59
+ order is marked paid. Repro: `workit check -- bun test pay.test.ts -t declined`
60
+ fails with this diff. Fix: rethrow `PaymentDeclined`."
61
+
62
+ ## Check
63
+
64
+ ```sh
65
+ workit ledger check --pr <n> # accepted only when current, passing and independent
66
+ ```
@@ -0,0 +1,24 @@
1
+ # Blast radius beyond the diff
2
+
3
+ A small diff is not a small risk. For every surface the change touches, name
4
+ the one fact it is safe because of and run the proof.
5
+
6
+ 1. List what the change touches: exported symbols and every caller
7
+ (`git grep -nw <symbol>`), shared state, wire or file formats, config keys,
8
+ migrations, CLI flags and outputs, public types.
9
+ 2. For each: the fact it is safe because of (a type boundary, an existing test
10
+ that covers the path, an unreachable branch, a version gate) and the command
11
+ that proves it.
12
+ 3. Run the proofs with `workit check -- <cmd>` so the result is observed.
13
+ 4. Anything you could not prove is a finding labeled UNPROVEN with what would
14
+ prove it. Never fold it into "looks safe".
15
+ 5. A fix belongs at the shared root (one guard that every caller passes
16
+ through), not copied per caller.
17
+
18
+ Example note:
19
+
20
+ | Surface | Safe because | Proof |
21
+ | --- | --- | --- |
22
+ | `parseRange()` (4 callers) | callers pass validated input; new branch only for `--since` | `workit check -- bun test range.test.ts` exit 0 |
23
+ | `config.json` `since` key | additive, old readers ignore unknown keys | `workit check -- bun test config-compat.test.ts` exit 0 |
24
+ | GitLab adapter | UNPROVEN - no fixture for relative dates | add a `gitlab/relative-since.json` fixture |
@@ -0,0 +1,71 @@
1
+ ---
2
+ name: workit-shape
3
+ description: Shape work before building - brainstorm, grill open choices with a recommended answer, challenge weak premises, slice into PRs, propose a spec/ADR only when it pays. Use for brainstorm, plan, spec, design, options, should we, grill me.
4
+ ---
5
+
6
+ # Shape the work
7
+
8
+ You own the facts; the user owns the choices. Read, run or prototype anything
9
+ observable before you ask. Skip all of this for a precise, settled request.
10
+
11
+ ## 1. Classify out loud
12
+
13
+ - **Spike** (can we / how does it work): answer with evidence. No files.
14
+ - **Bounded** (change to an existing flow): a short design in chat, then build.
15
+ - **Architectural** (new subsystem or interface, cross-repo, hard to reverse):
16
+ grill, then propose a record. Start light; escalate when a trigger fires.
17
+
18
+ ## 2. Challenge gently, first
19
+
20
+ Challenge an unverified premise first; grill on the next turn, once it
21
+ settles. Say you will check, then check. Right? Say so. Wrong? Name what makes
22
+ sense in the idea, explain why it fails with evidence, and show the better way
23
+ with an example. At most one high-stakes assumption per turn: ask that one
24
+ question, then stop and wait. If you were wrong, say so with the proof. The
25
+ teaching tone stays in chat; code, commits and docs stay plain.
26
+
27
+ ## 3. Diverge, then grill
28
+
29
+ Several viable approaches? Lay out two or three genuinely different ones (no
30
+ strawmen) with benefit, cost or risk, when each fits, and the smallest check
31
+ that settles it; recommend one. Then ask the whole frontier of open decisions
32
+ (every one whose prerequisites are settled), numbered, each with your answer:
33
+ `Q1 - <title>: <question>. Recommended: <answer>, because <evidence>.`
34
+ Dependent questions wait for the next round. If an authorized, reversible
35
+ default works, state it and proceed. Done when the frontier is empty and
36
+ nothing was silently assumed.
37
+
38
+ ## 4. Durable knowledge only when it pays
39
+
40
+ Propose a record (never create one silently) when a trigger fires or the user
41
+ asks: a spec for multi-slice, cross-repo or open-product-choice work; an ADR for
42
+ a choice that is hard to reverse, surprising and a real trade-off; a glossary
43
+ entry for a term you had to resolve; `.out-of-scope/<concept>.md` for a rejected
44
+ request that will come back. A one-file mechanical fix gets none. Formats and
45
+ triggers: `references/knowledge.md`. Record each settled choice once:
46
+ `workit ledger decision "<what>" --why "<why>"`; cite a plan: `workit policy assess --ref <path>`.
47
+
48
+ ## 5. Slice as tracer bullets
49
+
50
+ Each slice is a thin path through every layer, verifiable alone, one PR, one
51
+ context window. Acceptance is Given/When/Then; make it tests (call the skill tool with `workit-bdd`).
52
+ Dependent slices stack (`workit stack plan <bottom> ... <top>`); fan out
53
+ independent ones (call the skill tool with `workit-fanout`). Plans record decisions, not code, in a file
54
+ under `workit dir plans` (`references/slicing.md`). Diagrams and UI sketches
55
+ only when they settle a choice: `references/diagrams.md`, `references/mockups.md`.
56
+
57
+ Authorized to build? Continue into the build (call the skill tool with `workit-implement`). Do not ask
58
+ for a separate plan approval or repeat "continue?".
59
+
60
+ ## Example
61
+
62
+ Bad: "Should the cache use Redis or Postgres?" (the agent never looked).
63
+ Good: "Q1 - Cache store: the stack already runs Postgres 16 (compose.yml) and
64
+ peak load is ~50 rps (measured: last week's metrics export). Recommended: a
65
+ Postgres table with a TTL column, because it adds no new service."
66
+
67
+ ## Check
68
+
69
+ ```sh
70
+ workit ledger list --type decision # every settled choice is recorded
71
+ ```
@@ -0,0 +1,17 @@
1
+ # Diagrams: only when one argues a decision
2
+
3
+ Tables first, ASCII trees second, Mermaid only when a flow or architecture
4
+ needs it. Flowchart, sequence, state or ER only. No renderer, no network.
5
+
6
+ ## Mermaid rules (v11)
7
+
8
+ - Fence as ```` ```mermaid ```` with no prose inside the fence.
9
+ - Quote labels containing punctuation: `A["input (x, y)"]`.
10
+ - One direction per diagram (`TD` or `LR`); under twelve nodes.
11
+ - Name actors exactly as the code names them.
12
+
13
+ ## Verify by reading
14
+
15
+ Balanced quotes and brackets, every node reachable, labels match the spec's
16
+ terms. If it cannot be verified by reading, delete it. One diagram that argues
17
+ a decision, or none; never a diagram suite.
@@ -0,0 +1,61 @@
1
+ # Durable knowledge: when and how
2
+
3
+ Default: nothing durable. Conversation, the ledger (`workit ledger`) and the
4
+ code carry most work. Propose a record only when a trigger below fires or the
5
+ user asks for one, say which trigger fired, and let the user decline.
6
+
7
+ | Record | Trigger | Where |
8
+ | --- | --- | --- |
9
+ | Spec | more than one slice, crosses repos, or an open product choice a future reader must know | `docs/<topic>/spec.md` |
10
+ | Plan | more than one slice with dependencies, or work that will be resumed by someone else | `docs/<topic>/plan.md`, next to the spec |
11
+ | ADR | the choice is hard to reverse **and** surprising **and** a real trade-off (all three) | `docs/adr/NNNN-<slug>.md` |
12
+ | Glossary entry | a project term was ambiguous and you resolved it | `GLOSSARY.md` (create lazily) |
13
+ | Coding standard | a judgment-call rule a reviewer must check, recurring twice, found by workit-retro; a mechanical rule gets a check instead | `CODING_STANDARDS.md` (create lazily) |
14
+ | Out of scope | a request was rejected and is likely to come back | `.out-of-scope/<concept>.md` |
15
+
16
+ Never: a spec for a one-file mechanical fix, a plan that restates the spec,
17
+ file paths or line numbers in a spec (they go stale), a glossary entry for a
18
+ general programming term.
19
+ Create a lazy file only in the same edit as its first real entry, never as a
20
+ headers-only or TBD scaffold (`workit knowledge lint` flags one).
21
+
22
+ ## Spec (scaled to the work)
23
+
24
+ ```md
25
+ # <Topic> - spec
26
+ ## Problem (what hurts, for whom, with evidence)
27
+ ## Decisions (table: # | decision | why; link ledger rows)
28
+ ## Behavior (Given/When/Then, one line each; these become test names)
29
+ ## Out of scope
30
+ ```
31
+ Add `## Design` only for architectural work, and a diagram only when it argues
32
+ a decision.
33
+
34
+ ## Plan
35
+
36
+ Decisions, not code: per slice the branch, what it touches, its acceptance
37
+ lines, how it is verified, and what it depends on. A plan several times longer
38
+ than its spec is a transcript; cut it.
39
+
40
+ ## ADR
41
+
42
+ ```md
43
+ # NNNN <decision in a few words>
44
+ Status: accepted (YYYY-MM-DD)
45
+ <1-3 sentences: the context, the choice, the trade-off accepted.>
46
+ Considered: <option> - <why not>.
47
+ ```
48
+
49
+ ## Glossary entry
50
+
51
+ ```md
52
+ **Verdict** - an independent pass/fail judgment on a branch head, recorded in the ledger.
53
+ _Avoid_: approval, sign-off.
54
+ ```
55
+ One or two sentences, project terms only, no implementation detail.
56
+
57
+ ## Out of scope
58
+
59
+ One file per concept: the request, why it was declined, what would change the
60
+ answer, links to the issues that asked for it. Check this directory before
61
+ grilling a request that sounds familiar.
@@ -0,0 +1,15 @@
1
+ # ASCII mockups before UI code
2
+
3
+ Sketch, don't build. At most three genuinely different layout hypotheses,
4
+ ASCII only, no code.
5
+
6
+ 1. Fix a legend (`┌─┐ │ └─┘ ░ ≈ [ ] ( )`); keep sketches 60-80 columns and
7
+ 8-20 rows.
8
+ 2. Per hypothesis: regions, which existing components are reused (by their
9
+ real names) and which are new, the empty/loading/populated/error states,
10
+ and where navigation goes.
11
+ 3. Recommend one. Ask at most one question, then stop. Say when ASCII cannot
12
+ settle it (density, motion, brand) and a hi-fi prototype is needed.
13
+
14
+ The sketch and the chosen option go into the spec only if a spec exists;
15
+ otherwise they stay in the conversation.