关于 ak-task
ak-task 是一个 Agent 技能,通过 Realmroot Toolbox 在 agent-kanban 工作流中创建、分配、监控、审核和取消任务。它要求创建前预览任务详情,并使用有限等待及重新读取状态来处理重要更新。
主要功能
- 01查询看板、仓库、任务和 Agent
- 02创建前预览任务详情
- 03创建任务并分配 Agent
- 04使用游标等待任务状态变化
- 05检查备注并验证提交内容
- 06审核或取消任务
适用场景
- 01为可调度的 Agent 准备并分配任务
- 02避免无限轮询并跟踪任务进度
- 03批准或驳回前验证提交的工作
安装
复制下面的命令,在终端中运行。
npx skills add https:/ / github.com/ saltbo/ agent-kanban --skill ak-task安装后在 Claude Code 中输入/ak-task确认已加载。
附带文件agents/openai.yaml
详细介绍
AK 任务
创建前
使用通用 Toolbox 读取操作解析 Board、Repository 和现有 Task:
realmroot toolbox get agent-kanban/boards --json
realmroot toolbox get agent-kanban/repositories --json
realmroot toolbox get 'agent-kanban/tasks?boardId=<board-id>' --json
查找可用的 Agent:
realmroot toolbox get 'agent-kanban/agents?schedulable=true' --json
使用所选 Agent 的 subject 作为 assignedTo。如果不存在合适的 Agent,且已获准创建,则通过 agent-kanban/agents 创建一个。
解决实质性歧义,并在创建前向用户展示准确的 Task 预览。预览必须包含标题、Board、Repository、受派人、描述、依赖项和验收检查。
创建并指派
创建一个未指派的 Task,然后更新其 assignedTo 字段。
realmroot toolbox post agent-kanban/tasks \
--content-type application/json \
@task.json --json
realmroot toolbox patch agent-kanban/tasks/<task-id> \
--content-type application/merge-patch+json \
'{"assignedTo":"<realmroot-agent-actor-id>"}' --json
Realmroot Toolbox 会生成所需的幂等键,并在本次调用的临时重试中重复使用该键。仅当使用先前调用中已知的密钥进行恢复,且该调用结果仍未知时,才提供显式的 Idempotency-Key。
Task 正文使用 lowerCamelCase 资源字段,例如 boardId、title、description、repositoryId、labels、dependsOn、createdFrom 和 scheduledAt。创建 Task 时省略 scheduledAt;不支持延迟调度。PATCH 结果未知时,应重新读取 Task,再决定是否需要再次写入;不要创建另一个 Task。
监控
使用有界的 task wait 调用,并将返回的游标传入下一次调用。不要构建无界轮询循环。
realmroot toolbox agent-kanban task wait <task-id> in-review --wait-seconds 25 --json
每次发生有意义的状态变更后,使用通用 GET 操作检查 Task 和 Notes。已取消的 Task 为终态。
审核
当 Task 达到 in-review 状态时,验证已提交的工作,然后重新读取 Task,再作出审核决定:
realmroot toolbox get agent-kanban/tasks/<task-id> --include --json
realmroot toolbox patch agent-kanban/tasks/<task-id> \
--content-type application/merge-patch+json \
'{"status":"in-progress","statusReason":"Describe the required correction"}' --json
realmroot toolbox patch agent-kanban/tasks/<task-id> \
--content-type application/merge-patch+json \
'{"status":"done"}' --json
如果验收证据或实现不充分,则拒绝,然后等待 Task 进入新的 in-review 状态。只有在请求的结果得到证实时,才标记为完成。如果已验证的审核者与 Task 的 assignedTo 相同,则不要尝试作出任何一种决定;必须由另一位获授权的主体进行审核。
通过同一 Task patch 取消尚未进入终态的 Task:
realmroot toolbox patch agent-kanban/tasks/<task-id> \
--content-type application/merge-patch+json \
'{"status":"cancelled"}' --json