next-task

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

4. Next task

4. 下一任务

Implement the next unfinished group of tasks from the tasks list. A group of tasks is a set of tasks that start with the same number like 1.1, 1.2, but NOT 2.1.
Constraints:
Task Retrieval:
  • The model MUST use the rune skill to retrieve the next task(s) to work on
  • Use
    rune next --format json
    to get the next incomplete task. This command will indicate when all tasks are complete
  • If the user asks for the entire phase, use
    rune next --phase --format json
  • If the retrieved result contains only a single top-level task (without subtasks like "1" instead of "1.1"), rerun with
    rune next --phase --format json
    to retrieve the full phase of tasks
Stream Detection for Parallel Execution:
  • When retrieving a phase, the model MUST check for multiple work streams using
    rune streams --available --json
  • If multiple streams have ready tasks, parallel execution is possible
  • If only one stream has ready tasks, sequential execution within that stream is used
Task Execution:
  • The model MUST read all files referenced in the front_matter_references
  • The selected tasks MUST be added to the internal TODO list for tracking and implemented in the order specified
  • The model MUST implement all of the selected tasks, including all subtasks
  • Once a subtask or task is completed, use the rune skill to mark it complete (e.g.,
    rune complete 1.1
    )
  • The model MUST NOT proceed past the selected task. Once a task is done, it needs to be put up for review by the user
  • Use tools and skills as appropriate while implementing the task. For example, if you need to know the capabilities of a library, use context7, and if you want to verify your code is efficient, use the efficiency-optimizer skill
Parallel Execution with Multiple Streams: When a phase is pulled in and multiple streams have ready tasks:
  1. The model MUST use
    rune streams --available --json
    to identify streams with ready work
  2. If there are 2 or more streams with ready tasks:
    • The model SHOULD spawn subagents (using the Task tool) to handle each stream in parallel
    • Each subagent receives instructions to:
      • Retrieve all phase tasks for their stream using
        rune next --phase --stream N --format json
      • Read all referenced files from front_matter_references
      • Implement the tasks in dependency order
      • Mark tasks complete as they finish using
        rune complete <task-id>
      • Report back when all tasks in the stream are done or blocked
    • The main agent coordinates by:
      • Monitoring subagent progress
      • Handling any cross-stream dependencies that become unblocked
      • Aggregating results for user review
  3. If there is only 1 stream with ready tasks:
    • Execute tasks sequentially within that stream as normal
    • No subagents are needed
Subagent Instructions Template: When spawning a subagent for a stream, provide these instructions:
  • Stream number to work on
  • Path to the tasks file
  • List of front_matter_references to read
  • Instruction to use
    rune next --phase --stream N --format json
    to retrieve all tasks for the stream
  • Instruction to mark tasks complete using
    rune complete <task-id>
  • Instruction to stop when all tasks in the stream are complete or blocked by tasks in other streams
Cross-Stream Coordination:
  • When a subagent completes a task that unblocks tasks in another stream, that stream's agent will pick up the newly unblocked work on their next
    rune next --phase --stream N
    call
  • If all streams become blocked waiting on each other, this indicates a circular dependency problem that should be reported to the user
  • The main agent should periodically check
    rune streams --json
    to monitor overall progress
执行任务列表中下一组未完成的任务。任务组指的是前缀编号相同的一系列任务,例如1.1、1.2属于同一组,但2.1不属于该组。
约束条件:
任务获取:
  • 模型必须使用rune skill获取接下来要处理的任务
  • 使用
    rune next --format json
    获取下一个未完成的任务。当所有任务都完成时,该命令会给出提示
  • 如果用户需要查看整个阶段的任务,使用
    rune next --phase --format json
  • 如果获取到的结果仅包含单个顶层任务(没有子任务,比如只有"1"而没有"1.1"),重新运行
    rune next --phase --format json
    来获取该阶段的全部任务
并行执行的流检测:
  • 获取某一阶段的任务时,模型必须使用
    rune streams --available --json
    检查是否存在多个工作流
  • 如果多个流都有就绪的任务,可执行并行处理
  • 如果只有一个流有就绪任务,就在该流内按顺序执行任务
任务执行:
  • 模型必须读取front_matter_references中引用的所有文件
  • 选中的任务必须添加到内部TODO列表中以便追踪,并且按照指定顺序执行
  • 模型必须完成所有选中的任务,包括所有子任务
  • 某个子任务或主任务完成后,使用rune skill将其标记为已完成(例如
    rune complete 1.1
  • 模型不得越过选中的任务继续执行。某一任务完成后,需要提交给用户审核
  • 执行任务过程中按需使用工具和skill。例如,如果你需要了解某个库的能力,可以使用context7;如果你想要验证代码是否高效,可以使用efficiency-optimizer skill
多流并行执行: 当拉取了某个阶段的任务,且多个流都有就绪任务时:
  1. 模型必须使用
    rune streams --available --json
    识别有就绪工作的流
  2. 如果有2个及以上的流有就绪任务:
    • 模型应该(使用Task工具)生成subagent来并行处理每个流
    • 每个subagent收到的指令如下:
      • 使用
        rune next --phase --stream N --format json
        获取对应流的所有阶段任务
      • 读取front_matter_references中引用的所有文件
      • 按照依赖顺序执行任务
      • 完成任务后使用
        rune complete <task-id>
        标记任务为已完成
      • 当流内所有任务都完成,或者任务被阻塞时反馈结果
    • 主agent的协调工作包括:
      • 监控subagent的进度
      • 处理所有已解除阻塞的跨流依赖
      • 汇总结果提交给用户审核
  3. 如果只有1个流有就绪任务:
    • 正常在该流内按顺序执行任务
    • 不需要使用subagent
Subagent指令模板: 为某个流生成subagent时,提供以下指令:
  • 要处理的流编号
  • 任务文件的路径
  • 需要读取的front_matter_references列表
  • 指引其使用
    rune next --phase --stream N --format json
    获取流内的所有任务
  • 指引其使用
    rune complete <task-id>
    标记任务为已完成
  • 指引其当流内所有任务都完成,或者被其他流的任务阻塞时停止工作
跨流协调:
  • 当某个subagent完成的任务解除了另一个流中任务的阻塞状态时,对应流的agent会在下次调用
    rune next --phase --stream N
    时获取到新解除阻塞的任务
  • 如果所有流都被阻塞,互相等待,说明存在循环依赖问题,需要上报给用户
  • 主agent应该定期检查
    rune streams --json
    来监控整体进度