ワンクリックで
orchestrate-development
expert: "Multi-agent development orchestration with conflict-aware parallel
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
expert: "Multi-agent development orchestration with conflict-aware parallel
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Use at the start of every agent session, even if the task seems obvious and you think you already know what to do. Activates when the agent has just opened a repository, does not know what to do, needs to orient itself, or is beginning any new session. Also activates for "where do I start?", "what should I work on?", "what is the current state?". Skipping orientation leads to wasted effort and missed context.
expert: "Structured task execution procedure for individual implementation
expert: "Review orchestration with adaptive specialist dispatch,
Use at the start of every agent session, even if the task seems obvious and you think you already know what to do. Activates when the agent has just opened a repository, does not know what to do, needs to orient itself, or is beginning any new session. Also activates for "where do I start?", "what should I work on?", "what is the current state?". Skipping orientation leads to wasted effort and missed context.
expert: "Structured task execution procedure for individual implementation
expert: "Multi-agent development orchestration with conflict-aware parallel
| name | orchestrate-development |
| description | {"expert":"Multi-agent development orchestration with conflict-aware parallel dispatch, context compaction, failure handling, and lifecycle close-out for a single feature within a batch","natural":"Coordinate a team of agents to build a feature: dispatch tasks in parallel, monitor progress, handle failures, compact context, and close out the feature lifecycle"} |
| triggers | ["orchestrate development tasks","coordinate implementation work","dispatch sub-agents for development","manage parallel task execution","run a feature's dev-plan"] |
| roles | ["orchestrator"] |
| stage | developing |
| constraint_level | medium |
depends_on tasks are in done statusdepends_on entries are done before adding a task to the dispatch batch. Use the ready frontier exclusively.→ INV-001 — Handoff-only dispatch. Always use handoff(task_id: "TASK-xxx", role: "implementer-go") to generate sub-agent prompts. Manual composition violates INV-001: it silently omits graph project context, knowledge entries, and spec sections assembled by the pipeline. When P44's dispatch_task is available, use that instead.
Pre-delegation Code Investigation is a canonical anti-pattern defined in the
orchestratorrole (.kbz/roles/orchestrator.yaml).
Copy this checklist and track your progress:
Skip this phase entirely if the batch has 3 or fewer features.
Test-health gate: Before dispatching any cohort, call
test(action: "verify")to confirm the test suite onmainis green. If tests are failing, bail — do not dispatch sub-agents until the test suite is fixed. This prevents compounding pre-existing failures with new work.
## Merge Schedule block. If a merge schedule is present, treat
its cohort groupings as authoritative — record them and proceed to Phase 1 for
cohort-1 features only.conflict(action: "check", feature_ids: [...]) for
all features in the batch to identify file-scope overlap.INV-004 · No Code Investigation (ℋ): Do not read source files, trace call paths, search the code graph, or shell-read
.kbz/state/before dispatching. The sub-agent receives everything needed viahandoff; if the dev-plan is unclear, flag it — do not read code or workflow state to compensate. See INV-004 and the orchestrator role's Pre-delegation Code Investigation anti-pattern.Hard constraint (ℋ) — violation blocks stage advance.
status with the feature ID to get the current state of all tasks.
1a. Call knowledge(action: "list") with feature-area tags and status: "confirmed" to surface project-level knowledge before dispatching any sub-agents. Review all returned entries. Note any that describe pitfalls, architectural constraints, or patterns relevant to this feature. Carry these entries forward: include them in each handoff tool call via the instructions parameter so sub-agents benefit from accumulated knowledge without having to rediscover it.depends_on entries are all in done status and that is itself in ready status. This is the ready frontier — your dispatch batch.conflict tool to assess risk. IF conflict risk is high → remove one task from this batch and dispatch it in the next cycle.Sizing rule — one sub-agent per task for large-file features: For features with more than three tasks where tasks involve reading or rewriting source files longer than ~300 lines, dispatch one sub-agent per task rather than assigning multiple tasks to a single agent. Full-file rewrites embed entire file content in terminal tool calls; an agent assigned multiple large-file tasks will saturate its context window before completing the second task. Per-task isolation gives each agent a fresh context window sized for one file scope.
Features with small files or documentation-only tasks do not require per-task isolation — batch dispatch remains appropriate.
Rule: Always use handoff(task_id: "TASK-xxx", role: "implementer-go") to generate sub-agent prompts. Never compose implementation prompts manually — manual composition silently omits graph project context, knowledge entries, and spec sections.
.kbz/local.yaml has codebase_memory.graph_project set
(e.g. Users-alice-Dev-myrepo). If missing, add it now — worktrees created without it will not
inject Code Graph context into sub-agent handoffs. Once set in local config, the worktree tool
picks it up automatically and you never need to pass graph_project explicitly.handoff(task_id: "TASK-xxx", role: "implementer-go").refs/sub-agents.md: project name, tool preferences, and the propagation rule for nested delegation.done (not needs-rework or still active).Apply these three techniques throughout orchestration, not only at the end:
Technique 1 — Post-Completion Summarisation (after every task completion): When a sub-agent completes a task, reduce its outcome to a post-completion summary: the task ID, 2–3 sentences describing what was built and any notable decisions, and whether it passed or failed. Discard everything else — diffs, test output, reasoning traces, tool call logs. The summary is the only record you carry forward.
Technique 2 — Document-Based Offloading (at ~60% context utilisation): When accumulated conversation history approaches 60% of your context window, stop dispatching new tasks. Write a progress document containing: which tasks are done (with their post-completion summaries), which tasks remain, what the current ready frontier is, and any failures or escalations pending. Register or update this as a document attached to the feature. Then start a fresh orchestration session that reads the progress document to resume. This prevents the quality degradation that occurs when orchestrating in a saturated context.
Technique 3 — Single-Feature Scoping (session boundary rule): Each orchestration session handles exactly one feature. When all tasks for a feature are complete, write a feature completion summary and end the session. Begin the next feature in a new session. Do not attempt to orchestrate multiple features in one session because each feature's dependency graph, file scopes, and spec context are independent — combining them doubles context load without improving throughput.
After all tasks reach a terminal state, the feature must be explicitly advanced through the remaining lifecycle stages. This phase ensures the feature is not left in developing with all work done.
Verify all tasks are terminal. Call status(id: "FEAT-xxx") and confirm all tasks show done, not-planned, or duplicate. If the attention item "FEAT-xxx has N/N tasks done — ready to advance to reviewing" is visible, all tasks are terminal.
Transition the feature. Call entity(action: "transition", id: "FEAT-xxx", status: "reviewing"). INV-005 — Stage-transition gates are mandatory; the entity tool enforces all prerequisites (tasks terminal, required artefacts approved). Do not use override: true unless override_reason is provided and the prerequisite is genuinely inapplicable.
Merge and delete the branch. This step is mandatory regardless of how work was committed.
pr(action: "create", entity_id: "FEAT-xxx") (if require_github_pr: true), then merge(action: "check", entity_id: "FEAT-xxx"), then merge(action: "execute", entity_id: "FEAT-xxx"). The merge execute tool deletes the branch automatically (delete_branch defaults to true) — verify it did so.test(action: "run") to
confirm the test suite passes on main. Do not skip this step — it is the primary
gate against introducing test failures into the main branch.merge and pr will return not_applicable. In this case you must manually delete the feature branch: run git branch -d feature/FEAT-xxx (or git branch -D if git refuses due to squash history). Do not skip this step. Orphaned branches accumulate silently and are painful to audit later.Why this matters: When branches are not deleted after merging, they appear unmerged at sprint boundaries, making it impossible for humans to tell what has and hasn't landed. Files committed to the branch but not included in the squash merge commit will be permanently lost. This has caused repeated incidents.
Record a completion summary. Call finish (or leave a completion note in the task) summarising what was implemented and any relevant observations.
4a. Knowledge curation pass (primary curation mechanism for this feature). Call knowledge(action: "list") with status: "contributed" and tier: 2 to retrieve all tier 2 knowledge entries contributed during this feature's development. For each returned entry, apply one of three dispositions:
knowledge(action: "confirm", id: "KE-xxx") — entry proved accurate during the feature.knowledge(action: "flag", id: "KE-xxx", reason: "...") — entry proved inaccurate or misleading.knowledge(action: "retire", id: "KE-xxx", reason: "...") — entry has been superseded by architectural changes made during this feature.Tier 3 entries: Do NOT call confirm on tier 3 entries. Tier 3 entries are self-pruning and direct confirmation bypasses the promotion signal. Instead, for tier 3 entries that proved valuable, call knowledge(action: "promote", id: "KE-xxx") to elevate them to tier 2.
Clean up worktrees. If a worktree was created, run worktree(action: "remove", entity_id: "FEAT-xxx") after merging. Confirm with git worktree list that the worktree directory is gone.
Verify branch is gone. Run git branch | grep FEAT-xxx and confirm no output. If the branch still exists, delete it now. A feature is not truly closed out until its branch is absent from git branch.
Cohort checkpoint. If this batch has a merge schedule with multiple cohorts, check
whether cohort-N+1 features exist. If so, return to Phase 0 for cohort N+1. Do not
create cohort-N+1 worktrees until the cohort-N merge checkpoint is confirmed clean:
no open feature branches from cohort N remain (git branch | grep FEAT returns only
cohort-N+1 or later branches).
When the feature's tier is retro_fix or bug_fix, or the batch is explicitly
marked fast-track, replace the full 6-phase procedure with this lightweight 3-phase flow.
You are in fast-track mode. You will NOT stop for confirmation at any point.
Use the orchestrator role (without grep/search_graph). Delegate all code
investigation to sub-agents — do not search, trace, or read source code.
The ONLY valid stop conditions are:
If you find yourself about to produce a status table or summary, ask: is all work done? If no, continue immediately without producing output. This contract is a structural constraint — breaking it constitutes the Implicit Gate anti-pattern.
Replaces Phase 0 (Cohort Setup) from the full procedure. Fast-track has no cohorts — single-feature batches only.
Test-health gate: Call
test(action: "verify")before dispatching any sub-agents. If tests are failing onmain, bail — the first job is to fix the test suite, not to start new work. The orchestrator may return to this feature once tests are green.
Call status() to build authoritative entity state. Call status() with the plan
or batch ID. Identify:
Cross-reference task state against code existence. For each task marked done,
verify the described change exists in the codebase. If a task is done but its
deliverable does not exist, flag it — the task state is unreliable.
Check review-readiness drift before dispatch. If a feature is in reviewing via
override but still has non-terminal tasks, surface that as a blocker. Lifecycle
status alone is not authoritative — verify task terminality independently.
Check dirty working-tree state. Run git status. Before implementing, classify
any uncommitted changes as:
Identify ghost work. For each ready task, check whether the described change
already exists in the codebase. If yes, mark the task not-planned — do not claim
or implement it. Ghost work wastes cycles and creates merge conflicts.
Replaces Phase 1 (Read Dev-Plan), Phase 2 (Identify Parallel-Dispatchable), and Phase 3 (Dispatch Sub-Agents) from the full procedure.
Identify the ready frontier. From the session-start audit, select all tasks in
ready status with all depends_on tasks in a terminal state.
Dispatch all ready frontier tasks in parallel. Use
handoff(task_id: "TASK-xxx", role: "implementer-go") for every task in the ready
frontier. Dispatch them all in one batch — do not serialise independent tasks.
Integration note (P51): The role: "implementer-go" parameter is explicit
regardless of P51's handoff pipeline state. This ensures correctness even if P51
default-role routing is not yet active.
Integration note (P44): When dispatch_task arrives, this step changes from
handoff + spawn_agent to dispatch_task(task_id, category: "implementation").
The behavioral rules (no stops, continuous polling, immediate dispatch of
newly-unblocked tasks) remain identical — only the dispatch mechanism changes.
Do NOT stop after dispatching. If there is nothing to dispatch because tasks are
still active, poll status() once per minute until something completes. Do not
produce a status table or wait for confirmation.
Dispatch newly-unblocked tasks immediately. When a task completes, immediately dispatch any tasks that are now unblocked. Do not wait for the full batch to finish.
Replaces Phase 4 (Monitor Progress), Phase 5 (Context Compaction), and Phase 6 (Close-Out) from the full procedure.
Verify all tasks are terminal. When all tasks reach a terminal state, confirm
each feature can advance. Call status() and verify no non-terminal tasks remain.
Dispatch review sub-agents. Before transitioning any feature out of
developing, dispatch at minimum one review sub-agent for each feature
that modified source code (documentation-only features exempt):
bug_fix ≤5 files: one reviewer-conformance via spawn_agentretro_fix with source changes: reviewer-conformance minimum5 files or other tiers: follow
orchestrate-reviewSteps 3–6 All reviewers use clean contexts. Do not transition until findings are collated and no blocking findings remain.
Transition features. Call entity(action: "transition", id: "FEAT-xxx", status: ...)
to advance each feature through to done or reviewing as appropriate. Follow the
full procedure's Phase 6 steps for merge, branch deletion, and worktree cleanup.
Report completion. Produce a completion summary listing features and their final status. This is the ONLY status output produced during a fast-track session — every other output is extraneous.
Procedural compaction trigger. Before close-out, estimate context utilisation. If at ~60%+ estimated utilisation and work remains for another feature, produce a compaction artefact using the U-shaped template and instruct the human to start a fresh session with it.
Integration note (P44): This manual estimation step is a stopgap. P44 Phase 3b will replace it with automated token-count-based compaction triggers.
These rules are structural constraints — violating any of them brings the fast-track profile back into implicit full-orchestration behaviour:
not-planned.status() output only. User-provided state summaries go
stale and are not authoritative.handoff(task_id, role: "implementer-go") for sub-agent dispatch.
Never compose implementation prompts manually.These are additions to the main Anti-Patterns section. They apply only when operating under the fast-track profile.
not-planned and move on.status() to get authoritative entity state.status() at session start. Trust the entity system, not the
conversation. Reconcile any discrepancies before dispatching.When a feature is completed (all tasks done and merged), produce a Feature Completion Summary in this format:
Feature: FEAT-<nnn> — <name>
Batch: B<nnn>-<slug>
Tasks: N total, N done, N failed (retried and succeeded after escalation)
Summary: <2-3 sentences about what changed>
Notable decisions:
- <decision 1>
- <decision 2>
Tests: <test types run>, <result>
Include this in the close-out step via finish(task_id: ..., summary: ...).
See examples-orchestrate-development.md for worked orchestration examples: serial dispatch anti-pattern, unmet dependency anti-pattern, and a full dependency-respecting parallel dispatch cycle.
| # | Criterion | Weight |
|---|---|---|
| 1 | All tasks in the ready frontier are dispatched in parallel (no unnecessary serialisation) | high |
| 2 | Post-completion summaries are applied immediately, full outputs are discarded | high |
| 3 | Context utilisation does not exceed 60% — offloading is triggered at threshold | required |
| 4 | Feature close-out is complete: transition, merge, branch delete, knowledge curation | required |
| 5 | Failed tasks are handled — retry or escalate — before dependents are dispatched | high |
implement-task — what each sub-agent does when dispatchedreview-code — what reviewers check againstkanbanzai-agents — context assembly, commit format, knowledge contributionkanbanzai-workflow — lifecycle transitions and stage gates