AgentSkillsCN

eama-role-routing

当您需要将用户请求分派至合适的专项角色(架构师、编排师或集成师)时,此技能将助您快速响应。当您收到角色分派请求时,即可触发该技能。

SKILL.md
--- frontmatter
name: eama-role-routing
description: Use when routing user requests to appropriate specialist roles (Architect, Orchestrator, or Integrator). Trigger with role routing requests.
compatibility: Requires AI Maestro installed.
context: fork
agent: eama-main
triggers:
  - User submits a new request or task
  - Assistant Manager needs to delegate work
  - Handoff between roles is required

Role Routing Skill

Overview

This skill provides the Assistant Manager (EAMA) with decision logic for routing user requests to the appropriate specialist role:

Prerequisites

  • AI Maestro messaging system must be running
  • All specialist agents (EAA, EOA, EIA) must be registered
  • docs_dev/handoffs/ directory must exist and be writable
  • UUID generation capability required

Instructions

  1. Parse user message to identify primary intent
  2. Match intent to routing rule using the decision matrix
  3. If handling directly (status, approval, clarification), respond immediately
  4. If routing to specialist, create handoff document with UUID
  5. Save handoff to docs_dev/handoffs/
  6. Send via AI Maestro to target role
  7. Track handoff status and monitor for acknowledgment
  8. Report routing decision to user
  • EAA - Architect Agent
  • EOA - Orchestrator Agent
  • EIA - Integrator Agent

Output

Routing DecisionAction TakenHandoff FileMessage Sent
Route to ECOSCreate handoff documenthandoff-{uuid}-eama-to-ecos.mdAI Maestro message to Chief of Staff
Route to EAACreate handoff documenthandoff-{uuid}-eama-to-eaa.mdAI Maestro message to Architect
Route to EOACreate handoff documenthandoff-{uuid}-eama-to-eoa.mdAI Maestro message to Orchestrator
Route to EIACreate handoff documenthandoff-{uuid}-eama-to-eia.mdAI Maestro message to Integrator
Handle DirectlyRespond to userNoneNone
Ambiguous IntentRequest clarificationNoneNone

Plugin Prefix Reference

RolePrefixPlugin Name
Assistant Managereama-Emasoft Assistant Manager Agent
Chief of Staffecos-Emasoft Chief of Staff
Architecteaa-Emasoft Architect Agent
Orchestratoreoa-Emasoft Orchestrator Agent
Integratoreia-Emasoft Integrator Agent

Routing Decision Matrix

User Intent PatternRoute ToHandoff Type
"design", "plan", "architect", "spec", "requirements"EAA (Architect)task_assignment
"build", "implement", "create", "develop", "code"EOA (Orchestrator)task_assignment
"review", "test", "merge", "release", "deploy", "quality"EIA (Integrator)task_assignment
"spawn agent", "terminate agent", "restart session", "agent health"ECOS (Chief of Staff)agent_lifecycle
"status", "progress", "update"Handle directlynone
"approve", "reject", "confirm"Handle directlyapproval_response

Detailed Routing Rules

Route to EAA (Architect) when:

  1. New project/feature design needed

    • User says: "Design a...", "Plan how to...", "Create architecture for..."
    • Action: Create handoff with requirements, route to eaa
  2. Requirements analysis required

    • User says: "What do we need for...", "Analyze requirements for..."
    • Action: Create handoff with context, route to eaa
  3. Technical specification needed

    • User says: "Spec out...", "Document how...", "Define the API for..."
    • Action: Create handoff, route to eaa
  4. Module planning required

    • User says: "Break down...", "Modularize...", "Plan implementation of..."
    • Action: Create handoff, route to eaa

Route to EOA (Orchestrator) when:

  1. Implementation ready to start

    • Condition: Approved design/plan exists
    • Action: Create handoff with design docs, route to eoa
  2. Task coordination needed

    • User says: "Build...", "Implement...", "Start development..."
    • Action: Create handoff with requirements, route to eoa
  3. Multi-agent work coordination

    • Condition: Work requires multiple parallel agents
    • Action: Create handoff with task breakdown, route to eoa
  4. Progress monitoring required

    • Condition: Orchestration in progress, need intervention
    • Action: Forward message to eoa

Route to EIA (Integrator) when:

  1. Work ready for integration

    • Condition: Orchestrator signals completion
    • Action: Create handoff with completion report, route to eia
  2. Code review requested

    • User says: "Review...", "Check the PR...", "Evaluate changes..."
    • Action: Create handoff with PR details, route to eia
  3. Quality gates needed

    • User says: "Test...", "Validate...", "Run quality checks..."
    • Action: Create handoff, route to eia
  4. Release preparation

    • User says: "Prepare release...", "Merge...", "Deploy..."
    • Action: Create handoff, route to eia

Route to ECOS (Chief of Staff) when:

  1. Agent lifecycle operations needed

    • User says: "Spawn a new agent", "Create agent for...", "Start new session"
    • Action: Create handoff with agent requirements, route to ecos
  2. Agent termination required

    • User says: "Terminate agent", "Stop session", "Kill agent"
    • Action: Create handoff with agent ID, route to ecos
  3. Session management needed

    • User says: "Restart agent", "Check agent health", "Agent status"
    • Action: Create handoff with session details, route to ecos
  4. Permission management required

    • Condition: Sensitive operation requires elevated permissions
    • Action: Create handoff with permission request, route to ecos
  5. Failure recovery needed

    • Condition: Agent failure detected, escalation required
    • Action: Create handoff with failure details, route to ecos
  6. Approval requests from ECOS

    • Condition: ECOS requests user approval for agent operations
    • Action: Present approval request to user, forward decision to ecos

Handle Directly (no routing):

  1. Status requests

    • User says: "What's the status?", "How's progress?"
    • Action: Query relevant role, compile report, present to user
  2. Approval decisions

    • User says: "Yes, approve", "No, reject", "Proceed with..."
    • Action: Record decision, forward to requesting role
  3. Clarification requests

    • User says: "Explain...", "What does X mean?"
    • Action: Answer directly or query relevant role
  4. Configuration/settings

    • User says: "Set...", "Configure...", "Enable..."
    • Action: Handle directly

Communication Hierarchy

code
USER <-> EAMA (Assistant Manager) <-> ECOS (Chief of Staff) <-> EAA (Architect)
                                                            <-> EOA (Orchestrator)
                                                            <-> EIA (Integrator)

CRITICAL:

  • EAMA is the ONLY role that communicates directly with the USER
  • ECOS manages agent lifecycle and sits between EAMA and specialist agents
  • EAA, EOA, and EIA do NOT communicate directly with each other or with EAMA
  • All specialist agent operations flow through ECOS

Handoff Protocol

Step 1: Identify Intent

code
Parse user message -> Identify primary intent -> Match to routing rule

Step 2: Validate Handoff (CRITICAL)

Before creating and sending any handoff, complete this validation checklist:

Handoff Validation Checklist

Before sending handoff to ECOS or specialists:

  • All required fields present - Verify handoff contains: from, to, type, UUID, task description
  • UUID is unique - Check against existing handoffs in docs_dev/handoffs/ to prevent collisions
    bash
    # Verify UUID uniqueness
    ! grep -r "UUID: <new-uuid>" docs_dev/handoffs/ && echo "UUID is unique"
    
  • Target agent exists and is alive - Send health ping before handoff
    bash
    curl -s "$AIMAESTRO_API/api/messages?agent=<target-agent>&action=health"
    
  • File is valid markdown - No syntax errors, proper structure
  • File is readable by target agent - Verify file permissions and path accessibility
  • No [TBD] placeholders - All placeholder text must be replaced with actual values
    bash
    # Check for placeholder text
    ! grep -E "\[TBD\]|\[TODO\]|\[PLACEHOLDER\]|<fill-in>" handoff-file.md && echo "No placeholders found"
    
  • Task description is actionable - Contains clear success criteria
  • Dependencies documented - Any blocked-by or blocks relationships noted

Validation Failure Handling

If any validation check fails:

FailureResolution
Missing required fieldAdd missing field before proceeding
UUID collisionGenerate new UUID
Target agent unavailableQueue handoff, notify user, retry in 5 minutes
Invalid markdownFix syntax errors
Contains placeholdersReplace all [TBD] with actual values
Unclear taskRequest clarification from user

NEVER send an invalid handoff. An invalid handoff wastes agent resources and delays work.

Step 3: Create Handoff Document

code
Generate UUID -> Create handoff-{uuid}-eama-to-{role}.md -> Save to docs_dev/handoffs/

Step 4: Send via AI Maestro

code
Compose message -> Set appropriate priority -> Send to role session

Step 5: Track Handoff

code
Log handoff in state -> Set status to "pending" -> Monitor for acknowledgment

Step 6: Report to User

code
Confirm routing -> Provide tracking info -> Set expectation for response

File Naming Convention

code
handoff-{uuid}-{from}-to-{to}.md

Examples:
- handoff-a1b2c3d4-eama-to-eaa.md    # AM assigns to Architect
- handoff-e5f6g7h8-eaa-to-eama.md    # Architect reports to AM
- handoff-i9j0k1l2-eama-to-eoa.md    # AM assigns to Orchestrator
- handoff-m3n4o5p6-eoa-to-eama.md    # Orchestrator reports to AM
- handoff-q7r8s9t0-eama-to-eia.md    # AM assigns to Integrator

Storage Location

All handoff files are stored in: docs_dev/handoffs/

GitHub Operations Routing

Route to EIA (Integrator) for:

OperationUser Intent PatternHandoff Content
Issue creation"create issue", "open bug", "file ticket"Issue title, body, labels
Issue update"update issue", "change status", "add label"Issue number, changes
PR operations"create PR", "merge PR", "review PR"PR details, branch info
Kanban sync"sync kanban", "update board", "move card"Project ID, item updates
Release management"release", "tag version", "publish"Version, changelog

Route to EAA (Architect) for:

OperationUser Intent PatternHandoff Content
Issue-to-design linking"link issue to design", "connect to spec"Issue number, design UUID
Design from issue"design for issue #X", "spec from requirement"Issue number, scope

Route to EOA (Orchestrator) for:

OperationUser Intent PatternHandoff Content
Module issues"module implementation issue", "task tracking"Module UUID, task breakdown
Implementation issues"development issue", "coding task"Design UUID, module list

Cross-reference: See the eama-github-routing SKILL for complete GitHub decision trees.

Design Document Routing

Handle Locally (EAMA):

OperationToolDetails
Search designs by UUIDeama_design_search.py --uuidReturns matching design docs
Search designs by keywordeama_design_search.py --keywordFull-text search in design/*
Search designs by statuseama_design_search.py --statusFilter by draft/approved/deprecated
List all designseama_design_search.py --listCatalog of all design documents

Route to EAA (Architect) for:

OperationUser Intent PatternHandoff Content
Create new design"design", "create spec", "architect solution"Requirements, constraints
Update design"modify design", "update spec", "revise architecture"Design UUID, changes
Review design"review design", "validate architecture"Design UUID, review criteria

Search Before Route Decision Tree

code
User mentions design/spec/architecture
          │
          ▼
    ┌─────────────────┐
    │ Does user give  │
    │ UUID or path?   │
    └────────┬────────┘
             │
     ┌───────┴───────┐
     │ YES           │ NO
     ▼               ▼
┌────────────┐  ┌─────────────────┐
│ Search by  │  │ Search by       │
│ UUID/path  │  │ keyword/context │
└─────┬──────┘  └────────┬────────┘
      │                  │
      ▼                  ▼
┌───────────────────────────────────┐
│   Design found?                   │
└────────────────┬──────────────────┘
         ┌───────┴───────┐
         │ YES           │ NO
         ▼               ▼
┌────────────────┐  ┌─────────────────┐
│ Include design │  │ Route to EAA to │
│ context in     │  │ create new      │
│ routing        │  │ design          │
└────────────────┘  └─────────────────┘

Module Orchestration Routing

Route to EOA (Orchestrator) for:

OperationUser Intent PatternHandoff Content
Start module implementation"implement module", "build component"Module UUID from design
Coordinate parallel work"parallelize", "split tasks"Task breakdown, dependencies
Resume orchestration"continue building", "resume work"Orchestration state, progress
Replan modules"reorganize tasks", "reprioritize"Current state, new priorities

Orchestration Handoff Checklist

When routing to EOA, handoff MUST include:

  1. Design Reference: UUID of approved design
  2. Module List: Modules to implement (from design)
  3. Priority Order: Which modules first
  4. Dependencies: Inter-module dependencies
  5. Constraints: Time, resources, technical limits
  6. Success Criteria: What defines "done"

Checklist

Copy this checklist and track your progress:

  • Parse user message to identify primary intent
  • Match intent to routing rule using decision matrix
  • Determine if handling directly or routing to specialist
  • If routing: Generate UUID for handoff
  • If routing: Create handoff document with all required fields
  • If routing: Save handoff to docs_dev/handoffs/
  • If routing: Send AI Maestro message to target role
  • If routing: Track handoff status (set to "pending")
  • Report routing decision to user
  • Monitor for acknowledgment from target role
  • Update handoff status when acknowledged

Examples

Example 1: Routing a Design Request to EAA

code
# User says: "Design a user authentication system"

# EAMA identifies intent: "design" -> Route to EAA

# Creates handoff
## Handoff: handoff-a1b2c3d4-eama-to-eaa.md

**From**: EAMA (Assistant Manager)
**To**: EAA (Architect)
**Type**: task_assignment

### Request
Design a user authentication system

### Requirements
- Support OAuth2 and password-based auth
- Include role-based access control
- Must integrate with existing user database

### Expected Deliverable
- Design document in design/auth-system/DESIGN.md
- Module breakdown with dependencies

Example 2: Handling Status Request Directly

code
# User says: "What's the status of the project?"

# EAMA identifies intent: "status" -> Handle directly

# EAMA queries all roles, compiles report, presents to user
# No handoff created - direct response

Error Handling

ErrorCauseResolution
Ambiguous intentMultiple possible routesAsk user for clarification
Target agent unavailableSession not runningQueue handoff, notify user, retry
Handoff directory missingNot initializedCreate docs_dev/handoffs/ automatically
UUID collisionExtremely rareGenerate new UUID and retry

Resources

  • Handoff Template in the shared folder
  • Message Templates in the shared folder
  • GitHub Routing SKILL (eama-github-routing)
  • Proactive Handoff Protocol in eama-shared skill references