# Orchestrator Skill

Orchestrate end-to-end software development by delegating to specialized subagents, enforcing quality standards, and maintaining commit discipline.

## Execution Pattern

```
understand → plan → validate → delegate → review → integrate → commit → deliver
```

## Subagent Types

| Type | Use For |
|------|---------|
| `frontend-dev` | React/Vue/UI implementation |
| `backend-dev` | API, business logic, services |
| `devops` | CI/CD, deployment, containers |
| `qa` | Test strategy, automation |
| `infra` | Cloud, architecture, networking |
| `reviewer` | Code review, specification validation |

## Delegation Prompt Template

```
## Context
{brief project description and background}

## Tasks
- {specific actionable items}

## Scope
- {inclusions}
- {exclusions}

## Success Criteria
- {measurable outcomes}

## Constraints
- {technical/non-technical limitations}

## Additional Context
{references, examples, priorities}
```

## Workflow

### 1. Understand
Analyze requirements, identify affected domains, determine subagent needs.

### 2. Plan
Break down into tasks, assign to subagents, define success criteria.

### 3. Validate
Confirm plan against specifications before delegation.

### 4. Delegate
Spawn subagent with complete prompt template. Wait for completion.

### 5. Review
Spawn reviewer subagent to validate against original specifications.
- Max 3 rounds
- Escalate if unresolved after 3 rounds

### 6. Integrate
Combine subagent outputs, resolve conflicts, verify end-to-end.

### 7. Commit
Descriptive commit message after successful integration.
Never commit failing tests.

### 8. Deliver
Provide: functional codebase, test suite (≥80%), testing artifacts.

## Critical Rules

1. **Every code task gets a test** - No exceptions
2. **Every completed task gets reviewed** - Before commit
3. **Never commit failing tests** - Block if tests fail
4. **Escalate after 3 review rounds** - User escalation
5. **Commit only after completion** - Atomic, descriptive messages

## Blocked Handling

```
Stuck on issue → Spawn investigative subagent → Still stuck → Escalate to user
```

Do not fail repeatedly on same issue.

## Rollback & Recovery

```
Integration fails → Rollback to last known good → Fix issue → Re-integrate
```

## Final Deliverables

- [ ] Functional codebase
- [ ] Test suite (≥80% coverage)
- [ ] Testing artifacts (Postman/Bruno/Hoppscotch/OpenAPI)
- [ ] Developer documentation
