AgentSkillsCN

rune-orchestration

多智能体编排的架构参考:协调模式、输出格式、冲突解决以及基于文件的交接机制。 此技能适用于选择编排架构(监督者模式 vs 群体模式 vs 流水线模式)、定义智能体输出格式,或解决智能体之间相互矛盾的结论时使用。 若需在智能体孵化前设定预算并预防上下文溢出,则应改用上下文编织技能。 <示例> 上下文:进行多智能体代码评审 用户:“用多个智能体来评审这个 PR。” 助手:“我将运用符文编排技术,实现上下文隔离与基于文件的交接机制。” </示例> <示例> 上下文:协调代码库审计 用户:“开展一次以安全与性能为重点的审计。” 助手:“我将运用符文编排技术,统筹审计智能体的协作与输出格式。” </示例>

SKILL.md
--- frontmatter
name: rune-orchestration
description: |
  Architecture reference for multi-agent orchestration: coordination patterns, output formats, conflict resolution, and file-based handoff.
  This skill should be used when choosing orchestration architecture (supervisor vs swarm vs pipeline), defining agent output formats, or resolving conflicting agent findings.
  For pre-spawn budgets and overflow prevention, the context-weaving skill should be used instead.

  <example>
  Context: Running multi-agent code review
  user: "Review this PR with multiple agents"
  assistant: "I'll use rune-orchestration for context isolation and file-based handoff"
  </example>

  <example>
  Context: Coordinating a codebase audit
  user: "Run an audit with security and performance focus"
  assistant: "I'll use rune-orchestration for audit agent coordination and output format"
  </example>
user-invocable: false
allowed-tools:
  - Task
  - Read
  - Write

Rune Orchestration Skill

Guides designing distributed multi-agent systems that partition work across multiple language model instances to overcome single-agent context limitations.

Core Principle

Sub-agents exist primarily to isolate context, not to anthropomorphize role division.

The fundamental value lies in distributing cognitive load across separate context windows rather than simulating organizational hierarchies.

When to Use

CategoryWorkflowsOrchestration Pattern
Reviews/rune:reviewRunebearer Specialists
Audits/rune:auditRoundtable Circle (Fan-out / Fan-in)
Research/rune:planParallel Exploration
Work/rune:workSwarm Workers
CustomAny workflow spawning 3+ agentsChoose pattern from below

Generic trigger conditions:

  • Context window constraints from single-agent approach
  • Complex tasks requiring specialized expertise in parallel
  • Need for parallel processing of independent subtasks
  • Any workflow spawning 3+ agents via Task tool or Agent Teams

Agent Coordination Patterns

File-Based Handoff Pattern

Instead of supervisor synthesizing responses (telephone game), agents write directly to files:

Workflow TypeOutput DirectoryOutput TypeExample Contents
Reviewstmp/reviews/{pr-number}/Report (P1/P2/P3)forge-warden.md, ward-sentinel.md, TOME.md
Auditstmp/audit/{audit-id}/Report (P1/P2/P3)security.md, performance.md, TOME.md
Plan researchtmp/research/Researchbest-practices.md, framework-docs.md
Work (swarm)tmp/work/Statusrune-smith-1.md, rune-smith-2.md
Customtmp/{workflow-name}/VariesNamed by teammate role

Directory Purpose:

  • Persistent (todos/): Findings that become actionable items
  • Ephemeral (tmp/): Intermediate artifacts consumed by coordinator

The workflow: Agents write findings → Coordinator reads files → Synthesizes into Tome (TOME.md)

Structured output: Runebearers MAY also write companion JSON files ({runebearer}-findings.json) for CI/CD integration. After verification, a completion.json summarizes the workflow result. See Output Format for full specs.

Agent Output Formats

Each agent writes findings in a format matching its workflow type. All formats require mandatory evidence blocks.

  • Report Format (Reviews, Audits): P1/P2/P3 severity with Rune Traces. See Output Formats
  • Research Format (Plans): Knowledge synthesis with sources. See Output Formats
  • Status Format (Work): Implementation progress reports. See Output Formats

Conflict Resolution Rules

When multiple agents flag the same code with different priorities:

ConflictResolution
P1 vs P2P1 wins (highest priority)
P1 vs P1 (different issues)Both retained
Security vs PerformanceSecurity wins
Same issue, different agentsDeduplicate, keep first

Priority Hierarchy

code
ward-sentinel P1 > any other agent P1
any agent P1 > any agent P2
any agent P2 > any agent P3

Three Architectural Patterns

1. Supervisor/Orchestrator (Default)

Central coordinator delegates to specialists and aggregates results.

code
Team Lead (orchestrator)
    ├── forge-warden   (backend review)
    ├── ward-sentinel  (security review)
    ├── pattern-weaver (quality patterns)
    ├── glyph-scribe   (frontend review)
    └── knowledge-keeper    (docs review)

Used by: /rune:review, /rune:audit

Mitigate telephone game: Use file-based handoff, not message passing.

2. Peer-to-Peer/Swarm

Direct agent-to-agent communication. Workers self-organize and race to claim tasks.

Used by: /rune:work

Example use case: Multiple rune-smiths claiming independent tasks from a shared pool.

3. Hierarchical

Layered abstractions. Use for complex multi-phase workflows.

code
Strategy Layer (plan)
    └── Planning Layer (spec)
        └── Execution Layer (implement)

Used by: /rune:plan/rune:work/rune:review

Agent Role Patterns

Defines how agents are organized for each workflow type, including conditional spawning rules and validation pipelines.

  • Review Runebearers: Parallel specialists writing to tmp/reviews/{pr}/. See Role Patterns
  • Audit Runebearers: Fan-out/fan-in to tmp/audit/{id}/. See Role Patterns
  • Research Agents: Parallel exploration to tmp/research/. See Role Patterns
  • Work Agents (Rune Smiths): Swarm workers to tmp/work/. See Role Patterns
  • Conditional Runebearers: Spawned based on file types in scope. See Role Patterns
  • Validation Agents (Truthsight Pipeline): Post-review verification. See Role Patterns

Token Economics

ApproachToken MultiplierWhen to Use
Single agent1xSimple tasks
Multi-agent~15xComplex review, parallel analysis

Guideline: Use multi-agent only when context isolation is necessary, not for simple division of labor.

Essential Failure Mitigations

1. Supervisor Saturation

Problem: Coordinator overwhelmed by aggregating many agent responses.

Solution: Glyph Budget — each agent writes to file, returns only file path + 1-sentence summary (max 50 words).

2. Coordination Overhead

Problem: Too much time on handoff protocols.

Solution: Clear file-based handoff with consistent format.

3. Lack of Convergence

Problem: Agents disagree indefinitely.

Solution:

  • Time-to-live limits (max 2 iterations)
  • Priority hierarchy for conflicts
  • Human review for unresolved conflicts

4. Error Propagation

Problem: Early agent error cascades.

Solution:

  • Validate outputs between agents
  • Each agent reads source code directly, not previous agent's summary

Glyph Budget (MANDATORY for all multi-agent workflows)

Every agent in a parallel workflow MUST:

  1. Write detailed findings to a file
  2. Return ONLY: file path + 1-sentence summary (max 50 words)
  3. Never include analysis in the return message

This prevents lead agent context overflow regardless of how many agents run.

See context-weaving skill for the full Glyph Budget protocol and pre-spawn checklist.

Inscription Protocol (MANDATORY)

RULE: TeamCreate (any count) OR Task x 3+ agents → inscription.json REQUIRED. No exceptions.

code
TeamCreate → inscription.json REQUIRED (always, any teammate count)
Task x 3+  → inscription.json REQUIRED (parallel agents)
Task x 1-2 → glyph budget only (inscription optional)

Three steps:

  1. Generate inscription.json before spawning agents/teammates
  2. Inject required sections + Seal Format into each agent prompt
  3. Validate output files after completion (circuit breaker → per-file → gap report)

Agents send structured Seal messages (key-value: file, sections, findings, evidence-verified, confidence, self-reviewed, summary). TaskList completed is authoritative; Seal is supplementary metadata.

Full spec: Inscription Protocol

Structured Reasoning Integration

Multi-agent workflows benefit from structured reasoning at key decision points.

Three reasoning checkpoints for lead agents:

CheckpointWhenKey Action
Pre-spawnBefore launching agents8-thought checklist (see context-weaving)
Mid-monitorDuring agent executionIntervene on timeout, clarification requests, partial failures
Post-aggregateAfter collecting all outputsResolve conflicts between agents using branching analysis

Full protocol: Structured Reasoning

References

  • Output Formats — Report, Research, and Status output templates
  • Role Patterns — Agent organization per workflow type, conditional spawning, validation pipeline
  • Structured Reasoning — Reasoning principles for lead + teammate reasoning
  • Inscription Protocol — Output validation for all multi-agent workflows
  • Prompt Weaving — 7-section prompt template, context rot prevention, instruction anchoring
  • Truthsight Pipeline — 4-layer verification spec
  • Verifier Prompt — Smart Verifier prompt template
  • Companion: context-weaving (Glyph Budget, pre-spawn checklist)
  • Review workflow: roundtable-circle skill