AgentSkillsCN

delegate

通过emdx委托,将并行任务分配给子代理。在需要并行开展研究、分析或代码任务时使用——任务结果将持久保存于知识库中。

SKILL.md
--- frontmatter
name: delegate
description: Dispatch parallel work to sub-agents via emdx delegate. Use when you need to run research, analysis, or code tasks in parallel — results persist to the knowledge base.
disable-model-invocation: true

Delegate Work

Dispatch the following via emdx delegate: $ARGUMENTS

Core Usage

Single task:

bash
emdx delegate "analyze the auth module"

Parallel tasks (up to 10 concurrent):

bash
emdx delegate "check auth" "review tests" "scan for XSS"

Parallel with combined summary:

bash
emdx delegate --synthesize "task1" "task2" "task3"

Options

FlagShortPurpose
--doc-dPass a KB document as context
--prCreate a PR (implies --worktree)
--branchPush branch, no PR (implies --worktree)
--draft / --no-draftDraft PR toggle (default: --no-draft)
--base-branch-bCustom base branch
--worktree-wRun in a git worktree
--synthesize-sCombine parallel results into a summary
--jobs-jMax parallel tasks (default: auto)
--tags-tTag saved results
--title-TCustom title for saved results
--model-mOverride model
--sonnetShortcut for --model sonnet
--opusShortcut for --model opus
--quiet-qQuiet mode
--epic-eAssign to epic
--cat-cAssign category
--cleanupRemove stale worktrees

Flag Ordering

All --flags must come BEFORE positional arguments:

bash
# Correct
emdx delegate --synthesize --tags "analysis" "task1" "task2"

# Wrong — flags after positional args
emdx delegate "task1" "task2" --synthesize

When to Delegate vs Do Inline

Delegate when:

  • You need parallel research (2-10 tasks)
  • The task involves code changes that should become a PR
  • Results should persist to the KB for future reference
  • The work is independent and doesn't need your conversation context

Do inline when:

  • Quick, single-step lookups (use Grep/Glob/Read directly)
  • The task depends on your current conversation state
  • You need to iterate interactively with the user

Examples

bash
# Research with synthesis
emdx delegate --synthesize "analyze auth patterns" "review error handling" "check test coverage"

# Code change with PR
emdx delegate --pr "fix the auth bug described in issue #123"

# With document context
emdx delegate --doc 42 "implement the plan described here"

# Push branch without PR
emdx delegate --branch -b develop "add feature X"

# Use a faster model
emdx delegate --sonnet "quick analysis of the config module"

# Clean up stale worktrees
emdx delegate --cleanup