Hermes Kanban 看板系统 — 完整手册
Kanban 是 "信号卡" 的意思。在 Hermes 里,它是一个 SQLite 任务看板,可以把大需求拆成小卡片,自动或手动派发给 worker 去执行。
一、Kanban 能解决什么问题
没有看板时,你只能靠对话来推进任务:
你:重构战斗系统
Hermes:好的我要做 A
你:还要做 B
Hermes:好的
你:别忘了 C
...
有了看板,任务变成卡片,你一目了然:
看板状态:
╔═══════════════════════════════════════╗
║ 待处理 进行中 已完成 ║
║ ┌─────────┐ ┌─────────┐ ┌─────────┐║
║ │战斗系统B │ │战斗系统A │ │战斗系统C │║
║ │(等待中) │ │(worker1)│ │(已做完) │║
║ └─────────┘ └─────────┘ └─────────┘║
╚═══════════════════════════════════════╝
二、核心概念
看板(Board)
每个项目一个看板。比如石器时代项目一个看板,Nacos 配置项目另一个看板。
任务卡片(Task)
一个卡片 = 一件事。卡片有:标题、描述、状态、负责人、优先级、依赖关系。
任务状态流转
Scheduled ──→ Todo ──→ Ready ──→ In Progress ──→ Done
↑ ↑ │
└── 定时触发 └── blocked ─┘
| 状态 | 含义 |
|---|---|
| Scheduled | 定时任务,到时间自动变为 Ready |
| Todo | 任务已创建,等待人认领 |
| Ready | 可以开始做了(依赖已完成或手动 promote) |
| In Progress | 有人正在做 |
| Blocked | 被阻塞(依赖另一个任务、等审批等) |
| Done | 完成 |
| Archived | 归档(保留记录、不显示在看板上) |
依赖关系
卡片之间可以建立父子依赖:
hermes kanban link 3 1 # 任务 3 依赖任务 1
# 任务 1 做完后,任务 3 自动变为 Ready
三、配置
不需要改配置也能用,但了解这些可以更好地调优:
# ~/.hermes/config.yaml 中 kanban 相关配置
kanban:
dispatch_in_gateway: true # 让 Gateway 自动派发任务
dispatch_interval_seconds: 60 # 每 60 秒检查一次看板
failure_limit: 2 # 任务失败 2 次就标记失败
worker_log_rotate_bytes: 2097152 # worker 日志单个文件上限 2MB
worker_log_backup_count: 1 # 保留 1 份日志备份
orchestrator_profile: '' # 编排器使用的 profile
default_assignee: '' # 默认指派给谁
max_in_progress_per_profile: null # 每个人最多同时做几个任务(null=不限)
auto_decompose: true # 自动拆分子任务
auto_decompose_per_tick: 3 # 每次派发最多拆 3 个
dispatch_stale_timeout_seconds: 14400 # 任务超时 4 小时
四、命令行完整参考
初始化
hermes kanban init
# 创建 ~/.hermes/kanban.db,已有则跳过(幂等操作)
看板管理
hermes kanban boards list # 列出所有看板
hermes kanban boards create sa-game # 新建看板
hermes kanban boards switch sa-game # 切换到某个看板
# 切换后,后续所有命令都针对这个看板操作
创建任务
# 交互式:会依次询问标题、描述、优先级等
hermes kanban create
# 一行命令创建
hermes kanban create \
--title "实现登录接口" \
--body "客户端写 LoginView
服务端实现 fid=71/72
两端对齐 Nacos 契约"
# 创建 Swarm 编排任务(见下面 Swarm 章节)
hermes kanban swarm "实现登录功能" \
--worker profile-a:UI:skill-vue \
--verifier profile-b \
--synthesizer profile-c
查看任务
hermes kanban list # 列所有任务(标题+ID+状态+负责人)
hermes kanban stats # 统计板:各状态数量 + 最老的 Ready 任务等待多久
hermes kanban show <id> # 任务详情(描述、评论、事件历史、日志)
hermes kanban tail <id> # 实时跟踪某个任务的进展(Ctrl+C 退出)
hermes kanban watch # 持续看板事件流(新任务、状态变更等实时打印)
认领和指派
hermes kanban claim <id> # 认领一个 Ready 任务给自己
hermes kanban assign <id> --profile name # 指派给某个 profile
hermes kanban reassign <id> --profile name # 改派
hermes kanban reclaim <id> # 释放当前认领(让别人能认领)
状态变更
hermes kanban complete <id> # 标记完成
hermes kanban block <id> # 标记阻塞
hermes kanban unblock <id> # 解除阻塞
hermes kanban promote <id> # 手动将 Todo/Blocked 提升为 Ready
hermes kanban schedule <id> # 转为定时任务(需配合时间条件)
hermes kanban archive <id> # 归档(保留历史但不显示)
依赖管理
hermes kanban link 3 1 # 任务 3 依赖任务 1(1 做完后 3 自动 Ready)
hermes kanban unlink 3 1 # 解除依赖
协作
hermes kanban comment <id> --message "客户端已做完,等待服务端" # 加备注
hermes kanban log <id> # 查看 worker 运行日志
hermes kanban runs <id> # 查看任务的运行历史(每次尝试、耗时、结果摘要)
任务分解(高级)
hermes kanban decompose <id> # 自动拆成子任务,路由到不同 profiles
hermes kanban specify <id> # 把草稿任务细化为具体规格(标题+body)
通知订阅
hermes kanban notify-subscribe <task-id> <source> # 订阅任务完成通知
hermes kanban notify-list # 列出所有订阅
hermes kanban notify-unsubscribe <task-id> <source> # 取消订阅
Swarm 编排模式
Swarm 是 Kanban 的高级模式,创建一组 并行 Worker → Verifier 审查 → Synthesizer 合并 的任务结构:
hermes kanban swarm "实现登录系统的完整前后端对接" \
--worker profile-a:登录界面:skill-vue,skill-ui \
--worker profile-b:登录协议客户端:skill-ts,skill-net \
--worker profile-c:登录接口服务端:skill-node,skill-api \
--verifier profile-d \
--synthesizer profile-e
执行时的结构:
"实现登录系统"
│
Orchestrator 自动分解
│
┌──────────────┼──────────────┐
│ │ │
Worker A Worker B Worker C
(登录界面) (协议客户端) (服务端接口)
│ │ │
└──────────────┼──────────────┘
│
Verifier D
(审查三端一致性)
│
Synthesizer E
(合并结果,写回看板)
│
任务完成 ✅
清理
hermes kanban gc # 清理:归档任务的工作区、旧事件、旧日志
五、实际场景用法
场景:石器时代项目
# 1. 初始化
hermes kanban init
hermes kanban boards create sa-game
hermes kanban boards switch sa-game
# 2. 创建任务
hermes kanban create --title "登录模块" \
--body "客户端 LoginView
服务端 fid=71/72
对齐 Nacos sa-contract.yaml"
hermes kanban create --title "战斗系统" \
--body "B_SEND/fid=14 客户端发送
B_RECV 服务端 BC/BA/BU 推送"
hermes kanban create --title "地图模块" \
--body "MC_RECV/fid=37 地图数据
MapRenderer 渲染"
# 3. 看板上现在 3 个任务,都是 Todo
hermes kanban stats
# → Todo: 3 | In Progress: 0 | Done: 0
# 4. 开始做登录模块
hermes kanban claim 1
# → 任务 1 变为 In Progress
# 5. 做完了
hermes kanban comment 1 --message "客户端登录界面完成,等待服务端联调"
hermes kanban complete 1
# → 任务 1 变为 Done
hermes kanban stats
# → Todo: 2 | In Progress: 0 | Done: 1
六、局限性
- 只派发给 Hermes worker — Kanban 只能派发给 Hermes 自己的 profiles,不能直接派发给 Claude Code 或其他 Agent
- SQLite 单机 — kanban.db 是本地 SQLite 文件,不能直接跨机器共享
- 跨机器方案 — 需要把 kanban.db 放到 git 仓库或共享存储
七、常用命令速查
| 目的 | 命令 |
|---|---|
| 初始化 | hermes kanban init |
| 新建看板 | hermes kanban boards create <name> |
| 切看板 | hermes kanban boards switch <name> |
| 创建任务 | hermes kanban create --title "T" --body "B" |
| 列任务 | hermes kanban list |
| 看统计 | hermes kanban stats |
| 看详情 | hermes kanban show <id> |
| 认领 | hermes kanban claim <id> |
| 指派 | hermes kanban assign <id> --profile <p> |
| 完成 | hermes kanban complete <id> |
| 阻塞 | hermes kanban block <id> |
| 加备注 | hermes kanban comment <id> --message "..." |
| 实时跟踪 | hermes kanban tail <id> |
| 建依赖 | hermes kanban link <child> <parent> |
| Swarm | hermes kanban swarm "目标" --worker ... --verifier ... --synthesizer ... |
评论
评论功能即将上线,敬请期待。