home / skills / dimitrigilbert / task-o-matic / task-orchestrator

task-orchestrator skill

/docs/skills/task-orchestrator

This skill orchestrates autonomous task execution and validation, ensuring quality gates are met before completion and subtasks are managed correctly.

npx playbooks add skill dimitrigilbert/task-o-matic --skill task-orchestrator

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

Files (3)
SKILL.md
1.8 KB
---
name: task-orchestrator
description: Autonomous agent loop for executing, validating, and completing tasks. Handles state transitions, subtask management, and review cycles.
---

# Task Orchestrator

**Goal**: Drive tasks from `todo` to `completed` with strict quality gates.

## Core Rules
1. **Validation First**: NEVER complete a task without passing build/tests.
2. **Subtask Priority**: BLOCKED if subtasks are incomplete.
3. **Status Truth**: ALWAYS update status to reflect reality (`in-progress` when starting).
4. **Context Aware**: ALWAYS read linked PRD requirements before execution.

## The Loop

### 1. Claim & Context
Find work and lock it.

```bash
# Find next task
npx task-o-matic tasks get-next --status todo

# Set status (replace <ID> with the ID found above)
npx task-o-matic tasks status --id <ID> --status in-progress

# Load Context (Check for prdFile/prdRequirement)
npx task-o-matic tasks show --id <ID>
```

### 2. Execute
Perform the work. Use available tools (`opencode`, `edit`, `bash`).
*If task is complex, split it:* `npx task-o-matic tasks split --id $TASK_ID`

### 3. Validate
Run project-specific checks.

```bash
# Example validation cycle
bun run check-types && bun run build && bun test
```

### 4. Review & Fix
Triggers `code-reviewer` skill if validation passes.

*   **If Review Fails**: Create fix subtasks.
    ```bash
    npx task-o-matic tasks create --parent-id $TASK_ID --title "Fix: <issue>" --effort small
    ```
    *Loop back to Step 1 for the fix subtask.*

*   **If Review Passes**: Proceed to completion.

### 5. Completion
Only when:
- [x] Code implemented
- [x] Validation passed
- [x] Review approved
- [x] All subtasks completed

```bash
npx task-o-matic tasks status --id $TASK_ID --status completed
```

## Helper Scripts
- `scripts/check-status.sh <id>`: View task status and subtask tree.

Overview

This skill is an autonomous task orchestrator that drives work from todo to completed using strict quality gates. It manages state transitions, subtasks, validation loops, and review handoffs to ensure reliable deliveries. The agent enforces checks like builds and tests before marking tasks done. It is built for TypeScript workflows and integrates with tooling for execution and validation.

How this skill works

The orchestrator claims tasks, locks context, and updates status to reflect reality before work begins. It executes or splits tasks, runs validation (type checks, build, tests), and triggers code review when validation passes. If reviews fail or validation fails, it creates fix subtasks and re-queues work until all checks and subtasks pass. Completion only happens after implementation, validation, review approval, and subtask closure.

When to use it

  • Automating developer task flow from assignment to completion.
  • Enforcing CI-like validation and review gates as part of task lifecycle.
  • Coordinating complex tasks that require splitting into subtasks.
  • Preventing premature task completion without build/test confirmation.
  • Managing status truth and context-sensitive execution based on PRD requirements.

Best practices

  • Always read linked PRD or requirement fields before starting a task.
  • Mark status to in-progress when work begins and update status immediately on state changes.
  • Run full project validation (types, build, tests) before requesting review.
  • Split complex work into smaller subtasks to avoid blocking the main task.
  • Create explicit fix subtasks when reviews fail instead of modifying the main task silently.

Example use cases

  • Claiming the next todo task, loading the PRD, and locking the item for work.
  • Splitting a large feature into multiple subtasks and orchestrating their execution and validation.
  • Running a validation loop: type check, build, and tests, then triggering code-review on success.
  • Automatically creating small fix subtasks after a failed code review and re-queuing them.
  • Using helper scripts to inspect a task tree and confirm all subtasks are completed before finalizing.

FAQ

What prevents tasks from being marked completed prematurely?

The skill enforces a validation-first rule: tasks cannot be completed until build/tests pass, review is approved, and all subtasks are done.

How are review failures handled?

If a review fails, the orchestrator creates fix subtasks with appropriate effort estimates and returns them to the todo queue for the normal loop to address.