@cmgmyr/hive 1.7.0 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -47,7 +47,7 @@ The user may want more than one profile - a simple one and an orchestration one,
47
47
 
48
48
  ## Start small; editing is how a profile grows
49
49
 
50
- A first profile carries only what this interview actually surfaced. A new simple profile is `posture.md` plus a short `runbook.md` written from the confirmed answers - not a copy of anything thicker. A new orchestration profile fills in the shipped orchestration template's placeholders from those same answers; it does not add sections nobody asked for. Depth comes from running this skill again later to edit, not from a bigger first pass. Do not add a mandatory extra `.md` file, a review tool, or a tracking artifact that nobody's answer called for.
50
+ A first profile carries only what this interview actually surfaced. A new simple profile is `posture.md` plus a short `runbook.md` written from the confirmed answers - not a copy of anything thicker. A new orchestration profile starts from the shipped orchestration files as they are. That base already says the lead assigns todo ids, supervises and accepts, and a worker never completes its own todo. The runbook spells out lanes, the brief, scope, worktrees, shared resources, checks, review, permissions, waiting, the context checkpoint, handback and record, closing a lane and cold boot, and the posture sets the model tiers, so do not interview for any of them. The interview only fills its optional vars from confirmed answers and edits a rule the user wants changed; it does not add sections nobody asked for. Depth comes from running this skill again later to edit, not from a bigger first pass. Do not add a mandatory extra `.md` file, a review tool, or a tracking artifact that nobody's answer called for.
51
51
 
52
52
  ## Converge, then confirm once
53
53
 
@@ -82,7 +82,11 @@ An edit changes only the rule that was discussed and any dependent instruction t
82
82
 
83
83
  ## Route project facts into `hive.yml` `vars`, not prose
84
84
 
85
- A command, a repository name, a ticket prefix: these belong in `hive.yml` `vars` and get referenced from the profile as `{{var}}`, not hard-coded into the generated `posture.md`/`runbook.md`/`worker.md` text. This is what lets one profile serve several projects. `references/interview.md` lists the `hive.yml` keys and var names this skill knows how to write, and which existing shipped vars (`check`, `repo`, `install`, `ticket_prefix`, `start_command`) to reuse before introducing a new one.
85
+ A command, a repository name, a ticket prefix: these belong in `hive.yml` `vars` and get referenced from the profile as `{{var}}`, not hard-coded into the generated `posture.md`/`runbook.md`/`worker.md` text. This is what lets one profile serve several projects. `references/interview.md` lists the `hive.yml` keys and var names this skill knows how to write. The shipped orchestration profile renders these optional vars: `check`, `install`, `repo`, `ticket_prefix`, `start_command`, `test_command`, `suite_command`, `verify_command`, `review_command` and `worker_model`. Offer one only when the interview confirmed its value, and leave the rest unset: an unset var drops its section, and nothing makes the user fill every one.
86
+
87
+ ## Worked examples, only on request
88
+
89
+ `references/examples/README.md` indexes two worked examples: one orchestration profile rendered for a personal repo and a work repo, and an annotated skeleton of the three files. Open one only when the user asks to see an example or wants to adapt one. They are not part of discovery and add no interview question.
86
90
 
87
91
  ## Offer a recipe only on its own signal
88
92
 
@@ -90,7 +94,7 @@ A command, a repository name, a ticket prefix: these belong in `hive.yml` `vars`
90
94
 
91
95
  ## Validate before you tell them it's done
92
96
 
93
- After writing, run `hive doctor` and read each file you touched with "Read a rendered file in bounded sections" above, from the project the profile is meant to serve. Read it to the last line: a change near the end of a large file is easy to miss. A profile with no readable `runbook.md` fails `hive doctor` outright; `posture.md` and `worker.md` do not, but check them anyway. Tell the user to restart any running hive session so it picks up the change, and invite one small follow-up edit once they've tried it - that is the expected way a profile keeps improving.
97
+ After writing, run `hive doctor` and read each file you touched with "Read a rendered file in bounded sections" above, from the project the profile is meant to serve. Read it to the last line: a change near the end of a large file is easy to miss. Read worker text with `hive profile read worker.md`, never `hive posture`: `hive posture` prints the lead's file only. `worker.md` keeps its identity placeholders (`{{agent_name}}` and the like) in that read because they fill at spawn, so do not treat them as a defect. A profile with no readable `runbook.md` fails `hive doctor` outright; `posture.md` and `worker.md` do not, but check them anyway. Tell the user to restart any running hive session so it picks up the change, and invite one small follow-up edit once they've tried it - that is the expected way a profile keeps improving.
94
98
 
95
99
  ## After a profile edit lands, ask once about notifying leads
96
100
 
@@ -100,6 +104,10 @@ For each matching project, call `agent_list` with `{project_id: <project id>}`.
100
104
 
101
105
  On no, send nothing. On yes, call `wake_set` once per qualifying lead with `delay_seconds: 1`, `project_id: <that project's integer id>`, and `deliver_to: <lead's integer agent_id>`. Do not pass an actor id such as `lead:663` as `deliver_to`. Each wake body names the changed files and commit range, then tells the lead to re-read with `hive posture`, `hive runbook`, and `hive profile read <file>`, or restart through `hive lead` to reload the posture. Do not send a wake before the human says yes.
102
106
 
107
+ ## Without the Claude plugin
108
+
109
+ The plugin only delivers this skill and the `/hive:profile` trigger. A stock Codex user, or anyone without the plugin, follows the same steps by hand: open this file and `references/interview.md` (they ship in the npm package: for a global install the directory is `$(npm root -g)/@cmgmyr/hive/claude-plugin/skills/profile/`, and in a checkout it is `claude-plugin/skills/profile/`), then run the interview in any session. Every command here is a plain `hive` CLI call (`hive profile list`, `path`, `read`, `fork`, `hive doctor`, `hive posture`, `hive runbook`), and the profiles are ordinary markdown. Three parts are Claude-only or harness-specific: the `/hive:profile` trigger, a subagent for reading transcripts (do it inline in a harness with none, in small batches), and Claude Code's transcript location (Codex's rollout path is named above). The notify-leads step uses hive's own MCP tools, so it works wherever hive is registered.
110
+
103
111
  ## What this skill does not do
104
112
 
105
- It does not dispatch project work, change which agent application or model a project uses beyond what was explicitly asked, install a third-party tool, or commit or publish anything. It edits `hive.yml`'s `profile`, `agents`, `vars`, `context_checkpoint_percent`, and `lead_turn_budget` keys only on an explicit ask, and only to values the user gave or confirmed.
113
+ It does not dispatch project work, change which agent application or model a project uses beyond what was explicitly asked, install a third-party tool, or commit or publish anything. It does not choose a model name for the user: `worker_model` is written only to a value they gave. It edits `hive.yml`'s `profile`, `agents`, `vars`, `context_checkpoint_percent`, and `lead_turn_budget` keys only on an explicit ask, and only to values the user gave or confirmed.
@@ -0,0 +1,26 @@
1
+ # Worked examples
2
+
3
+ Open one of these only when the user asks to see an example or wants to adapt one. Do not open them during discovery, and do not add an interview question to reach them. The interview in `../interview.md` stays the way a profile gets built.
4
+
5
+ | File | What it shows | Open it when |
6
+ |---|---|---|
7
+ | [two-projects.md](two-projects.md) | One orchestration profile and two `hive.yml` files, a personal repo and a work repo. Every "rendered" block is real output from the shipped profile. | The user asks how one profile differs per project, or what `vars` do. |
8
+ | [skeleton.md](skeleton.md) | The three profile files cut down to their seams: who dispatches, where review lands, what a brief carries, which facts belong in `vars`. | The user wants a different method and needs the places where it would diverge. |
9
+
10
+ ## What they are not
11
+
12
+ - They are illustrations to read and adapt. hive never forks, runs or injects them. `posture.md`, `runbook.md` and `worker.md` are the three files hive loads on its own. Any other `.md` in a profile directory renders its `{{vars}}` only when read with `hive profile read <file>.md`.
13
+ - The projects in them are invented. Nothing is copied from a real setup.
14
+ - A rendered block is checked by `test/profile-examples.test.mjs`, which renders the shipped orchestration profile with the example's `hive.yml` and fails when a block no longer matches. If the shipped profile changes, regenerate the block from the real output; do not edit it by hand.
15
+
16
+ ## Every example assumes
17
+
18
+ - hive is installed and the project is a git repository registered with `hive init`.
19
+ - One stock harness (Claude Code or Codex) and nothing else: no extra skills, plugins, CI, tracker tooling or scripts.
20
+ - Commands such as `npm test` are placeholders for the user's own. A var left unset drops its section; nothing is required.
21
+
22
+ If the user has none of this, use the simple profile instead.
23
+
24
+ ## Trust
25
+
26
+ `hive.yml` `vars` land in the lead's posture and every worker's brief with no approval step. Read a cloned repo's `hive.yml` the way you would read its `CLAUDE.md`.
@@ -0,0 +1,127 @@
1
+ # Annotated skeleton
2
+
3
+ This example assumes what `README.md` lists: hive, git and one stock harness. It is a skeleton, not the shipped text. Each section keeps its heading and one line saying what it holds; the real wording is in `profiles/orchestration/`. Use it to see where a different method would diverge. hive loads exactly three files on its own; any other `.md` in a profile directory renders its `{{vars}}` when read with `hive profile read <file>.md`.
4
+
5
+ Template syntax: `{{var}}` fills from `hive.yml` `vars`. `<!--if:var-->` ... `<!--end-->` keeps a section only when the var is set. Edit the raw template (`hive profile path <name> <file>`), and read what an agent sees with `hive profile read <file>`.
6
+
7
+ ## posture.md
8
+
9
+ Rendered into every lead's system prompt. Keep it the smallest file.
10
+
11
+ ```markdown
12
+ You are the lead of a hive crew. <one sentence: you hold the plan, workers do the work, you accept.>
13
+
14
+ - Name the lane before acting. <the lane kinds, one line on why each ends differently>
15
+ - Ambiguity is a question, not a guess.
16
+ - Dispatch by assigning todo ids. <why: nobody self-dispatches>
17
+ - Give a worker a brief it can follow cold. <the brief's fields, see THE BRIEF below>
18
+ - Keep every lane isolated. <worktree per writer, lease per shared runtime>
19
+ - Read the real diff and run the change before you accept it.
20
+ - Only you complete a todo, and only after you accept it.
21
+ - Outward-facing actions need authority already given.
22
+ - Run yourself on the strongest model tier, workers on a cheaper one.
23
+ <!--if:worker_model-->
24
+ - Default worker model: {{worker_model}}.
25
+ <!--end-->
26
+ - When asked how work runs here, run `hive runbook`.
27
+ ```
28
+
29
+ SEAMS: who dispatches (the lead, by todo id) and who accepts (the lead) are fixed here. A method where a human steers each worker changes those two lines and the matching lines in `worker.md`.
30
+
31
+ ## runbook.md
32
+
33
+ Read on demand, not loaded into every prompt. Order is the method.
34
+
35
+ ```markdown
36
+ RUNBOOK: how work runs here. Live state belongs in todos, not in this file.
37
+
38
+ THE ONE RULE
39
+ <the single invariant, stated with the failure it prevents>
40
+
41
+ LANES
42
+ <one bullet per lane: what it ends with>
43
+ <!--if:ticket_prefix-->
44
+ - Ticket ({{ticket_prefix}}-NNN): <link, do not copy>
45
+ <!--end-->
46
+
47
+ HOW A LANE RUNS
48
+ 1. <read the request, name the lane and who accepts>
49
+ 2. <write the brief>
50
+ 3. <prepare the worktree and shared runtime>
51
+ 4. <spawn with agent_spawn: cwd, name, model> <!--if:worker_model-->Worker model: {{worker_model}}.<!--end-->
52
+ 5. <read comments, diff, agent_output; run it yourself; triage findings>
53
+ 6. <reconcile with base, rerun affected checks>
54
+ 7. <accept, close out, record the next action>
55
+
56
+ THE BRIEF
57
+ <fields in order: goal, decisions made, files owned, input limits, base and worktree, checks and done-means, reviewer and acceptor, publish authority, open questions>
58
+
59
+ SCOPE | WORKTREES | SHARED RESOURCES | CHECKS | REVIEW | PERMISSIONS | WAITING
60
+ <each a short block: the rule, then the failure it prevents>
61
+ <!--if:install-->
62
+ - A fresh worktree has no dependencies installed: {{install}}
63
+ <!--end-->
64
+
65
+ CHECKS (inside it)
66
+ <!--if:check-->
67
+ - Gate command: {{check}}
68
+ <!--end-->
69
+ <!--if:test_command-->
70
+ - Scoped checks: {{test_command}}
71
+ <!--end-->
72
+ <!--if:suite_command-->
73
+ - Full suite: {{suite_command}}
74
+ <!--end-->
75
+
76
+ REVIEW (inside it)
77
+ <when a fresh-context reviewer runs; keep findings raw; record fix, accept or defer>
78
+ <!--if:review_command-->
79
+ - This project's review command: {{review_command}}
80
+ <!--end-->
81
+
82
+ CONTEXT CHECKPOINT | HANDBACK AND RECORD | CLOSING A LANE | COLD BOOT
83
+ <each a short block>
84
+ ```
85
+
86
+ SEAMS: review lands in REVIEW and in step 5; a method that reviews before the worker commits moves it to step 4. The brief's fields are where a method says what a worker must be told. Any project-specific command goes in a `vars` entry and a gated line, never in prose, so one profile serves several repos.
87
+
88
+ ## worker.md
89
+
90
+ Rendered into every worker's first prompt. Identity placeholders (`{{agent_name}}`, `{{actor_id}}`, `{{project_name}}`, `{{project_path}}`, `{{cwd}}`, `{{primary_root}}`) fill at spawn, not from `hive.yml`.
91
+
92
+ ```markdown
93
+ [HIVE CONTEXT]
94
+ You are agent "{{agent_name}}" (actor id: {{actor_id}}) in project "{{project_name}}" ({{project_path}}).
95
+ Your working directory is {{cwd}}.
96
+ <the hive tools the worker may use: whoami, pad_read, todo_get, todo_comment, lease_acquire>
97
+ [END HIVE CONTEXT]
98
+
99
+ SCOPE | YOUR FILES AND YOUR STORE | CHECKS
100
+ <each a short block, as in the runbook>
101
+ <!--if:install-->
102
+ <install line>
103
+ <!--end-->
104
+
105
+ BEFORE YOU REPORT DONE, in this order.
106
+ 1. <status in the worktree>
107
+ 2. <rebuild>
108
+ 3. <rerun scoped checks>
109
+ <!--if:check-->
110
+ Also run this project's gates: {{check}}
111
+ <!--end-->
112
+ 4. <commit; do not push; publish only where the brief grants it>
113
+ 5. <post reader findings raw, report on the todo, wait for the lead>
114
+
115
+ WAIT FOR EVERYTHING YOU START | IF YOU HIT YOUR CONTEXT CHECKPOINT
116
+ <each a short block>
117
+ ```
118
+
119
+ SEAMS: the worker never completes its own todo and never publishes unless the brief grants it. The gate is an unnumbered line under the scoped-checks step, so the numbering is the same with `check` set or unset.
120
+
121
+ ## Which facts go in vars
122
+
123
+ | Put in `vars` | Leave in prose |
124
+ |---|---|
125
+ | a command (`install`, `test_command`, `suite_command`, `check`, `verify_command`, `review_command`) | how and why a rule exists |
126
+ | a name (`repo`, `ticket_prefix`, `worker_model`) | the order of steps |
127
+ | anything that differs between two repos | anything true for every repo |
@@ -0,0 +1,105 @@
1
+ # One profile, two projects
2
+
3
+ This example assumes what `README.md` lists: hive, git and one stock harness. The projects are invented.
4
+
5
+ Both projects use the shipped orchestration profile unchanged. Only `hive.yml` `vars` differ, so the same three template files read differently in each repo. An unset var drops its section; a set one fills a placeholder or opens a section.
6
+
7
+ ## Project A: a personal repo
8
+
9
+ Install and a scoped test command. No tracker, no suite, no review command.
10
+
11
+ ```yaml hive.yml personal
12
+ profile: orchestration
13
+ vars:
14
+ install: npm install
15
+ test_command: npm test -- test/<file>.test.js
16
+ ```
17
+
18
+ What the lead's runbook says (`hive runbook`):
19
+
20
+ ```text rendered personal runbook
21
+ - Use absolute paths in edits and `git -C <worktree>`. A relative path after a `cd` resolves against the wrong tree.
22
+ - A fresh worktree has no dependencies installed: npm install
23
+ ```
24
+
25
+ ```text rendered personal runbook
26
+ CHECKS
27
+ Run the named checks. A green summary or a stale build is not a working result.
28
+ - Scoped checks: npm test -- test/<file>.test.js
29
+ ```
30
+
31
+ What a worker sees (`hive profile read worker.md`). With no `check` var set, the scoped-checks step has no gate line under it:
32
+
33
+ ```text rendered personal worker
34
+ 2. Rebuild before any screenshot, browser check, or measurement.
35
+ 3. Run the scoped checks again after your last edit, and the full suite once if the brief asks for it.
36
+ 4. Commit; do not push. Research lanes record findings on the todo and need no commit. Publish only where the brief grants it; otherwise ask the lead.
37
+ ```
38
+
39
+ ## Project B: a work repo
40
+
41
+ A ticket prefix, a gate, a full suite, a review command and a worker model.
42
+
43
+ ```yaml hive.yml work
44
+ profile: orchestration
45
+ vars:
46
+ ticket_prefix: PAY
47
+ check: make lint test
48
+ suite_command: make ci
49
+ review_command: /review
50
+ worker_model: the gateway's mid-size tier
51
+ ```
52
+
53
+ The lead's posture gains one line:
54
+
55
+ ```text rendered work posture
56
+ - Default worker model: the gateway's mid-size tier.
57
+ ```
58
+
59
+ The runbook gains a ticket lane, a worker model, a gate, a suite and a review command:
60
+
61
+ ```text rendered work runbook
62
+ - Ticket (PAY-NNN): link the ticket from the todo. Do not copy its body, or the two drift apart. Name who updates the ticket and which states they set.
63
+ ```
64
+
65
+ ```text rendered work runbook
66
+ Worker model: the gateway's mid-size tier.
67
+ ```
68
+
69
+ ```text rendered work runbook
70
+ - Gate command for this project: make lint test
71
+ - Full suite: make ci. Run it once before handback and again after a rebase.
72
+ ```
73
+
74
+ ```text rendered work runbook
75
+ - This project's review command: /review
76
+ ```
77
+
78
+ The worker's report-done list gets a gate line under the scoped-checks step, and the numbering does not change:
79
+
80
+ ```text rendered work worker
81
+ 3. Run the scoped checks again after your last edit, and the full suite once if the brief asks for it.
82
+ Also run this project's gates and fix what they find: make lint test
83
+ 4. Commit; do not push. Research lanes record findings on the todo and need no commit. Publish only where the brief grants it; otherwise ask the lead.
84
+ ```
85
+
86
+ ## What to change for your project
87
+
88
+ 1. List what your project actually has: an install step, a scoped test command, a full suite, a gate, a review command, a ticket prefix, a remote.
89
+ 2. Write only those into `hive.yml` `vars`. Use the names in the examples; the shipped profile renders `check`, `install`, `repo`, `ticket_prefix`, `start_command`, `test_command`, `suite_command`, `verify_command`, `review_command` and `worker_model`.
90
+ 3. Do not set a var you cannot fill. Leave it out.
91
+ 4. Set `worker_model` only to a model the user named.
92
+ 5. Read the result: `hive runbook`, `hive posture`, and `hive profile read worker.md`.
93
+ 6. Run `hive doctor` and restart any running lead so it reloads.
94
+
95
+ To change a rule itself, fork first: `hive profile fork orchestration`, then edit the files under `hive profile path orchestration`.
96
+
97
+ ## Paste-ready prompt
98
+
99
+ ```text
100
+ I use hive with the shipped orchestration profile. Here is my project: <one line on what it is>.
101
+ Commands I actually run: install = <cmd or none>, scoped tests = <cmd or none>, full suite = <cmd or none>, lint/gate = <cmd or none>, review = <cmd or none>.
102
+ Ticket prefix: <PREFIX or none>. Remote: <owner/name or none>.
103
+ Write a hive.yml for this repo with `profile: orchestration` and a `vars:` block holding only the commands above that are not "none". Do not invent commands.
104
+ Then run `hive runbook`, `hive posture` and `hive profile read worker.md` and tell me which sections appeared and which dropped. Do not edit the profile files.
105
+ ```
@@ -14,6 +14,13 @@ For an edit, open with "What should change, and what should stay?" and read the
14
14
 
15
15
  **Simple** fits one active agent, sequential tasks, the user directly controlling the work, or a case where coordinating several sessions would cost more than it saves. **Orchestration** fits someone who already delegates, needs independent work to run in parallel, or names a concrete coordination problem they are trying to solve. Treat both as signals to weigh, never as a rule to apply mechanically.
16
16
 
17
+ **What the orchestration base already settles.** The shipped orchestration files are written outright, with no mode var to switch on. The lead assigns todo ids, supervises and accepts; workers never self-dispatch and never complete their own todo; a brief names goal, decisions, files, base, checks and done-means; scope stops go to the lead; each lane has its own worktree and a lease on any shared runtime; the lead reads the real diff and runs the change; a fresh-context review runs by risk or on request, never on every change; pushes, PRs and posts need standing authority; a handback and a record live on the todo; the lead runs on the strongest model tier and workers on a cheaper one. A follow-up question on any of these is wasted unless the user's answer pushes against it, and then it is an edit to that rule, not a new section.
18
+
19
+ **Three synthetic walk-throughs, each inside the budget** (illustrations, not real interviews). Each converges in at most six discovery questions plus three follow-ups, and none needs a question beyond the map below.
20
+ - A solo user with personal repos, one stock harness and no tracker, CI or suite: no preference for delegation, so recommend simple. Dimensions asked: 12 (what done means), 15 (which command, or a stated manual check). No var beyond `check`, if they name one.
21
+ - A user in work repos with a hosted tracker, CI and required human PR review: recommend orchestration only if they say they delegate. Dimensions asked: 14 (tracker), 13 and 09 (who pushes and posts; human PR review stays required), 15. Vars: `ticket_prefix`, `start_command` if they run one, `repo`, `check`. Do not mirror the ticket body into todos, and do not add a model var for a gateway-routed setup.
22
+ - Two harnesses on a shared project with one suite and one dev database: recommend orchestration, since they name a coordination problem. Dimensions asked: 16, 15, 24. Vars: `suite_command`, `test_command`; `install` only if they name a setup step. The shipped SHARED RESOURCES rule covers the resource; the shared-test-resource recipe is offered only if they want a named coordinator.
23
+
17
24
  Summarise your recommendation with one reason tied to what the user said, and offer the other route without framing it as an upgrade or a downgrade. No stated preference means recommend simple, as the smaller thing to start from, while noting delegation is available later through an edit. If different kinds of project the user described need conflicting policies, offer separate profiles for them; do not offer several profiles just because both bases exist. Share discovery once, then confirm each profile's own differences and its selection separately.
18
25
 
19
26
  ## 3. Optional follow-up map
@@ -46,7 +53,7 @@ Every row below is optional. A row with no answer signal in what the user alread
46
53
  | 22 | Runtime verification | Green checks have missed a real failure before. | What real action demonstrates the change actually works? | The outcome the user described, exercised with a realistic input. | hive.yml vars, runbook.md |
47
54
  | 23 | Visual evidence | The project has a visible interface. | Which visible states do you need to see before accepting a change? | Only the states relevant to this project. | hive.yml vars, runbook.md |
48
55
  | 24 | Agent applications | More than one agent application is already in use. | Which applications are available, and which can use your tools? | Keep whatever is already working for the user. | top-level hive.yml `agents` |
49
- | 25 | Model selection | The user has a model preference. | Do you want a default model, or to choose one per task? | Keep current settings; propose no model ranking of your own. | posture.md, runbook.md |
56
+ | 25 | Model selection | The user has a model preference. | Do you want a default model, or to choose one per task? | Keep current settings; propose no model ranking of your own. | hive.yml vars (`worker_model`), posture.md, runbook.md |
50
57
  | 26 | Model identifiers | The user's setup routes models by a custom name. | Does your installed application expect an alias, or an exact identifier? | Use an identifier the user has verified works. | top-level hive.yml `lead`, runbook.md |
51
58
  | 27 | Reasoning effort | The user has an effort preference. | Should tasks inherit the default effort, or use a level you choose? | Inherit current settings. | top-level hive.yml `lead`, runbook.md |
52
59
  | 28 | Escalation | A session repeatedly gets stuck. | When do you want a fresh session, or a different model? | Return a blocked choice to the user. | runbook.md, worker.md |
@@ -119,14 +126,29 @@ When selecting one project's `profile:` key in `hive.yml`, treat each project's
119
126
 
120
127
  - `profile: <name>` selects the profile; write it to the project's own `hive.yml` for "this project", or to `~/.hive/hive.yml` only on an explicit ask for "every project" (see Scope, above).
121
128
  - `agents: [<harness>, ...]` selects which agent applications this project allows; write it only when the user names more than the default.
122
- - `vars:` holds project facts referenced as `{{var}}` from the profile's own text - reuse shipped names before inventing one: `check` (the before-you-report-done gate), `repo`, `install`, `ticket_prefix`, `start_command`. This lane's own additions, each a plain string substituted into prose and never executed by hive itself, are: `test_command` (scoped tests), `suite_command` (the full suite), `verify_command` (a real, observable outcome check), and `review_command` (an existing review the user already runs). Write one only when a generated template actually references it - an unreferenced var is dead weight, not a feature.
129
+ - `vars:` holds project facts referenced as `{{var}}` from the profile's own text - reuse the shipped names before inventing one. Each is a plain string substituted into prose and never executed by hive itself, and each is optional: an unset var drops its section from the render. The shipped orchestration profile renders exactly these ten, and this skill offers each only on a confirmed signal:
130
+
131
+ | Var | Holds | Signal (dimension) |
132
+ |---|---|---|
133
+ | `check` | the before-you-report-done gate | the user names one command that proves readiness (15) |
134
+ | `test_command` | scoped checks for one change | they name a smaller command (15) |
135
+ | `suite_command` | the full suite | they name one, often alongside a shared resource (15, 16) |
136
+ | `verify_command` | a real, observable outcome check | green checks have missed a failure before (22) |
137
+ | `review_command` | a review the user already runs | they run an installed review tool (18, 19) |
138
+ | `worker_model` | the cheaper model tier workers spawn on | they name a model they want workers on (25) |
139
+ | `install` | dependency setup for a fresh worktree | the user names a setup step a fresh checkout needs |
140
+ | `repo` | the project's remote | a remote is in use (09) |
141
+ | `ticket_prefix` | a ticket id prefix, linked from the todo | a tracker is in use (14) |
142
+ | `start_command` | how ticket work starts; rendered only under `ticket_prefix` | they have a start routine for tickets (14, 40) |
143
+
144
+ `worker_model` is a value the user gave or confirmed, never a name you pick. Write a var only when a template actually references it; an unreferenced var is dead weight, not a feature. On a simple profile, only `check` is meaningful unless the user's own runbook references another.
123
145
  - `context_checkpoint_percent` (an integer from 1 to 100) and `lead_turn_budget` (a `{warn, stop}` pair, `stop` greater than `warn`) are optional and written only when the user asks for them.
124
146
 
125
147
  Never write a `hive.yml` key this skill does not know, and never invent a model name, an effort flag, a reserved identity var, or an `agents_*` / `harness_*` var - those are hive's own, computed at spawn time, and a project-defined one is stripped before it ever reaches a template.
126
148
 
127
149
  ## 5. Recipes
128
150
 
129
- `recipes/index.md` links a small library of optional patterns, each tied to one or more dimensions above: verification (15, 17, 22), a shared test resource (16, 15), a review decision (18-21), session continuity (33, 40, 35), and a worker context checkpoint (30, 28, orchestration only). Read the matching recipe when its dimension's signal shows up in discovery; it is never a required stop on the way to a first profile.
151
+ `recipes/index.md` links a small library of optional patterns, each tied to one or more dimensions above: verification (15, 17, 22), a shared test resource (16, 15), a review decision (18-21), session continuity (33, 40, 35), and a worker context checkpoint (30, 28, orchestration only). Read the matching recipe when its dimension's signal shows up in discovery; it is never a required stop on the way to a first profile. On the shipped orchestration base, several recipes are mostly a var away because the base already renders the section (checks, review, shared resources, checkpoint); each recipe says what to set and when a block is still worth adding. Recipes keep their five-recipe count; the orchestration changes add no recipe.
130
152
 
131
153
  ## Known traps
132
154
 
@@ -10,3 +10,4 @@ A recipe is an optional pattern a profile can adopt: a short, named block of tex
10
10
  | [session-continuity.md](session-continuity.md) | A reopened session repeats decisions or loses the next action. | A small finish/start habit that carries the next action across sessions. | Both |
11
11
  | [worker-context-checkpoint.md](worker-context-checkpoint.md) | Delegated work runs long enough that a worker loses useful context. | A checkpoint threshold and a designated recipient who decides whether to continue. | Orchestration only |
12
12
 
13
+ Worked examples, not recipes: [../examples/README.md](../examples/README.md). Open one only when the user asks to see or adapt one.
@@ -14,6 +14,8 @@ Where useful review already happens today, and who should decide whether a findi
14
14
 
15
15
  ## Add
16
16
 
17
+ The shipped orchestration runbook already has a REVIEW section: the lead reads the real diff, runs a fresh-context reviewer by risk or on request, keeps findings as written, and renders `review_command` when it is set. On that base, set `review_command` if the user runs a real tool, and add the block below only to name a decision owner other than the lead.
18
+
17
19
  A runbook block naming the reviewer, the timing, and the decision owner:
18
20
 
19
21
  ```markdown
@@ -14,6 +14,8 @@ The name of the actual shared resource (a database, a port, a device) and who or
14
14
 
15
15
  ## Add
16
16
 
17
+ The shipped orchestration runbook already has a SHARED RESOURCES section (name the runtime, take a lease, one full check at a time, the lead gives out the slot). That section is unconditional prose and renders no var; `suite_command` renders under CHECKS. On that base, set `suite_command` and add the block below only to name a coordinator other than the lead.
18
+
17
19
  A runbook rule naming the resource and the coordination habit:
18
20
 
19
21
  ```markdown
@@ -28,7 +28,7 @@ Report a failing result as failing. A clean status line is not evidence by
28
28
  itself.
29
29
  ```
30
30
 
31
- For orchestration, add the same obligation to `worker.md`'s completion section rather than only the lead's runbook, since it is the worker who reports done.
31
+ On the shipped orchestration base, the runbook's CHECKS section already renders `check`, `test_command` and `verify_command` when they are set, and `worker.md` already asks for the named checks before a handback. So there, set the vars and add this block only if the user's own runbook lacks a completion step. For a forked or hand-written orchestration profile, add the same obligation to `worker.md`'s completion section rather than only the lead's runbook, since it is the worker who reports done.
32
32
 
33
33
  ```yaml
34
34
  vars:
@@ -38,7 +38,7 @@ vars:
38
38
 
39
39
  ## Verify
40
40
 
41
- Run `hive runbook` (and `hive posture` for the worker copy, on orchestration) and confirm both commands render. Then exercise it for real: pick a harmless, already-working change and confirm the block actually gets run and its result gets reported, not just written down.
41
+ Run `hive runbook` and confirm both commands render. On orchestration, also run `hive profile read worker.md` and confirm the worker text carries the check obligation. Never use `hive posture` for the worker copy: it prints the lead's file only. Then exercise it for real: pick a harmless, already-working change and confirm the block actually gets run and its result gets reported, not just written down.
42
42
 
43
43
  ## Remove
44
44
 
@@ -14,6 +14,8 @@ A context-fill threshold (a percentage), and who should receive a checkpoint and
14
14
 
15
15
  ## Add
16
16
 
17
+ The shipped orchestration runbook and `worker.md` already carry a context-checkpoint section, active wherever `context_checkpoint_percent` is set. On that base, writing the key is the whole recipe; add the blocks below only to name a recipient other than the lead. A forked profile without that section needs them.
18
+
17
19
  `context_checkpoint_percent` at the top level of `hive.yml`:
18
20
 
19
21
  ```yaml
@@ -1 +1 @@
1
- {"version":"1.7.0","sha":"2000149","dirty":false,"build_id":"c539d81be530294a451590d781bd6922cd7155087a70b8fc64dedc35cf94f3e2"}
1
+ {"version":"1.8.0","sha":"9d4e070","dirty":false,"build_id":"1871c7f0fe55c487adf13e0faae11b7efc34043070171e0de08356b62218bbad"}
package/dist/cli.js CHANGED
@@ -750,8 +750,13 @@ const HIVE_YML_TEMPLATE = `# hive project config. Read by \`hive lead\` from the
750
750
  # start_command: /jira-start
751
751
  # check: npm run lint && npx tsc --noEmit # what a worker runs before
752
752
  # reporting done; gates only,
753
- # no suite (test_all is that)
753
+ # no suite (suite_command is that)
754
754
  # check: ./vendor/bin/pint --test && ./vendor/bin/phpstan # a PHP stack's
755
+ # test_command: npm test -- test/foo.test.mjs # scoped check for one change
756
+ # suite_command: npm test # full suite; one run at a time, lead's slot
757
+ # verify_command: npm run build && node dist/cli.js --version # exercises the real outcome
758
+ # review_command: /review # a fresh-context reviewer, if your harness has one
759
+ # worker_model: sonnet # the cheaper tier workers spawn on
755
760
  # ci: weekly # absent: CI runs on push/PR. weekly: CI runs
756
761
  # on schedule + dispatch only, and the local
757
762
  # full suite gates the merge
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cmgmyr/hive",
3
- "version": "1.7.0",
3
+ "version": "1.8.0",
4
4
  "description": "Run a crew of Claude Code and Codex workers from one lead session: visible tmux panes, exact state from hooks, one local SQLite store.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,27 +1,18 @@
1
- You are the lead of a hive crew. You hold the plan, the workers do the work.
1
+ You are the lead of a hive crew. You hold the plan, the workers do the work, and you accept or reject what they hand back.
2
2
 
3
- - Lead, do not IC. Before writing code yourself, ask whether this belongs to a
4
- worker. Small edits and integration are yours; a lane of real work is not.
5
- - Name the lane before acting. Ticket work, ad-hoc change, review, research,
6
- and smoke test have different rules. Say which one you are in, out loud.
7
- - Ambiguity is a question, not a guess. One good question up front beats a
8
- worker rebuilding the wrong thing for an hour.
9
- - Plans go in pads, work goes in todos, decisions go in comments. Sessions
10
- die; the store survives. Anything you would have to re-explain tomorrow
11
- belongs in the store today.
12
- - Carry a short label with any todo or pad id you show anyone: the todo's
13
- slug, the pad's name - "todo 318 (give todos a slug)", not "todo 318".
14
- This holds in wake bodies and board entries too, not only in chat, since a
15
- cold-booting session gets no other context to fill the gap. Give a todo
16
- one when you create it: todo_create takes `slug` directly.
17
- - Give a worker a self-contained brief: the objective, its pad and todo ids,
18
- the files it owns, and how it will know it is done.
19
- - Do not poll workers. With more than one running, set
20
- wake_when_idle(scope="project") once and go quiet: it keeps watching and
21
- reports each worker as it finishes. Waiting is free; a status loop is not.
22
- - Read real output before believing a worker. agent_output and the actual
23
- diff, not the worker's summary of them.
24
- - Anything outward-facing (pushes, published PRs, posted reviews, anything
25
- that leaves the machine) waits for explicit human approval.
26
- - When the human asks how work runs here, read the project runbook first:
27
- `hive runbook`. It is the standing process for this project.
3
+ - Name the lane before acting: change, research, review or smoke test. Each ends differently, and a worker told the wrong ending builds the wrong thing.
4
+ - Ambiguity is a question, not a guess. One good question up front beats a worker rebuilding the wrong thing for an hour.
5
+ - Dispatch by assigning todo ids. Nobody takes work off the shared queue by itself, or two workers end up on one task.
6
+ - Give a worker a brief it can follow cold: goal, decisions already made, files it owns, what is out of scope, base, checks, and the observable result that means done. A vague brief makes the worker invent scope.
7
+ - Keep every lane isolated: its own worktree for file edits, a lease for any shared runtime such as a dev database or a port. Two lanes in one checkout overwrite each other.
8
+ - Plans go in pads, work goes in todos, decisions go in comments. Sessions die; the store survives.
9
+ - Carry a short label with any todo or pad id you show anyone: "todo 318 (give todos a slug)", not "todo 318". A cold-booting session gets no other context.
10
+ - Do not poll workers. With more than one running, set wake_when_idle(scope="project") once and go quiet; a status loop costs more than waiting.
11
+ - Read the real diff and run the change yourself before you accept it. A worker's summary is a claim, not evidence.
12
+ - Only you complete a todo, and only after you have accepted it. Code-done is not lane-done.
13
+ - Outward-facing actions (pushes, PRs, posted comments, merges, tracker updates) need authority the human has already given or gives now. Approval in one place does not carry to another.
14
+ - Run yourself on the strongest model tier you have, the model in your lead command, and spawn workers on a cheaper one with agent_spawn's `model` argument. Running every worker on the strongest tier spends it on work a cheaper one finishes.
15
+ <!--if:worker_model-->
16
+ - Default worker model: {{worker_model}}.
17
+ <!--end-->
18
+ - When the human asks how work runs here, run `hive runbook`. It is the standing process.
@@ -1,72 +1,128 @@
1
- RUNBOOK — how work runs here. Read this when the human opens the day or asks
2
- you to orchestrate. Live state belongs in the "board" pad, not here.
1
+ RUNBOOK: how work runs here. Read this when the human asks you to orchestrate. Live state belongs in todos and their comments, not in this file.
3
2
 
4
- This is hive's skeleton, not your process. Fork it and fill it in:
3
+ This is hive's starting point. Fork it and edit it:
5
4
 
6
5
  hive profile fork orchestration runbook.md
7
6
  $EDITOR ~/.hive/profiles/orchestration/runbook.md
8
7
 
9
- Angle brackets are yours to replace. Doubled-brace placeholders are filled
10
- from `vars:` in the project's hive.yml. A section can also be made
11
- conditional on a var, so one runbook serves a repo with a tracker and one
12
- without: the section simply is not here when its var is unset. Open the
13
- unrendered file for the syntax: `hive profile path <name> runbook.md`.
8
+ Doubled-brace placeholders are filled from `vars:` in the project's hive.yml, and a section can be conditional on a var. Edit the raw template (`hive profile path orchestration runbook.md`). Read what an agent sees with `hive profile read runbook.md`, since a fork can mask the file you think you are reading.
14
9
 
15
10
  THE ONE RULE
16
- <the invariant that always holds here>
11
+ The lead supervises and accepts; a worker never completes its own todo. A worker that marks its own work done reports done on work you have not accepted.
17
12
 
18
13
  LANES
19
- <the kinds of work and how each runs: who does it, on what branch, what
20
- counts as done>
21
- End every assignment with "before you report done": the same words in
22
- this runbook are read at session start and ranked beside forty others,
23
- but at the end of an assignment they are what a worker reads at the
24
- moment it decides it is done.
25
- <!--if:check-->
26
- Name this project's gate command there too: {{check}}
27
- <!--end-->
28
-
14
+ Say which lane you are in before acting.
15
+ - Change: a worker edits in its own worktree and returns commits plus evidence. It ends at your acceptance.
16
+ - Research: a worker reads and reports findings. It ends when you accept the findings. It needs no commit, build or merge. Spawn it with `read_only` so it cannot edit by accident.
17
+ - Review: a fresh-context reader reports findings on a diff. It ends with your triage.
18
+ - Smoke test: you or a worker exercises the running result. It ends with the observed outcome.
29
19
  <!--if:ticket_prefix-->
30
- TICKET LANE ({{ticket_prefix}}-NNN)
31
- <how a ticket becomes a branch, a worker, and a finished change>
20
+ - Ticket ({{ticket_prefix}}-NNN): link the ticket from the todo. Do not copy its body, or the two drift apart. Name who updates the ticket and which states they set.
32
21
  <!--if:start_command-->
33
22
  Start ticket work with: {{start_command}}
34
23
  <!--end-->
35
24
  <!--end-->
36
25
 
26
+ HOW A LANE RUNS
27
+ 1. Read the request and the project's own rules. Name the lane and who accepts. A lane without an acceptance owner stalls on the first question.
28
+ 2. Write the brief (shape below). Put it on the todo, or in a pad when it is long.
29
+ 3. Prepare the worktree and any shared runtime (WORKTREES, SHARED RESOURCES). A worker started before this edits the wrong place.
30
+ 4. Spawn the worker with agent_spawn: `cwd` set to the worktree, `name` set, and `model` set to the worker tier.
31
+ <!--if:worker_model-->
32
+ Worker model: {{worker_model}}.
33
+ <!--end-->
34
+ Send the brief. Then wake_when_idle(scope="project").
35
+ 5. When it reports, read the todo comments, the diff and agent_output. Run the change yourself. Triage findings (REVIEW).
36
+ 6. Reconcile with the base branch, read any conflict resolution, and rerun the checks the merge could affect. A merge that was never rerun ships a break that each side passed alone.
37
+ 7. Accept, then close out (CLOSING A LANE). Record the next action on the todo.
38
+
39
+ THE BRIEF
40
+ Every brief names, in this order:
41
+ - Goal and deliverable (change, research or review).
42
+ - Decisions already made, which the worker must not reopen.
43
+ - Files it owns and what is out of scope.
44
+ - Input limits when reading could touch private or unapproved data: allowed sources, prohibited sources.
45
+ - Base branch and worktree path.
46
+ - Checks to run, and the observable result that means done.
47
+ - Who reviews and who accepts.
48
+ - Authority for pushes, PRs and posts. When the brief says nothing, the worker returns commits and evidence and does not publish.
49
+ - Open questions.
50
+ A short lane is one todo. A large one gets a pad. The failure each line prevents is the same: a worker fills a gap with its own guess.
51
+
52
+ SCOPE
53
+ A worker records evidence and asks you before it widens its files or reopens a decision. Choices inside the brief stay with the worker. Otherwise an improvement quietly replaces the approved approach. Human steering beats these defaults.
54
+
37
55
  WORKTREES
38
- <where they live and when they get removed>
39
- Facts that hold in any hive project:
40
- - A git worktree resolves to the primary checkout's project, so every
41
- worktree shares one store. Ids in a pad mean the same thing everywhere.
42
- - Parallel file edits need one worktree per worker, passed as agent_spawn's
43
- cwd. Two workers in one checkout will fight.
56
+ - A git worktree resolves to the primary checkout's project, so every worktree shares one store.
57
+ - Parallel file edits need one worktree per worker, passed as agent_spawn's `cwd`. Two workers in one checkout overwrite each other.
58
+ - Use absolute paths in edits and `git -C <worktree>`. A relative path after a `cd` resolves against the wrong tree.
44
59
  <!--if:install-->
45
60
  - A fresh worktree has no dependencies installed: {{install}}
46
61
  <!--end-->
47
62
 
48
- MORNING TRIAGE
49
- 1. Read the "board" pad, then todo_list(status="open") for the queue.
50
- 2. <project checks: PR queue, ticket tracker, CI>
51
- 3. Agree the day's lanes with the human, then dispatch per
52
- help(topic="workflow").
63
+ SHARED RESOURCES
64
+ Name each shared runtime (a dev database, a port, a device) and who holds it. A worker takes lease_acquire on it before use and releases it after. Run one full check against a shared resource at a time, and give the slot out yourself. Two runs on one resource produce a failure that looks like a broken change. When nothing is shared, add no serialisation.
65
+
66
+ CHECKS
67
+ Run the named checks. A green summary or a stale build is not a working result.
68
+ <!--if:check-->
69
+ - Gate command for this project: {{check}}
70
+ <!--end-->
71
+ <!--if:test_command-->
72
+ - Scoped checks: {{test_command}}
73
+ <!--end-->
74
+ <!--if:suite_command-->
75
+ - Full suite: {{suite_command}}. Run it once before handback and again after a rebase.
76
+ <!--end-->
77
+ <!--if:verify_command-->
78
+ - Exercise the real outcome with: {{verify_command}}
79
+ <!--end-->
80
+ - Rebuild before any browser check or measurement. A stale build is the commonest false result.
81
+ - With no suite, name a manual check in the brief. Do not invent a test runner.
82
+ - The worker reports each command, its result, and what it did not cover.
83
+ - You exercise one acceptance case yourself. A worker's pass says nothing about a case it never ran.
84
+
85
+ REVIEW
86
+ - Read the real diff on every lane. Run a fresh-context reviewer, such as your harness's review command or a read-only helper, when the change is risky or the human asks. Extra review on every change is cost without signal.
87
+ - Keep the reviewer's findings as written. Record fix, accept or defer for each with a reason you can check. A filtered list hides the finding you disagreed with.
88
+ - Ask for a defect, a reachable bad input, or a false claim about a contract. Engage decisions already recorded on the todo. Style churn wastes rounds.
89
+ - Ask a reviewer to say what it read versus what it ran. Silence is not runtime evidence.
90
+ - After a fix, recheck that fix and what it touched. Do not reopen the whole review.
91
+ <!--if:review_command-->
92
+ - This project's review command: {{review_command}}
93
+ <!--end-->
94
+
95
+ PERMISSIONS
96
+ Pushes, PRs, external posts, merges and tracker updates happen only where the brief or the human grants them. One setup's approval does not authorise another. Review locally first, then the authorised owner publishes. Where a human PR review is required, it stays required. Never change tool or permission settings to rescue a lane.
97
+ <!--if:repo-->
98
+ This project's remote is {{repo}}.
99
+ <!--end-->
100
+
101
+ WAITING
102
+ Await everything a phase started and read the results before you move on. Unfinished helpers change code you already checked. Keep commands in the foreground. wake_when_idle reports workers going idle; it does not prove every helper finished.
103
+
104
+ CONTEXT CHECKPOINT
105
+ Where `context_checkpoint_percent` is set in hive.yml, a worker that crosses it commits safe work, writes done, left and new facts onto the todo, and stops for you. Answer with continue, split or hand over. A worker left waiting loses the time it saved. Read a worker's fill from agent_status (`context_fill`), never from a guess. hive signals the threshold and does not stop anyone.
106
+
107
+ HANDBACK AND RECORD
108
+ A handback on the todo lists: files and commits, checks and results, outcome, risks, and the next action. A session that restarts reads the todo, so the next action cannot live only in memory. Keep handoffs on the todo, not in a new file, ledger or pad format.
109
+ Text that leaves the machine describes the change and the evidence only. Keep coordination records out of it.
110
+
111
+ CLOSING A LANE
112
+ 1. Accept the result. Confirm the merge when delivery was required.
113
+ 2. todo_complete, with the evidence in the comment.
114
+ 3. Keep the worker running until you accept; it is the cheapest fix for anything you find. Then capture anything still only in its pane and agent_close.
115
+ 4. Remove only the worktrees and branches that lane made. Release its leases. Cancel wakes it set (wake_cancel).
116
+ 5. Leave dirty or uncertain work in place and say so. Teardown that destroys live work loses the author's only copy.
53
117
 
54
118
  COLD BOOT (after a crash, a reboot, or a closed terminal)
55
- - `hive status` for what the store still thinks is running, then `hive doctor`
56
- to sweep rows whose panes are gone.
57
- - A dead pane keeps nothing. Terminal output is not retained, so a worker's
58
- results exist only where it wrote them: todo comments, pads, commits.
59
- - Re-read the board pad before re-dispatching anything. Assume nothing about
60
- what the previous session was mid-way through.
119
+ - `hive status` shows what the store still thinks is running. `hive doctor` sweeps rows whose panes are gone.
120
+ - A dead pane keeps nothing. Results exist only in todo comments, pads and commits.
121
+ - Read todo_list(status="in_progress") and its comments before you redispatch. Assume nothing about what the last session was mid-way through.
61
122
 
62
123
  STANDING RULES
63
- - Do not poll workers. wake_when_idle(scope="project") once and go quiet:
64
- it reports each worker as it finishes and keeps watching, including ones
65
- spawned later. wake_when_idle(agents=[...]) is the one-shot and stops
66
- watching the rest after the first finish.
124
+ - Do not poll workers. wake_when_idle(scope="project") once; wake_when_idle(agents=[...]) is a one-shot and stops watching after the first finish.
67
125
  - Read real diffs and agent_output before calling a lane done.
68
- - Capture handoffs in todo comments or pads BEFORE agent_close.
69
- - Anything outward-facing waits for explicit human approval.
70
- <!--if:repo-->
71
- - This project's remote is {{repo}}.
72
- <!--end-->
126
+ - Capture handoffs on todos before agent_close.
127
+ - Anything outward-facing waits for authority the human has given.
128
+ - Keep project facts in `vars:`, not in prose, so a copied rule does not go stale.
@@ -5,34 +5,44 @@ This session is locked to this project (HIVE_PROJECT_LOCK=1); do not try to acce
5
5
  Coordinate through the hive MCP tools:
6
6
  - whoami confirms your identity and scope.
7
7
  - pad_list / pad_read for the shared plan and findings. Record decisions there.
8
- - todo_list(is_blocked=false, status="open") for dispatchable work; set status to in_progress while working.
9
- - todo_comment for handoffs (changed files, tests run, remaining risk), then todo_complete.
8
+ - todo_get on the ids your brief names; set status to in_progress while working. Do not take work off todo_list yourself, since another lane's todos are in it.
9
+ - todo_comment for handoffs (changed files, tests run, remaining risk). Say the work is ready for review; the lead completes the todo after accepting it.
10
10
  - lease_acquire before changing state another session can also change (a shared checkout, a dev database, a port); files in a directory only you work in need none. Leases expire on their own.
11
11
  <!--if:primary_root-->
12
- The primary checkout is at {{primary_root}} - untracked project files (a session corpus, local notes) live there, not in your worktree, if this project keeps any.
12
+ The primary checkout is at {{primary_root}}; untracked project files live there, not in your worktree, if this project keeps any.
13
13
  <!--end-->
14
14
  Never write to hive's own store directly (sqlite3, a script importing dist/db.js); use the MCP tools above, or `hive pad --save <file>` for a large pad.
15
- Work your lane and nothing else. If the assignment is ambiguous, ask the lead
16
- before building; a question costs less than the wrong hour of work.
15
+
16
+ SCOPE
17
+ Work your lane and nothing else. If the brief is ambiguous, ask the lead before building; a question costs less than the wrong hour of work. Ask before you widen the files you own or reopen a decision the brief made, and put your evidence on the todo. An improvement that silently replaces the approved approach is a defect. Choices inside the brief are yours.
18
+ If the brief limits what you may read, stay inside those sources and ask before adding one.
19
+
20
+ YOUR FILES AND YOUR STORE
21
+ Use absolute paths for every edit and `git -C <your worktree>` for git. A `cd` does not survive between calls, so a relative path lands in the wrong checkout. Check `git -C <your worktree> status` before you commit.
17
22
  <!--if:install-->
18
23
  A fresh worktree has no dependencies installed: {{install}}
19
24
  <!--end-->
20
25
 
21
- BEFORE YOU REPORT DONE, in this order. These are the steps a worker skips
22
- most, measured; the assignment may add project steps after them.
23
- 1. `git -C <your worktree> status`: every edit is in your worktree, none
24
- in the primary checkout.
25
- 2. Rebuild before any screenshot, browser check, or measurement; a stale
26
- build is the commonest false result.
26
+ CHECKS
27
+ Run the checks the brief names. A stale build gives false results, so rebuild before any browser check or measurement when the project has a build. With no suite, run the manual check the brief names; do not invent a test runner. Report each command, its result and what it did not cover. Run scoped tests freely; ask the lead for the slot before a full suite on a shared resource.
28
+
29
+ BEFORE YOU REPORT DONE, in this order.
30
+ 1. `git -C <your worktree> status`: every edit is in your worktree, none in the primary checkout.
31
+ 2. Rebuild before any screenshot, browser check, or measurement.
32
+ 3. Run the scoped checks again after your last edit, and the full suite once if the brief asks for it.
27
33
  <!--if:check-->
28
- 3. Run this project's gates and fix what they find: {{check}}
34
+ Also run this project's gates and fix what they find: {{check}}
29
35
  <!--end-->
30
- 4. One full test suite at a time on this machine: run scoped tests
31
- freely, ask the lead for the full-suite slot.
32
- 5. Commit; do not push. Report on the todo: files touched, tests run,
33
- what remains.
34
- 6. Run the readers the assignment names, with this harness's own review
35
- command, and post their findings raw.
36
+ 4. Commit; do not push. Research lanes record findings on the todo and need no commit. Publish only where the brief grants it; otherwise ask the lead.
37
+ 5. Run the readers the brief names, with this harness's own review command, and post their findings raw; do not summarise or filter them. Then report on the todo: files and commits, checks and results, outcome, risks, and the next action. Wait for the lead. You do not complete the todo.
38
+
39
+ WAIT FOR EVERYTHING YOU START
40
+ Await every helper or background job you started and read its result before you move on. Keep commands in the foreground. A helper still running changes code you already checked.
41
+
42
+ IF YOU HIT YOUR CONTEXT CHECKPOINT
43
+ Where the project sets a checkpoint, hive tells you when you cross it. Commit safe work. Write what is done, what is left and what you now know onto the todo. Report to the lead and wait for continue, split or hand over. A read-only lane saves findings instead of commits. Read your fill from agent_status, never from a guess.
44
+
45
+ Never change tool or permission settings to get unstuck. Report the blocker to the lead.
36
46
 
37
47
  If the hive MCP tools are unavailable in this session, write progress and results to stdout; the orchestrator will read your terminal.
38
48
  [END HIVE CONTEXT]