Prime Agent Delegation Protocol

Detailed protocol for Prime Agent task delegation including decision trees, delegation matrix, and best practices for orchestrating multi-agent workflows.

Overview

This protocol provides Prime Agent with systematic guidance for delegating work to specialized agents. Effective delegation is key to efficient project delivery and team productivity.

Core Delegation Principles

1. Know Your Agents’ Specialties

Feature Developer: Implementation, coding, system architecture

  • Implements features from specifications
  • Writes and tests code
  • Handles technical implementation challenges

Code Reviewer: Quality assurance, standards compliance, security

  • Reviews code for quality
  • Validates adherence to standards
  • Identifies potential issues

QA Engineer: Testing, investigation, debugging, validation

  • Investigates bugs and issues
  • Creates test plans
  • Validates fixes and deployments

Technical Writer: Documentation, knowledge management

  • Creates and updates documentation
  • Writes release notes
  • Maintains knowledge base

Workflow Enforcer: Process, deployment, infrastructure

  • Manages deployment processes
  • Validates workflow compliance
  • Handles production deployments

2. Delegate, Don’t Do

Common mistakes Prime Agent makes:

WRONG: Prime Agent investigates the bug RIGHT: Prime Agent delegates to QA Engineer

WRONG: Prime Agent writes the fix RIGHT: Prime Agent delegates to Feature Developer

WRONG: Prime Agent creates tests RIGHT: Prime Agent delegates to QA Engineer

WRONG: Prime Agent deploys to production RIGHT: Prime Agent delegates to Workflow Enforcer

3. Clear, Specific Delegation

Every delegation should include:

  1. What: Clear description of the task
  2. Why: Context and business rationale
  3. Scope: Boundaries of what to do/not do
  4. When: Timeline and deadlines
  5. Reference: Issue links, related work, context
  6. Definition of Done: What success looks like

Delegation Decision Matrix

For Investigation/Debug Work

Issue Type          Delegate To        Reasoning
────────────────────────────────────────────────────
Bug report          QA Engineer        Investigation expertise
Error in logs       QA Engineer        Debugging skills
Regression          QA Engineer        Testing and comparison
User complaint      QA Engineer        Impact assessment
Performance issue   QA Engineer        Analysis and profiling
Inconsistent result QA Engineer        Root cause investigation

For Implementation Work

Task Type           Delegate To            Reasoning
──────────────────────────────────────────────────────
New feature         Feature Developer      Coding expertise
Bug fix             Feature Developer      Implementation skills
Code refactoring    Feature Developer      Architecture knowledge
Integration work    Feature Developer      System knowledge
Configuration      Feature Developer      Technical setup
Performance opt.    Feature Developer      Optimization skills

For Testing/Validation Work

Task Type              Delegate To      Reasoning
───────────────────────────────────────────────────
Test creation          QA Engineer      Test design expertise
Test execution         QA Engineer      Testing methodology
Regression testing     QA Engineer      Comparison skills
Deployment validation  QA Engineer      Environment testing
Fix verification       QA Engineer      Testing expertise
Acceptance testing     QA Engineer      Requirements validation

For Code Quality Work

Task Type              Delegate To        Reasoning
───────────────────────────────────────────────────
Code review            Code Reviewer      Quality expertise
Standard compliance    Code Reviewer      Standards knowledge
Security review        Code Reviewer      Security expertise
Architecture review    Code Reviewer      Design knowledge
Test coverage check    Code Reviewer      Testing knowledge
Documentation review   Code Reviewer      Clarity expertise

For Documentation Work

Task Type              Delegate To           Reasoning
────────────────────────────────────────────────────
Release notes          Technical Writer      Documentation skills
User documentation    Technical Writer      Writing expertise
API documentation     Technical Writer      Technical clarity
Tutorial creation     Technical Writer      Teaching approach
README updates        Technical Writer      Knowledge management
Knowledge base        Technical Writer      Organization skills

For Deployment Work

Task Type              Delegate To           Reasoning
────────────────────────────────────────────────────
Pre-deployment check   Workflow Enforcer     Process validation
Deployment execution   Workflow Enforcer     DevOps expertise
Rollback preparation   Workflow Enforcer     Infrastructure knowledge
Production deployment  Workflow Enforcer     Deployment expertise
Infrastructure config  Workflow Enforcer     System administration
Process verification   Workflow Enforcer     Compliance check

Delegation Templates

Bug Investigation Delegation

To: QA Engineer
Subject: Investigate [Issue #XXX]: [Bug Description]

Please investigate the following issue:

ISSUE: [Clear description of reported problem]
AFFECTED AREA: [What part of the system is affected]
IMPACT: [How many users affected, severity]
REPRODUCTION: [Steps to reproduce if known]
ENVIRONMENT: [Where it occurs: dev/test/prod]

INVESTIGATION SCOPE:
- Determine root cause
- Identify if regression or new issue
- Assess impact severity
- Document findings

REFERENCE ARTIFACTS:
- Issue: #XXX
- Related commits: [commit hashes]
- Test environment: [URL or location]

TIMELINE: [Expected completion date]

DEFINITION OF DONE:
- Root cause clearly identified and documented
- Impact assessment completed
- Report with recommendations provided
- Ready for Feature Developer to fix

Thank you!

Feature Implementation Delegation

To: Feature Developer
Subject: Implement [Issue #XXX]: [Feature Name]

Please implement the following feature:

FEATURE: [Clear feature description]
BUSINESS VALUE: [Why this feature matters]
USER STORY: [As a [user], I want to [action], so that [benefit]]

REQUIREMENTS:
- [Requirement 1]
- [Requirement 2]
- [Requirement 3]

ACCEPTANCE CRITERIA:
- [Criteria 1 - testable and clear]
- [Criteria 2 - testable and clear]
- [Criteria 3 - testable and clear]

TECHNICAL CONTEXT:
- Related systems: [What systems this touches]
- Architecture considerations: [Design notes]
- Technology stack: [Relevant tools/frameworks]
- Constraints: [Any limitations]

REFERENCE ARTIFACTS:
- Issue: #XXX
- Design doc: [URL if exists]
- Related issues: [#XXX, #YYY]
- Prototype: [URL if exists]

TESTING REQUIREMENTS:
- Local testing required: [Specific scenarios]
- Docker testing server: [URL]
- Test approval by: [Who needs to verify]

TIMELINE: [Expected completion date]
EFFORT ESTIMATE: [Small/Medium/Large]

DEFINITION OF DONE:
- Code implemented per requirements
- Local testing completed and verified
- Docker testing server deployment passes
- PR created and ready for review
- All acceptance criteria met

Thank you!

Code Review Delegation

To: Code Reviewer
Subject: Review PR [#XXX]: [Feature/Fix Name]

Please review the following pull request:

PR: #XXX - [PR Title]
FEATURE/FIX: [What was implemented]
BRANCH: [feature/XXX-description]

REVIEW FOCUS:
- Code quality and standards compliance
- Test coverage adequacy
- Security implications
- Performance considerations
- Documentation completeness
- Architectural alignment

CONTEXT:
- Issue being addressed: #XXX
- Feature requirements: [Link to issue]
- Design decisions: [Any notes on approach]
- Known limitations: [Any trade-offs made]

ACCEPTANCE CRITERIA FOR REVIEW:
- Code follows project standards
- Test coverage is adequate (>80%)
- Security concerns addressed
- No critical issues identified
- Documentation is accurate and complete

TIMELINE: [Expected review completion]

APPROVAL REQUIRED FOR:
- Feature completeness
- Code quality (minimum 8/10)
- Test adequacy (minimum 80% coverage)
- Documentation accuracy

Thank you!

Testing/QA Delegation

To: QA Engineer
Subject: Test and Validate [Issue #XXX]: [Feature Name]

Please test and validate the following implementation:

FEATURE/FIX: [What's being tested]
PR: #XXX
TESTING SERVER: [URL or location]
BRANCH: [Branch to test]

TEST SCENARIOS:
- [Scenario 1: Expected behavior]
- [Scenario 2: Expected behavior]
- [Scenario 3: Edge case]
- [Scenario 4: Error handling]

ACCEPTANCE CRITERIA:
- [Criterion 1 - verifiable]
- [Criterion 2 - verifiable]
- [Criterion 3 - verifiable]

REGRESSION TESTING:
- Check [Feature 1] still works
- Check [Feature 2] still works
- Check [Feature 3] still works

ENVIRONMENTS TO TEST:
- Local development
- Docker testing server
- Browser compatibility: [Chrome, Firefox, Safari]
- Device compatibility: [Mobile, tablet, desktop]

SIGN-OFF BY: [Who needs to approve]

TIMELINE: [Expected completion]

DEFINITION OF DONE:
- All test scenarios passed
- No regressions detected
- All environments verified
- Feature-ready or blockers documented
- Ready for deployment or escalation

Thank you!

Documentation Delegation

To: Technical Writer
Subject: Document [Issue #XXX]: [Feature Name]

Please create documentation for the following:

FEATURE/CHANGE: [What's being documented]
RELATED PR: #XXX
ISSUE: #XXX
VERSION: [Version number this is released in]

DOCUMENTATION NEEDED:
- Release notes update
- Website overview update
- Feature user guide
- Administrator guide
- Architecture documentation
- API documentation

AUDIENCE:
- End users: [What they need to know]
- Developers: [Technical details needed]
- Administrators: [Configuration/deployment info]

STYLE GUIDE:
- Keep it clear and concise
- Use active voice, present tense
- Include examples where helpful
- Link to related resources

ARTIFACTS TO INCLUDE:
- Code examples: [Files or snippets]
- Configuration examples: [Sample configs]
- Screenshots: [UI elements to document]
- Architecture diagrams: [Needed diagrams]

REVIEW BY: [Who needs to verify accuracy]

TIMELINE: [Expected completion]

DEFINITION OF DONE:
- All sections complete and accurate
- Examples working and tested
- Hugo site builds successfully
- Links validated
- Ready for publication

Thank you!

Decision Tree for Delegation

Task/Issue Identified
│
├─ Is it a problem that needs investigation?
│  │
│  ├─ YES → Delegate to QA Engineer
│  │         "Investigate [issue description]"
│  │         Wait for findings report
│  │
│  └─ NO → Continue to next question
│
├─ Does it require code implementation?
│  │
│  ├─ YES → Delegate to Feature Developer
│  │         "Implement [feature specification]"
│  │         Wait for PR and testing
│  │
│  └─ NO → Continue to next question
│
├─ Does it require code quality verification?
│  │
│  ├─ YES → Delegate to Code Reviewer
│  │         "Review PR [PR number]"
│  │         Wait for approval/feedback
│  │
│  └─ NO → Continue to next question
│
├─ Does it require testing and validation?
│  │
│  ├─ YES → Delegate to QA Engineer
│  │         "Test and validate [feature]"
│  │         Wait for test report
│  │
│  └─ NO → Continue to next question
│
├─ Does it require documentation?
│  │
│  ├─ YES → Delegate to Technical Writer
│  │         "Document [feature/change]"
│  │         Wait for documentation completion
│  │
│  └─ NO → Continue to next question
│
└─ Does it require deployment?
   │
   ├─ YES → Delegate to Workflow Enforcer
   │         "Deploy [feature] to [environment]"
   │         Wait for deployment confirmation
   │
   └─ NO → Task may be complete or needs escalation

Anti-Patterns to Avoid

1. Asking the Wrong Agent

WRONG: Asking QA Engineer to implement a feature RIGHT: Ask QA Engineer to test the feature after Feature Developer implements it

WRONG: Asking Feature Developer to create the release notes RIGHT: Ask Technical Writer to create release notes after Feature Developer completes PR

WRONG: Asking Code Reviewer to investigate a bug RIGHT: Ask QA Engineer to investigate, then Feature Developer to fix

2. Unclear Delegation

WRONG: “Can you fix this issue?” RIGHT: “Please investigate issue #XXX. Root cause analysis needed by EOD. Document findings in issue comments.”

WRONG: “Implement the new feature” RIGHT: “Implement the new feature per acceptance criteria in issue #XXX. Testing server deployment needed for stakeholder approval. Expected completion: Friday EOD.”

3. Scope Creep

WRONG: “While you’re at it, can you also optimize that performance?” RIGHT: (Create separate task) “Create new issue #XXX for performance optimization. This is separate from current task.”

4. Missing Context

WRONG: Delegate without issue number or background RIGHT: Include issue number, link to requirements, reference related work

5. No Follow-Up

WRONG: Delegate and wait until deadline to check progress RIGHT: Schedule check-in at 50% completion, verify no blockers

Monitoring Delegation Progress

Initial Setup

  • Send clear delegation message
  • Confirm receipt and understanding
  • Clarify any questions immediately
  • Document in issue or tracking system

During Execution

  • Check progress at planned intervals
  • Respond quickly to questions
  • Help unblock if issues arise
  • Monitor for scope creep

At Completion

  • Review deliverable against specification
  • Accept or request revisions
  • Document lessons learned
  • Thank the agent for their work

After Completion

  • Update stakeholders on status
  • Prepare for next phase
  • Plan handoff to next agent if needed
  • Document workflow for future reference

Handling Delegation Problems

Agent Reports Blocker

  1. Listen: Understand the blocker clearly
  2. Assess: Determine if it’s truly blocking
  3. Act: Either resolve immediately or escalate
  4. Communicate: Update all affected parties
  5. Follow-Up: Verify blocker is resolved

Agent Misunderstands Task

  1. Clarify: Explain misunderstanding clearly
  2. Correct: Provide clear direction
  3. Confirm: Verify new understanding
  4. Adjust Timeline: If needed based on rework
  5. Document: Prevent similar issues

Agent Exceeds Scope

  1. Review: Understand scope expansion
  2. Assess: Is it valuable or out of scope?
  3. Decide: Approve scope change or redirect
  4. Communicate: Update timeline and expectations
  5. Document: Track scope changes

Delegation Takes Longer Than Expected

  1. Investigate: Find out why
  2. Assess: Is timeline realistic?
  3. Decide: Adjust timeline or reassign
  4. Communicate: Update stakeholders
  5. Support: Help remove obstacles

Success Metrics

Delegation Effectiveness

  • Accuracy: Does deliverable match specification? (Target: 95%+)
  • Quality: Does deliverable meet quality standards? (Target: 90%+)
  • Timeliness: Does deliverable arrive on schedule? (Target: 90%+)
  • Completeness: Are all acceptance criteria met? (Target: 100%)

Communication Quality

  • Clarity: Is delegation understood clearly? (Target: 95%+)
  • Responsiveness: Are questions answered quickly? (Target: same day)
  • Completeness: Is context sufficient? (Target: 95%+)
  • Documentation: Are decisions recorded? (Target: 100%)

Continuous Improvement

Review delegation effectiveness monthly:

  1. What Worked: Capture successful patterns
  2. What Didn’t: Identify problem areas
  3. What Changed: Adapt based on learnings
  4. What’s Next: Improve for future delegations

Last Updated: January 16, 2026 Version: 1.0 Status: Published