con un clic
orchestrate
// Orchestrate development work through sub-agents using td for state. Use when given a td task ID, text idea, markdown plan, or td epic to execute through plan-implement-review loops.
// Orchestrate development work through sub-agents using td for state. Use when given a td task ID, text idea, markdown plan, or td epic to execute through plan-implement-review loops.
Create and maintain DESIGN.md files — a design system specification optimized for AI consumption. Use when creating a project's design system file, extracting tokens from existing CSS/code, auditing design consistency, or onboarding an agent to a project's visual language.
Write naturally and avoid AI-detectable patterns. Use when (1) generating any written content, (2) reviewing/editing text for AI-like patterns, (3) user asks to make writing sound more human/natural, or (4) improving text that sounds robotic or generic. Covers vocabulary, structure, tone, and formatting tells that signal AI authorship.
Coordinate Claude Code agent teams for td-watch development. Use when creating teams, assigning tasks, running team sessions, or when any agent needs to understand team coordination rules. Covers roles, file ownership, friction protocol, quality gates, and common team configurations.
Use the Perch plan CLI to create, read, update, and manage architectural plans. Covers project lifecycle, tree building, reviews, snapshots, facets, inputs, and export. Use when asked to retrieve a plan by name, build a plan tree, run a review, or interact with the planner in any way.
Set up and run autonomous overnight coding loops that process td epic tasks one at a time. Includes the loop runner, Rich TUI cockpit dashboard, and prompt template. Use when automating multi-day feature development across many tasks with td for state management.
Adapt AI agent runtimes (Claude Code SDK, Codex CLI app-server) into multi-turn conversational systems. Covers session lifecycle, resume/fork, event normalization, JSON-RPC 2.0 over stdio, tool policy enforcement, and rich component rendering (agent→UI generative components, UI→agent bidirectional state, component registries, surface targets). Use when building orchestrators, chat UIs, or sidecar processes that need persistent multi-turn agent sessions with rich interactive interfaces.
| name | orchestrate |
| description | Orchestrate development work through sub-agents using td for state. Use when given a td task ID, text idea, markdown plan, or td epic to execute through plan-implement-review loops. |
You are an orchestrator. Never write code directly. Spawn sub-agents via the Task tool and track all state in td.
| Input | Detect | Bootstrap |
|---|---|---|
| TD task | td-[a-f0-9]+ | td show <id> + td context <id>, then implement |
| TD epic / multiple IDs | Multiple td IDs or user says "epic" | td show each, plan execution order |
| Text idea | No td ID, plain text | Planner creates td task(s), then implement |
| Markdown plan | Structured markdown with steps | Planner converts to td tasks, then implement |
When spawning each agent via Task tool, prefix its prompt with the role and include: the td task ID, repo path, and instruction to td log progress. Always pass the orchestration instructions below so agents know the process if context compacts.
td create, td log --decision.feat|fix|chore: <summary> (td-XXXXXX). One task, one commit.td approve <id> or td reject <id> --reason '...'. Cannot approve own implementation.td log.td start <id>
b. Spawn implementer
c. Spawn reviewer — if rejected, re-spawn implementer (max 3 iterations)
d. Spawn tester if tests are needed
e. Verify commit exists with td ID in messageBetween steps, read td state (td show <id>) — do not carry state in memory.
If the user asks to prove or verify work, the orchestrator must assign proof capture to sub-agents as part of completion, not as an optional follow-up.
proof label.Recommended pattern:
Proof: <thing proved> as a child task.proof.td log, td approve, td reject — externalize state.td log --blocker on the blocked one.proof label and the proof artifact recorded in its description.These patterns were validated across a 12-task epic (backend, frontend, CLI, tests) executed in dependency order.
The orchestrator gets flagged as "involved with implementation" even though it only spawned the implementing sub-agent. This means td approve / td complete cannot be used by the orchestrator after it spawned the implementer. Workaround: use td log <id> "Review: PASS — <summary>" for review verdicts instead of td approve.
Reviewer agents only need to: read the git diff, run quality gates (tests, type-check), and report pass/fail. Keep their prompts short — they finish fast compared to implementers and don't need deep context about the codebase.
Every implementer prompt should include:
td-XXXXXX)feat|fix|chore: <summary> (td-XXXXXX) with Co-Authored-Bysvelte-check (or equivalent lint/type-check) before committingProcessing tasks in strict dependency order — starting each only after its blocker completes — avoids merge conflicts and build breakage. Do not parallelize tasks that touch overlapping files, even if they seem independent.
The user may add tasks while execution is in progress. After completing the current task, re-read the epic (td show <epic-id>) to pick up new sub-tasks. Slot them into the dependency graph rather than appending to the end.
A proof task description must name the exact artifact to produce — not "capture proof" but "screenshot of ActivityPanel showing 3 block types at /tmp/rich-blocks-proof.png" or "paste output of go test ./internal/modules/planner/... showing all tests pass". Generic proof tasks get skipped or produce useless output.
Before context runs out or if pausing:
td handoff <current-task-id> \
--done "completed tasks and outcomes" \
--remaining "pending tasks in order" \
--decision "key decisions made" \
--uncertain "open questions"
Tell the user: "Resume with /orchestrate td-<id>."
CRITICAL: When spawning any sub-agent, include this instruction: "If your context is compacted, read td state with td context <id> and continue from where the previous context left off. The orchestration process is: plan -> implement -> review -> test -> commit, one task at a time."