一键导入
adding-swarm-patterns
Use when adding new multi-agent coordination patterns to agent-relay - provides checklist for types, schema, templates, and docs updates
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when adding new multi-agent coordination patterns to agent-relay - provides checklist for types, schema, templates, and docs updates
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use when creating, updating, or reviewing a Workforce cloud persona (`persona.ts` + `agent.ts`) for the current deploy/runtime shape. Covers cloud, useSubscription, integrations with scope mounting/enabledByInput gating/adapter config passthrough, inputs, memory, sandbox modes, onEvent, runtime fields, capabilities, defineAgent triggers/schedules/watch/team-dispatcher launch, provider IO via @relayfile/relay-helpers, multi-transport delivery, ctx.relay messaging, and the deploy flow.
Use when you are a registered relay agent (a spawned worker, or a lead that called register_agent) coordinating with peers in real time over current Agent Relay MCP tools - messaging, channels, threads, reactions, search, inbox, actions, and worker spawn/release. For role selection and orchestrator startup instructions, use https://agentrelay.com/skill and the orchestrating-agent-relay skill.
The canonical way to run agent-relay - self-bootstrap the local broker and autonomously spawn, monitor, and coordinate a team of worker agents without human intervention. Covers infrastructure startup, agent spawning, lifecycle monitoring, message-based reading via the relay MCP, and team coordination.
Use when creating, editing, or validating an Agent Relay Factory factory.config.json file, including repo routing, Linear state/team settings, GitHub issue ingestion, live mode, babysitter options, and Relayflows dispatch wiring boundaries.
Use when adding webhook events to make sure integrations properly register the webhook events they carry
Use when an agent or human needs to set up relayfile end-to-end so agents can read and write provider files through a local mount. Covers `relayfile setup`, dynamic integration discovery with `relayfile integration available/search`, Nango and Composio backend selection, Atlassian site selection and metadata, cloud login, OAuth/connect flows, mount verification, `RELAYFILE_LOCAL_DIR` handoff, writeback status and retry commands, and key May 2026 cloud-mount gotchas.
| name | adding-swarm-patterns |
| description | Use when adding new multi-agent coordination patterns to agent-relay - provides checklist for types, schema, templates, and docs updates |
Add new multi-agent coordination patterns to agent-relay by updating four locations: TypeScript types, JSON schema, YAML template, and markdown docs.
| File | Location | What to Add |
|---|---|---|
| types.ts | packages/broker-sdk/src/workflows/types.ts | Add to SwarmPattern union type |
| schema.json | packages/broker-sdk/src/workflows/schema.json | Add to SwarmPattern.enum array |
| template.yaml | packages/broker-sdk/src/workflows/builtin-templates/ | Create {pattern}.yaml |
| pattern.md | docs/workflows/patterns/ | Create {pattern}.md |
| template.md | docs/workflows/templates/ | Create {pattern}.md |
| README.md | docs/workflows/README.md | Add to patterns and templates tables |
// packages/broker-sdk/src/workflows/types.ts
export type SwarmPattern =
| 'fan-out'
| 'pipeline'
// ... existing patterns ...
| 'your-new-pattern'; // Add here
// packages/broker-sdk/src/workflows/schema.json
"SwarmPattern": {
"type": "string",
"enum": [
"fan-out",
"pipeline",
// ... existing patterns ...
"your-new-pattern"
]
}
# packages/broker-sdk/src/workflows/builtin-templates/{pattern}.yaml
version: '1.0'
name: pattern-name
description: 'One-line description'
swarm:
pattern: pattern-name
maxConcurrency: N
timeoutMs: N
channel: swarm-pattern-name
agents:
- name: lead
cli: claude
role: 'Role description'
# ... more agents
workflows:
- name: workflow-name
steps:
- name: step-name
agent: agent-name
task: |
Task description with {{task}} placeholder
verification:
type: output_contains
value: STEP_COMPLETE
coordination:
barriers:
- name: barrier-name
waitFor: [step1, step2]
state:
backend: memory
namespace: pattern-name
errorHandling:
strategy: fail-fast
# docs/workflows/patterns/{pattern}.md
# Pattern Name
One-sentence description.
## When to Use
- Use case 1
- Use case 2
## Structure
[ASCII diagram showing agent/step flow]
## Configuration
[YAML snippet]
## Best Practices
- Practice 1
- Practice 2
# docs/workflows/templates/{pattern}.md
# Pattern Template
**Pattern:** name | **Timeout:** N minutes | **Channel:** swarm-name
## Overview
What this template does.
## Agents
| Agent | CLI | Role |
| ----- | --- | ---- |
## Workflow Steps
1. **step** (agent) — Description
## Usage
[CLI and TypeScript examples]
## Verification Markers
- `MARKER` — Description
Add to both tables in docs/workflows/README.md:
| [pattern](patterns/pattern.md) | Description | Best For || [pattern](templates/pattern.md) | pattern | Description || Mistake | Fix |
|---|---|
| Forgetting schema.json | Validation will fail if schema doesn't include the pattern |
| Inconsistent naming | Use same name in types, schema, template filename, and docs |
| Missing verification markers | Each step should have output_contains verification |
| Wrong doc links | Use relative paths: patterns/name.md not /docs/workflows/patterns/name.md |
Good patterns have:
Pattern categories: