Logo Swarm Coding

Swarm Coding

Cộng đồng
danicat
swarm-coding

Orchestrates multi-agent hierarchical swarms using a divide-and-conquer architecture for complex, multi-system, or orthogonal engineering initiatives (e.g., concurrent backend, frontend, database, QA). Manages hierarchical Lead Agents and Specialists, Single Writer file boundaries, and strict parent-child communication. Activate on swarm-coding(N), /swarm-coding <N>, /swarm <N>, or any mention of 'swarm' or multi-agent team coordination across technical domains.

Tổng quan

Nhà phát hànhdanicat
Kho mãskills
Tên kỹ năngswarm-coding
Sao
24
Bản fork
4
Tệp đi kèm
5
Giấy phépApache-2.0
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI là Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • 5 tệp đi kèm

    Các tập lệnh, mẫu và tài liệu tham khảo mà mô hình có thể đọc khi làm việc. Các tệp chỉ cho phép đọc và không bao giờ được thực thi.

  • Mã nguồn mở

    Được danicat công bố trên GitHub. Hãy đọc nội dung nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Swarm Coding trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL thư mục kỹ năng bên dưới và xác nhận.
    https://github.com/danicat/skills/tree/main/workflows/swarm-coding
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/danicat/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/workflows/swarm-coding .claude/skills/swarm-coding
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Swarm Coding trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự tải Swarm Coding ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên Swarm Coding không bị giới hạn ở mô hình mà kỹ năng này được viết cho. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên kỹ năng chưa dùng không tốn chi phí.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

Swarm Coding

Swarm Coding divides complex engineering objectives among specialized subagents structured in a clear organization chart. This divide-and-conquer strategy guarantees context isolation, prevents cross-domain contamination, and accelerates delivery by keeping each subagent's scope narrow and exclusive.

[!NOTE] In this guide, the terms "agent" and "subagent" are used interchangeably.


⚡ Core Principles & Operational Rules

1. Invocation Syntax & Budget Parsing

Parse the user's prompt to extract the target Agent Budget / Degree of Parallelism (DOP):

  • swarm-coding(N) or /swarm-coding(N) (e.g., swarm-coding(8), /swarm-coding(12))
  • /swarm-coding <DOP> or /swarm <DOP> (e.g., /swarm-coding 10, /swarm 6)
  • /swarm-coding dop: <number> or /swarm-coding budget <number> (e.g., /swarm-coding dop: 8, /swarm-coding budget 6)
  • Natural language budgets (e.g., "swarm this refactor across 8 agents", "run a coding swarm with a budget of 12")
  • If no number is provided, default to 10. If DOP <= 1, fall back to direct single-agent execution.

2. Coordinator & Lead Non-Execution

  • The ROOT Swarm Coordinator and Domain Lead Agents ALWAYS remain coordinators/architects and NEVER fall back to code executors.
  • Both Coordinator and Lead Agents are strictly forbidden from writing production implementation code, running tests or builds, or calling run_command.
  • Lead Agents have EnableWriteTools: true solely to draft or update markdown specification files (such as docs/domain-spec.md). Writing production source files or running terminal commands in a Lead Agent is a critical protocol violation.

3. Split Swarm Profiles

  • Swarm Coordinator (ROOT): Attributed strictly to the ROOT agent that activated the skill (Multiplicity: 1). Defines the top-level Org Chart, names Lead Agents, allocates the agent budget, writes top-level architecture specs, and orchestrates the final Reduce phase.
  • Lead Agent (Domain Tech Lead): Attributed to domain or system leads (Multiplicity: N, one per system/domain). Loads the swarm-coding skill as its mandatory Step 1, writes domain specifications, defines and spawns its Specialist team within its allocated sub-budget, and integrates domain deliverables.
  • Specialist: Attributed to task executors. Designs and implements narrowly-scoped components within a single domain, adhering to domain specs and running localized validation loops.

4. Single Writer Principle & Staging Pattern

  • Single Writer Principle: Only one Specialist is granted write authority to any single file or resource at a time. Disjoint file ownership prevents concurrent write collisions.
  • Staging Pattern: When outputs from multiple workers must combine into a shared contract, configuration, or unified module, workers output to isolated staging files (staging/chunk_*.md or scoped temporary files), which the Lead Agent or Integration Specialist reconciles during the Reduce phase.

5. Strict Vertical Communication (No Lateral Crosstalk)

  • Allowed: Messaging between immediate parents and children ONLY (Swarm Coordinator <-> Lead Agent, Lead Agent <-> Specialist, or Swarm Coordinator <-> Specialist in flat/hybrid structures).
  • Forbidden: Direct communication between agents on the SAME layer (Lead <-> Lead, Specialist <-> Specialist) or direct escalation (Specialist <-> Swarm Coordinator bypassing an intermediate Lead Agent) is strictly forbidden.
  • Design Document First: Cross-domain coordination MUST be handled by writing or updating shared design documents first, then notifying parent/child agents via send_message.

6. Fine-Grained Targeted Testing (No Broad Root Sweeps)

Specialists MUST execute fine-grained, package-scoped unit tests (e.g., go test ./internal/physics/...) strictly targeting their assigned task. Running broad project-root test commands (e.g., go test ./...) is strictly forbidden for Specialists unless explicitly requested by the Swarm Coordinator during the final Reduce phase, preventing cross-task contamination and false failures while peer agents work concurrently.

7. Mandatory Skill Onboarding & Team Assembly (Zero Ambient Knowledge)

  • Subagents spawn with a blank context window and have zero ambient understanding of the swarm-coding skill, DOP arithmetic, non-execution rules, or how to call define_subagent and invoke_subagent.
  • Merely stating "you are a swarm coding lead" or "you have a budget of X" causes Lead Agents to fail to assemble their teams and write code themselves.
  • Coordinator -> Lead Propagation:
    1. Configure Lead Agents with EnableSubagentTools: true, EnableWriteTools: true, and EnableMCPTools: true.
    2. Mandate Step 1 (Load Skill): Instruct the Lead Agent to immediately read/load the swarm-coding skill (SKILL.md and references/lead.md) before taking any other action.
    3. Supply the exact define_subagent and invoke_subagent tool schemas and budget arithmetic (1 slot for Lead + (DOP - 1) concurrent Specialists) in the Lead's initial briefing prompt.
  • Lead -> Specialist Propagation: The Lead MUST configure Specialists with EnableWriteTools: true and EnableSubagentTools: false, and provide explicit file ownership boundaries, localized test commands, fail-fast rules, and instructions to report terminal proof via send_message before terminating.

🎯 Agent Budget & Degree of Parallelism (DOP)

  • Definition: Agent Budget is synonymous with Degree of Parallelism (DOP). It defines the maximum number of active, concurrent subagents allowed to execute at the exact same time across the entire swarm hierarchy.
  • Budget Arithmetic & Slot Accounting:
    • Domain Budget (DOP) = 1 (Lead Agent) + (DOP - 1) (Concurrent Specialists).
    • The Lead Agent consumes 1 concurrency slot. For example, if a Lead is allocated a budget slice of 8, it occupies 1 slot and can run up to 7 concurrent Specialists simultaneously.
  • Active vs. Past Capacity (Slot Recycling): Completed or terminated subagents do not consume budget. When a Specialist completes its work and terminates, its concurrency slot is immediately freed back to the domain pool.
  • Backlog Drip-Feeding: When domain tasks exceed available specialist slots (DOP - 1), the Lead Agent maintains a domain task backlog and drip-feeds tasks to fresh Specialists as active workers finish.
  • Default Concurrency: Assumes a default budget of 10 active concurrent agents if omitted by the user.
  • Low Budget Guard (<= 1): If the user specifies an agent budget <= 1, multi-agent orchestration is disabled. Automatically fall back to direct single-agent execution without spawning subagents, notifying the user: "Agent budget is set to <= 1; running in direct single-agent execution mode. To enable swarm parallelism, specify an agent budget > 1 (default: 10)."
  • Swarm Shapes (Flat, Nested, Hybrid):
    • Flat (Budget < 10): Swarm Coordinator coordinates Specialists directly (no intermediate Tech Leads).
    • Nested (Budget >= 10, Max Depth = 1): Swarm Coordinator assigns Domain Tech Leads and allocates each a slice of the agent budget (Coordinator -> Domain Tech Leads -> Specialists). Never add deeper sub-lead layers; scale wider or drip-feed from the domain backlog.
    • Hybrid: Combines nested domain teams with flat direct specialists reporting to the Coordinator for standalone or cross-cutting tasks.

🌲 Swarm Sizing Decision Tree

Decision Rules:
  1. Agent Budget < 10 -> Flat Structure:
    • Coordinator coordinates Specialists directly (no intermediate Tech Leads).
    • Partition tasks with strict Single Writer file boundaries and assign one task to each Specialist.
  2. Agent Budget >= 10 -> Nested Structure (Max Depth = 1):
    • Assign one Domain Tech Lead per technical domain and allocate each a slice of the agent budget (each Tech Lead counts as 1 slot).
    • Maximum Nesting Depth is strictly 1 (Coordinator -> Domain Tech Leads -> Specialists). Do not spawn Sub-Leads or Component Leads; even for large budgets (20+), Domain Leads manage their concurrency slice directly and drip-feed tasks from a backlog as Specialists finish.
  3. Hybrid Structure (Mixed Workloads):
    • Combine nested domain teams (Coordinator -> Domain Lead -> Specialists) with direct Specialists (Coordinator -> Specialist) for focused, standalone, or cross-cutting tasks (such as the final Integration/QA Specialist).

📡 Non-Blocking Coordinator & Reactive Concurrency

The Swarm Coordinator is the primary user interface and top-level organizational conductor. It must remain unblocked >= 99% of the time to receive steering comments, scope modifications, and status requests from the user.

  1. Role Separation (Delegation over Execution):
    • The Swarm Coordinator acts like an engineering director: it breaks down epics, writes top-level architectural contracts, and manages the org chart. It never blocks itself with sequential coding, manual building, or terminal test runs.
  2. Fire-and-Yield Concurrency:
    • When the Coordinator spawns Lead Agents via invoke_subagent, it immediately halts tool calls to end its turn. It never loops, sleeps, or polls.
  3. Always Unblocked for User Steering & Status Inquiries:
    • Because the Coordinator never enters busy-wait polling loops, it is permanently available to process incoming user messages while the swarm works in the background:
      • Status Inquiries: The Coordinator can immediately provide live progress updates or inspect active workers via manage_subagents (Action="list").
      • In-Flight Steering / Scope Changes: If the user provides new constraints or changes requirements mid-run, the Coordinator can steer active Lead Agents via send_message or cancel/restart them via manage_subagents (Action="kill").
  4. Sole User Escalation Interface:
    • Subagents do not possess ask_question. All requirement ambiguities or design trade-offs encountered by Specialists are messaged up to their Tech Lead, who routes them to the Swarm Coordinator via send_message. The Coordinator prompts the user with ask_question and relays decisions back down the hierarchy.

🔄 Map-Reduce Workflow & The "Reduce" (Reconciliation) Step

Swarm Coding operates as a two-stage Map-Reduce engineering pipeline:

1. Map Phase (Parallel Development & Collision Avoidance)

  • Single Writer File Ownership: Assign each Specialist an exclusive set of target files. Only one subagent may hold write authority to any single file at a time.
  • Staging Pattern: When multiple workers contribute to a shared module, schema, or document, have them write to isolated staging files (staging/chunk_*.md or scoped temporary files) for the Lead Agent or Integration Specialist to merge during Reduce.
  • Tech Lead Arbitration: Domain Tech Leads dynamically arbitrate file boundaries and dependencies among their specialists as changes evolve.
  • Temporary Interface Contracts: When Specialist A depends on in-progress work from Specialist B, they program against agreed interface stubs or mocks defined in the domain specification.

2. The Final "Reduce" Phase (Integration & Placeholder Purge)

Parallel execution often leaves behind temporary mocks, stubs, or staged chunks where real implementations were created by peer agents. Before declaring success, the Coordinator orchestrates the final Reduce step:

  1. Placeholder & Stub Audit: Scans code boundaries to ensure no dangling TODO comments, dummy return values, or temporary mock adapters survive.
  2. Reconciliation & Real Component Wiring: The Coordinator tasks a designated Integration/QA Specialist to merge staged files and connect all real modules together.
  3. End-to-End Project Verification: The QA Specialist runs full project builds, integration tests, and linters, reporting actual terminal proof back to the Coordinator before final delivery to the user.

👥 Mechanics and Roles

Subagents in a Swarm Coding session assume one of three roles:

  1. Swarm Coordinator (ROOT) [Multiplicity: 1]
    • Acts as top-level architect and organizational manager.
    • Defines the Org Chart, names Lead Agents for each domain, allocates agent budgets, and writes top-level architecture specs.
    • Persistence & Non-Execution: Strictly forbidden from executing code or running build/test commands.
    • Sole User Interface: Sole agent in the swarm authorized to interact with the user via ask_question.
  2. Lead Agent (Domain Tech Lead) [Multiplicity: N]
    • Technical lead for a specific domain or system (e.g., Frontend, Backend, Database).
    • Mandatory Step 1: Immediately loads the swarm-coding skill (SKILL.md and references/lead.md) into context upon startup.
    • Writes domain specs ("Design Document First"), defines the specialist subagent via define_subagent, spawns Specialists via invoke_subagent within its allocated sub-budget, arbitrates file boundaries, and integrates deliverables.
    • Tool Restrictions: Configured with EnableSubagentTools: true, EnableWriteTools: true (strictly for writing docs/*.md specification files only), and EnableMCPTools: true. Strictly forbidden from editing production code or calling run_command. Routes user questions up to the Swarm Coordinator via send_message.
  3. Specialist (Task Implementer / QA) [Multiplicity: N]
    • Ephemeral and task-scoped (disposable worker). Operates with a clean, focused context window dedicated strictly to its assigned task.
    • Configured with EnableWriteTools: true, EnableMCPTools: true, and EnableSubagentTools: false.
    • Follows domain specifications, executes the operational validation loop (build, package-scoped test, lint, format), replaces stubs, and sends proof-of-validation logs to its parent Lead Agent before terminating.

🛠️ Subagent Configuration & Runtime Tool Schemas

When spawning subagents at runtime with define_subagent and invoke_subagent (or via static agent definitions in assets/agents/*.md), follow these exact configurations:

  • Model Configuration (Model: "inherit"): Always pass Model: "inherit" in invoke_subagent (and model: inherit in static definitions) so subagents adopt the parent session's model and reasoning effort without configuration drift.
  • Customization & MCP Inheritance: Set EnableMCPTools: true in define_subagent (and inheritCustomizations: true, inheritMcp: true in static definitions) so subagents retain project rules, domain linters, and MCP servers.
  • Coordinator -> Defining & Invoking Lead Agents: The Coordinator MUST enable subagent tools (EnableSubagentTools: true) so Lead Agents have the define_subagent, invoke_subagent, and manage_subagents tools required to assemble their teams:
    json
    // 1. Coordinator defines the lead-agent type
    {
      "Name": "lead-agent",
      "Description": "Domain Tech Lead that authors domain specs and orchestrates Specialist subagents.",
      "EnableSubagentTools": true,
      "EnableWriteTools": true,
      "EnableMCPTools": true,
      "SystemPrompt": "You are a Domain Tech Lead in a Swarm Coding session. Step 1: Load the swarm-coding skill and references/lead.md immediately. You may use write_file/edit_file ONLY to author markdown specifications in docs/. You are strictly forbidden from writing production code or calling run_command. You must define and invoke Specialist subagents for all code implementation and testing."
    }
  • Lead Agent -> Defining & Invoking Specialists: Each Lead Agent defines the specialist worker type with EnableWriteTools: true and EnableSubagentTools: false, then spawns up to (DOP - 1) concurrent Specialists:
    json
    // 1. Lead Agent defines the specialist type
    {
      "Name": "specialist",
      "Description": "Specialist worker that implements scoped code tasks and runs package-scoped validation.",
      "EnableSubagentTools": false,
      "EnableWriteTools": true,
      "EnableMCPTools": true,
      "SystemPrompt": "You are a Specialist worker in a Swarm Coding session. Implement only your assigned task within your allowed file boundaries. Run package-scoped unit tests only (never broad root sweeps). Never add fallbacks or mocks for live data. Send terminal validation proof to your parent Lead Agent via send_message and terminate immediately."
    }

📋 Swarm Briefing Protocols & Canonical Prompt Templates

Subagents start with a blank conversational context and do not automatically load the swarm-coding skill or know how to call define_subagent and invoke_subagent. Coordinators and Leads must supply complete, self-contained briefings using the templates below.

1. Coordinator -> Lead Agent Briefing Protocol

When the Swarm Coordinator spawns a Lead Agent via invoke_subagent(TypeName: "lead-agent", Model: "inherit", ...), the Prompt MUST follow this structure:

markdown
You are the Lead [Domain] Engineer in a hierarchical Swarm Coding session.

### Step 1: Mandatory Skill Onboarding (Execute First)
Before taking any other action, load the `swarm-coding` skill (and its `references/lead.md` playbook) into your context so you have full awareness of Swarm Coding rules and protocols.

### Role & Execution Boundary (Strict Non-Execution)
- You are the architect, planner, and manager for the [Domain] domain.
- Your `write_file` and `edit_file` tools are enabled **strictly** for drafting or updating markdown specification files in `docs/`.
- You are **strictly forbidden** from writing production source code or calling `run_command`. All code changes, package installations, builds, and test runs MUST be delegated to Specialist subagents that you spawn.

### Agent Budget & Concurrency Mechanics (DOP: [N])
- Your allocated domain budget is [N] concurrent agents.
- You occupy 1 concurrency slot, leaving **[N - 1] active concurrent Specialist slots**.
- Concurrency slots recycle immediately when a Specialist finishes and terminates.
- If your epic has more than [N - 1] tasks, maintain a domain task backlog and drip-feed tasks to fresh Specialists as active workers complete.

### Domain Epic & Specifications
[Detailed domain objective, referencing workspace specification files or top-level architecture specs in docs/]

### How to Assemble & Run Your Specialist Team
1. **Specification First**: Draft or update your domain API/data contracts in `docs/` using `write_file` or `edit_file`.
2. **Task Deconstruction (Single Writer Principle)**: Break the epic into independent tasks with disjoint file boundaries so only one Specialist writes to any file at a time (or use `staging/` files for shared outputs).
3. **Define the Specialist Subagent**: Call `define_subagent` with:
   - `Name`: `"specialist"`
   - `Description`: `"Domain Specialist worker for code implementation and localized testing."`
   - `EnableWriteTools`: `true`
   - `EnableMCPTools`: `true`
   - `EnableSubagentTools`: `false`
   - `SystemPrompt`: `"You are a Specialist worker in a Swarm Coding session. Edit only your assigned target files, run localized package tests only, fail fast without fallbacks, send terminal validation proof via send_message, and terminate immediately."`
4. **Spawn Specialists (`invoke_subagent`) & Yield**: Invoke up to [N - 1] Specialists concurrently with `TypeName: "specialist"` and `Model: "inherit"`, supplying each with its target files, forbidden boundaries, and localized test command. **Immediately stop calling tools after `invoke_subagent`** to yield your turn and wait reactively for Specialist completion messages.
5. **Domain Reconciliation & Escalation**: Verify that Specialists replace all temporary stubs with real implementations, review their terminal validation logs, and report completion to the Swarm Coordinator via `send_message`. Route any requirement ambiguities to the Swarm Coordinator via `send_message` (you do not have `ask_question`).

2. Lead Agent -> Specialist Briefing Protocol

When a Lead Agent spawns a Specialist via invoke_subagent(TypeName: "specialist", Model: "inherit", ...), the Prompt MUST follow this structure:

markdown
You are a [Domain] Specialist worker in a Swarm Coding session reporting to the Lead [Domain] Engineer.

### Assigned Scope & Single Writer File Boundaries
- Task: [Explicit description of the granular task]
- Exclusive Target Files: [Explicit list of allowed files to create/edit — you are the Single Writer for these files]
- Staging Path (if shared): [Optional staging/chunk_*.md path if output must be merged later]
- Forbidden Boundaries: Do NOT touch files outside your assigned list. If you depend on contracts from other modules, use the agreed interfaces in [spec path].

### Execution & Validation Rules
1. Scoped Validation: Run ONLY localized package/file tests (e.g., `npm test path/to/test` or `go test ./pkg/...`). NEVER run full-repository root commands like `npm test` or `go test ./...` which pollute other concurrent workers.
2. Fail Fast & No Fallbacks: Never introduce fallback mechanisms, mock modes for live data, or silent error suppression. Always fail fast with rich diagnostics.
3. Proof & Completion: Once implementation passes tests and linters, send your terminal validation output to your parent (Lead [Domain] Engineer) via `send_message`, then terminate immediately to release your concurrency slot.

💬 Communication Hierarchy & Rules

  1. Vertical Parent-Child Messaging ONLY:
    • Swarm Coordinator <-> Lead Agent
    • Lead Agent <-> Specialist
  2. Forbidden Lateral Communication:
    • Communication between agents on the SAME layer (Lead <-> Lead, Specialist <-> Specialist) is strictly forbidden.
    • Specialists MUST NOT message the Swarm Coordinator directly.
  3. Specification-Driven Coordination ("Design Document First"):
    • When a change in Domain A impacts Domain B, Lead Agent A updates the shared design document in the workspace, then messages the Swarm Coordinator. The Swarm Coordinator reviews and notifies Lead Agent B.

⚠️ Gotchas & Antipatterns

  1. The Unonboarded Lead Trap: Spawning a Lead Agent without instructing it to load the swarm-coding skill as Step 1 and without providing the exact define_subagent / invoke_subagent tool schemas. Without explicit onboarding and tool schemas, Leads fail to assemble their teams.
  2. The Missing EnableSubagentTools Trap: Defining a lead-agent with EnableSubagentTools: false (or omitting it). Without EnableSubagentTools: true, the Lead Agent lacks define_subagent and invoke_subagent and cannot spawn Specialists.
  3. The Lead-As-Coder Trap: Prompting a Lead Agent with individual coding instructions or allowing a Lead Agent to use its write_file/edit_file tools on production code instead of docs/*.md specs, or calling run_command.
  4. The Write Collision Trap: Allowing multiple Specialists to edit the same file concurrently. Enforce the Single Writer Principle or use isolated staging/ files reconciled during Reduce.
  5. The Customization Stripping Trap: Setting EnableMCPTools: false or inheritCustomizations: false on subagents, which strips away project rules (fail-fast, no fallbacks), linters, and installed skills.
  6. The Coordinator-to-Executor Fallback Trap: Once activated, the Swarm Coordinator MUST NOT interpret user follow-up messages as permission to write code or execute tasks directly. Treat all messages as requests to the swarm.
  7. Leftover Placeholder / Staging Trap: Delivering code where temporary stubs, mocks, or unmerged staging/ files survive into the final codebase. Always execute the Reduce phase to purge stubs and wire real implementations.
  8. Under-Utilization Mismatch: Spawning too few agents or failing to utilize Lead Agents when the agent budget (DOP >= 10) and task scope call for domain delegation.
  9. Sibling Messaging Trap: Attempting to send direct messages between peer Lead Agents or peer Specialists. Always route cross-component updates through shared design documents and hierarchical parent-child messages.
  10. The Long-Running Agent Context-Pollution Trap: Retaining Specialists across multiple unrelated tasks accumulates noisy tool logs and token bloat. Spawn fresh, disposable Specialists with clean context windows per task.
  11. The Root Test Contamination Trap: Running broad project-root test commands (e.g., go test ./...) while parallel agents are modifying other packages causes false test failures. Specialists must scope test commands strictly to their assigned package until the final Reduce step.
  12. Passive Polling Loops: Coordinator and Lead agents must never poll subagent statuses in a tight loop; always halt tool calls after invoke_subagent and rely on automatic reactive wakeup.

📚 Progressive Disclosure & References

  • Swarm Coordinator Reference: references/coordinator.md — Root coordinator responsibilities, org chart design, unblocked posture, and the Reduce step.
  • Lead Agent Reference: references/lead.md — Domain tech lead responsibilities, dynamic collision arbitration, and sub-team management.
  • Specialist Reference: references/specialist.md — Task execution, operational validation loop, stub replacement, and proof-of-correctness reporting.
  • Bundled Lead Agent Template: assets/agents/lead-agent.md — Standard subagent definition for domain leads.
  • Bundled Specialist Agent Template: assets/agents/specialist-agent.md — Standard subagent definition for specialist workers.

Tệp đi kèm

Mô hình đọc các tệp này khi cần trong lúc kỹ năng được tải. Các tệp được cung cấp ở dạng có thể đọc và không bao giờ được thực thi.

Câu hỏi thường gặp

Kỹ năng AI Swarm Coding làm được gì?

Orchestrates multi-agent hierarchical swarms using a divide-and-conquer architecture for complex, multi-system, or orthogonal engineering initiatives (e.g., concurrent backend, frontend, database, QA). Manages hierarchical Lead Agents and Specialists, Single Writer file boundaries, and strict parent-child communication. Activate on swarm-coding(N), /swarm-coding <N>, /swarm <N>, or any mention of 'swarm' or multi-agent team coordination across technical domains.

Vì sao nên dùng Swarm Coding trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Swarm Coding là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Swarm Coding trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/danicat/skills/tree/main/workflows/swarm-coding. TypingMind đọc tệp SKILL.md, đóng gói các tệp đi kèm và cài đặt thành một kỹ năng mà bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Swarm Coding?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Bạn có thể dùng Swarm Coding với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Swarm Coding với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Swarm Coding có miễn phí không?

Có. Kỹ năng này được danicat phát hành trên GitHub theo giấy phép Apache-2.0. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp cho mô hình các công cụ mới để gọi — mã được chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và tiêu chí của đầu ra tốt. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇