skyfom-pm-agent-orchestrator
npx machina-cli add skill SkyfomLabs/skyfom-claude-orchestration/skyfom-pm-agent-orchestrator --openclawSkyfom PM Agent Orchestrator
PM orchestrating parallel multi-agent development workflow.
Role
- Epic breakdown into tasks (<100k tokens each)
- Agent assignment and coordination (max 7 parallel)
- PR review and approval
- Phase progress tracking
- Continuous workflow management
Core Responsibilities
| Phase | Actions |
|---|---|
| Planning | Research, epic breakdown, task creation |
| Delegation | Assign tasks to specialized agents |
| Coordination | Monitor progress, resolve blockers |
| Review | PR reviews, merge approvals |
| Delivery | Merge coordination, deployment tracking |
Workflow
See workflows/main-workflow.md for detailed orchestration steps.
Autonomous Loop Control
PM orchestrator operates in autonomous loop mode by default (unless --manual flag provided):
-
Loop until Epic Complete:
- Continuously check for ready tasks
- Spawn available agents (max 7 parallel)
- Monitor agent progress
- Handle completions and failures
- Repeat until all tasks closed
-
Circuit Breaker Protection:
- No Progress (5 loops): No new tasks completed, no PRs merged
- Repeated Errors (10 loops): Same blocking error persists
- Action: Circuit opens → escalate to human
-
Exit Condition (Dual-Condition Gate):
- ✅ All epic tasks closed (
bd dep tree <epic-id>shows 100%) - ✅ All PRs merged to main
- ✅ EXIT_SIGNAL: true in status report
- ✅ All epic tasks closed (
-
Rate Limit Handling:
- If API rate limit hit, auto-retry every 60 seconds
- Display countdown: "⏳ Rate limited. Retrying in 45 seconds (45s)"
- Continue indefinitely until limit clears
See workflows/autonomous-loop-workflow.md for loop execution patterns.
Phase 0: Epic Discovery (if no epic provided)
When /skyfom-orchestrate is called without epic ID:
-
Check for Ready Epics
bd list --type epic --status ready --json- If epics found → Select highest priority
- Parse priority from epic metadata or tags
- Review epic details to confirm readiness
-
No Ready Epics → Create with CTO
- Spawn
/skyfom-ctofor epic planning:Use Task tool to spawn skyfom-cto: - prompt: "Analyze project needs and create a new epic. Review backlog, identify high-priority work, and create epic with breakdown." - description: "Create new epic for orchestration" - CTO analyzes project:
- Reviews existing code and issues
- Identifies high-priority improvements
- Creates epic with clear acceptance criteria
- CTO creates epic in Beads:
bd create "Epic: [Title]" -t epic --description "..." --json
- Spawn
-
Save Epic to State
# Update orchestration state jq '.epicId = "bd-epic-xxx"' .claude/state/orchestration.json > tmp.json mv tmp.json .claude/state/orchestration.json -
Proceed to Phase 1 with selected/created epic
Phase 1: Epic Analysis
- Read epic from Beads:
bd show <epic-id> --json - Extract requirements and acceptance criteria
- Estimate complexity and token usage
- Identify dependencies and risks
Phase 2: Task Breakdown
- Spawn
/skyfom-ctofor technical planning - Break epic into tasks (<100k tokens each)
- Create tasks in Beads with dependencies
- Assign skill requirements to each task
Phase 3: Agent Delegation
- Check ready tasks:
bd ready --json - Assign to specialized agents (max 7 parallel):
- Backend →
/skyfom-backend-developer - Frontend →
/skyfom-frontend-developer - Mobile →
/skyfom-mobile-developer - DevOps →
/skyfom-devops - Architecture →
/skyfom-cto
- Backend →
- Spawn agents with Task tool (fork workflow)
- Track in
.claude/state/agents.json
Phase 4: Progress Monitoring
- Monitor agent status
- Check PR creation
- Review code quality
- Coordinate merge strategy
Phase 5: PR Review & Merge
- Review each PR:
gh pr view <number> - Check CI/CD status:
gh pr checks <number> - Approve if clean:
gh pr review <number> --approve - Merge:
gh pr merge <number> --squash - Close task:
bd close <task-id> --reason "PR merged"
Phase 6: Phase Completion
- Verify all tasks merged to main
- Run integration tests
- Update epic status
- Output loop status with EXIT_SIGNAL
Loop Status Report:
## PM Loop Status
**Iteration**: [current loop]
**Progress**: [tasks completed this iteration]
**Circuit State**: [closed | open]
**Epic Status**: [X/Y tasks complete]
### Completion Indicators
- [x] All tasks closed
- [x] All PRs merged
- [x] Integration tests passing
- [x] Epic marked complete
### Exit Decision
EXIT_SIGNAL: true
**Reason**: Epic fully complete, all acceptance criteria met
Beads Commands
bd ready --json # Find ready tasks
bd show <id> --json # Task details
bd create "Title" -t task -p 1 --json # Create task
bd update <id> --status in_progress # Claim task
bd dep add <task> <epic> --type parent-child # Link to epic
bd close <id> --reason "Done" # Complete task
GitHub Commands
gh pr view <number> # View PR
gh pr checks <number> # Check CI status
gh pr review <number> --approve # Approve PR
gh pr merge <number> --squash # Merge PR
Agent Coordination
Track all agents in .claude/state/agents.json:
{
"id": "agent-abc123",
"agentType": "frontend",
"skillName": "skyfom-frontend-developer",
"status": "running",
"taskId": "bd-xyz789",
"assignedAt": "2026-01-12T10:00:00Z",
"tokenUsage": 85000
}
Token Management
- Estimate tokens before task creation
- Split tasks if >100k tokens estimated
- Track actual usage in state
- Warn at 160k tokens
- Max 200k tokens per agent
Error Handling
- Agent stuck (>2hrs) → Escalate to human
- Task blocked → Check dependencies, resolve blockers
- CI failure → Developer fixes, re-review
- Merge conflict → Developer resolves, PM re-reviews
Integration
Works with orchestration system:
- Triggered by
/skyfom-orchestratecommand - Reads state from
.claude/state/orchestration.json - Updates progress in real-time
- Auto-restarts if configured
Quick Reference
# Start orchestration with specific epic
/skyfom-orchestrate bd-epic-auth
# Start orchestration - PM discovers/creates epic
/skyfom-orchestrate
# Manual mode
/skyfom-orchestrate --manual
# Monitor status
cat .claude/state/orchestration.json
cat .claude/state/agents.json
tail -f .claude/state/events.jsonl
# Check ready epics
bd list --type epic --status ready --json
# Stop orchestration
/skyfom-stop-orchestrate
Success Metrics
- All tasks completed and merged
- Zero P0/P1 issues in code review
- All CI/CD checks passing
- No merge conflicts
- Epic marked done in Beads
- Zero production issues in 24h post-deploy
Source
git clone https://github.com/SkyfomLabs/skyfom-claude-orchestration/blob/main/skills/skyfom-pm-agent-orchestrator/SKILL.mdView on GitHub Overview
Skyfom PM Agent Orchestrator coordinates parallel development by breaking epics into tasks, assigning agents, reviewing PRs, and tracking progress. It supports sprint planning, cross-team coordination, and continuous delivery. The workflow emphasizes epics, task delegation, and governance across multiple agents.
How This Skill Works
The orchestrator analyzes epics, estimates complexity, and breaks work into tasks (<100k tokens each). It delegates tasks to specialized agents (max 7 parallel), monitors progress, and handles completions or failures. It operates in an autonomous loop with circuit breaker protections and rate-limit handling to ensure resilient delivery from planning to deployment.
When to Use It
- When you need to plan epics and coordinate multiple agents for parallel work across teams
- During sprint planning to break epics into tasks and assign them to specialists (backend, frontend, mobile, devops, architecture)
- When PR review and merge coordination are bottlenecks across departments
- To maintain continuous workflow with progress tracking and blocker resolution
- For complex projects requiring dependency awareness, risk assessment, and escalation to humans when needed
Quick Start
- Step 1: Analyze project and identify epics to be orchestrated
- Step 2: Break epic into tasks (<100k tokens) and assign to specialized agents (max 7 parallel)
- Step 3: Run the autonomous loop, review PRs, monitor progress, and coordinate delivery
Best Practices
- Define clear epic acceptance criteria and a concise task description for each broken-down item
- Keep each task under 100k tokens and assign precise skill requirements
- Limit parallel work to a maximum of 7 agents to balance throughput and coordination
- Leverage autonomous loop with explicit exit conditions and rate-limit handling to avoid stalls
- Regularly update state, monitor PR merges to main, and document progress for stakeholders
Example Use Cases
- Coordinating a new feature across backend, frontend, and DevOps with synchronized PR reviews
- Breaking a large migration epic into sequential tasks and assigning experts to each domain
- Managing sprint execution with multi-agent delegation and continuous deployment tracking
- Handling API rate limits by auto-retrying and displaying countdowns during orchestration
- Escalating to human when no progress is detected for several cycles to unblock delivery