Skip to main content

agent-mail

Multi-agent coordination with Agent Mail MCP. Use when registering agents, reserving files, sending messages, coordinating with other agents, or when the user mentions "agent mail", "coordination", "file reservation", or "multi-agent".

소스 정보

저장소
Mburdo/knowledge_and_vibes
최근 소스 활동
2025년 12월 28일 19:46
감지된 SKILL.md 언어
영어
스타
44
포크
5

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
name
agent-mail
description
Multi-agent coordination with Agent Mail MCP. Use when registering agents, reserving files, sending messages, coordinating with other agents, or when the user mentions "agent mail", "coordination", "file reservation", or "multi-agent".
# Agent Mail (MCP Server) Multi-agent coordination: registration, file reservations, messaging, and build slots. ## When This Applies | Signal | Action | |--------|--------| | Starting a session | `ensure_project` + `register_agent` | | Before editing files | `file_reservation_paths` | | Communicating with agents | `send_message` / `fetch_inbox` | | Finishing work | `release_file_reservations` | --- ## Registration (Required First) ```python # 1. Ensure project exists ensure_project(human_key="/abs/path/to/project") # 2. Register yourself (auto-generates name like "GreenCastle") register_agent( project_key="/abs/path/to/project", program="claude-code", model="opus-4.5", task_description="Working on feature X" ) # SAVE the returned agent name! # 3. Set contact policy set_contact_policy( project_key="/abs/path/to/project", agent_name="YOUR_AGENT_NAME", policy="open" ) ``` --- ## File Reservations **Reserve before editing:** ```python file_reservation_paths( project_key="/abs/path", agent_name="YourName", paths=["src/module/**", "tests/test_module.py"], ttl_seconds=3600, exclusive=True, reason="bd-123: implementing feature" ) ``` **Extend if needed:** ```python renew_file_reservations( project_key="/abs/path", agent_name="YourName", extend_seconds=1800 ) ``` **Release when done:** ```python release_file_reservations( project_key="/abs/path", agent_name="YourName" ) ``` --- ## Messaging **Send message:** ```python send_message( project_key="/abs/path", sender_name="YourName", to=["OtherAgent"], subject="[CLAIMED] bd-123 - Feature Title", body_md="Starting work on **bd-123**.\n\nFile reservations: `src/module/**`", thread_id="bd-123", importance="normal" # low, normal, high, urgent ) ``` **Reply:** ```python reply_message( project_key="/abs/path", message_id=123, sender_name="YourName", body_md="Acknowledged. Proceeding." ) ``` **Check inbox:** ```python fetch_inbox( project_key="/abs/path", agent_name="YourName", include_bodies=True, limit=10 ) # Urgent only fetch_inbox(project_key, agent_name, urgent_only=True) ``` **Acknowledge:** ```python acknowledge_message(project_key, agent_name, message_id) ``` --- ## Discovery **Find other agents:** ```python ReadMcpResourceTool( server="mcp-agent-mail", uri="resource://agents/PROJECT_PATH" ) ``` **Search messages:** ```python search_messages(project_key, query="authentication", limit=20) ``` **Thread summary:** ```python summarize_thread(project_key, thread_id="bd-123") ``` **Who is this agent?** ```python whois(project_key, agent_name="BlueLake") ``` --- ## Build Coordination ```python # Acquire build slot (prevents concurrent builds) acquire_build_slot(project_key, agent_name, slot="main", exclusive=True) # Release when done release_build_slot(project_key, agent_name, slot="main") ``` --- ## Quick Start Macro (RECOMMENDED) One call to start a session - **use this instead of manual steps**: ```python macro_start_session( human_key="/abs/path", program="claude-code", model="opus-4.5", file_reservation_paths=["src/**"], inbox_limit=10 ) ``` This automatically: 1. Ensures project exists 2. Registers agent (auto-generates name) 3. Reserves specified files 4. Fetches recent inbox messages **Return value includes:** - `agent_name`: Your assigned name (e.g., "BlueLake") - `project`: Project details - `file_reservations`: Granted reservations - `inbox`: Recent messages --- ## Error Handling ### Common Errors | Error | Fix | |-------|-----| | "from_agent not registered" | Call `register_agent` first | | `FILE_RESERVATION_CONFLICT` | Wait for expiry or coordinate with holder | | "project not found" | Call `ensure_project` first | ### Graceful Error Handling Pattern When a tool call fails, include `is_error: true` in the result so Claude understands the failure: ```python # Example: Handling file reservation conflict result = file_reservation_paths( project_key="/abs/path", agent_name="YourName", paths=["src/auth/**"], exclusive=True ) if result.get("conflicts"): # Return error so Claude can adapt tool_result = { "type": "tool_result", "tool_use_id": tool_use_id, "is_error": True, # CRITICAL: Tells Claude this failed "content": f"FILE_RESERVATION_CONFLICT: {result['conflicts'][0]['holders']}" } # Claude will now try a different approach or coordinate ``` ### Error Response Examples ```python # Conflict error { "is_error": True, "content": "FILE_RESERVATION_CONFLICT: src/auth/** held by BlueLake (expires in 45min)" } # Registration error { "is_error": True, "content": "AGENT_NOT_REGISTERED: Call register_agent() before sending messages" } # Project error { "is_error": True, "content": "PROJECT_NOT_FOUND: Call ensure_project() with absolute path first" } ``` ### Recovery Strategies | Error Type | Recovery | |------------|----------| | `FILE_RESERVATION_CONFLICT` | Wait, coordinate via message, or pick different task | | `AGENT_NOT_REGISTERED` | Call `register_agent()` then retry | | `PROJECT_NOT_FOUND` | Call `ensure_project()` then retry | | `MESSAGE_SEND_FAILED` | Retry with exponential backoff | --- ## Web UI http://127.0.0.1:8765/mail --- ## Quick Reference ```python # Startup ensure_project(human_key=PATH) register_agent(project_key=PATH, program="claude-code", model="opus-4.5") # Files file_reservation_paths(project_key, agent_name, paths, exclusive=True) release_file_reservations(project_key, agent_name) # Messaging send_message(project_key, sender_name, to, subject, body_md, thread_id) fetch_inbox(project_key, agent_name, include_bodies=True) reply_message(project_key, message_id, sender_name, body_md) ``` --- ## See Also - `prime/` — Full startup protocol - `advance/` — Bead lifecycle with announcements
GitHub에서 보기