@sjawhar/opencode-legion-envoy 5.3.1 → 5.4.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": "@sjawhar/opencode-legion-envoy",
3
- "version": "5.3.1",
3
+ "version": "5.4.0",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "main": "dist/src/server.js",
package/skills/AGENTS.md CHANGED
@@ -8,6 +8,7 @@ event intake, process lifecycle, credentials, and role delivery.
8
8
  | --- | --- | --- |
9
9
  | `ce-simplify-code/` | the implementer, once per pull request | the behaviour-preserving simplify pass before the reviewer's final pass (Legion's copy of the MIT-licensed Compound Engineering skill; `LICENSE` beside it) |
10
10
  | `dispatch/` | every role, and any session writing to Dispatch | specs, asks, comments, artifacts, and messages on native Dispatch |
11
+ | `dispatch-brainstorming/` | any session with Dispatch that starts a design conversation or writes a plan, as `dispatch-first` directs | the design conversation in the issue's spec, turn by turn to one approval, and the plan as the issue's `plan.md`; in a session with Dispatch it replaces superpowers' `brainstorming` and `writing-plans` |
11
12
  | `dispatch-first/` | every session with Dispatch configured, injected by each host plugin on every request (Oh My Pi), on every `SessionStart` (startup, resume, clear, compact, fork) and `SubagentStart` (Claude Code), or as an instruction file (OpenCode) | searching Dispatch before acting, extending the existing issue, citing decisions, closing duplicates; kept under 60 lines and 6,000 characters |
12
13
  | `envoy/` | every role | subscriptions, agent-to-agent messages, and topic formats |
13
14
  | `legion-architect/` | root and sub-architects | tree ownership, decomposition, waves, gates, integration, sign-off |
@@ -26,7 +26,6 @@ after `skill://dispatch/` is relative to this skill's base directory.
26
26
  | call `dispatch_doc_edit`: rewrite a paragraph, insert or move a block, change a table's cells, rows or columns | [Editing a document](skill://dispatch/references/document-edits.md) |
27
27
  | write a typed block (an `:::ask`, a callout), comment on or suggest a change to a document, upload an artifact, or retry after `DOC_SERVICE_UNAVAILABLE` | [Documents](skill://dispatch/references/documents.md) |
28
28
  | choose your next issue, claim one, move its status or priority, reorder a board, or audit a project's backlog | [Working an issue](skill://dispatch/references/issues.md) |
29
- | start or answer a design conversation in a spec: each turn, a comment that settles a question, coming to terms, a worked example | [Brainstorming in the spec](skill://dispatch/references/brainstorming.md) |
30
29
  | find who answers an ask, edit, retract or resolve one, reply with the turn, or follow a thread | [Asks after they open](skill://dispatch/references/asks.md) |
31
30
  | catch up after a restart, trace what cites a node, or write a `dispatch://` reference | [Reading back](skill://dispatch/references/reading.md) |
32
31
  | answer a BTW, Aside or Steer frame, or a message from the Agents page | [Targeted and direct messages](skill://dispatch/references/messages.md) |
@@ -36,17 +35,9 @@ after `skill://dispatch/` is relative to this skill's base directory.
36
35
  ## Design changes are brainstormed here
37
36
 
38
37
  When a session has Dispatch, a design change needing the human's choices is brainstormed in its
39
- issue's spec, not chat or a repository design document. The first version holds only established
40
- facts and every ready question, each a decision block at the end of the section that sets it up; a
41
- question waits only when it depends on an answer still open. Each next version replies in each
42
- human comment's thread (`dispatch_comment` with `reply_to`; under an open ask whose next move is
43
- yours, such as an approval request you must revise or hand back, `reply_to_ask` with
44
- `turn: "agent"`, since a default-turn reply hands it back to the human), folds the answers into the
45
- surrounding text while their decision blocks stay, in the human's words (or the option they chose)
46
- with the date, and adds the questions they open. Approval is requested at the end, not after each
47
- section, when nothing in the spec is new to the human. Before you write a spec's first version, and
48
- again before each next turn, read [Brainstorming in the spec](skill://dispatch/references/brainstorming.md):
49
- each step, and a worked example.
38
+ issue's spec, not chat or a repository design document, and its plan is the issue's `plan.md`
39
+ document. `skill://dispatch-brainstorming` holds the process: read it before a spec's first
40
+ version, before each next turn, and before you write a plan.
50
41
 
51
42
  ## Writing for the human
52
43
 
@@ -89,11 +80,14 @@ a new version that keeps the human's own text, never a second "spec" artifact be
89
80
 
90
81
  - **Each open question is a decision block**, shaped and placed as [Decision blocks](#decision-blocks)
91
82
  says. Because it is an ask, it reaches the human's Inbox, and the answer lands next to its context.
92
- - **A settled point records the human's own words and the date**, quoted, so no reader mistakes
83
+ - **A settled point records the person's own words and the date**, quoted, so no reader mistakes
93
84
  it for your inference; an answer that is only a chosen option is recorded in the form
94
- `Sami chose "Commit author" on the question below (2026-10-02)`. A point you inferred says so,
95
- with the reasoning. One carried in from another document keeps its provenance: an agent's
96
- inference there is marked one here, or stays out until the human raises it.
85
+ `<name> chose "Commit author" on the question below (<date>)`, naming them from `dispatch_whoami`
86
+ or the conversation, or "the person" when the token names no owner — never a name you were not
87
+ given. A point you inferred says so, with the reasoning; during a live brainstorming
88
+ conversation, `skill://dispatch-brainstorming` is stricter and keeps an inference out of the spec
89
+ until the human has agreed to it. One carried in from another document keeps its provenance: an
90
+ agent's inference there is marked one here, or stays out until the human raises it.
97
91
  - **Sections follow the topic.** No heading is required and none has a fixed place; name each
98
92
  section for what it discusses.
99
93
  - **A changed point is rewritten, not appended to.** When an answer or a new fact changes the
@@ -0,0 +1,113 @@
1
+ ---
2
+ name: dispatch-brainstorming
3
+ description: "Use in a session with Dispatch tools whenever a design conversation with a person starts: brainstorming or /brainstorming, \"let's design\", writing or changing a spec, writing an implementation plan, or a feature request or change that needs a person's choices. In a session with Dispatch it replaces superpowers' brainstorming and writing-plans; a Legion architect's own spec follows skill://legion-architect instead."
4
+ ---
5
+
6
+ # Brainstorming in Dispatch
7
+
8
+ This skill governs a design conversation with a person, never a Legion architect's own issue
9
+ spec: an architect follows `skill://legion-architect` for that, even for a child issue.
10
+
11
+ In a session with Dispatch, such a conversation happens in its issue's spec, and the plan that
12
+ follows is a document on the same issue. This skill replaces superpowers' `brainstorming` and
13
+ `writing-plans` there, even when the user invokes one of them by name:
14
+
15
+ - No design question goes to chat. Every question is a decision block in the spec, and your reply
16
+ in chat links the issue and asks nothing.
17
+ - There is no limit of one question per message. Every question that is ready goes out at once.
18
+ - There is no approval after each section, only the one at the end.
19
+ - A small change gets a short spec, never a design in chat: its size shortens the spec and changes
20
+ nothing about where the conversation happens.
21
+ - No spec or plan file goes in the repository (`docs/superpowers/specs/`,
22
+ `docs/superpowers/plans/`, `docs/plans/`): the spec is the issue's primary document and the plan
23
+ is its `plan.md` document.
24
+
25
+ The brainstorming stages still shape what you ask: clarifying questions, then two or three
26
+ approaches with a recommendation, then the design section by section. A question that depends on
27
+ no open answer goes out at once, whatever its stage.
28
+
29
+ Read `skill://dispatch` before the first version: its "Writing a spec", "Decision blocks",
30
+ "Writing for the human" and "Approval of a spec" sections define the spec's shape, each block's
31
+ shape, and when approval is requested. A Legion phase worker never writes the spec; it sends a
32
+ decision to its architect (`skill://legion-worker`).
33
+
34
+ ## Where the spec lives
35
+
36
+ Search Dispatch first, as `skill://dispatch-first` says. When an issue already tracks the work, its
37
+ primary document is the spec: extend it in place with `dispatch_doc_edit`, keeping the human's own
38
+ text. Otherwise create the issue with its first version as `spec`, in the project a search hit
39
+ already named or, when none does, the project the human names:
40
+
41
+ ```ts
42
+ dispatch_issue({ project, title, spec })
43
+ ```
44
+
45
+ No tool lists every project, so when nothing you found names one, ask the human in chat which
46
+ project the issue belongs in before you create it — a filing question with nowhere else to land
47
+ yet, not a design question, so it does not change "your reply in chat links the issue and asks
48
+ nothing" for the design itself. Never read the project from the environment, a configuration file,
49
+ or the Dispatch HTTP API: every read and write goes through a `dispatch_*` tool.
50
+
51
+ Before the first version, read the code and documents the design touches, so the facts you write
52
+ are ones you checked.
53
+
54
+ ## Each turn
55
+
56
+ 1. **Start with what is established.** The first version holds only what the conversation has
57
+ established: the problem and its evidence, what the human has said in their own words, the
58
+ facts the next questions need, and each question that is ready, as a decision block at the end
59
+ of the section that sets it up. Write nothing past those questions: no design, no defaults you
60
+ chose, no "what we will build", and no recommendation outside a decision block's own text. A
61
+ point the human has not stated, however obvious it seems (what a word in the request means, how
62
+ an edge case behaves, what a change does to an existing command), goes inside a decision block
63
+ or stays out. This is stricter than `skill://dispatch`'s general rule for an inferred point
64
+ elsewhere in a spec ("a point you inferred says so, with the reasoning"): in a live conversation
65
+ nothing is settled until the human has seen it, so even a flagged inference waits for its own
66
+ decision block.
67
+ 2. **The human answers or comments.** Reply to each human comment in its thread
68
+ (`dispatch_comment` with `reply_to`), then rewrite the passage the answer or the comment changes.
69
+ Under an open ask whose next move is yours, such as the approval request you must revise or
70
+ hand back, reply with `reply_to_ask` and `turn: "agent"` instead: a `reply_to` reply takes the
71
+ default turn, which hands the request back to the human unchanged, and a call with a corrected
72
+ `summary` is refused while it waits on them.
73
+ 3. **Each next version folds the answers in and adds what they open.** Keep each answered
74
+ decision block where it is, fold its answer into the surrounding text in the human's words with
75
+ the date, recording the person as `skill://dispatch`'s "Writing a spec" says for a settled
76
+ point. Then add the next sections, each with its question. Every question that is ready goes out
77
+ at once, each as a decision block at the end of the section that sets it up; a question waits
78
+ only when it depends on an answer still open.
79
+ 4. **A comment that answers a question settles it** as surely as the block does. Fold it into the
80
+ text at once, and close the block with `dispatch_resolve_ask` if the human has not.
81
+ 5. **Request approval at the end, not after each section.** Once nothing in the spec is new to the
82
+ human, request it exactly when "Approval of a spec" in `skill://dispatch` says: every decision
83
+ block settled and folded in, the human has agreed to every point in the spec, and the current
84
+ version is not yet approved (or waived, as that section's next paragraph covers). The request
85
+ carries nothing new, as that section also says.
86
+
87
+ ## Coming to terms
88
+
89
+ The conversation comes to terms in both directions. Explain what the code does today, plainly
90
+ enough for the human to react to and with each tool, event and route it uses named exactly (as
91
+ "Writing for the human" in `skill://dispatch` says), and ask; the human's model comes out of those
92
+ reactions, and so do corrections to it. Neither your model nor theirs is the starting truth.
93
+
94
+ ## The plan
95
+
96
+ Once the spec is approved — or, when the issue needed no spec at all (a bug fix with no design
97
+ decision), once you have enough to plan from — the implementation plan is the issue's `plan.md`
98
+ document, never its spec and never a repository file:
99
+
100
+ ```ts
101
+ dispatch_artifact({ issue, name: "plan.md", content })
102
+ ```
103
+
104
+ Uploading `plan.md` again writes its next version. `writing-plans`'s content rules still apply in
105
+ full — file structure, task right-sizing, bite-sized steps, no placeholders, the header, and its
106
+ self-review — only where the plan lives changes: the issue's `plan.md`, never a repository file.
107
+ Technical choices inside the approved design are made in the plan and need no question. A plan
108
+ never changes a decision the human made in the spec: a change to one goes back to the spec as a
109
+ decision block, with the evidence for it.
110
+
111
+ Execution reads the plan the same way: `dispatch_doc_read({ issue, artifact: "plan.md" })` in place
112
+ of opening a plan file, then follows `executing-plans` or `subagent-driven-development` as it would
113
+ for a file on disk.
@@ -41,10 +41,14 @@ parent's children and the issue's `Components:` line show where the rest of that
41
41
  facts, the options and your recommendation in it, and link what you cite (`dispatch://…`)
42
42
  instead of writing "see above" or "my earlier message".
43
43
 
44
+ ## Design in the spec
45
+
46
+ A design conversation with a person, or the implementation plan that follows one, uses
47
+ `skill://dispatch-brainstorming`: read it before your first design question on a change, the spec,
48
+ or that plan. It replaces superpowers' `brainstorming` and `writing-plans` here, even when the user
49
+ invokes one by name. A Legion architect's own issue spec follows `skill://legion-architect`.
50
+
44
51
  ## Load the full skill before you write
45
52
 
46
- - **Before your first design question on a change, and before you write or change a spec, read
47
- `skill://dispatch`,** including its "Writing a spec" section: a design change is brainstormed in
48
- its issue's spec, not in chat, even when the brainstorming skill says otherwise.
49
- - Before any other write to Dispatch (an ask, a message, a comment, a document edit, a status
50
- change, a claim), load `skill://dispatch` unless you already have in this session.
53
+ Before any write to Dispatch (an ask, a message, a comment, a document edit, a status change, a
54
+ claim), load `skill://dispatch` unless you already have in this session.
@@ -46,12 +46,16 @@ takes this order: write, commit and push the handoff; submit the review of the h
46
46
  made, by its SHA; then complete. An approval waits for the CI verdict to settle green at that head
47
47
  before you submit it, since an approval stands only on green checks and GitHub can dismiss one
48
48
  once the head moves, and a verdict that settles red there makes the round's decision a request for
49
- changes naming the failing checks; a request for changes does not wait, since it stands whatever CI says and the
50
- issue leaves reviewing with it. A review of a head the handoff push then replaces names a head
51
- the pull request no longer has. A round that writes none (the final approval of the `.legion/`
52
- deletion head) reviews the head as it is. The daemon moves the issue once both are in —
53
- the decision GitHub reports and your completion, in either order — so a review posted without a
54
- completion leaves the issue in reviewing until you finish.
49
+ changes naming the failing checks; a request for changes does not wait, since it stands whatever
50
+ CI says and the issue leaves reviewing with it. The verdict is of the checks the base branch
51
+ requires, the set READY checks: red when one of them failed, and never red for a check the base
52
+ branch does not require. A required check that was cancelled, or that the head's checks settled
53
+ without, leaves no verdict until a later settlement decides it, since a run can be cancelled or
54
+ not yet queued when the head settles. A review of a head the handoff push
55
+ then replaces names a head the pull request no longer has. A round that writes none (the final
56
+ approval of the `.legion/` deletion head) reviews the head as it is. The daemon moves the issue
57
+ once both are in — the decision GitHub reports and your completion, in either order — so a
58
+ review posted without a completion leaves the issue in reviewing until you finish.
55
59
 
56
60
  ## Retro
57
61
 
@@ -1,53 +0,0 @@
1
- # Brainstorming in the spec: each turn, from the first version to approval
2
-
3
- This overrides the brainstorming skill's pace: no design question goes to chat, there is no limit
4
- of one question per message, and there is no approval after each section, only the one at the end.
5
- Its stages still shape what you ask (clarifying questions, then two or three approaches with a
6
- recommendation, then the design section by section), but a question that depends on no open answer
7
- goes out at once, whatever its stage.
8
-
9
- ## Each turn
10
-
11
- 1. **Start with what is established.** The first version holds only what the conversation has
12
- established: the problem and its evidence, what the human has said in their own words, the
13
- facts the next questions need, and each question that is ready, as a decision block at the end
14
- of the section that sets it up, shaped as "Decision blocks" in `skill://dispatch` says. Write
15
- nothing past those questions.
16
- 2. **The human answers or comments.** Reply to each human comment in its thread
17
- (`dispatch_comment` with `reply_to`), then rewrite the passage the answer or the comment changes.
18
- Under an open ask whose next move is yours, such as the approval request you must revise or
19
- hand back, reply with `reply_to_ask` and `turn: "agent"` instead: a `reply_to` reply takes the
20
- default turn, which hands the request back to the human unchanged, and a call with a corrected
21
- `summary` is refused while it waits on them.
22
- 3. **Each next version folds the answers in and adds what they open.** Keep each answered
23
- decision block where it is, fold its answer into the surrounding text in the human's words with
24
- the date (an answer that is only a chosen option as
25
- `Sami chose "Commit author" on the question below (2026-10-02)`), then add the next sections,
26
- each with its question. Every question that is ready goes out at once, each as a decision block
27
- at the end of the section that sets it up; a question waits only when it depends on an answer
28
- still open.
29
- 4. **A comment that answers a question settles it** as surely as the block does. Fold it into the
30
- text at once, and close the block with `dispatch_resolve_ask` if the human has not.
31
- 5. **Request approval at the end, not after each section, when nothing in the spec is new to the
32
- human:** every block settled, every comment answered, and every point they have not agreed to,
33
- however small, either put to them first as its own decision block or, when it is yours to
34
- decide, taken out of the spec and made where the work happens. An inference you cannot defend in
35
- a decision block comes out of the spec. The request carries nothing new ("Approval of a spec" in
36
- `skill://dispatch`).
37
-
38
- ## Coming to terms
39
-
40
- The conversation comes to terms in both directions. Explain what the code does today, plainly
41
- enough for the human to react to and with each tool, event and route it uses named exactly (as
42
- "Writing for the human" in `skill://dispatch` says), and ask; the human's model comes out of those
43
- reactions, and so do corrections to it. Neither your model nor theirs is the starting truth.
44
-
45
- ## A worked example
46
-
47
- Take the spec for the secrets broker's identity model. Its first version
48
- held the problem, the human's words, what exists today, and the one question that was ready then;
49
- it also called itself "a conversation", which the human struck as commentary. Each later version
50
- folds the answers in with the human's words and date and adds the questions they open. Its first
51
- approval request, on the spec's version 35, named four inferences the human
52
- had never discussed; the human rejected it, and each of the four was then either put to the human
53
- as its own decision block or taken out of the spec.