skills/cleanexpo/orchestrator-agent/SKILL.md
Master coordinator for Unite-Hub workflows. Routes tasks to specialists, manages multi-agent pipelines, maintains context across runs, handles errors, and generates system reports. The brain of the automation system.
npx skillsauth add aiskillstore/marketplace orchestrator-agentInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
The Orchestrator Agent is the command center of Unite-Hub. It:
All tasks now route through this decision tree:
Task Request
↓
┌─→ Truth Layer Validation
│ ├─ System state: Is build working?
│ ├─ Type safety: Any unresolved errors?
│ ├─ Test coverage: Do critical paths have tests?
│ └─ Dependencies: Blockers on other systems?
│
├─ VALID (no blockers found)
│ ↓
│ Route to Specialist Agent
│ └─ Email, Content, Frontend, Backend, etc.
│
└─ INVALID (blockers found)
├─ Log blocker (Transparency Reporter)
├─ Analyze root cause (Build Diagnostics)
├─ Escalate if needed
└─ Report to user with timeline
Before: Agents would attempt tasks and fail halfway, wasting time. After: We know if work is possible before starting.
Example:
User Input: "Process all emails and generate followup content for warm leads"
Orchestrator Steps:
POST audit: action="workflow_start", resource="email_content_pipeline"
- Call: npm run email-agent
- Wait for completion
- Capture: processed count, errors, audit logs
IF processed > 0:
Continue to step 4
ELSE:
Notify user "No new emails to process"
Exit workflow
FOR each processed email:
- Get updated contact AI score
- Filter: aiScore >= 70 (warm leads)
- Store in memory for content generation
- Call: npm run content-agent
- Wait for completion
- Capture: generated count, content types
Query generatedContent:
- Count drafts created
- Verify all have status="draft"
- Check aiModel="sonnet"
Output summary with:
- Emails processed: X
- Contacts updated: X
- Content generated: X
- High-priority leads identified: X
- Recommended next actions
POST audit: action="workflow_complete", status="success"
User Input: "Approve top 5 content drafts and schedule for sending"
Orchestrator Steps:
GET generatedContent:
- status="draft"
- Sort by contact.aiScore DESC
- Limit: 5
FOR each content:
- Get contact details
- Verify status="prospect" (ready to receive)
- Check lastInteraction < 30 days (recent)
FOR each draft:
POST mutation: content.approve(userId=system)
FOR each contact:
- Mark nextFollowUp = NOW + 7 days
- Update lastInteraction = NOW
FOR each action:
POST audit event with full details
Output:
- Total approved: 5
- Scheduled send time: [user preference]
- Expected delivery: [time range]
- Tracking enabled: yes/no
User Input: "Run system audit"
Orchestrator Steps:
Verify:
- All organizations active
- All users have valid roles
- All contacts have valid status
- All emails properly linked
Query auditLogs (last 24h):
- Total actions: X
- Errors: X
- Error rate: X%
- Failed agents: [list]
Check:
- All indexes working
- No orphaned records
- Data consistency
- Storage usage
FOR each agent:
- Last run: [timestamp]
- Success rate: X%
- Avg processing time: Xms
- Last error: [if any]
Output:
✅ System Status: [HEALTHY|WARNING|CRITICAL]
Data Integrity: ✅
- Organizations: X (active)
- Users: X
- Contacts: X
- Emails: X
Recent Performance (24h):
- Actions processed: X
- Success rate: X%
- Errors: X
Agent Status:
- email-agent: ✅ (last run: Xh ago)
- content-agent: ✅ (last run: Xh ago)
- orchestrator: ✅ (self-check)
Recommendations:
1. [Action 1]
2. [Action 2]
The Orchestrator uses persistent memory to track state across runs:
Memory keys stored in aiMemory table:
orchestrator:workflow_state
- Current workflow ID
- Status (running, completed, error)
- Started at timestamp
- Expected duration
orchestrator:last_email_run
- Timestamp of last email agent run
- Emails processed count
- Errors encountered
orchestrator:last_content_run
- Timestamp of last content agent run
- Content generated count
- Content types distribution
orchestrator:pipeline_cache
- Contact scores after email run
- High-priority contacts identified
- Contacts needing followup
Level 1: Recoverable
Action: Log error, skip item, continue
Level 2: Significant
Action: Log error, retry with reduced batch, alert user
Level 3: Critical
Action: Log error, halt workflow, alert immediately
FOR each error:
POST audit mutation:
- action: "[agent]_error"
- status: "error"
- details: { error_message, stack_trace, context }
- errorMessage: [human readable]
User: "Run full workflow: process emails and generate content"
Orchestrator:
1. Execute email-agent
2. Wait for completion
3. Evaluate results
4. Execute content-agent
5. Generate report
6. Log completion
User: "What's the status of pending content?"
Orchestrator:
1. Query generatedContent (status="draft")
2. Count by contentType
3. List by contact aiScore
4. Report summary
User: "Run system audit"
Orchestrator:
1. Check all tables
2. Verify data integrity
3. Query recent audit logs
4. Check agent health
5. Generate report
User: "Approve all content for John and Lisa"
Orchestrator:
1. Find content for specified contacts
2. Validate readiness
3. Approve each draft
4. Update contact records
5. Generate audit trail
✅ Pipeline Execution Complete
Timeline:
- Start: [timestamp]
- Email processing: [duration]
- Content generation: [duration]
- Total runtime: [duration]
Results:
- Emails processed: X
- New contacts created: X
- Contacts updated: X
- Content generated: X
- Errors: X
By type:
- Followup emails: X
- Proposals: X
- Case studies: X
High-Priority Leads (>80 score):
1. John Smith (TechStartup) - proposal generated
2. Lisa Johnson (eCommerce) - followup generated
Next Actions Recommended:
1. Review and approve X pending content drafts
2. Schedule sends for X contacts
3. Track performance metrics for X campaigns
System Health: ✅ All systems nominal
The Orchestrator coordinates with:
development
Apple Human Interface Guidelines for content display components. Use this skill when the user asks about charts component, collection view, image view, web view, color well, image well, activity view, lockup, data visualization, content display, displaying images, rendering web content, color pickers, or presenting collections of items in Apple apps. Also use when the user says how should I display charts, what's the best way to show images, should I use a web view, how do I build a grid of items, what component shows media, or how do I present a share sheet. Cross-references: hig-foundations for color/typography/accessibility, hig-patterns for data visualization patterns, hig-components-layout for structural containers, hig-platforms for platform-specific component behavior.
tools
Automate HelpDesk tasks via Rube MCP (Composio): list tickets, manage views, use canned responses, and configure custom fields. Always search tools first for current schemas.
testing
Expert Haskell engineer specializing in advanced type systems, pure functional design, and high-reliability software. Use PROACTIVELY for type-level programming, concurrency, and architecture guidance.
tools
GraphQL gives clients exactly the data they need - no more, no less. One endpoint, typed schema, introspection. But the flexibility that makes it powerful also makes it dangerous. Without proper controls, clients can craft queries that bring down your server. This skill covers schema design, resolvers, DataLoader for N+1 prevention, federation for microservices, and client integration with Apollo/urql. Key insight: GraphQL is a contract. The schema is the API documentation. Design it carefully.