ā” EXECUTION WORKFLOW FOR CLAUDE
šØ CRITICAL DIRECTIVE: You are an autonomous task executor.
YOUR COMPLETE WORKFLOW:
- Fetch messages (metadata only, max 20)
- Classify by priority (urgent, action, info, low)
- Send acknowledgment replies for urgent/action items
- Mark messages as read
- Report what you're working on
- START WORKING - Actually execute the tasks described in URGENT/ACTION messages
šØ MANDATORY ACTIONS FOR URGENT/ACTION MESSAGES:
- ā
Acknowledge the message with brief reply
- ā
IMMEDIATELY START WORKING on the task described
- ā
Search for files, check issue trackers, investigate code as needed
- ā
Use all necessary tools (Read, Grep, Glob, Beads, GitHub, etc.)
- ā
Complete the work fully before moving to next message
- ā
Report results back via reply when done
AUTONOMOUS EXECUTION WORKFLOW:
- Fetch:
fetch_inbox(include_bodies=false, limit=20) - metadata scan
- Classify: Categorize by subject/sender (urgent > action > info > low)
- Acknowledge: Reply: "Acknowledged - starting work now"
- Execute: DO THE ACTUAL WORK - investigate, code, test, fix
- Complete: Reply with results when done
- Repeat: Process next URGENT/ACTION message
PERFORMANCE GUIDELINES:
- Process urgent/action messages one at a time (sequential execution)
- Use all necessary tools to complete each task fully
- Report progress and results for each task
- Don't skip investigation steps - be thorough
IMPORTANT: This processes inter-agent messages from MCP Agent Mail. Your job is to acknowledge AND EXECUTE the work described in messages autonomously.
šØ AUTONOMOUS EXECUTION WORKFLOW (6 STEPS)
Step 1: š„ Fetch Message Metadata
Action:
fetch_inbox(include_bodies=false, limit=20) - Get subject, sender, date, importance
Output: List of message IDs with metadata for quick scanning
Step 2: š·ļø Classify Messages
Classification Rules (metadata only):
- URGENT:
importance="urgent" OR subject contains "urgent", "blocker", "asap"
- ACTION:
ack_required=true OR subject has "?", "please", "review"
- INFO: Status updates, progress reports
- LOW: Automated notifications
Output: Prioritized list (URGENT/ACTION first)
Step 3: āļø Acknowledge First URGENT/ACTION Message
For first URGENT/ACTION message:
reply_message(body_md="Acknowledged - starting work on this now")
mark_message_read(message_id=...)
Step 4: š Execute the Task
šØ CRITICAL: DO THE ACTUAL WORK
- Search for files mentioned (Glob, Grep)
- Check issue trackers (Beads, GitHub MCP)
- Read code files (Read tool)
- Investigate requirements fully
- Write code, fix bugs, implement features
- Test your changes
- Use ALL tools needed to complete the task
Output: Completed work (code changes, bug fixes, implementations)
Step 5: š Report Results
After completing work:
reply_message(body_md="Completed [task summary]. [Details of what was done]")
- Include file paths, changes made, test results
Step 6: š Repeat or Summary
If more URGENT/ACTION messages remain:
- Go to Step 3 for next message
If all urgent work complete:
- Output final summary of all work completed
š REFERENCE DOCUMENTATION
/processmsgs Command - Intelligent Agent Message Processing
Usage: /processmsgs [options]
Purpose: Automated agent message processing that reads inter-agent communications, analyzes content, and takes intelligent actions
š ļø Prerequisites
- MCP Agent Mail server configured and running
- Agent registered in the project (use
register_agent first)
- Project initialized with
ensure_project
š Command Options
/processmsgs # Process all unread agent messages
/processmsgs urgent # Process only urgent/flagged messages
/processmsgs sender:BlueLake # Process messages from specific agent
šÆ What This Command Does
Core Actions - FULL AUTONOMOUS EXECUTION:
- Reads unread agent messages using MCP Agent Mail tools
- Analyzes content for action items, urgency, importance
- Classifies messages into categories (URGENT, ACTION, INFO, LOW)
- Acknowledges urgent/action messages
- EXECUTES the work described in urgent/action messages autonomously
- Completes tasks fully (investigates, codes, tests, fixes)
- Reports results back to sender when done
- Marks messages as read
Autonomous Execution Pattern:
- ā
Fetch and classify messages
- ā
Acknowledge urgent/action items immediately
- ā
ACTUALLY DO THE WORK - don't just report, execute
- ā
Use all necessary tools to complete tasks
- ā
Report completion with results
- ā
Move to next urgent/action message and repeat
ā” Performance & Execution Strategy
Autonomous Task Processing:
- 20 message limit: Fetches max 20 messages per run for classification
- Metadata-first: Quick classification using metadata (subject/sender/importance)
- Sequential execution: Process URGENT/ACTION messages one at a time
- Full completion: Complete each task before moving to next
- Thorough investigation: Use all tools needed (no shortcuts)
Typical Performance:
- Inbox fetch: ~2 seconds (metadata only)
- Classification: Instant (pure analysis)
- Task execution: Variable (depends on complexity)
- Simple fixes: 1-3 minutes
- Feature implementation: 5-15 minutes
- Complex investigations: 15-30 minutes
- Report & reply: ~5 seconds
Note: This command prioritizes completion quality over speed - tasks are fully executed, not just acknowledged.
š Workflow Integration
Typical Use Cases:
- Project Coordination: Process messages from other agents working on same project
- Task Assignment: Receive and acknowledge task assignments from coordinator
- Status Updates: Process progress reports from collaborating agents
- Question/Answer: Respond to questions from other agents
š Security & Privacy
Safe Automation Model:
- Messages are project-scoped (no cross-project access)
- Full audit trail via Git repository
- No external API calls beyond MCP Agent Mail server
- All actions are reversible
š Success Metrics
Processing Results Include:
- Total messages processed
- Categories breakdown (urgent: 2, action: 5, status: 10, etc.)
- Actions taken (replies: 3, tasks extracted: 5, marked read: 15)
- Urgent items requiring immediate attention
š Continuous Improvement
Learning Mechanism:
- Track which message types require action
- Improve classification accuracy over time
- Adapt to agent communication patterns
- Suggest better collaboration strategies
š”ļø Error Handling
Graceful Failures:
- MCP server unavailable ā Report status, suggest troubleshooting
- Agent not registered ā Provide registration instructions
- Project not initialized ā Suggest running
ensure_project
- Network issues ā Retry with exponential backoff
šØ CRITICAL: Classification-First Accountability
Every message MUST be classified and reported. Actions are required when appropriate:
- URGENT and ACTION_REQUIRED messages demand concrete follow-up (reply, task extraction, etc.)
- STATUS_UPDATE and INFORMATION messages may simply be summarized and marked read if no action is needed
- Always explain what was processed and why each item was handled that way
NEVER output: "I've read 10 messages" without detailing the disposition of each message.
š Related Skills
See .claude/skills/mcp-agent-mail.md for detailed MCP Agent Mail server setup and usage instructions.
š Examples
Autonomous Task Execution
/processmsgs
Output:
š¬ Processed: 13 messages
āā URGENT (1): Message #754 from mv - Fix multi-agent manual test serialization
āā ACTION (0): None
āā INFO (12): Completed work threads, status updates
š Starting work on URGENT task: mcp_agent_mail-uo7
[Agent proceeds to work autonomously:]
1. ā
Acknowledged message #754
2. š Checked Beads issue tracker (mcp_agent_mail-uo7 assigned to me)
3. š Located test file: testing_llm/MULTI_AGENT_MESSAGING_TEST.md
4. š Identified issue: FastMCP Root objects not JSON serializable
5. š§ Applied fix: Convert results with .model_dump() before json.dump()
6. ā
Verified fix works
7. š¬ Replied to mv with completion report
š Summary:
- Messages processed: 13
- Urgent tasks completed: 1
- Files modified: testing_llm/MULTI_AGENT_MESSAGING_TEST.md
- Status: All urgent work complete
What happened:
- Fetched 13 message metadata
- Classified #754 as URGENT (new assignment from mv)
- Sent acknowledgment: "Acknowledged - starting work now"
- ACTUALLY DID THE WORK: Searched files, checked Beads, investigated code, applied fix
- Tested the fix to verify it works
- Replied to mv with completion report including file changes
- Marked #754 as read
When Everything is Info
/processmsgs
Output:
š¬ Processed: 8 messages
āā URGENT (0): None
āā ACTION (0): None
āā INFO (8): All status updates from completed work
ā
No urgent/action items requiring work
š Summary: All messages are informational status updates
Performance: 1 tool call, ~3s
š Integration Points
- Project Coordination: Multi-agent workflows via message passing
- Task Management: Task extraction integrates with project tracking
- Status Reporting: Progress updates to coordinator agents
- Collaboration: Inter-agent question/answer workflows
āļø Configuration
MCP Agent Mail Setup: See .claude/skills/mcp-agent-mail.md for:
- Server configuration
- Agent registration
- Project initialization
- Message sending/receiving patterns
šÆ Success Criteria
Command considered successful when:
- ā
All retrieved messages classified
- ā
Appropriate actions taken for each category (mandatory for URGENT/ACTION_REQUIRED)
- ā
Summary report generated
- ā
Urgent items clearly highlighted
- ā
User can act on provided information immediately