home / skills / arjenschwarz / agentic-coding / next-task

next-task skill

/claude/skills/next-task

This skill helps you automatically fetch and implement the next unfinished group of tasks using rune, manage subtasks, and report progress.

npx playbooks add skill arjenschwarz/agentic-coding --skill next-task

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
3.7 KB
---
name: next-task
description: 4. Next task
---

### 4. Next task

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

Overview

This skill automates implementing the next unfinished group of tasks from a task list, focusing on phase-aware and stream-aware execution. It retrieves the next task(s) via the rune CLI, reads referenced files, implements tasks in order, and marks subtasks complete for user review. It supports parallel execution across multiple work streams by spawning subagents and coordinating cross-stream dependencies.

How this skill works

The skill calls rune next --format json (or rune next --phase --format json when requested or when the top-level result lacks subtasks) to retrieve the next incomplete group. If a phase is retrieved, it checks available streams with rune streams --available --json to detect parallelizable work. For each selected task it reads all front_matter_references, adds tasks to an internal TODO list, implements each subtask in order, and uses rune complete <task-id> to mark completions. When multiple streams are ready, it spawns subagents to run each stream in parallel and coordinates progress and dependency unblocking.

When to use it

  • You want the next logical group of tasks implemented from a maintained task list.
  • You need to pull an entire phase of work rather than a single task.
  • Parallel work across independent streams should be executed concurrently.
  • You must ensure referenced source files are read before implementing tasks.
  • You want clear, incremental handoffs so the user can review after each task group.

Best practices

  • Always use rune next --format json and rerun with --phase when the result is a single top-level task to ensure full phase retrieval.
  • Read every file listed in front_matter_references before making changes to avoid missing context.
  • Keep an explicit internal TODO list and process tasks in the order specified; do not advance past the selected task group.
  • When multiple streams are ready, spawn subagents and give each the prescribed subagent instruction template to avoid coordination errors.
  • Mark each subtask complete with rune complete <task-id> as soon as it is finished and present the result for user review.

Example use cases

  • Resume work after an interrupted run by retrieving the next unfinished phase and completing its subtasks.
  • Execute a multi-stream phase where frontend and backend tasks can proceed in parallel via spawned subagents.
  • Enforce strict task-ordering: read referenced docs, implement subtasks, and mark them complete for incremental review.
  • Detect and report circular dependencies when streams block each other, prompting user intervention.
  • Pull an entire development phase to prepare a reviewable patch set while ensuring referenced files were consulted.

FAQ

What if rune next returns a single top-level task ID like "2"?

Rerun with rune next --phase --format json to retrieve the full set of subtasks for that phase before proceeding.

How does parallel execution handle cross-stream dependencies?

Subagents run per stream and report progress; when a task completes that unblocks another stream, the waiting stream picks it up on its next rune next --phase --stream N call. The main agent monitors streams and alerts the user if streams become mutually blocked (circular dependency).