The AI Agent Discovery Protocol solves a critical problem: How do AI agents automatically discover and use Task Orchestrator when it's installed in a project?
Without this protocol, agents might:
- Not realize Task Orchestrator is available
- Use less effective coordination methods
- Miss the opportunity for seamless multi-agent orchestration
Task Orchestrator implements automatic discovery through the ORCHESTRATOR.md Protocol - a standardized file that AI agents are trained to look for and understand.
- Automatic Generation: When you run
./tm init, Task Orchestrator createsORCHESTRATOR.mdin your project root - Static Discovery Contract: The file is a stable protocol guide, not a live task board
- AI-Optimized Format: Written specifically for AI agents to understand and use
- Universal Discovery: Works with Claude Code, GitHub Copilot, Cursor, and any AI tool
# 🤖 AI Agent Orchestration Protocol
## 📋 Runtime Task Status
[Retrieved live via `./tm list` from Task Orchestrator data]
## 🚀 Quick Start for AI Agents
[Essential commands and patterns]
## 🤝 Multi-Agent Patterns
[Common coordination patterns with examples]
## 🎯 Quick Reference
[Command reference table]The discovery protocol is implemented in src/orchestrator_discovery.py:
class OrchestratorDiscovery:
def create_orchestrator_md(self) -> bool
# Creates ORCHESTRATOR.md from template
def update_orchestrator_md(self) -> bool
# Compatibility hook: ensure file exists if missing
def add_readme_section(self) -> bool
# Optionally adds discovery hint to README.mdTask status is not persisted in ORCHESTRATOR.md.
Live state is always queried from Task Orchestrator data via:
./tm list./tm list --format json./tm list --assignee <agent>
The protocol uses a template at templates/ORCHESTRATOR.md.template that includes:
- Quick reference commands
- Multi-agent coordination patterns
- Best practices for AI agents
- Runtime status retrieval commands
AI agents can check for ORCHESTRATOR.md existence:
[ -f ORCHESTRATOR.md ] && echo "Task Orchestrator available!"The file points agents to current-state commands:
./tm list./tm list --format json./tm show TASK_ID
Each pattern includes working code:
# Sequential pipeline pattern
DESIGN=$(./tm add "Design system" --assignee architect | grep -o '[a-f0-9]\{8\}')
BACKEND=$(./tm add "Build API" --assignee backend --depends-on $DESIGN)Tailored guidance for different agent types:
- Orchestrating agents learn to use
./tm watch - Specialist agents understand task assignment
- All agents know how to share context
-
Check for ORCHESTRATOR.md
if os.path.exists("ORCHESTRATOR.md"): # Task Orchestrator is available use_task_orchestrator()
-
Read Discovery Contract
with open("ORCHESTRATOR.md") as f: content = f.read() # Parse orchestration protocol and command patterns
-
Follow Patterns
- Use documented patterns for task creation
- Apply dependency management
- Share context appropriately
Without ORCHESTRATOR.md:
Agent: "I'll work on the backend API now."
[No coordination, potential conflicts]
With ORCHESTRATOR.md:
Agent: "I see Task Orchestrator is available. Creating tracked task..."
$ ./tm add "Implement user API" --assignee backend_agent
Task created with ID: a1b2c3d4
Agent: "Task a1b2c3d4 created. Starting work and will update progress."
The discovery protocol is enabled by default. Control it via:
# In tm wrapper script
ENABLE_DISCOVERY = os.environ.get("TM_ENABLE_DISCOVERY", "1") == "1"You can customize the ORCHESTRATOR.md template:
- Edit
templates/ORCHESTRATOR.md.template - Add project-specific patterns
- Include custom agent instructions
Agents should retrieve runtime state directly whenever needed:
./tm list
./tm list --format jsonClaude Code automatically detects ORCHESTRATOR.md and adjusts its workflow to use Task Orchestrator for coordination.
Copilot can be prompted to check for ORCHESTRATOR.md:
"Check if this project uses Task Orchestrator and use it if available"
Cursor's AI agents will discover and read ORCHESTRATOR.md when analyzing project structure.
Any AI agent can implement discovery:
def discover_orchestration():
if Path("ORCHESTRATOR.md").exists():
return "task_orchestrator"
# Check for other orchestration tools
return NoneRegenerate from template when needed:
./tm init # Regenerates ORCHESTRATOR.mdEnhance the template with project-specific information:
- Team conventions
- Specialized workflows
- Custom agent types
Check if agents are using Task Orchestrator:
# See assigned tasks
./tm list --assignee backend_agentWhen starting a session, remind agents:
"This project uses Task Orchestrator. Check ORCHESTRATOR.md for coordination."
-
Check permissions:
ls -la . | grep -E "^d.*w" # Directory must be writable
-
Manually generate:
./tm init # Force regeneration -
Check for errors:
TM_VERBOSE=1 ./tm init # Enable verbose output
-
Query runtime state directly:
./tm list
-
Use machine-readable output when parsing:
./tm list --format json
-
Regenerate discovery file if missing/corrupt:
./tm init
- Ensure ORCHESTRATOR.md is in project root
- Check file permissions (must be readable)
- Verify agent has access to project directory
- Test with explicit prompt:
"Check for ORCHESTRATOR.md and use Task Orchestrator if available"
- Agent Registration: Agents can register themselves
- Custom Templates: Per-agent-type instructions
- Webhook Support: Notify external systems
- API Endpoint: REST API for discovery
- Multi-Project: Cross-project coordination
We welcome improvements to the discovery protocol:
- Additional agent patterns
- Integration guides for specific tools
- Template enhancements
- Discovery mechanism improvements
The ORCHESTRATOR.md Protocol transforms Task Orchestrator from a tool you have to remember to use into one that AI agents discover and use automatically. This creates a self-organizing ecosystem where:
- Discovery is automatic - No manual configuration needed
- Context retrieval is deterministic - Live status always comes from task data
- Patterns guide usage - Ready-to-use examples ensure correct implementation
- Coordination is seamless - Agents naturally work together
By making Task Orchestrator discoverable, we ensure that AI agents always use the best available coordination mechanism, leading to more efficient development and fewer coordination failures.
The AI Agent Discovery Protocol is implemented in Task Orchestrator v2.9.0+