agentleFS
aws-solutionsaws-solutions/konductor/skills/delegation-protocol/SKILL.md

delegation-protocol

Skill11 starsChanged 49 days agoApache-2.0View on GitHub

Use when spawning any subagent, deciding which agent should handle a piece of work, coordinating parallel or sequential agent execution, or handing off artifacts between agents. Defines the mandatory 8-field delegation prompt format, agent registry, and handoff patterns.

5 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

12 rules. 0 are common, 6 are distinctive, and 6 are very specific to this project.

  • 0

    Common

    Most of the 4 edited versions we read keep these.

  • 6

    Distinctive

    This author's own choices. Worth a look.

  • 6

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill when:

    line 16
  2. Very specific:

    Every delegation MUST include all 8 fields — the 7 sections below, plus an explicit TARGET AGENT preamble line:

    line 25
  3. Very specific:

    If a section is not applicable, write N/A — never omit the section.

    line 53
  4. Very specific:

    Claude Code: use the agent name exactly as it appears in your own tool definitions / available-agent list for this session (e.g.

    line 61
  5. Very specific:

    Kiro CLI: use the bare name from toolsSettings.subagent.availableAgents (e.g.

    line 62
  6. Very specific:

    When uncertain which agent to use, check the agent's skill list in the README or invoke sdlc-navigator.

    line 93
  7. Distinctive:

    When a SOP is registered on more than one agent, the caller MUST pick the target based on what else the delegating step needs rather than …

    line 121
  8. Distinctive:

    Never block on one subagent when another independent task can start

    line 129
  9. Distinctive:

    Before spawning any write agent, explicitly name its exact target in the dispatch prompt — a new dedicated worktree, an existing worktree …

    line 134
  10. Distinctive:

    After code changes, run the maker-checker cycle:

    line 178
  11. Distinctive:

    If the retry fails, escalate to the user with: what was attempted, what failed, and the root cause

    line 190
  12. Very specific:

    If a subagent times out, check .konductor/handoff/ for partial output.

    line 191

“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Delegation Protocol

Overview

Defines how the orchestrator delegates work to specialist agents. Every subagent spawn MUST use the 8-field prompt format — an explicit target agent plus the 7 sections — and MUST NOT omit the target agent. This ensures tasks are atomic, outcomes are verifiable, agents stay within scope, and spawns never fail outright from a missing subagent_type.

Usage

Use this skill when:

  • Spawning any subagent for a delegated task
  • Deciding which agent handles a piece of work
  • Coordinating parallel or sequential agent execution
  • Handing off artifacts between agents

Delegation Prompt Format

Every delegation MUST include all 8 fields — the 7 sections below, plus an explicit TARGET AGENT preamble line:

TARGET AGENT: <Exact subagent_type value — see "Never Omit the Target Agent" below. Never leave blank.>

TASK: <Atomic, specific goal — one verb, one outcome>

EXPECTED OUTCOME: <Concrete deliverables with success criteria>

REQUIRED SKILLS: <Relevant expertise the subagent needs>

REQUIRED TOOLS: <Explicit tool allowlist — only these tools may be used>

MUST DO:
- <Exhaustive requirements list>
- Preserve existing comments and JSDoc blocks
- Preserve existing logging statements
- Add inline comments for complex logic

MUST NOT DO:
- <Forbidden actions list>
- Do NOT remove comments or documentation
- Do NOT strip logging statements
- Do NOT silently reduce scope

CONTEXT: <File paths, patterns, constraints, handoff file references>

If a section is not applicable, write N/A — never omit the section. TARGET AGENT is the one exception: it is never N/A — every delegation targets exactly one agent.

Never Omit the Target Agent

Every subagent spawn — every Agent() call (Claude Code), every subagent tool invocation (Kiro CLI), and every agent() call inside a Workflow tool script (.claude/workflows/*.js) — MUST include an explicit target agent drawn from the Agent Registry below. Never omit it. For Agent() and subagent, the tool's own default when the target is omitted is general-purpose — this fleet registers no agent by that name, and the spawn fails outright ("Agent type 'general-purpose' not found"). For agent() inside a Workflow script, the equivalent field is the agentType option in the call's options object (the second argument) — set it explicitly on every call; never leave it to default.

Resolve the exact identifier from the runtime's own available-agents list for the current session — do not guess or hardcode a single form, since the correct literal string is install-dependent:

  • Claude Code: use the agent name exactly as it appears in your own tool definitions / available-agent list for this session (e.g. konductor:k-architect for a Claude Code plugin install, k-architect for a konductor install into .claude/agents/).
  • Kiro CLI: use the bare name from toolsSettings.subagent.availableAgents (e.g. k-architect).
  • Workflow agent() calls: set the agentType option using the same Claude Code naming form as above (e.g. agentType: "konductor:k-researcher"). The Workflow tool is Claude Code only, so there is no Kiro CLI equivalent to resolve.

This is distinct from spawning the wrong agent for the task (an IMPORTANT-tier Quality Gate issue below) — this rule guards against spawning no agent at all.

Deliberate exception for Workflow agent() calls: a call may omit agentType only when the step is pure reasoning over data already inlined into the prompt (decomposition, classification, or synthesis with no need to read files, run commands, or use any other tool) — in that case the session's default reasoning agent is a legitimate choice, not an oversight. Every such omission MUST carry an inline comment immediately above the call explaining why no specialist is needed, so the omission is never mistaken for the bug this rule exists to prevent. A call that needs file/tool access (reading a file, listing a directory, running a command, web search, etc.) always needs an explicit agentType — omitting it there is the CRITICAL defect below, not a deliberate exception.

Format ownership rule: MUST DO / MUST NOT DO sections should not contradict the receiving agent's skills or system prompt. If a specialist agent has a skill that defines how output is produced (e.g., cloudscape-mock-ui uses a CDN bundle), do not add constraints that override that skill's behavior. Format guidance from the user's request (e.g., "output as a single file") is acceptable to pass through.

Agent Registry

SDLC Specialists

AgentPurposeWhen to Spawn
k-product-managerRequirements & planningUser stories, requirements extraction, document formatting, sprint planning, deliberation on PM-domain tradeoffs (deliberation-panel)
k-architectDesign & architectureSystem design, threat modeling, design documentation, requirements extraction, decision research, multi-option deliberation (deliberation-panel)
k-developerImplementationBackend/frontend code, code review, infra validation, git workflow, Kiro spec generation (requirements.md, design.md, tasks.md)
k-quality-assuranceTestingTest coverage analysis, E2E test strategy, Cypress test implementation, DOM inspection for functional test generation, security test generation
k-researcherResearchExternal docs, web research, deliberation on research-options/feasibility (deliberation-panel)
k-tpmProgram managementProgram plans, status reports, risk tracking, decision docs, plan review, sprint planning
k-browserBrowser automationWeb scraping, E2E test execution via Playwright, form automation, screenshots
konductor-mux-orchestratorParallel orchestration (tmux/zellij)Use when running on a platform with tmux or zellij active. Dispatches specialist agents to visible, interactive tmux/zellij panes for parallel execution. Auto-detects multiplexer from $TMUX / $ZELLIJ. Requires tmux or zellij; errors if neither is detected and directs the user to konductor instead.
konductor-cmux-orchestratorParallel orchestration (cmux, macOS)Use on macOS with cmux available. Dispatches specialist agents to cmux surfaces (tabs, splits, or workspaces) for parallel execution with human interaction. Errors when cmux is not available and directs the user to konductor instead.

Meta-Agents (Quality & Planning)

AgentPurposeWhen to Spawn
k-media-analyzerMedia analysisPDFs, images, diagrams that need interpretation beyond raw text; web content requiring visual or structural interpretation

When uncertain which agent to use, check the agent's skill list in the README or invoke sdlc-navigator.

Tool-to-Agent Routing

Authoritative source: This table is the detailed routing reference. context/k-orchestrator-routing-rules.md is a quick-reference summary loaded at startup — when the two conflict, this file wins. Update both when adding new tool domains.

Tool DomainPrimary AgentOther Agents with Access
Web (external pages)k-researcherk-browser (automation/scraping); k-media-analyzer (extract/interpret content from a specific URL)

For web content, prefer k-researcher for information retrieval. Delegate to k-browser for interactive automation or scraping, and to k-media-analyzer when the page content requires visual or structural interpretation.

Per-Agent SOP Registrations

Which SOPs each agent declares in its own dependencies.agentSops.agentSopNames, read directly from agents/*.agent-spec.json. This is the authoritative source for which agent a SOP dispatches to when it names another SOP by identifier — a referencing SOP should look up the owning agent here rather than stating or assuming one independently.

AgentRegistered SOPs (own agentSopNames)
k-architectk-design-doc-creation, k-existing-design-review, k-principal-engineer-design-review, k-adversarial-pull-request-review
k-developerk-code-cleanup, k-pre-cr-critique, k-codebase-analysis, k-code-review-workflow
k-quality-assurancek-test-coverage-review
konductorkiro-spec-workflow, k-delegate, k-plan, k-context-gathering, k-verify, k-light-ui-testing, k-comprehensive-search, k-full-sdlc, k-e2e-test-generation, about-konductor
konductor-mux-orchestratorkiro-spec-workflow, k-plan, k-context-gathering, k-verify, k-comprehensive-search, k-full-sdlc, k-e2e-test-generation, k-light-ui-testing, about-konductor
konductor-cmux-orchestratorkiro-spec-workflow, k-plan, k-context-gathering, k-verify, k-comprehensive-search, k-full-sdlc, k-e2e-test-generation, k-light-ui-testing, about-konductor
k-product-manager, k-researcher, k-tpm, k-browser, k-media-analyzerNone declared — these agents execute delegated tasks; they do not select their own SOPs

konductor additionally registers k-delegate; konductor-mux-orchestrator and konductor-cmux-orchestrator do not.

When a SOP is registered on more than one agent, the caller MUST pick the target based on what else the delegating step needs rather than treat the lookup as single-valued.

A SOP registered directly on an orchestrator's own agentSopNames, such as kiro-spec-workflow on konductor above, MUST be invoked directly rather than routed through a specialist-agent lookup, since it delegates to its own agents internally.

Parallel Execution

  • Independent tasks ALWAYS run in parallel (max 4 concurrent subagents)
  • Typical pattern: research + explore → synthesize → plan → implement
  • Never block on one subagent when another independent task can start
  • Dependent tasks run sequentially — wait for the upstream handoff file before spawning

Both runtimes support spawning the same agent multiple times in parallel with different tasks (e.g., two k-developer instances — one for backend, one for frontend, each in its own worktree), via their native delegation tool: the subagent tool (Kiro CLI) or Agent() (Claude Code). Each instance runs independently with its own context; the orchestrator waits for all spawned instances to complete before proceeding.

Before spawning any write agent, explicitly name its exact target in the dispatch prompt — a new dedicated worktree, an existing worktree to reuse, or (solo sequential dispatch only) the shared working tree. Never let an agent infer or default to a location: a silent default is what causes two agents, from the same task or different tasks, to collide in the same tree. The write agent itself provisions or reuses the named target using its own shell/file tools — not the orchestrator — on either runtime.

Parallel write agents MUST own disjoint files. Before spawning two or more write agents at once, list the files each one will edit. If a file appears in more than one list (a shared router, an index.ts, a registry), give that file to one agent, or run the parts that touch it in sequence. Separate worktrees do not prevent this: both edits conflict at merge, or one is lost.

For dispatch into a separate, visible pane or surface rather than an in-session subagent call, see claude-teams-behavior (Claude Code Agent Teams), mux-dispatch (tmux/zellij), or cmux-dispatch (cmux) for the dispatch-method-specific steps. mux-dispatch and cmux-dispatch each detect and drive Kiro CLI the same as Claude Code, so Kiro CLI is already covered there; for a plain in-session subagent/Agent() call with no multiplexer, the three paragraphs above are the complete procedure on either runtime and no separate skill is needed.

Examples of parallelizable work:

  • Two k-developer instances: one for backend handler, one for frontend component
  • Running code review + test coverage analysis on separate modules
  • Generating threat model + cost estimation from the same design doc

Handoff Pattern

Large outputs between agents go through handoff files:

  1. Subagent writes output to .konductor/handoff/<agent>-<task>.md
  2. Subagent returns only the file path to the orchestrator
  3. Next subagent reads the handoff file directly as CONTEXT
  4. Max ~300 lines per handoff file — split into multiple files if larger

File naming: <source-agent>-<descriptive-task>.md Example: architect-system-design.md, developer-task-breakdown.md

Post-Implementation Review

After code changes, run the maker-checker cycle:

  1. Get the git diff of all changes
  2. Spawn the appropriate reviewer agent (e.g., k-developer with backend-review or frontend-review)
  3. Address all CRITICAL findings
  4. Re-review. If the fix fails, follow rule 5 under Orchestration Rules in your orchestrator prompt.

Failure Recovery

This section covers failed spawns: the spawn errors, times out, or the subagent returns nothing. For output that fails verification, follow rule 5 under Orchestration Rules instead.

  • If a spawn fails, retry once with additional CONTEXT explaining the failure. If it failed because a permission was denied (a declined prompt, a permission rule or hook, or a sandbox or OS refusal such as EPERM, EACCES or a read-only filesystem), do not retry or re-route it; ask the user.
  • If the retry fails, escalate to the user with: what was attempted, what failed, and the root cause
  • If a subagent times out, check .konductor/handoff/ for partial output. Verify any partial output under rule 5; retry the spawn only if there is none.

Quality Gate

CRITICAL (block delegation):

  • Subagent spawned with no explicit target agent (subagent_type omitted) — the tool defaults to general-purpose, which is not registered in this fleet, and the spawn fails outright
  • Workflow agent() call with agentType omitted and no inline comment justifying the omission (see "Deliberate exception" above) — treat as an unreviewed omission, not a deliberate one
  • Delegation prompt missing any of the 7 required sections (or the TARGET AGENT preamble line)
  • Subagent spawned without explicit MUST NOT DO constraints
  • Dependent task spawned before upstream handoff file exists
  • More than 4 concurrent subagents
  • Any write agent spawned without an explicitly named target (new worktree / existing worktree to reuse / shared tree) in its dispatch prompt

IMPORTANT (fix before proceeding):

  • Wrong agent selected for the task domain
  • Handoff file exceeds 300 lines without splitting
  • Post-implementation review skipped after code changes

SUGGESTION:

  • Could parallelize independent tasks that are running sequentially
  • Could add more specific success criteria to EXPECTED OUTCOME

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.