@brainervirus/workit-claude-code 7.3.0 → 7.5.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brainervirus/workit-claude-code",
3
- "version": "7.3.0",
3
+ "version": "7.5.0",
4
4
  "private": false,
5
5
  "description": "Workit Claude Code plugin — session and per-turn task context, branch policy on git shell commands, workit method skills, and verifier/reviewer/implementer agents",
6
6
  "keywords": [
@@ -39,8 +39,8 @@
39
39
  "build": "bun scripts/build.ts"
40
40
  },
41
41
  "devDependencies": {
42
- "@brainervirus/workit-cli": "^7.3.0",
43
- "@brainervirus/workit-core": "^7.3.0"
42
+ "@brainervirus/workit-cli": "^7.5.0",
43
+ "@brainervirus/workit-core": "^7.5.0"
44
44
  },
45
45
  "engines": {
46
46
  "node": ">=24"
@@ -14,30 +14,30 @@ ceremony; do it yourself.
14
14
  per slice an id, branch, TIER, the file-scope manifest (SCOPE globs),
15
15
  `owns` for shared files (lockfile, registry, barrels), `dependsOn` only for
16
16
  a real dependency (independent PRs off trunk are the default), and the
17
- brief fields. `workit fanout plan <plan.json>` refuses an empty brief field
18
- (exit 2) and two slices that may write one file (exit 3) with a fix: an
19
- owner for a shared file, or a dependency that serializes them. Apply it and
20
- re-run: refuse to spawn while a field is empty or the plan is refused.
21
- Its `waves` say which slices may run together; keep 4-6 in flight.
17
+ brief fields. `workit fanout plan <plan.json>` refuses an empty or
18
+ placeholder (`<goal>`, `TBD`) brief field (exit 2) and two slices that may
19
+ write one file (exit 3) with a fix: an owner for a shared file, or a
20
+ dependency that serializes them. Apply it and re-run: refuse to spawn while
21
+ a field is empty or the plan is refused. Its `waves` say which slices may
22
+ run together; keep 4-6 in flight.
22
23
  2. **Brief each worker** from its slice with the fixed template: GOAL, SCOPE,
23
24
  CONTEXT (pointers, not pasted text), ACCEPTANCE (Given/When/Then), VERIFY
24
- (exact commands), TIER, TIMEBOX, FORBIDDEN, REPORT, STANDING. STANDING is
25
- every standing order and user directive so far, pasted verbatim into each
26
- spawn and respawn, because directives decay across resumes.
25
+ (exact commands), TIER, TIMEBOX, SCRATCH, FORBIDDEN, REPORT, STANDING.
26
+ STANDING is every standing order and user directive so far, pasted
27
+ verbatim into each spawn and respawn: directives decay across resumes.
27
28
  3. **Spawn all workers in one message**, in the background, each in its own
28
- worktree (Claude Code: the `implementer` agent; elsewhere
29
- `git worktree add --detach ../<repo>-wt/<slug> origin/<base>`). The first
30
- command a worker runs is `workit git branch <branch> --base <base>`.
31
- 4. **Judge liveness by side effects only:** new commits and pushes
32
- (`git log <branch>`), PR and check changes (`workit pr status --branch <b>`).
33
- No progress past the timebox means stuck. Stop the old worker and observe
34
- that it exited (a timeout is not proof). `git worktree remove --force`
35
- drops its uncommitted changes, so first record `git -C <wt> status --short`
36
- in the ledger or your report; only then remove the worktree. Respawn with
37
- the brief in `MODE: resume` (original, later directives, its last report):
38
- the new worker runs `git switch <branch>` in its fresh worktree instead of
39
- `workit git branch`. Never two live workers on one branch. Replace at most
40
- twice, then re-slice or report the gap. Never chain resumes.
29
+ worktree: Claude Code's `implementer` agent (first command `workit git
30
+ branch <branch> --base <base>`); elsewhere `workit fanout worktree create
31
+ <slice>`, which prints the SCRATCH dir. Refill from `fanout status`.
32
+ 4. **Judge liveness by side effects only:** `workit fanout status` (head age,
33
+ PR, CI, verdict, landed; STUCK past the TIMEBOX, default 30 min). Stop a
34
+ stuck worker and observe that it exited (a timeout is not proof). Removing
35
+ a worktree drops its uncommitted changes: `workit fanout worktree release
36
+ <slice>` records `git status` in the ledger first and refuses them without
37
+ `--force` (native worktrees: record `git -C <wt> status --short` first).
38
+ Respawn in `MODE: resume` (brief, directives, last report), same branch.
39
+ Never two live workers on one branch. Replace at most twice, then re-slice
40
+ or report the gap. Never chain resumes.
41
41
  5. **Verify each slice independently.** A fresh agent that did not write it
42
42
  (Claude Code: the `verifier` agent) runs VERIFY and verify-<app>, then
43
43
  `workit ledger verdict <result> --branch <b> --how "<evidence>"` under the
@@ -47,12 +47,12 @@ ceremony; do it yourself.
47
47
  6. **Fan in** with `workit fanout check`: out-of-scope files (any file outside
48
48
  it stops the fan-in), and `git merge-tree` conflicts with trunk and between
49
49
  siblings, charged to the slice that lands later. Fix what it names (an
50
- out-of-scope edit becomes a follow-up slice) until it exits 0. A landed
51
- slice reads as not found: re-plan without it and drop it from dependents'
52
- `dependsOn`. Then `workit ledger check --branch <b>` per slice; land in its
53
- order. Stacked slices: `workit stack plan <bottom> … <top>` once, then
54
- `workit stack sync` and `land`. Only you touch topology: workers never
55
- rebase, retarget or merge. Then workit-ship.
50
+ out-of-scope edit becomes a follow-up slice) until it exits 0. A slice
51
+ whose PR merged reads as landed; its dependents stop waiting. Then
52
+ `workit ledger check --branch <b>` per slice, land in `fanout status` order
53
+ and release the worktrees you made. Stacks: `workit stack plan <bottom> …
54
+ <top>` once, then `stack sync` and `land`. Only you touch topology: workers
55
+ never rebase, retarget or merge. Then workit-ship.
56
56
 
57
57
  ## Example
58
58
 
@@ -14,6 +14,7 @@ ACCEPTANCE:
14
14
  VERIFY: <exact commands, e.g. `workit check test`, the verify-<app> feature to drive>
15
15
  TIER: <mundane | standard | hard: how much model the slice needs>
16
16
  TIMEBOX: <wall clock or turn budget; past it without a new commit you will be replaced>
17
+ SCRATCH: <your own temp dir: the one `fanout worktree create` printed, else `mktemp -d`; never a shared path>
17
18
  FORBIDDEN: <no edits outside SCOPE; no rebase, retarget, merge or force-push; no new dependencies; ...>
18
19
  REPORT: branch, head SHA, files changed, each VERIFY command with its exit code,
19
20
  each ACCEPTANCE line met / not met, rulings you made (`workit ledger ruling`),
@@ -37,6 +38,7 @@ ACCEPTANCE:
37
38
  VERIFY: `workit check test`; verify-api feature "usage"
38
39
  TIER: standard
39
40
  TIMEBOX: 45 minutes
41
+ SCRATCH: ../app-wt/usage-endpoint/.workit-scratch
40
42
  FORBIDDEN: no edits outside SCOPE; no schema migration; no rebase or force-push; no new packages
41
43
  REPORT: as in the template
42
44
  STANDING: conventional commits; no comments that restate code; ask nothing, record rulings instead
@@ -50,7 +52,9 @@ verify, forbidden must be filled; tier is mundane, standard or hard). `base`
50
52
  defaults to the trunk, or to the branch of a single `dependsOn` slice (a
51
53
  stack); `worktree` defaults to `../<repo>-wt/<id>`. `owns` claims a shared
52
54
  file another slice's glob also matches. Globs that match no file yet are compared
53
- through a sample path. Escape literal brackets: `"app/\\[id\\]/page.tsx"`.
55
+ through a sample path. Use `/` as the separator; a backslash only escapes
56
+ literal brackets: `"app/\\[id\\]/page.tsx"`. A `timebox` such as `45 minutes`
57
+ is the slice's STUCK threshold in `workit fanout status`.
54
58
 
55
59
  ```json
56
60
  {
@@ -0,0 +1,72 @@
1
+ ---
2
+ name: 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 (ambiguities the agent had to
19
+ settle), failed or self verdicts, handoffs, check runs, CI reruns.
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.** When a workit skill, verb or hook caused the friction,
42
+ propose an issue or PR on BrainerVirus/workit. Never fork a local copy.
43
+ The issue shows the workit behavior in a minimal synthetic reproduction:
44
+ no private repo name, path, code, ledger text, PR or thread quote, or
45
+ transcript. Show the exact draft body; file it only after the user approves.
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:** Accepted (proposed), Backlog,
51
+ Dropped, each with its citations, enforcer and reason. Each approved item
52
+ becomes a normal slice (workit-implement, then workit-ship), a tracker
53
+ issue, or `.out-of-scope/<concept>.md` when rejected and likely to return.
54
+ Record the user's answer so the next retro starts there:
55
+ `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`).
@@ -18,8 +18,9 @@ independent; `type-check-only` never proves a behavior change.
18
18
  3. Judge two axes separately, never merged or re-ranked:
19
19
  - **Spec:** does the diff do what the acceptance says? Missing, creep or
20
20
  wrong; quote the line.
21
- - **Standards:** repo rules first, then a smell baseline (unclear name, long
22
- function, duplicated logic, leaky abstraction). Judgment only; lint owns nits.
21
+ - **Standards:** repo rules first (`CODING_STANDARDS.md` when present),
22
+ then a smell baseline (unclear name, long function, duplicated logic,
23
+ leaky abstraction). Judgment only; lint owns nits.
23
24
  4. **Tests:** `workit test-audit --diff`. Would each new test fail if the
24
25
  behavior broke? Triage with workit-test-audit.
25
26
  5. **Blast radius:** for each touched contract, caller, config or migration,
@@ -10,11 +10,14 @@ user asks for one, say which trigger fired, and let the user decline.
10
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
11
  | ADR | the choice is hard to reverse **and** surprising **and** a real trade-off (all three) | `docs/adr/NNNN-<slug>.md` |
12
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 (workit-retro); a mechanical rule gets a check instead | `CODING_STANDARDS.md` (create lazily) |
13
14
  | Out of scope | a request was rejected and is likely to come back | `.out-of-scope/<concept>.md` |
14
15
 
15
16
  Never: a spec for a one-file mechanical fix, a plan that restates the spec,
16
17
  file paths or line numbers in a spec (they go stale), a glossary entry for a
17
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).
18
21
 
19
22
  ## Spec (scaled to the work)
20
23
 
@@ -53,7 +53,8 @@ the base keeps moving, or after 3 failed fix attempts on the same check.
53
53
  6. **Verified.** After the last push a non-author records a verdict
54
54
  (workit-review); `pr status` showing self-reviewed is not verified. Land only when granted: `workit stack land` (the
55
55
  contiguous verified run from the root) or `workit pr merge`.
56
- 7. **Observe it landed:** `workit verify-delivery pr` or `merge`.
56
+ 7. **Observe it landed:** `workit verify-delivery pr` or `merge`. At any endpoint
57
+ (stack land, fan-in too), after a failed verdict or a check red 3+ times: offer `/wk-retro`.
57
58
 
58
59
  ## Example
59
60