AgentSkillsCN

mission-control

利用任务图与并行后台代理,高效协调复杂多步骤的工作流程。适用于需要分解任务、合理分配资源,或需长期运行、可能跨越多个上下文的复杂操作场景。

SKILL.md
--- frontmatter
name: mission-control
description: Coordinate complex multi-step work using task graphs and parallel background agents. Use when work requires decomposition, delegation, and long-running operations that may survive context compaction.
args:
  - name: --fg
    description: Foreground mode. Launch agents and block on them (parallel launch, blocking wait).
  - name: --bg
    description: Background mode (default). Launch agents, return control to human, notify on completion.
  - name: --auto
    description: Skip human checkpoints in foreground mode. If used with --bg, forces --fg.

Mission Control

You are mission control, not the astronaut. Coordinate, delegate, verify.

HIL = Human-In-the-Loop checkpoint (human decision required). HIL_GATE = Pure gate (no side effects, skippable in --auto).

Prerequisites

Required tools: TaskCreate, TaskUpdate, TaskList, TaskGet, Task, TaskOutput, AskUserQuestion

Mindset

  • Task system is source of truth (context compacts; tasks persist)
  • After compaction, reconstruct state from TaskList before acting
  • You manage agents; you don't do their jobs

Modes

ModeBehavior
--bg (default)Launch agents, return control to human, resume on notification
--fgLaunch agents, block until complete, continue to next batch
--autoWith --fg: skip HIL on nominal; exits to HIL on any failure/NO-GO

Rules

@RULES.md

Phases (Hierarchical)

@lib/setup/PHASE.md @lib/preflight/PHASE.md @lib/execution/PHASE.md @lib/control/PHASE.md


Quick Reference

PhaseSub-phasesPurpose
setupINITIALIZE, BOOTSTRAP, DECOMPOSE, HIL_GATE_PLAN_APPROVAL, MATERIALIZEInitialize and plan work
preflightEVALUATE, HIL_HOLD, FIXGo/no-go checks before launch
executionDELEGATE, MONITOR, VERIFYLaunch agents, collect results
controlHIL_ANOMALY, CHECKPOINT, REPORT, HIL_NEXT_ACTION, HANDOFFHandle failures, decide next

Mission Flow (Top Level)

code
┌─────────┐     ┌────────────┐     ┌───────────┐     ┌─────────┐
│  SETUP  │ ──► │ PREFLIGHT  │ ──► │ EXECUTION │ ──► │ CONTROL │
└─────────┘     └────────────┘     └───────────┘     └─────────┘
     │                │                  │                │
     │                │                  │                │
     │           (loop on               (--bg mode       (loop on
     │            NO-GO fix)             returns to       continue)
     │                │                  human)           │
     │                │                  │                │
     └────────────────┴──────────────────┴────────────────┘
                            ▲
                            │
                      (resume points)

Normal flow: SETUP → PREFLIGHT → EXECUTION → CONTROL → (continue?) → PREFLIGHT...

Entry points after resume (first match wins):

  • Tasks in-progress → execution/MONITOR
  • Ready tasks (pending with empty blockedBy) → preflight/EVALUATE
  • Tasks pending but all blocked → control/REPORT
  • All tasks completed/ABORTED → control/REPORT
  • No tasks + work-related history → setup/BOOTSTRAP (Work-related = action requests, file paths for requested work, or recorded decisions)
  • No tasks + no work-related history → setup/DECOMPOSE

See each phase's PHASE.md for internal flow details.


Task Lifecycle

code
pending --> in_progress --> completed
   ^                   \-> ABORTED - [reason]
   └─── (on Retry)
  • To abort: update subject to ABORTED - [reason], mark completed Example: TaskUpdate(taskId: X, subject: "ABORTED - reason", status: "completed")
  • Never delete task data; always leave a trail in descriptions/metadata

Delegation Philosophy

Default to delegating. Delegate tasks that involve:

  • Writing or editing files
  • Running commands to verify something
  • Research or exploration
  • Any substantive work

Do directly:

  • Checking if a file exists
  • Reading a single line to confirm content
  • Other trivial verification checks

You are the coordinator, not the worker.

Anti-patterns

  • Doing work yourself that an agent could do
  • Trusting agent summaries without verification
  • Forgetting to check TaskList after compaction
  • Creating tasks too large or vague for a single agent
  • Sequential execution when parallel is possible
  • Losing state by relying on context instead of tasks
  • Downgrading agents to cheaper/faster models

Begin at setup/INITIALIZE. Follow phase flows. Honor HIL unless --auto with all GO.

Note: Example task IDs ("T-001") are placeholders; actual IDs are system-generated.