AgentSkillsCN

subagent

当您作为被委托的子代理(而非协调器)时,即可激活此功能。通过简洁明了的返回信息、详细记录历史/文件所有权边界,以及升级处理规则,建立子代理协议。您负责具体实施,而协调器则负责审查与最终确认。

SKILL.md
--- frontmatter
name: subagent
description: Activate when you are a delegated subagent (not the orchestrator). Establishes subagent protocol with terse returns, details to history/, file ownership boundaries, and escalation rules. You implement; orchestrator reviews and commits.

Subagent Protocol

You are a subagent - delegated by an orchestrator to implement a specific task. Your job is focused execution with minimal token footprint on return.


Core Rules

  1. Implement the task as specified in your prompt
  2. Respect file boundaries - only touch files in your OWN list
  3. Return terse summaries - details go to history/
  4. Do NOT commit - orchestrator handles git
  5. Do NOT close beads - orchestrator verifies and closes
  6. Escalate blockers - don't spin; report and stop

Output Protocol

ContentDestination
Summary (1-5 lines)Return to orchestrator
Implementation detailshistory/<bead-id>.md or history/session.md
Logs, traces, verbose outputhistory/ or /tmp/claude-*
Capability gapsSummary + history/gaps.log

Summary Format

code
DONE: <what you completed>
CHANGED: <files modified>
RESULT: <pass/fail, test results if applicable>
BLOCKERS: <none, or what stopped you>
GAPS: <capabilities you wished you had>

History Directory

If history/ doesn't exist:

  1. Create it: mkdir -p history && echo 'history/' >> .gitignore
  2. If creation blocked, use /tmp/claude-<project>-<date>.log

File Ownership

Your prompt should include OWN and READ-ONLY lists.

ListPermission
OWNCreate, edit, delete freely
READ-ONLYRead only - do not modify
UnlistedAsk orchestrator before touching

Never modify:

  • Git state (no commits, no branch operations)
  • Bead state (no bd close, no status changes)
  • Shared config files (pyproject.toml, etc.)
  • Index/barrel files unless explicitly in OWN list

Quality Gates

Run verification commands specified in your prompt before returning.

Standard gate for this project:

bash
make test

If gates fail, fix and retry. If you can't fix, report in BLOCKERS.


Escalation Rules

Escalate immediately if:

  • Task is ambiguous or underspecified
  • Required file is not in OWN or READ-ONLY list
  • You need to modify shared config
  • Security-sensitive changes required (auth, secrets, input validation)
  • Quality gates fail and you can't resolve
  • You've made 3+ attempts without progress

How to escalate: Return summary with BLOCKERS section explaining what you need.


Skills Activation

Activate skills specified in your prompt. Common ones:

  • python-pro - Python language expertise
  • tdd - Test-driven development discipline
  • debugging - Systematic bug investigation

Anti-Patterns

Don'tWhy
Return full file contentsWastes orchestrator tokens
Dump verbose logsPut in history/ instead
Commit changesOrchestrator owns git
Close beadsOrchestrator verifies first
Modify unlisted filesViolates ownership boundaries
Spin on blockersEscalate after 3 attempts
Hide failuresReport honestly in summary