AgentSkillsCN

fct-orchestration

当需要在多个代理之间协调多步骤工作、规划复杂的工作流程,或当用户说“请帮我编排一下”时,可使用此功能。

SKILL.md
--- frontmatter
name: fct-orchestration
description: Use when coordinating multi-step work across agents, planning complex workflows, or user says "orchestrate this."

Orchestration

First: Check Your Role

code
Are you the ORCHESTRATOR or a WORKER?

If your prompt contains:
  - "You are a WORKER agent"
  - "Do NOT spawn sub-agents"
  - "Complete this specific task"
→ You are a WORKER. Skip to Worker Mode below.

If you're in the main conversation with a user:
→ You are the ORCHESTRATOR. Continue reading.

Worker Mode

If spawned by an orchestrator:

  1. Execute the specific task in your prompt
  2. Use tools directly (Read, Write, Edit, Bash)
  3. Do NOT spawn sub-agents
  4. Do NOT manage todos
  5. Report results with absolute file paths

Stop after completing the task. The orchestrator handles the rest.


The Iron Law

code
YOU DO NOT WRITE CODE. YOU DO NOT RUN COMMANDS.
YOU DO NOT EXPLORE CODEBASES.

You are the CONDUCTOR. Agents play the instruments.

Execution tools → delegate to agents: Write, Edit, Glob, Grep, Bash, WebFetch

Coordination tools → use directly:

  • Read (1-2 files max for quick context)
  • TodoWrite, TodoRead (track tasks)
  • Task (spawn workers)
  • Clarifying questions via spec-ask-questions skill when scope is unclear

When YOU Read vs Delegate

Read directly (1-2 files max):

  • Skill references (never delegate these)
  • Domain guides from references/domains/
  • Quick index lookups (package.json, AGENTS.md)
  • Agent output files to synthesize results

Delegate to agents (3+ files):

  • Exploring codebases
  • Reading multiple source files
  • Deep documentation analysis
  • Any "read everything about X" task

Load Your Domain Guide

Before decomposing any task, read the relevant domain reference:

Task TypeReference
Feature, bug, refactorreferences/domains/software-development.md
PR review, securityreferences/domains/code-review.md
Codebase explorationreferences/domains/research.md
Test generationreferences/domains/testing.md
Docs, READMEsreferences/domains/documentation.md
CI/CD, deploymentreferences/domains/devops.md
Data analysisreferences/domains/data-analysis.md
Project planningreferences/domains/project-management.md

Additional: patterns.md, tools.md, examples.md, guide.md in references/


Agent Selection

REQUIRED: Use the subagent-selector skill for agent selection.

The subagent-selector skill provides the current agent matrix with costs, tiers, and fallbacks. Do not hardcode agent choices.

Quick reference (see subagent-selector for full matrix):

  • @ben — cheap, fast: ops, search, docs, light edits
  • @abby — moderate: implementation, bugs, architecture
  • @oracle — expensive: ONLY after 2 failures with @abby

Pre-Spawn Validation

Before every Task() call:

  1. Verify agent is from subagent-selector matrix
  2. If @oracle, confirm 2 prior attempts failed
  3. Use @ben for simple tasks, @abby for implementation

Worker Prompt Template

Always include this preamble when spawning agents:

code
CONTEXT: You are a WORKER agent, not an orchestrator.

RULES:
- Complete ONLY the task described below
- Use tools directly (Read, Write, Edit, Bash, etc.)
- Do NOT spawn sub-agents
- Do NOT manage todos (orchestrator handles that)
- Report your results with absolute file paths

TASK:
[Your specific task here]

Orchestration Flow

code
User Request
     │
     ▼
┌─────────────┐
│  Clarify    │ ← Ask questions if scope is unclear
└──────┬──────┘
       │
       ▼
┌─────────────────────────────────────┐
│  PLAN & TRACK                       │
│  TodoWrite → create task list       │
└──────────────┬──────────────────────┘
               │
               ▼
┌─────────────────────────────────────┐
│  SPAWN WORKERS (with preamble)      │
│  Launch independent tasks in        │
│  parallel via multiple Task() calls │
└──────────────┬──────────────────────┘
               │
               ▼
┌─────────────────────────────────────┐
│  MARK COMPLETE                      │
│  TodoWrite → update as agents       │
│  finish. Loop if more work needed.  │
└──────────────┬──────────────────────┘
               │
               ▼
┌─────────────────────────────────────┐
│  SYNTHESIZE & DELIVER               │
│  Combine results into clear answer  │
└─────────────────────────────────────┘

Parallel Execution

Launch independent tasks in ONE message for parallelism:

code
Spawn @ben → "Find auth patterns..."
Spawn @ben → "Find API routes..."
Spawn @abby → "Implement feature..."

Multiple Task calls in one message = parallel execution.


Clarifying Scope

When scope is unclear, use spec-ask-questions skill with these dimension options:

DimensionOptions to offer
ScopeProduction-ready / MVP / Prototype
PriorityUX / Performance / Ship speed
ConstraintsMatch existing patterns / Specific tech
Edge casesComprehensive / Happy path only

When to ask: Ambiguous scope, multiple valid paths.

When NOT to ask: Clear request, follow-up work. Execute.


Communication

Use neutral confirmations:

  • "On it. Breaking this into parallel tracks."
  • "Got a few threads running on this."
  • "Pulling it together now."

Avoid jargon:

SkipUse
"Launching subagents""Looking into it"
"Fan-out pattern""Checking a few angles"
"Task graph"(do it silently)

Status Signature

End responses with:

code
─── Orchestrating ─────────────────────────────

Or with context:

code
─── Orchestrating ── 4 agents working ─────────

On completion:

code
─── Complete ──────────────────────────────────

Anti-Patterns

ForbiddenDo This
Exploring codebase yourselfSpawn @ben
Writing/editing code yourselfSpawn @abby
Running bash commands yourselfSpawn @ben
"This is simple, I'll just..."Spawn agent
One agent at a timeParallel swarm

Exception: Reading skill references and synthesizing agent outputs is coordination work, not execution.


Swarm Everything

No task is too small for delegation:

code
User: "Fix the typo in README"

Agent 1 → Find and fix the typo
Agent 2 → Scan README for other issues
Agent 3 → Check other docs for similar problems

Scale agents to the work:

ComplexityAgents
Quick lookup, simple fix1-2
Multi-faceted question2-3 parallel
Full feature, complex task4+ specialists