subagents-tasks-run
Installation
SKILL.md
Summary
This skill consumes a plan folder (named ${descriptive-name}) that contains a tasks.md control file and per-task files (taskN.md). It executes the next pending task and updates both tasks.md and the executed taskN.md to reflect In progress / Done state, outputs, blockers, and signals for the next sub-agent. This enables iterative execution of plans generated by the subagents-tasks skill with a clear separation between a central workflow state and per-task contexts.
Step by step process
- Locate the specified plan folder (e.g.,
${descriptive-name}/) in the chosen output directory.- Default output directory:
/tmp/unless the workspace contains a.tasksfolder or the user explicitly requests a different output location. If a.tasksfolder exists, prefer and use.tasks/inside the workspace. - File/folder pattern: the plan folder must follow the
subagents-tasksconvention:${descriptive-name}/containingtasks.md(control file) andtaskN.mdfiles (task files). Filenames inside the folder should follow the patterntasks.mdandtask1.md,task2.md, ...
- Default output directory:
- Read
${descriptive-name}/tasks.mdand parse theSub-agent workflowsection to build an ordered queue of pendingtaskN.mdentries. If no pending tasks exist, exit. - For each pending
taskN.mdin the queue, run the task to completion before proceeding to the next:- Read the referenced
${descriptive-name}/taskN.mdto load full task context, acceptance criteria, dependencies, estimated effort, and theNext sub-agentcommand. - Update
tasks.mdto mark thistaskN.mdasIn progressand append an execution note (timestamp, executor id). - Loop: repeatedly invoke a sub-agent to perform the work described in
taskN.mduntil the task is explicitly markedDoneor a terminal blocker/timeout occurs:- Invoke a sub-agent (for example via
runSubagent) with theNext sub-agentcommand and the currenttaskN.mdcontent as context. - Capture outputs, logs, and any updates the sub-agent made to the task file.
- Re-read
taskN.mdand check for a clearDonemarker (for exampleStatus: Done, an explicit next-state signal, or that acceptance criteria are met), or detect a blocker. - If
Done: updatetasks.mdto move the task toDone, include a short execution note and a link to the updatedtaskN.md, then break the loop and continue to the next pending task. - If blocked: append blocker details to
taskN.mdandtasks.md, add aSignalsentry for human review or automated remediation, and either retry after a configurable backoff (default: a small number of retries) or move the task back toPending/Blockedfor manual intervention depending on policy. - If the sub-agent made progress but not
Done, continue the loop and invoke the sub-agent again with the updated context.
- Invoke a sub-agent (for example via
- After the task completes or is escalated, add
Signalsintasks.mdfor the next sub-agent (for examplerun-task: ${descriptive-name}/task3.md).
- Read the referenced
- After processing all pending tasks, write all modified files back to the filesystem using the agent filesystem actions (
create_file/overwrite), ensuring directories exist before writing. - Behavior for single-file inputs, errors, and constraints:
- If the input is a single embedded Agents tasks file (no plan folder), offer to split it into a
${descriptive-name}/folder withtasks.mdandtaskN.mdfiles and proceed; otherwise operate in-place but prefer the folder model. - Implement reasonable retry, timeout and maximum-attempt policies to avoid infinite loops; record attempts and timestamps in
taskN.md. - Ensure all state transitions are explicit and machine-friendly (
Pending,In progress,Done,Blocked) and thattasks.mdreferences eachtaskN.md.
- If the input is a single embedded Agents tasks file (no plan folder), offer to split it into a
- Signals and machine flags (examples):
run-task: ${descriptive-name}/taskN.md— request execution of a task.task-done: ${descriptive-name}/taskN.md— mark completion.task-blocked: ${descriptive-name}/taskN.md— flag a blocker for manual review.
- Logging and audit:
- For every state change, append an audit entry with timestamp, executor id, and a short message to both the
taskN.mdandtasks.mdto aid traceability.
- For every state change, append an audit entry with timestamp, executor id, and a short message to both the
- Validation checklist (ensure these are satisfied before finishing):
- Problem + outcomes are clear
- Success criteria measurable
- Scope is clearly surfaced
- Tasks actionable and upper bound ready
- No missing dependencies
- Sub-agent state transitions are defined in the file
- Control file created and references all task files
- Each task has a standalone markdown file with context and
Next sub-agentcommand - All file paths included in final summary
tasks.mdcreated inside${descriptive-name}/and references alltaskN.mdfiles- Each
taskN.mdis created inside${descriptive-name}/with context andNext sub-agentcommand - All created file paths included in final summary
Related skills