AGENT SKILL

Ralph 循环执行行动项

ralph-initiative

以 Ralph 循环的方式运行 Kairos 行动项中的未完成任务,按照其 blocks(阻塞)边的顺序执行。

License 许可
Apache-2.0
所属仓库
colliery-io/kairos
最近更新
2026-11-13
Stars
★ 1
Forks
4

01 前言 Front Matter

name
ralph-initiative
description
Run the open tasks of a Kairos initiative in a Ralph loop, in the sequence of their blocks edges.
argument-hint
<initiative short code> [--max-iterations N]
disable-model-invocation
true

02 资源文件 2

03 SKILL.md 正文

Ralph loop: the tasks of an initiative

The arguments are: $ARGUMENTS

1. Read the initiative and its tasks

  1. Call get_item with the initiative short code (the form is PREFIX-I-NNNN). If get_item does not find it, tell the user, and do not start the loop.
  2. The result gives the children of the initiative. Call get_item for each child task. Ignore a task in a done column. For each other task, record:
    • its short code;
    • its column;
    • each item that blocks it, and if that blocker is done (get_item marks a done blocker [done]).
  3. A task can have a different repository from this checkout. Tell the user, and do not give that task to the script.

2. Start the loop

Give the tasks to the script as JSON on stdin, sorted by short code. The script puts each blocker before the task that it blocks. It skips these tasks:

  • a task in the Blocked column;
  • a task with a blocker that is not done and not in the list;
  • a task in a cycle of blocks edges, or a task after a skipped blocker.
"${CLAUDE_PLUGIN_ROOT}/plugin/hooks/ralph.py" start-initiative --session "${CLAUDE_SESSION_ID}" $ARGUMENTS <<'JSON'
{"tasks": [
  {"code": "PREFIX-T-0001", "column": "Todo", "blockers": []},
  {"code": "PREFIX-T-0002", "column": "Todo", "blockers": [{"code": "PREFIX-T-0001", "done": false}]}
]}
JSON

The fields are code, column and blockers (each with code and done). The script refuses each other field. If the command fails, show its message to the user and stop. The loop did not start.

The script writes the state of the loop to ~/.claude/kairos-ralph/<session id>.json, outside the repository. The Stop hook of the plugin reads this file and gives you the next step at each stop.

3. Do the tasks

The output of the script gives the tasks in sequence and the procedure. It also gives the skipped tasks and the reasons. Write the skipped tasks and their reasons on the initiative with append_note.

Do the tasks in that sequence. Each task goes through each step of /kairos:implement:

  • the repository check;
  • Todo, then Active;
  • progress notes on the item;
  • the completion gate, with evidence for each acceptance criterion;
  • the review, the commit, the push and the draft PR, then Completed.

The loop pushes the branch of each task and opens a draft PR (KAIROS-A-0046). It does not merge, release or tag.

Follow the commit rules of the repository and of the user. Every few tasks, write a short progress note on the initiative with append_note.

What remains lives on the items: the open tasks of the initiative and their blocks edges. When the loop finds work that no task holds, record it as a task with its edge (or a note on the task when it is small) before it goes on. A deliverable of the active task is never "out of scope" in a reply: it is done, split into a task with a reason, or left on the task as open. Do not rewrite the list of what is left from memory: read it (get_item, search with traverse).

The loop ends in one of four ways:

  • Each task in the sequence is in Completed. End your reply with <promise>ALL TASKS COMPLETE</promise>. Do not move the initiative: the user reviews it.

  • A task stops the loop. Do not guess. Stop when one of these conditions occurs:

    • a task is in the Blocked column;
    • a task has no acceptance criteria that you can check;
    • the work needs a design decision, a deploy, or a change in a different repository;
    • the work needs a merge, a release, a tag, or a push that the git guard asks for.

    Write the reason on the task and on the initiative. Give the reason in your reply. End the reply with <promise>LOOP STOPPED</promise>.

  • The loop needs an answer from the user. Do not guess. Write the question on the task with append_note. Give the question in your reply. End the reply with <promise>NEED INPUT</promise>. The user answers, then starts the loop again.

  • The loop gets to the iteration limit (25 by default). Each stop of the session is one iteration. --max-iterations N changes the limit, and --max-iterations 0 removes it. The hook then lets the session stop.

Write a promise only when it is true. To stop the loop at a different time, the user runs /kairos:cancel-ralph.

04 同仓库更多 Skills

colliery-io
colliery-io/kairos

交付看板梳理

triage

梳理交付看板——细化验收标准、确定缺陷优先级、权衡技术债务、归档过期条目、补充待办事项、上报跨团队阻碍。

项目经理工单与问题跟踪管理
★ 1
colliery-io
colliery-io/kairos

对话转行动项 PRD

to-initiative

将当前对话转化为一个附带 PRD 的 Kairos 行动项——无需访谈,仅综合已经讨论过的内容。

产品经理任务规划与分解
★ 1
colliery-io
colliery-io/kairos

Ralph 循环执行任务

ralph

以 Ralph 循环的方式逐个运行 Kairos 任务,依次执行 `/kairos:implement` 的各个步骤。

软件开发工程师定时任务与自动化编排
★ 1
colliery-io
colliery-io/kairos

交付团队组建配置

onboard-team

带领一个新的或设置了一半的交付团队与相关人员一起进入可工作状态——包括其团队、成员、看板、代码仓库、团队页面和章程、任务派发以及本地配置连接。先读取、列出缺口、每次写入前先询问;可安全重复运行。

项目经理办公管理与协作
★ 1
colliery-io
colliery-io/kairos

Kairos 任务实现

implement

将一个 Kairos 任务从 Todo(待办)推进到 Completed(已完成)。当用户指定要实现的具体任务或短代码、要求接手下一个待办项,或经过梳理(groomed)的工作被移交执行时使用。

软件开发工程师代码实现
★ 1
colliery-io
colliery-io/kairos

行动项质询打磨

grill-initiative

一场持续的追问式访谈,用于打磨 Kairos 行动项(或战略),并将每个已确定的答案立即写入该条目。传入行动项或战略的短代码,或新行动项的标题。

产品经理方案质询与决策压力测试
★ 1