Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Use Python 3.11+ with 4-space indentation and type hints where practical. Match

Every CLI command should have at least one CLI test and complex flows should also have e2e coverage. Add unit tests for pure logic before relying on higher-level tests. Keep new tests in the correct layer and use shared fixtures from `tests/conftest.py` or helpers in `tests/e2e/_helpers.py`.

Do not test hand-written prose by locking exact words. Forbidden: tests that read repo-authored docs, specs, prompts, or skill text (`AGENTS.md`, `README.md`, `skills/**/SKILL.md`, `src/hive/core_assets/specs/*.md`) and assert that specific phrases or headings are present or absent. Review prose changes by reading the diff.
Do not test hand-written prose by locking exact words. Forbidden: tests that read repo-authored docs, specs, prompts, or skill text (`AGENTS.md`, `README.md`, `skills/**/SKILL.md`) and assert that specific phrases or headings are present or absent. Review prose changes by reading the diff.

Allowed: tests that read generated files, state files, JSON, scripts, or payloads to verify executable behavior. Prefer assertions on command exit codes, structured fields, files created, parser output, tmux side effects, and other runtime contracts. If prose must control behavior, move the contract into code or structured data and test that boundary instead of literal wording.

Expand Down
6 changes: 3 additions & 3 deletions hive-topology.html
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,12 @@ <h2>入口交互 · 单一选择</h2>
<pre>
你打 /hive (任何 pane 都行)
▼ 自动加载通信底座 (hive skills get core: send/reply/team)
▼ 自动加载通信底座 (hive:core skill: send/reply/team)
[问] AskUserQuestion —— 唯一一次交互:"起哪种拓扑?"
├─ cell worker + validator,你自己编排 (2 panes)
└─ crew orch + skeptic + 按需 worker-cell (orch = 当前 pane)
hive skills get &lt;选的&gt; → 拉该拓扑的角色说明
加载 hive:&lt;选的&gt; skill → 拉该拓扑的角色说明
▼ 跑对应 init:hive cell init / hive crew init → 自动布 tmux + spawn 角色
▼ 开干
</pre>
Expand All @@ -164,7 +164,7 @@ <h4>✓ 已在 main(via #5,非本会话)</h4>
<div class="stbox todo">
<h4>⧗ 待建(设计已定,未写码)</h4>
<ul>
<li><code>hive skills get &lt;core|cell|crew&gt;</code> —— 新命令,目前不存在。</li>
<li><code>hive:&lt;core|cell|crew&gt;</code> —— role spec 分发面,已改为按 role 独立的插件 skill,按名加载。</li>
<li><code>hive cell init</code> —— 把 cell 落成 <b>worker+validator(固定角色)</b>。<b>注意</b>:当前 <code>hive init</code> 起的还是<b>旧的对称 peer</b>(<code>group=peer</code>、双方都写码互审),<u>尚未</u>改成本图里的 doer+validator。</li>
<li>重写 <code>/hive</code> skill 成 AskUserQuestion(cell/crew) 选择器 + fetch + init。</li>
</ul>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
name: advanced-routing
description: Hive 高级路由:active-turn fork、handoff 接管、复杂 thread routing。仅在 hive 协作中按需加载。
---

# advanced routing — thread takeover

hive 路由的低频场景。常规 `hive send` / `hive reply` 流程不需要读这份,core「消息机制」已经覆盖。
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
name: core
description: Hive 无角色 pane 的通信协议。仅当你被拉进 hive team 而没有分配角色时加载。
---

# core — 无角色 pane 的通信协议

你在一个 Hive team 里,但没有固定角色。先拿到通信底座,再按 team 里的任务做事。
Expand Down Expand Up @@ -34,15 +39,15 @@ hive reply dodo "ack, looking"

- 标签里的 `body` 是短摘要。
- `artifact=<path>` 是正文;需要细节时直接打开这个文件。
- 以 `<HIVE>` block 为准。`hive thread` 只用于排障;需要时取 `hive skills get debug`
- 以 `<HIVE>` block 为准。`hive thread` 只用于排障;需要时调用 hive:debug skill

### 发消息:send 还是 reply

先判断内容是不是在回应某条入站消息。

- 新话题用 `hive send <agent> "<短摘要>"`,例如派任务、提新问题、发新汇报。`send` 不接 `--reply-to`。
- 回应入站消息用 `hive reply <agent> "<回复>"`。不传 `--reply-to` 时,它会锚到最近一条来自该 agent 且你还没回过的入站消息。
- 有 anchor msgId 但当前 pane 没有那条入站消息时,显式 `hive reply <agent> --reply-to <msgId> "<回复>"`。接管 thread 的细节需要时取 `hive skills get advanced-routing`
- 有 anchor msgId 但当前 pane 没有那条入站消息时,显式 `hive reply <agent> --reply-to <msgId> "<回复>"`。接管 thread 的细节需要时调用 hive:advanced-routing skill

不要因为“刚收到过对方消息”就用 `reply`。如果现在说的是新任务或新汇报,用 `send` 开新 thread。

Expand Down Expand Up @@ -113,5 +118,5 @@ source: ...

日常收发只用上面的通信底座。

- 排障命令、delivery、thread、capture、inject、interrupt、kill:`hive skills get debug`
- active-turn fork、handoff 接管、复杂 thread routing:`hive skills get advanced-routing`
- 排障命令、delivery、thread、capture、inject、interrupt、kill:hive:debug skill
- active-turn fork、handoff 接管、复杂 thread routing:hive:advanced-routing skill
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
name: debug
description: Hive 排障深潜:delivery、thread、capture、inject、interrupt、kill。仅在 hive 协作排障时按需加载。
---

# debug + 协议边界

排障命令清单和 hive kernel 的协议硬约束。主通道见 core「消息机制」;日常收发消息不读这份。
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
name: duo-validator
description: Hive duo 的 validator 角色协议。仅当 hive 出生提示或 init 输出指定你为 duo-validator 时加载;其他场景不要触发。
---

# duo-validator — 自包含协议

你是 standalone duo 的 **validator**。worker 写代码;你先审 worker 的 plan 并主笔 VAL,再审 handoff。
Expand All @@ -21,15 +26,15 @@

- 标签里的 `body` 是短摘要。
- `artifact=<path>` 是正文;需要细节时直接打开这个文件。
- 以 `<HIVE>` block 为准。`hive thread` 只用于排障;需要时取 `hive skills get debug`
- 以 `<HIVE>` block 为准。`hive thread` 只用于排障;需要时调用 hive:debug skill

### 发消息:send 还是 reply

先判断内容是不是在回应某条入站消息。

- 新话题用 `hive send <agent> "<短摘要>"`,例如派任务、提新问题、发新汇报。`send` 不接 `--reply-to`。
- 回应入站消息用 `hive reply <agent> "<回复>"`。不传 `--reply-to` 时,它会锚到最近一条来自该 agent 且你还没回过的入站消息。
- 有 anchor msgId 但当前 pane 没有那条入站消息时,显式 `hive reply <agent> --reply-to <msgId> "<回复>"`。接管 thread 的细节需要时取 `hive skills get advanced-routing`
- 有 anchor msgId 但当前 pane 没有那条入站消息时,显式 `hive reply <agent> --reply-to <msgId> "<回复>"`。接管 thread 的细节需要时调用 hive:advanced-routing skill

不要因为“刚收到过对方消息”就用 `reply`。如果现在说的是新任务或新汇报,用 `send` 开新 thread。

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
name: duo-worker
description: Hive duo 的 worker 角色协议。仅当 hive 出生提示或 init 输出指定你为 duo-worker 时加载;其他场景不要触发。
---

# duo-worker — 自包含协议

你是 standalone duo 的 **worker**。validator 审你的 plan、主笔 VAL、最后审 code。你是 duo 对 human 的唯一出口。
Expand All @@ -21,15 +26,15 @@

- 标签里的 `body` 是短摘要。
- `artifact=<path>` 是正文;需要细节时直接打开这个文件。
- 以 `<HIVE>` block 为准。`hive thread` 只用于排障;需要时取 `hive skills get debug`
- 以 `<HIVE>` block 为准。`hive thread` 只用于排障;需要时调用 hive:debug skill

### 发消息:send 还是 reply

先判断内容是不是在回应某条入站消息。

- 新话题用 `hive send <agent> "<短摘要>"`,例如派任务、提新问题、发新汇报。`send` 不接 `--reply-to`。
- 回应入站消息用 `hive reply <agent> "<回复>"`。不传 `--reply-to` 时,它会锚到最近一条来自该 agent 且你还没回过的入站消息。
- 有 anchor msgId 但当前 pane 没有那条入站消息时,显式 `hive reply <agent> --reply-to <msgId> "<回复>"`。接管 thread 的细节需要时取 `hive skills get advanced-routing`
- 有 anchor msgId 但当前 pane 没有那条入站消息时,显式 `hive reply <agent> --reply-to <msgId> "<回复>"`。接管 thread 的细节需要时调用 hive:advanced-routing skill

不要因为“刚收到过对方消息”就用 `reply`。如果现在说的是新任务或新汇报,用 `send` 开新 thread。

Expand Down
36 changes: 12 additions & 24 deletions plugins/hive/skills/hive/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: Hive 是 tmux 里的多 agent 协作 runtime。当收到 HIVE 消

# Hive — agent 协作入口

Hive 让多个 agent 在 tmux 里用 `<HIVE ...>` 消息协作。这个文件只是发现入口;真正协议由 CLI 按当前角色取回
Hive 让多个 agent 在 tmux 里用 `<HIVE ...>` 消息协作。这个文件只是发现入口;真正协议是按角色命名的独立 skill,按名加载

## 已在 team 里

Expand All @@ -17,24 +17,18 @@ hive team

看 `self`、`members`、`group`、`peer` 和当前 pane 状态。

如果出生 prompt 或 init 输出给了角色,就只取那一份
如果出生 prompt 或 init 输出给了角色,就只加载那一个 skill

```bash
hive skills get duo-worker
hive skills get duo-validator
hive skills get squad-orch
hive skills get squad-challenger
hive skills get squad-worker
hive skills get squad-validator
```
- `hive:duo-worker`
- `hive:duo-validator`
- `hive:squad-orch`
- `hive:squad-challenger`
- `hive:squad-worker`
- `hive:squad-validator`

这些角色 spec 都是自包含协议。取回一份、读完、照它做;不要再拼别的 role spec
这些角色 skill 都是自包含协议。加载一个、照它做;不要再拼别的角色 skill

如果你只是被拉进已有 team、没有角色,取:

```bash
hive skills get core
```
如果你只是被拉进已有 team、没有角色,加载 `hive:core`。

没有待办时结束当前 turn,pane 保持打开等下一条 `<HIVE>` 注入。不要 `sleep` 轮询,不要自己翻库找活。

Expand All @@ -52,14 +46,8 @@ hive duo init
hive squad init
```

init 的 JSON 会给 `next`,例如 `hive skills get duo-worker` 或 `hive skills get squad-orch`。你自己跑 `next` 取当前 pane 的完整协议。
init 的 JSON 会给 `next`,例如 `invoke skill hive:duo-worker`。照 `next` 加载对应角色 skill,取当前 pane 的完整协议。

## 速查

```bash
hive skills list
hive skills get debug
hive skills get advanced-routing
```

`debug` 和 `advanced-routing` 是按需逃生口;日常流程按当前角色 spec。
`hive:debug` 和 `hive:advanced-routing` 是按需逃生口;日常流程按当前角色 skill。
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
name: squad-challenger
description: Hive squad 的 challenger 角色协议。仅当 hive 出生提示或 init 输出指定你为 squad-challenger 时加载;其他场景不要触发。
---

# squad-challenger — 自包含协议

你是 squad 的 **challenger**。orch 拆需求和派 duo;你审 orch 的 plan,并评估 worker 的终态交付是否能推进给 orch。
Expand All @@ -16,15 +21,15 @@

- 标签里的 `body` 是短摘要。
- `artifact=<path>` 是正文;需要细节时直接打开这个文件。
- 以 `<HIVE>` block 为准。`hive thread` 只用于排障;需要时取 `hive skills get debug`
- 以 `<HIVE>` block 为准。`hive thread` 只用于排障;需要时调用 hive:debug skill

### 发消息:send 还是 reply

先判断内容是不是在回应某条入站消息。

- 新话题用 `hive send <agent> "<短摘要>"`,例如派任务、提新问题、发新汇报。`send` 不接 `--reply-to`。
- 回应入站消息用 `hive reply <agent> "<回复>"`。不传 `--reply-to` 时,它会锚到最近一条来自该 agent 且你还没回过的入站消息。
- 有 anchor msgId 但当前 pane 没有那条入站消息时,显式 `hive reply <agent> --reply-to <msgId> "<回复>"`。接管 thread 的细节需要时取 `hive skills get advanced-routing`
- 有 anchor msgId 但当前 pane 没有那条入站消息时,显式 `hive reply <agent> --reply-to <msgId> "<回复>"`。接管 thread 的细节需要时调用 hive:advanced-routing skill

不要因为“刚收到过对方消息”就用 `reply`。如果现在说的是新任务或新汇报,用 `send` 开新 thread。

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
name: squad-orch
description: Hive squad 的 orch 角色协议。仅当 hive 出生提示或 init 输出指定你为 squad-orch 时加载;其他场景不要触发。
---

# squad-orch — 自包含协议

你是 squad 的 **orch**。human 给你高层需求;你拆 feature、派 duo、收结论、跑集成验、向 human 汇报。你不写业务代码。
Expand All @@ -23,15 +28,15 @@

- 标签里的 `body` 是短摘要。
- `artifact=<path>` 是正文;需要细节时直接打开这个文件。
- 以 `<HIVE>` block 为准。`hive thread` 只用于排障;需要时取 `hive skills get debug`
- 以 `<HIVE>` block 为准。`hive thread` 只用于排障;需要时调用 hive:debug skill

### 发消息:send 还是 reply

先判断内容是不是在回应某条入站消息。

- 新话题用 `hive send <agent> "<短摘要>"`,例如派任务、提新问题、发新汇报。`send` 不接 `--reply-to`。
- 回应入站消息用 `hive reply <agent> "<回复>"`。不传 `--reply-to` 时,它会锚到最近一条来自该 agent 且你还没回过的入站消息。
- 有 anchor msgId 但当前 pane 没有那条入站消息时,显式 `hive reply <agent> --reply-to <msgId> "<回复>"`。接管 thread 的细节需要时取 `hive skills get advanced-routing`
- 有 anchor msgId 但当前 pane 没有那条入站消息时,显式 `hive reply <agent> --reply-to <msgId> "<回复>"`。接管 thread 的细节需要时调用 hive:advanced-routing skill

不要因为“刚收到过对方消息”就用 `reply`。如果现在说的是新任务或新汇报,用 `send` 开新 thread。

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
name: squad-validator
description: Hive squad 的 validator 角色协议。仅当 hive 出生提示或 init 输出指定你为 squad-validator 时加载;其他场景不要触发。
---

# squad-validator — 自包含协议

你是 squad 派生 duo 里的 **validator**:`<squad>.validator-<N>`。worker 是 `<squad>.worker-<N>`。你对照 orch 发来的 VAL 审 worker 的 plan,再审 handoff。
Expand All @@ -21,15 +26,15 @@

- 标签里的 `body` 是短摘要。
- `artifact=<path>` 是正文;需要细节时直接打开这个文件。
- 以 `<HIVE>` block 为准。`hive thread` 只用于排障;需要时取 `hive skills get debug`
- 以 `<HIVE>` block 为准。`hive thread` 只用于排障;需要时调用 hive:debug skill

### 发消息:send 还是 reply

先判断内容是不是在回应某条入站消息。

- 新话题用 `hive send <agent> "<短摘要>"`,例如派任务、提新问题、发新汇报。`send` 不接 `--reply-to`。
- 回应入站消息用 `hive reply <agent> "<回复>"`。不传 `--reply-to` 时,它会锚到最近一条来自该 agent 且你还没回过的入站消息。
- 有 anchor msgId 但当前 pane 没有那条入站消息时,显式 `hive reply <agent> --reply-to <msgId> "<回复>"`。接管 thread 的细节需要时取 `hive skills get advanced-routing`
- 有 anchor msgId 但当前 pane 没有那条入站消息时,显式 `hive reply <agent> --reply-to <msgId> "<回复>"`。接管 thread 的细节需要时调用 hive:advanced-routing skill

不要因为“刚收到过对方消息”就用 `reply`。如果现在说的是新任务或新汇报,用 `send` 开新 thread。

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
name: squad-worker
description: Hive squad 的 worker 角色协议。仅当 hive 出生提示或 init 输出指定你为 squad-worker 时加载;其他场景不要触发。
---

# squad-worker — 自包含协议

你是 squad 派生 duo 里的 **worker**:`<squad>.worker-<N>`。validator 是 `<squad>.validator-<N>`。orch 派 feature,challenger 收终态交付,orch 管集成。
Expand All @@ -21,15 +26,15 @@

- 标签里的 `body` 是短摘要。
- `artifact=<path>` 是正文;需要细节时直接打开这个文件。
- 以 `<HIVE>` block 为准。`hive thread` 只用于排障;需要时取 `hive skills get debug`
- 以 `<HIVE>` block 为准。`hive thread` 只用于排障;需要时调用 hive:debug skill

### 发消息:send 还是 reply

先判断内容是不是在回应某条入站消息。

- 新话题用 `hive send <agent> "<短摘要>"`,例如派任务、提新问题、发新汇报。`send` 不接 `--reply-to`。
- 回应入站消息用 `hive reply <agent> "<回复>"`。不传 `--reply-to` 时,它会锚到最近一条来自该 agent 且你还没回过的入站消息。
- 有 anchor msgId 但当前 pane 没有那条入站消息时,显式 `hive reply <agent> --reply-to <msgId> "<回复>"`。接管 thread 的细节需要时取 `hive skills get advanced-routing`
- 有 anchor msgId 但当前 pane 没有那条入站消息时,显式 `hive reply <agent> --reply-to <msgId> "<回复>"`。接管 thread 的细节需要时调用 hive:advanced-routing skill

不要因为“刚收到过对方消息”就用 `reply`。如果现在说的是新任务或新汇报,用 `send` 开新 thread。

Expand Down
Loading