Kanban Workflow (core)
Goal
Provide a reusable core for a project-management “co-worker” that:
- - Uses the existing
stage:* lifecycle as the canonical state machine. - Integrates with PM platforms via adapter-managed auth (external CLIs/scripts; may require env vars like API keys). Kanban Workflow does not run interactive OAuth flows or persist secrets.
- Centralizes workflow/rules/runbooks so GitHub/Planka/Plane/Linear implementations share logic.
Canonical stage model
Treat these labels/states as canonical (and the only stages the agent should consider):
- - INLINECODE1
- INLINECODE2
- INLINECODE3
- INLINECODE4
Notes:
- - Done/closed is platform-specific and intentionally not part of the canonical stage set.
Adapters map platform concepts (labels, lists, statuses, custom fields) into this canonical set.
Architecture (ports & adapters)
Core (platform-agnostic)
- - Canonical entities:
WorkItem, Project, Comment, Stage. - Canonical events:
WorkItemCreated, WorkItemUpdated, StageChanged, CommentAdded, etc. - Workflow engine: stage-based worker loop + clarification/comment templates.
- State: cursors + dedupe + snapshots for diffing.
Adapters (platform-specific)
Adapters are “smart wrappers” that:
- - Call existing CLIs (e.g.
gh, planka-cli, plane), relying on their auth/session (Plane uses PLANE_API_KEY + PLANE_WORKSPACE; Linear uses LINEAR_API_KEY via the ClawHub skill linear). - Compose multiple CLI calls to implement higher-level operations.
- Synthesize events by polling + snapshot diffing when webhooks or event types are missing.
Canonical adapter entrypoints live in src/adapters/:
- -
github.ts (gh CLI) - INLINECODE22 (planka-cli)
- INLINECODE23 (ClawHub skill
plane CLI; owner: vaguilera-jinko) - INLINECODE26 (ClawHub skill
linear auth convention via scripts/linear_json.sh)
See also: src/adapters/README.md for CLI links and assumptions.
Entry points
Library entry points:
- -
tick() (poll → normalize → diff → events) - verb-level workflow helpers:
show, next, start, update, ask, complete, create, INLINECODE38 - automations: INLINECODE39
CLI entry point:
- -
src/cli.ts (provides kanban-workflow <verb>; see README for setup flags)
CLI ergonomics: "What next" tips
All kanban-workflow <verb> commands print a What next: tip after execution to guide the canonical flow:
INLINECODE44 → next → start → (ask | update) → complete → INLINECODE50
After start, the tip additionally reminds you to run the actual execution/implementation work in a subagent, then report back via ask/update.
If config/kanban-workflow.json is missing or invalid, all commands error and instruct you to complete setup.
Setup (flags-only)
Setup writes config/kanban-workflow.json and validates that the selected platform CLI is installed + authenticated.
Required:
- - INLINECODE56
- stage mapping flags:
--map-backlog, --map-blocked, --map-in-progress, INLINECODE60
Optional autopilot scheduling:
- -
--autopilot-cron-expr "*/5 * * * *" (default) - INLINECODE62 (optional)
- INLINECODE63 (creates an OpenClaw cron job that runs
kanban-workflow autopilot-tick)
Adapter flags (summary):
- - GitHub:
--github-repo <owner/repo>, optional INLINECODE66 - Plane:
--plane-workspace-slug <slug>, --plane-project-id <uuid>, optional INLINECODE69 - Linear:
--linear-team-id <id> or --linear-project-id <id>, optional INLINECODE72 - Planka:
--planka-board-id <id>, INLINECODE74
Continuous status updates
While a task is in stage:in-progress, Kanban Workflow can post an automatic progress update comment every 5 minutes.
Use runProgressAutoUpdates() and persist its state in your agent/runtime.
Recommended repo layout
- -
scripts/: deterministic helper scripts used by adapters or the core. - INLINECODE79 : schemas and adapter notes (loaded on demand).
- INLINECODE80 : runbooks/SOP templates.
Repo status
- - The current core implementation is in TypeScript under
src/.
Next implementation steps
1) Extend the adapter port to include idempotent write operations (comment/transition/label) in addition to fetchSnapshot().
2) Finish and validate the Plane + Linear adapters (consume ClawHub skill plane output schema; Linear uses scripts/linear_json.sh JSON compatibility wrapper).
3) Decide on the authoritative mapping rule for stage → platform state (names vs explicit mapping table) and codify it.
4) Add a small CLI surface for Kanban Workflow itself (e.g. kanban-workflow tick --adapter plane --workspace ... --project ...).
看板工作流(核心)
目标
提供一个可复用的项目管理“协作者”核心,实现以下功能:
- - 使用现有的 stage:* 生命周期作为规范状态机。
- 通过适配器管理的认证(外部CLI/脚本;可能需要环境变量如API密钥)与项目管理平台集成。看板工作流不运行交互式OAuth流程或持久化密钥。
- 集中管理工作流/规则/操作手册,使GitHub/Planka/Plane/Linear实现共享逻辑。
规范阶段模型
将以下标签/状态视为规范状态(也是代理应考虑的唯一阶段):
- - stage:backlog
- stage:blocked
- stage:in-progress
- stage:in-review
注意:
- - 完成/关闭状态是平台特定的,有意不包含在规范阶段集合中。
适配器将平台概念(标签、列表、状态、自定义字段)映射到该规范集合。
架构(端口与适配器)
核心(平台无关)
- - 规范实体:WorkItem、Project、Comment、Stage。
- 规范事件:WorkItemCreated、WorkItemUpdated、StageChanged、CommentAdded等。
- 工作流引擎:基于阶段的工作者循环 + 澄清/评论模板。
- 状态:用于差异比较的游标 + 去重 + 快照。
适配器(平台特定)
适配器是“智能包装器”,实现以下功能:
- - 调用现有CLI(例如 gh、planka-cli、plane),依赖其认证/会话(Plane使用PLANEAPIKEY + PLANEWORKSPACE;Linear通过ClawHub技能linear使用LINEARAPI_KEY)。
- 组合多个CLI调用以实现更高级别的操作。
- 在缺少webhook或事件类型时,通过轮询 + 快照差异比较合成事件。
规范适配器入口点位于 src/adapters/:
- - github.ts(gh CLI)
- planka.ts(planka-cli)
- plane.ts(ClawHub技能plane CLI;所有者:vaguilera-jinko)
- linear.ts(ClawHub技能linear通过scripts/linear_json.sh的认证约定)
另见:src/adapters/README.md 获取CLI链接和假设。
入口点
库入口点:
- - tick()(轮询 → 标准化 → 差异比较 → 事件)
- 动词级别的工作流辅助函数:show、next、start、update、ask、complete、create、autopilot-tick
- 自动化:runProgressAutoUpdates()
CLI入口点:
- - src/cli.ts(提供 kanban-workflow ;参见README获取设置标志)
CLI用户体验:下一步提示
所有 kanban-workflow 命令在执行后打印 What next: 提示以引导规范流程:
setup → next → start → (ask | update) → complete → next
在 start 之后,提示额外提醒您在子代理中运行实际的执行/实施工作,然后通过 ask/update 报告结果。
如果 config/kanban-workflow.json 缺失或无效,所有命令都会报错并指示您完成设置。
设置(仅标志)
设置写入 config/kanban-workflow.json 并验证所选平台CLI已安装且已认证。
必需:
- - kanban-workflow setup --adapter ...
- 阶段映射标志:--map-backlog、--map-blocked、--map-in-progress、--map-in-review
可选的自动驾驶调度:
- - --autopilot-cron-expr /5 *(默认)
- --autopilot-cron-tz Europe/Berlin(可选)
- --autopilot-install-cron(创建一个运行 kanban-workflow autopilot-tick 的OpenClaw定时任务)
适配器标志(摘要):
- - GitHub:--github-repo ,可选 --github-project-number
- Plane:--plane-workspace-slug 、--plane-project-id ,可选 --plane-order-field
- Linear:--linear-team-id 或 --linear-project-id ,可选 --linear-view-id
- Planka:--planka-board-id 、--planka-backlog-list-id
持续状态更新
当任务处于 stage:in-progress 阶段时,看板工作流可以每5分钟自动发布进度更新评论。
使用 runProgressAutoUpdates() 并在您的代理/运行时中持久化其 state。
推荐仓库布局
- - scripts/:适配器或核心使用的确定性辅助脚本。
- references/:模式和适配器说明(按需加载)。
- assets/:操作手册/SOP模板。
仓库状态
- - 当前核心实现为TypeScript,位于 src/ 下。
下一步实施步骤
1) 扩展适配器端口,除 fetchSnapshot() 外,还包括幂等写入操作(评论/转换/标签)。
2) 完成并验证Plane + Linear适配器(消费ClawHub技能plane输出模式;Linear使用scripts/linear_json.sh JSON兼容性包装器)。
3) 确定阶段到平台状态的权威映射规则(名称与显式映射表)并编码。
4) 为看板工作流本身添加小型CLI界面(例如 kanban-workflow tick --adapter plane --workspace ... --project ...)。