# Orchestrator
`valdr-orchestrator` is the top-level wrapper for Valdr discovery, registry operations, and sprint routing. It resolves an orchestrator agent, loads that agent's prompt, and defers the actual workflow to the loaded prompt.

> [!IMPORTANT]
> You can target a specific orchestrator handle such as `gunnar`, `nikol`, or `skadi`, or let Valdr list the available orchestrators and ask you to choose.

Orchestrator is available on **Vanguard** and **Sovereign** plans with MCP access.

## Use Orchestrator When You Need To

- Inspect projects, tasks, sprints, prompts, agents, or capabilities
- Register agents or repair registry state
- Route sprint planning, staffing, review coverage, or launch readiness
- Find the right task, planner, reviewer, or auditor before handing off

## How To Use It

Start with:

```text
/valdr-orchestrator
```

Then give the wrapper a direct request. If you already know which orchestrator should own the work, name it in the prompt:

- Discovery with a named orchestrator:

```text
Use gunnar to show open tasks in api-platform and summarize blockers.
```

- Registry work with a named orchestrator:

```text
Use nikol to register a new reviewer agent for security audits.
```

- Sprint orchestration with a named orchestrator:

```text
Use skadi to create a sprint from the checkout hardening plan and route reviewers for every in-review task.
```

If you do not name an orchestrator, the wrapper will list the available handles and ask you which one should take the request.

## Wrapper Contract

The shipped wrapper is intentionally small:

```
1. Resolve the orchestrator handle.
2. Load that orchestrator's prompt.
3. Follow the loaded prompt as the single source of truth.
```

### Step 1: Resolve the Orchestrator

If the user already names an orchestrator handle, validate it directly:

```json
mcp__valdr__pm_agent → { "action": "get", "handle": "<orchestrator handle>" }
```

Common pack examples are `gunnar`, `nikol`, and `skadi`.

If the user does not name one, list the available orchestrators first:

```json
mcp__valdr__pm_agent → { "action": "list", "defaultRoles": ["orchestrator"] }
```

Resolution rules:

- If one or more orchestrators exist, present the handles and ask the user which one should own the request.
- If none exist, stop and send the user to registry setup or repair.

### Step 2: Load the Prompt

Once the handle is resolved, load the prompt by handle:

```json
mcp__valdr__pm_agent → { "action": "get_prompt", "handle": "<orchestrator handle>" }
```

If the prompt cannot be loaded, stop and ask the user how to proceed.

### Step 3: Execute the Loaded Flow

After the prompt is loaded, the wrapper steps aside. Discovery logic, registry operations, sprint workflows, and any hot-loaded follow-up instructions come from the resolved orchestrator prompt, not from the wrapper.

## Related Skills

- **[Executor](../valdr-executor/)** — Execute tasks discovered through navigation
- **[Planner](../valdr-planner/)** — Create structured plans for new work
- **[Reviewer](../valdr-reviewer/)** — Route work into review after execution
- **[Auditor](../valdr-auditor/)** — Audit sessions after work and review are complete

