본문으로 건너뛰기
cccskills
무료GitHub에 공개

task-delegation

Agent task delegation patterns — spawn protocols, handoff metadata, drain gate, parallel limits, and model selection for multi-agent orchestration

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(10)

  • SKILL.md8.0 KB
  • commands/task-delegation.md115 B
  • hooks/post-execute.cjs183 B
  • hooks/pre-execute.cjs289 B
  • references/research-requirements.md290 B
  • rules/task-delegation.md289 B
  • schemas/input.schema.json492 B
  • schemas/output.schema.json259 B
  • scripts/main.cjs1014 B
  • templates/implementation-template.md189 B

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Task Delegation Skill

When to Invoke

Skill({ skill: 'task-delegation' });

Use when:

  • Spawning subagents to perform work
  • Decomposing a complex task into parallel or sequential subtasks
  • Implementing handoff metadata between agents
  • Verifying pipeline completion via drain gate
  • Selecting the right model for a spawned agent

Core Protocol: Spawn → Update → Drain

Every delegation sequence follows three phases:

1. SPAWN  — Task({ task_id, subagent_type, prompt })
2. UPDATE — TaskUpdate({ taskId, status: 'in_progress', owner: 'router' }) [immediately after spawn]
3. DRAIN  — TaskList() → verify zero in_progress/pending tasks before claiming done

Skipping any phase causes invisible work, stuck tasks, or duplicate execution.


Spawn Template

Every Task() call MUST include a task_id parameter. Missing task_id is hard-blocked by spawn hooks.

Task({
  task_id: 'task-7',
  subagent_type: 'developer',
  prompt: `
## Task ID: task-7
## Agent: developer

### Context
<brief description of what this agent needs to know>

### Objective
<single concrete deliverable>

### Instructions
1. Call TaskUpdate({ taskId: 'task-7', status: 'in_progress' }) IMMEDIATELY.
2. <step-by-step work instructions>
3. Call TaskUpdate({ taskId: 'task-7', status: 'completed', metadata: { summary: '...', filesModified: [...] } }).

### Constraints
- Scope: only files listed above
- Do NOT modify unrelated files
`,
});

Immediate Status Rule

After every Task(...) spawn, immediately call TaskUpdate for that task:

// Spawn the agent
Task({ task_id: 'task-7', subagent_type: 'developer', prompt: '...' });

// Immediately record as in_progress (router-owned until agent picks it up)
TaskUpdate({ taskId: 'task-7', status: 'in_progress', owner: 'router' });

This guarantees task visibility even before the spawned agent emits its first tool call.


Parallel Delegation — Token Budget Limits

NEVER spawn more than 2 heavy agents simultaneously.

Heavy agents: architect, security-architect, code-reviewer, qa, developer, devops Light agents: researcher, general-assistant, technical-writer

// CORRECT: Max 2 heavy agents in parallel
Task({ task_id: 'task-3', subagent_type: 'developer', prompt: '...' });
Task({ task_id: 'task-4', subagent_type: 'qa', prompt: '...' });

// WRONG: 3+ heavy agents causes context overflow
Task({ task_id: 'task-3', subagent_type: 'developer', prompt: '...' });
Task({ task_id: 'task-4', subagent_type: 'qa', prompt: '...' });
Task({ task_id: 'task-5', subagent_type: 'architect', prompt: '...' }); // DO NOT

For 3+ parallel workstreams, use master-orchestrator to manage sequencing.


Handoff Metadata Protocol

Use structured metadata on TaskUpdate(completed) to enable downstream agents to pick up context without re-reading files:

TaskUpdate({
  taskId: 'task-5',
  status: 'completed',
  metadata: {
    summary: 'Implemented JWT auth middleware with refresh tokens',
    filesModified: ['src/middleware/auth.ts', 'src/lib/jwt.ts', 'tests/middleware/auth.test.ts'],
    outputArtifacts: ['.claude/context/plans/auth-design.md'],
    keyDecisions: [
      'Used RS256 (asymmetric) over HS256 for key rotation support',
      'Refresh tokens stored in Redis with 7-day TTL',
    ],
    discoveredFiles: ['src/auth/legacy-session.ts'], // existing code to reuse/replace
    worktreePath: process.env.AGENT_WORKTREE_PATH || process.cwd(),
    completedAt: new Date().toISOString(),
  },
});

Downstream agents read this via TaskGet({ taskId: 'task-5' }):

const task = TaskGet({ taskId: 'task-5' });
const { keyDecisions, filesModified, discoveredFiles } = task.metadata;

Drain Gate (MANDATORY Before Completion)

Before claiming "pipeline complete", execute all drain-gate checks in order:

// Step 1: Task drain
const tasks = TaskList();
const openTasks = tasks.filter(t => ['in_progress', 'pending', 'blocked'].includes(t.status));
if (openTasks.length > 0) {
  // Report open task IDs, continue orchestration
  console.log(
    'Still open:',
    openTasks.map(t => t.id)
  );
}

// Step 2: Reflection queue check
// Read .claude/context/runtime/reflection-spawn-request.json
// If any entries exist with status: 'pending', spawn reflection-agent first

// Step 3: Only after steps 1 and 2 pass — write completion summary

Never claim completion with open tasks or unprocessed reflections.


Model Selection

Task TypeModelRationale
Simple Q&A, research, summarizationhaikuCost-effective, fast
Implementation, bug fixes, testssonnetBalanced capability/cost (default)
Architecture, security review, planningopusHighest reasoning for complex tasks
Orchestrators (master, evolution)opusMust coordinate many subtasks
Context compressionhaikuToken-efficient, low complexity
Task({
  task_id: 'task-8',
  subagent_type: 'security-architect',
  model: 'claude-opus-4-5', // explicit override
  prompt: '...',
});

Model precedence (highest to lowest):

  1. Explicit model: in Task() call
  2. Agent frontmatter model: field
  3. config.yaml agents.{type}.model
  4. Complexity-based default
  5. Fallback: sonnet

Sequential Dependencies

For tasks that must run in order, use addBlockedBy:

TaskCreate({ subject: 'Design auth', taskId: 'task-1' });
TaskCreate({ subject: 'Implement auth', taskId: 'task-2' });
TaskCreate({ subject: 'Test auth', taskId: 'task-3' });

TaskUpdate({ taskId: 'task-2', addBlockedBy: ['task-1'] });
TaskUpdate({ taskId: 'task-3', addBlockedBy: ['task-2'] });

Poll with TaskList() to detect when blocked tasks become unblocked, then spawn the next agent.


Specialist-First Routing (IRON LAW)

Before spawning developer, check if a specialist matches. Developer is the LAST RESORT.

Request TypeCorrect Agent
Update documentationtechnical-writer
Refactor/clean up codecode-simplifier
Review codecode-reviewer
Run tests / QAqa
Deploy / CI / Dockerdevops
Database designdatabase-architect
Research / investigateresearcher
Security-sensitive worksecurity-architect
Debug productiondevops-troubleshooter

Anti-Patterns

  • Never skip task_id — spawn hooks hard-block missing IDs
  • Never claim completion before TaskList() drain — open tasks = invisible work
  • Never spawn 3+ heavy agents in parallel — causes context overflow
  • Never use developer for git commit/push/deploy — always use devops
  • Never spawn reflection-agent with run_in_background: true — breaks atomic handshake
  • Never write multi-fix prompts (4+ fixes per agent) — causes silent failures
  • Never use haiku for security or hooks tasks — use sonnet minimum

INLINE SUMMARY Before TaskUpdate(completed)

Before calling TaskUpdate({ status: 'completed' }), output this block:

IMPLEMENTATION_RESULT:
  summary: <one-line description>
  filesModified:
    - path/to/file1
    - path/to/file2
  testsRun: <command>
  testResult: <PASS/FAIL + counts>
  worktreePath: <AGENT_WORKTREE_PATH or cwd>

The pre-completion-validation.cjs hook reads this block to validate completion.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Ensure accessibility in UI components including semantic HTML, ARIA attributes, keyboard navigation, and WCAG 2.2 AA compliance.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

oimiragieo/agent-studio422026년 7월 14일 업데이트

Use when you want to improve response quality through meta-cognitive reasoning. Applies 15+ reasoning methods to reconsider and refine initial outputs.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

oimiragieo/agent-studio422026년 7월 14일 업데이트

N-round opposing-stance debates for trade-off analysis. Assigns pro/con roles to agents, runs structured debate rounds with quality scoring, and produces a moderator synthesis with confidence-rated recommendation. Generalizable to architecture, technology, security, and design decisions.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

oimiragieo/agent-studio422026년 7월 14일 업데이트

Force adversarial code review stance that eliminates confirmation bias — reviewer must find issues or re-analyze

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

oimiragieo/agent-studio422026년 7월 14일 업데이트

Creates specialized AI agents on-demand when no existing agent matches a request. Use when the Router cannot find a suitable agent for a task. Enables self-evolution by generating persistent agents.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

oimiragieo/agent-studio422026년 7월 14일 업데이트

LLM-as-judge evaluation framework with 5-dimension rubric (accuracy, groundedness, coherence, completeness, helpfulness) for scoring AI-generated content quality with weighted composite scores and evidence citations

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

oimiragieo/agent-studio422026년 7월 14일 업데이트

oimiragieo의 스킬 모두 보기

이 스킬의 문제 신고