@sjawhar/claude-envoy 1.28.1 → 1.28.2

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.
@@ -2,5 +2,5 @@
2
2
  "name": "claude-envoy",
3
3
  "description": "Put Envoy events into the Claude Code session's own conversation and expose Envoy MCP tools.",
4
4
  "mcpServers": "./.mcp.json",
5
- "version": "1.28.1"
5
+ "version": "1.28.2"
6
6
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-envoy",
3
- "version": "1.28.1",
3
+ "version": "1.28.2",
4
4
  "description": "Put Envoy events into the Claude Code session's own conversation and expose Envoy MCP tools.",
5
5
  "mcpServers": {}
6
6
  }
@@ -55391,7 +55391,7 @@ var import_nats2 = __toESM(require_mod4(), 1);
55391
55391
 
55392
55392
  // package.json
55393
55393
  var name = "@sjawhar/claude-envoy";
55394
- var version2 = "1.28.1";
55394
+ var version2 = "1.28.2";
55395
55395
  var legion = {
55396
55396
  daemonApiVersion: 59
55397
55397
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sjawhar/claude-envoy",
3
- "version": "1.28.1",
3
+ "version": "1.28.2",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Claude Code plugin for Legion's Envoy bus",
6
6
  "type": "module",
@@ -1,99 +0,0 @@
1
- ---
2
- name: leading-a-work-stream
3
- description: Use when you lead a work stream or team of agents, when an agent asks you to approve, confirm or review its step or pull request, when you want to know the state of the stream, when an agent starts a long project, or when you consider building tooling or a restriction for agents.
4
- ---
5
-
6
- # Leading a work stream
7
-
8
- If this skill disagrees with the code, a command's output or its `--help`, follow those and say which line of this skill is wrong.
9
-
10
- A lead raises the stream's numbers by making its agents faster, and is not a gate: agents waiting on your reply are a queue, and a queue is the stream's largest hidden cost. Keep it empty — answer at once, or reply "your call" — and when one kind of question keeps arriving, write the answer into the stream's plan or skill, or build the tool that makes the question unnecessary. The stream's own facts (its numbers, scoreboard format, plan, dashboard) are in its issue spec or the organization's stream document; read them there.
11
-
12
- In a Legion tree, the daemon's workflow and your role prompt decide who starts a worker, who accepts the work and how it merges. This skill does not change that sequence. There, a tool the stream needs is a child of your tree or a finding (`skill://legion-worker/references/findings.md`), not an agent you start on your own. Why each rule below works: [sources.md](skill://leading-a-work-stream/references/sources.md).
13
-
14
- Once Legion runs a stream, its controller is that stream's lead; there is no separate lead beside it. Hand an idle stream to Legion as one short-lived agent per issue, each with a handoff comment on its issue, and never hand-apply a program taken from a lead's session, because the program's reasons stayed in that session.
15
-
16
- ## What a lead does
17
-
18
- 1. **Sets direction**: the numbers and targets, the bottleneck, and which experiments run in what order, written where every agent can read it, so each agent constrains its own choices by it. How to open the stream's issue and get its three lines from the user: [direction-and-coaching.md](skill://leading-a-work-stream/references/direction-and-coaching.md).
19
- 2. **Removes obstacles** its agents cannot: access, a decision above their authority, a conflict with another stream.
20
- 3. **Checks results against the numbers**, not against its own reading of the work.
21
- 4. **Coaches each agent's loop**: does it measure its number, write a prediction before each change, and compare more than one design? Give procedure, not solutions, because the agent has the facts of its own work. Which workflow a change or an experiment runs through, and what it predicts before it starts: [direction-and-coaching.md](skill://leading-a-work-stream/references/direction-and-coaching.md).
22
- 5. **Makes the stream faster**: finds where agents lose time and changes the skill, tool or step that causes it.
23
- 6. **Proves its facts with a command.** A claim about what exists or what a thing can do rests on a command and its output, not on a reading. A claim that nothing exists rests on a command whose search could have found it: state the search and why it could match. A lead's facts about its own stream are the ones nobody else checks.
24
- 7. **Keeps the stream's record of what each agent accepted.** At each check-in, read it against the agents' issues and open asks. An item that is neither done, in progress, nor an open ask is dropped work. The lead finds its owner and has it recorded at once.
25
-
26
- ## The speed loop
27
-
28
- Arm a reminder that wakes you every 3 hours and run the six-step loop it names: [speed-tick.md](skill://leading-a-work-stream/references/speed-tick.md). A reminder inside the session dies with the session, and a stream nobody measures for speed slows to the pace of its slowest wait.
29
-
30
- ## Dates
31
-
32
- A date is the time the work takes at agent speed, plus only the waits nobody can shorten. Agents run in parallel and around the clock, so a day of agent work is due tomorrow, and ten minutes of work is due within the hour.
33
-
34
- - Each date carries its basis in one line ("about 3 h of work, 2 h of benchmark runs"), so padding is visible.
35
- - A key performance indicator (KPI) is one of the stream's numbers in its issue spec. A KPI target's date is the earliest date the fastest plan you can write down reaches it. Then shorten the plan: more agents in parallel, the slow step removed, a first slice that lands today.
36
- - When a date will slip, say so the moment you know, with the new date and why. A date beaten by days was padded: set the next date for that kind of work earlier by the margin you beat this one by.
37
-
38
- ## What a lead does not do
39
-
40
- - Gate a decision an agent can make. A concern about a reversible step goes to the agent as a constraint, and the agent decides.
41
- - Review every pull request. Peer review and tests are the approval.
42
- - Require a plan, spec or confirmation to be sent to it before an agent acts.
43
- - Ask agents for a report of each decision or step. Read results in GitHub, Dispatch and the numbers, and measure a number with a command you run.
44
- - Ration a shared resource (disk, VMs, compute) by approving each use. Set the limit, and the agents apply it themselves or through a tool.
45
- - Relay messages between agents who can talk directly.
46
- - Give an agent orders specific to its own work (which task to launch, at what size, what to regrade): the agent has the facts of its own work and the lead does not. Give the rule and the goal (the target, the budget, the bottleneck) and let each agent choose its steps. Before you pass on a precondition from another agent, check it against the code or have its owner send it directly.
47
-
48
- ## Decision rights
49
-
50
- A step that is easy to undo is the agent's: it acts and reports to nobody, and you read the result in GitHub, Dispatch and the numbers. A step that is hard to undo goes from the agent to its owner directly — a person through that agent's own Dispatch ask, the other stream's lead, the owner of the shared infrastructure — never through you, because a relay adds a wait and loses the agent's own facts. Which steps fall where: [decision-rights.md](skill://leading-a-work-stream/references/decision-rights.md).
51
-
52
- When an agent asks permission for an easy-to-undo step, reply "your call" and state any constraint it must keep; add no check of your own before it may act. Do not send a "yes" to an agent that said it would not wait, because the reply arrives as an interruption with nothing in it.
53
-
54
- ## Rules reach agents through what they read
55
-
56
- A rule sent only by message reaches the agents online that day, in the lead's paraphrase, and is gone for the next session. Put each rule where agents read it before they act — the skill that covers the step, the stream's brief, the repository's own instructions — written as an instruction at the step it governs.
57
-
58
- Keep one record of the words of the person the stream works for, each quoted with its date and source, and link that quote wherever a text says the person wants something ([user-quotes.md](skill://leading-a-work-stream/references/user-quotes.md)). Never shorten a quote into a stronger rule ("don't regrade his finished versions without asking him" is not "never regrade"), and never turn a direction into a number the person did not give.
59
-
60
- ## Keep every request and wait in Dispatch
61
-
62
- You answer for every request the user gives any of your agents, and for every wait any of them has.
63
-
64
- - **A request from the user goes on a claimed Dispatch issue before work on it starts**: a line in that issue's `open-items.md` artifact, never its spec, since each spec edit after approval is a new version that closes the design gate. Add it within the hour — what, who asked, a link to the source, what done means (deployed, merged, measured) and a date. A line leaves only with a link to the evidence that it is done, or to the user's agreement that it is dropped.
65
- - **Done is delivered and checked: you saw the result yourself** (deployed, merged, measured). Written into a spec, an approval requested, a todo closed or a message sent to an agent is not done.
66
- - **A wait on a person is an open Dispatch ask the moment you know it** — never only a chat question, a note, a peer message, a comment on an answered ask, or a review request, because nobody tracks those. A wait on anything else is an `open-items.md` line naming the blocker, its owner and its link. Keep working on everything else.
67
- - **Every hour, run the stream's Dispatch check,** the command its brief names. **Once a day, run the repository's dropped-work audit over each agent's transcript and your own;** it also lists long idle spans with work open and long projects that do not use their workflow skill. Each agent gets its own findings directly, and you write in the stream's issue how many items each audit found.
68
- - Three more rules of this upkeep — checking a delegated result, a step held back from a hand-over, and what to re-read after a restart — are in [dispatch-upkeep.md](skill://leading-a-work-stream/references/dispatch-upkeep.md).
69
-
70
- ## Plan the day with the team
71
-
72
- Every morning by 09:00 Pacific, you and your agents agree on Envoy what the stream will merge today, and you write that list into the stream's record, checking that each item has an agent that committed to land it; without it each agent optimises its own day and the stream's numbers move by accident. How the planning runs, what an item must say, and the end-of-day comparison: [daily-plan.md](skill://leading-a-work-stream/references/daily-plan.md).
73
-
74
- ## Knowing the state of the stream
75
-
76
- From records you read yourself (GitHub, Dispatch, the numbers), answer: what is the target; what is the actual value now; what is the obstacle, and which one is being worked on; what is the next step and what should it do to the number; when will we know? Message an agent to plan the day with it, to remove an obstacle or to change its direction, not to collect status.
77
-
78
- ## Before you say something is blocked
79
-
80
- **Read the thing itself, not the thing next to it.** Before you write that X is blocked by Y, read X's own state: `gh pr checks` at the head, not the queue's length; the session's own registry record — its state (`live`, `unresponsive` or `gone`) and its `last_seen` — not its absence from a list of sessions; the job's own start time, not the pool's history. In one day on one box this error was made four times and two of those reached every stream; each was cheap to check and expensive to act on, because a stopped resource and a contended one look identical from a queued job, and a session waiting for its workers looks identical to a dead one. `unresponsive` is that same trap in one word: the session has missed the live window, is still working, still holds its claims, and takes the message you send it when it answers again. Only `gone` is a session that ended.
81
-
82
- **A blocker you relay to other streams carries the command that shows it.** Without it, each stream spends a check to disprove it after acting on it.
83
-
84
- **Ask a fresh reviewer, for each claimed cause, to name the command or record that would show it FALSE, and to run it.** A reviewer that reads only the prose confirms a confident wrong cause. The causes that cost most are the ones nobody could falsify, because nobody looked for what would disprove them.
85
-
86
- **Run a watch that names quiet sessions, and let it restart nothing.** A session that dies mid-task stays dead until a person notices: measured at about 7 hours on a day when one credential failure stopped a box, and at 5 minutes or less once a watch existed. A watch reads each session's registry state and `last_seen`, and nothing else: it names a session that reads `unresponsive` as quiet, one that reads `gone` as ended, and it reports to the owner, who decides. Never have it start a replacement, release a role claim or take an issue claim, because a quiet session is working. One trap: a watch that reads a session's absence from a list, rather than its state, calls working sessions dead under load. Test it by making it report something you know is true.
87
-
88
- ## Delegation and tooling
89
-
90
- - Use subagents and peer agents for review, research and skill improvement. Delegation keeps the responsibility with you: when a delegated result lands, read the number it was meant to move yourself.
91
- - When an agent starts a long project, check that it uses the workflow skill for that kind of work and name the skill: the `/sdd` workflow for an engineering project, `building-and-delivering-tasks` for RL task work. That skill's own review steps replace review by the lead.
92
- - When agents keep losing time to the same chore, start an agent to build the tool that removes it. Do not wait to be asked.
93
- - Do not build, file or ask for a restriction, guard or gate against a failure nobody has seen. Fix a real failure at its cause, after it happens.
94
- - When the user asks the stream for an explainer video, you own it: have a subagent make it with the `making-explainer-videos` skill.
95
- - When a problem is named, fix it now — run the audit, apply the label, change the thing — instead of another round of agents agreeing it is a problem. Routing every change through you for review is a slowdown, not safety; the stream's own peer review and tests stay. When a neighbour names a problem, swarm on it rather than file an issue and wait.
96
-
97
- ## Improving this skill
98
-
99
- When a rule here failed or was missing, edit this file directly, and put the evidence in the commit message, so the next lead gets the fix instead of the same failure.
@@ -1,8 +0,0 @@
1
- # Planning the day with the team
2
-
3
- Every morning, by 09:00 Pacific, the lead and its agents agree on Envoy what the stream will merge today, as a working team does at its daily planning: each agent says what it can land and what stands in the way, the team settles the list, and the lead writes it into the stream's record. The lead owns the list and that it is real.
4
-
5
- - Each item starts with the key performance indicator (KPI, one of the stream's numbers) it moves and the change expected, for example "Grade wall time 7,104 s -> 5,700 s: ...", so the day can be checked against the numbers.
6
- - Work that moves no KPI goes on the list only when it unblocks an item that does, and names that item.
7
- - During the day, an agent that will miss an item says so as soon as it knows, so the team can move work.
8
- - At the end of the day, post each item's actual KPI reading next to its prediction in the stream's record, and ask the owner of each missed item on Envoy what blocked it.
@@ -1,6 +0,0 @@
1
- # Decision rights
2
-
3
- | The step | Who decides |
4
- | --- | --- |
5
- | Easy to undo: a code change, a flag, a branch, opening or merging a pull request that passed peer review and tests, a planned experiment, and any spending the workflow itself calls for (a paid-API review, compute, a VM, a model run the task needs) | The agent. It acts and reports to nobody: the lead reads the result in GitHub, Dispatch and the numbers. |
6
- | Hard to undo: deleting data someone else created, a new financial commitment (a contract, a subscription), a message outside the organization, security, another stream's work or shared state | The agent takes it to its owner directly: a person through the agent's own Dispatch ask, the other stream's agent or lead, the owner of the shared infrastructure. It does not pass through the lead. |
@@ -1,13 +0,0 @@
1
- # Setting direction and coaching the loop
2
-
3
- ## The stream's three lines
4
-
5
- Open the stream's issue with three lines above its targets: the problem the stream exists to solve, the one approach it commits to, and what it will not do. Agents use the third line as a constraint on their own choices, so without it they take work the stream decided against.
6
-
7
- Ask the user those three questions once, in one message, each with a draft answer taken from the user's own words. If an answer rules no work in and none out, ask once more with two concrete options.
8
-
9
- ## Coaching an agent's loop
10
-
11
- - An experiment on a number, with a benchmark that runs in minutes, goes through `/autoresearch`: the expected gain is in its notes before each run, and the change is run again before it is kept, so a result that came from noise does not survive.
12
- - Use the `ce-optimize` skill instead when the result is noisy or has several objectives.
13
- - A one-off change still gets its prediction written in the scoreboard before it starts, so a wrong prediction is visible instead of explained away afterwards.
@@ -1,8 +0,0 @@
1
- # Dispatch upkeep: the rest of the lead's rules
2
-
3
- These go with the "Keep every request and wait in Dispatch" section of the skill.
4
-
5
- - **Check a delegated or relayed result against its done before you report it**, because an agent's "done" is often a message sent, not a thing delivered. Each follow-up the result names becomes a claimed issue, an ask, or an `open-items.md` line, the same hour.
6
- - **A step you keep back from a hand-over becomes its own claimed issue,** blocked by the handed-over one, or it is lost when the hand-over closes.
7
- - **An owner whose session reads `unresponsive` has not dropped its work**: it is past the live window and inside the gone horizon, it keeps its issue claim and its role claim, and the message you send it waits for it. Leave its items with it, start no replacement, and give the work another owner only once its session reads `gone`, or reads `unresponsive` with a `last_seen` more than 20 minutes old.
8
- - **After a restart or a compaction, first re-read your claimed issues and your open asks** (`dispatch open-asks`), then the transcript since your last audit, because what you were waiting for is not in the new context.
@@ -1,9 +0,0 @@
1
- # Why these rules
2
-
3
- - Bezos, [2015 shareholder letter](https://www.sec.gov/Archives/edgar/data/1018724/000119312516530910/d168744dex991.htm): reversible decisions go to individuals, fast; a heavy process on them causes "slowness, unthoughtful risk aversion".
4
- - DORA, [Streamlining change approval](https://dora.dev/capabilities/streamlining-change-approval/): external approval slows delivery and does not cut failed changes; peer review plus automation works; more process after problems makes things worse.
5
- - US Army, [ADP 6-0 Mission Command](https://armypubs.army.mil/epubs/DR_pubs/DR_a/ARN47032-ADP_6-0-000-WEB-1.pdf), 1-37 to 1-44: act within intent; delegation cuts response time; responsibility stays with the commander.
6
- - Google re:Work, [research behind great managers](https://rework.withgoogle.com/intl/en/guides/following-the-data-the-research-behind-great-managers): good managers coach and "empower the team without micromanaging".
7
- - Rother & Liker, [A Kata for PDCA](https://cdn.prod.website-files.com/68b9f0686639ca6b3c064d61/68dd8a5720bf6d3042bafc50_a_kata_for_pdca_-_target_summer_2014.pdf), and [LEI, Kata](https://www.lean.org/lexicon-terms/kata/): the five questions; the coach gives procedure, not solutions.
8
- - Reinertsen, [Product Development Flow, ch. 1](http://lpd2.com/wp-content/uploads/2013/06/ReinertsenFLOWChap1.pdf): queues are the largest hidden cost.
9
- - [Summary of Grove's High Output Management](https://www.becausetech.rocks/blog/high-output-management/): meddling makes people refer problems up; follow delegated work through.
@@ -1,44 +0,0 @@
1
- # The speed tick: the 3-hourly loop and a reminder that survives restarts
2
-
3
- ## The loop, on each tick
4
-
5
- 1. Read the stream's state from its records: the numbers, today's plan against what merged, the hourly Dispatch check.
6
- 2. Ask each agent on Envoy what slows it down most right now. Not status.
7
- 3. Answer in writing: how can I help this go faster while the targets and the checks that gate them stay unchanged; how can I do better work faster; how can I help the team do better work faster?
8
- 4. Give the answers to a fresh subagent to attack — is each target ambitious, is each change concrete, is each date padded — and rewrite what it finds weak, because your own answers read better to you than they are.
9
- 5. Make the change now, or start an agent on it.
10
- 6. Append the tick to the stream's speed log (an artifact `speed-log.md` on the stream issue): the time, the change, the number it should move and by how much; on the next tick, what it did.
11
-
12
- ## Arming the reminder
13
-
14
- A reminder inside the session (`sleep` in a background job) dies with the session's processes. A systemd user timer survives them and wakes the session with an Envoy message. Arm it once, from a shell on the machine the session runs on.
15
-
16
- Replace `NAME` with a short name for your stream and `SESSION` with your full session id. The timer below fires at 01, 04, 07, 10, 13, 16, 19 and 22 UTC; change `OnCalendar` for another rhythm.
17
-
18
- ```bash
19
- mkdir -p ~/.config/systemd/user
20
- cat > ~/.config/systemd/user/speed-tick-NAME.service <<'EOF'
21
- [Unit]
22
- Description=Speed tick for NAME's lead
23
-
24
- [Service]
25
- Type=oneshot
26
- ExecStart=<envoy-send-command> SESSION "SPEED TICK: run the six-step loop in leading-a-work-stream references/speed-tick.md now."
27
- EOF
28
- cat > ~/.config/systemd/user/speed-tick-NAME.timer <<'EOF'
29
- [Unit]
30
- Description=Speed tick for NAME's lead, every 3 hours
31
-
32
- [Timer]
33
- OnCalendar=*-*-* 01/3:00:00
34
- Persistent=true
35
-
36
- [Install]
37
- WantedBy=timers.target
38
- EOF
39
- systemctl --user daemon-reload
40
- systemctl --user enable --now speed-tick-NAME.timer
41
- systemctl --user list-timers speed-tick-NAME.timer
42
- ```
43
-
44
- Set `ExecStart` to the Envoy send command the deployment provides. A session that runs where it cannot install a user timer (a pod) arms an equivalent wake-up there, and says in its speed log how.
@@ -1,7 +0,0 @@
1
- # The record of the user's own words
2
-
3
- Keep one record of the words of the person the stream works for, each quoted with its date and source.
4
-
5
- - A skill, brief, spec or message that says that person wants something links the quote. Without a quote, it names whose rule it is, so nobody takes an agent's invention for the user's instruction.
6
- - When a later quote changes an earlier one, the record says which one stands, and every text that used the earlier one is changed the same day; otherwise two texts give agents opposite rules.
7
- - Never shorten a quote into a stronger rule ("don't regrade his finished versions without asking him" is not "never regrade"), and never turn a direction into a number the person did not give.