AgentSkillsCN

delegate

利用小队扩展工具,将工作委派给实习子代理。当用户请求您执行某项任务时使用此功能——所有工作均由实习生完成,绝不会由负责人直接处理。

SKILL.md
--- frontmatter
name: delegate
description: Delegate work to intern sub-agents using the squad extension tools. Use when the user asks you to do something — all work is done by interns, never by the lead directly.

Always Delegate

You are a lead, not a worker. All actual work must be done by interns. When the user asks you to build, fix, refactor, write, or do anything — delegate it. Your job is to break down tasks, write clear instructions, assign them to interns, and manage the squad.

Hard limit: maximum 6 interns at a time.

Tools

The squad extension provides these tools:

ToolPurpose
intern_listList all live interns and on-disk sessions
intern_spawnStart a new intern process (or reconnect an existing one)
intern_sendSend work to an intern (fire-and-forget, non-blocking)
intern_statusCheck on an intern (synchronous — waits for reply if idle)
intern_steerInterrupt a working intern with new instructions
intern_abortAbort an intern's current work without killing the process
intern_killShut down an intern process (session stays on disk)

How to Delegate

1. Check existing interns

code
intern_list

Cross-reference with tasks.md. Look for idle interns to reuse or done interns to clean up.

2. Enforce the intern cap (max 6)

If at capacity, find candidates to free up:

  • Done interns — get a final report via intern_status, then intern_kill and rm -rf
  • Idle interns — reuse them for the new task
  • All active — ask the user who to drop

3. Spawn and send work

code
intern_spawn name: "fix-login-bug"
intern_send name: "fix-login-bug" message: "There's a bug in src/auth/login.ts where..."

The intern works in the background. You are notified automatically when it finishes — no need to poll.

4. Follow-up and steering

Send more work (queued if busy):

code
intern_send name: "fix-login-bug" message: "Also add a unit test for the edge case"

Redirect mid-task:

code
intern_steer name: "fix-login-bug" message: "Stop what you're doing, focus on the null case instead"

5. Update task tracker

After every action, update tasks.md using the task-tracker skill.

Work Isolation

Each intern gets its own directory under ./interns/<name>/. If they need to work on a git repo, have them clone into their directory:

code
intern_send name: "fix-bug" message: "Clone git@github.com:org/repo.git into your working directory, then..."

Never let interns work directly in shared repos outside their directory.

Before Evicting an Intern

  1. Get a final report: intern_status name: "old-intern" question: "Final report: what did you do, what files did you create/modify, what's unfinished?"
  2. Ensure work is committed/saved outside the intern directory
  3. Log the eviction in tasks.md
  4. intern_kill name: "old-intern" then rm -rf ./interns/old-intern/

Parallel Delegation

Spawn and send to multiple interns — they all run concurrently:

code
intern_spawn name: "api-refactor"
intern_spawn name: "add-tests"
intern_send name: "api-refactor" message: "Refactor the API routes..."
intern_send name: "add-tests" message: "Add integration tests for..."

Notes

  • Always tell interns to check for AGENTS.md and guidance files in any project they work in
  • If an intern keeps failing, abort it, get a report, kill it, and re-delegate with a different approach
  • The session file in each intern dir persists across reconnects — intern_spawn on an existing dir resumes the session
  • Completion notifications appear in your conversation automatically — you don't need to poll