swarm-mail

tOgg1's avatarfrom tOgg1

Coordinate with other agents using Swarm mail and file locking

⭐1stars🔀0forks📁View on GitHub🕐Updated Dec 28, 2025⬇️1downloads

When & Why to Use This Skill

This Claude skill facilitates advanced multi-agent coordination and synchronization within Swarm deployments. It enables agents to communicate through a structured mail system, manage task queues for complex workflows, and utilize advisory file locking to prevent resource conflicts during collaborative software development. By providing a framework for handoffs and concurrency control, it ensures high-integrity outputs in multi-agentic environments.

Use Cases

  • Streamlining agent handoffs: Use Swarm mail to transfer tasks between specialized agents, such as moving from a code generation agent to a security review agent with full context.
  • Concurrency management: Implement advisory file locking to prevent multiple AI agents from editing the same source files simultaneously, avoiding merge conflicts and data loss.
  • Asynchronous workflow orchestration: Utilize the mail and queue system to manage long-running tasks, cooldown periods, and complex sequences that require non-linear execution.
  • Conflict resolution: Check for existing file locks before starting a task to ensure the agent is working on an available path, improving overall system reliability.
nameswarm-mail
descriptionCoordinate with other agents using Swarm mail and file locking
alwaysApplytrue

Swarm Multi-Agent Coordination

You are part of a Swarm deployment with multiple AI agents working on the same codebase. Use these patterns to coordinate effectively.

When to Use Mail vs Queue vs Direct

  • Mail: Handoff tasks to specific agents, request reviews, report completion
  • Queue: Send work to yourself for later (cooldown, complex sequences)
  • Direct: Only for emergency interrupts (use swarm inject)

Writing Actionable Handoff Messages

Good handoff messages require no follow-up questions.

Good Example

Subject: Review PR #123 - User authentication refactor Body:

  • PR is ready for review at https://github.com/...
  • Focus on: error handling in login flow
  • Tests pass locally, CI pending
  • After review, send results to agent-xyz

Bad Example

Subject: Please review Body: The PR is ready.

Advisory File Locking

Before editing files, claim a lock:

swarm lock claim --agent $AGENT_ID --path "src/api/auth.go" --ttl 30m

Check for conflicts before claiming:

swarm lock check --path "src/api/auth.go"

Always release when done:

swarm lock release --agent $AGENT_ID

Subject/Body Conventions

Subjects should be:

  • Specific: "Fix null pointer in UserService.getById()"
  • Searchable: Include file names, function names, issue numbers
  • Actionable: Start with verb (Fix, Review, Implement, Update)

Checking Your Inbox

Poll for new work regularly:

swarm mail inbox --agent $AGENT_ID --unread

Additional template files

See the templates in templates/:

  • templates/handoff.md
  • templates/review-request.md
  • templates/conflict-resolution.md