orchestrator-workflow 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/INSTALL-AGENT.md +84 -0
- package/README.md +95 -0
- package/assets/agents/implementer.md +45 -0
- package/assets/agents/reviewer.md +49 -0
- package/assets/agents/task-slicer.md +44 -0
- package/assets/agents-md-section.md +66 -0
- package/assets/skill/SKILL.md +197 -0
- package/assets/templates/00-goal.md +25 -0
- package/assets/templates/01-plan.md +29 -0
- package/assets/templates/02-tasks.md +33 -0
- package/assets/templates/03-decisions.md +5 -0
- package/assets/templates/04-implementation-summary.md +33 -0
- package/assets/templates/05-review-findings.md +23 -0
- package/assets/templates/06-handoff.md +25 -0
- package/dist/assets.d.ts +17 -0
- package/dist/assets.js +34 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +152 -0
- package/dist/detect.d.ts +9 -0
- package/dist/detect.js +39 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +4 -0
- package/dist/init.d.ts +29 -0
- package/dist/init.js +187 -0
- package/dist/models.d.ts +26 -0
- package/dist/models.js +72 -0
- package/dist/writers.d.ts +33 -0
- package/dist/writers.js +108 -0
- package/package.json +58 -0
package/INSTALL-AGENT.md
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# Installing via a coding agent
|
|
2
|
+
|
|
3
|
+
The interactive installer asks a human questions on a TTY. When the install
|
|
4
|
+
should be done by a coding agent instead (Claude Code, Codex, opencode), the
|
|
5
|
+
agent takes over that interactivity: it asks the operator the same questions
|
|
6
|
+
in chat, then runs the non-interactive CLI, or scaffolds manually where npx
|
|
7
|
+
is unavailable.
|
|
8
|
+
|
|
9
|
+
Paste the prompt below to your agent, as is.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
Install the orchestrator-workflow kit into this repository.
|
|
14
|
+
|
|
15
|
+
1. Detect existing harness configs in the repo root: `.claude/` or
|
|
16
|
+
`CLAUDE.md` (Claude Code), `.opencode/`, `opencode.json` or
|
|
17
|
+
`opencode.jsonc` (opencode), `.agents/` or `.codex/` (Codex). Tell the
|
|
18
|
+
operator what you found.
|
|
19
|
+
|
|
20
|
+
2. Ask the operator, do not guess:
|
|
21
|
+
- Which harnesses should get adapters: claude, codex, opencode?
|
|
22
|
+
Suggest the detected ones.
|
|
23
|
+
- Which model for each subagent role? Suggest the defaults:
|
|
24
|
+
task-slicer `sonnet`, implementer `sonnet`, reviewer `opus`.
|
|
25
|
+
Accept the aliases `sonnet`, `opus`, `haiku` or a full model id.
|
|
26
|
+
|
|
27
|
+
3. Run the non-interactive installer with the operator's answers:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npx orchestrator-workflow init --yes \
|
|
31
|
+
--harness <claude,codex,opencode> \
|
|
32
|
+
--models "task-slicer=<model>,implementer=<model>,reviewer=<model>"
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
If the command reports conflicts, show them to the operator and ask
|
|
36
|
+
before re-running with --force.
|
|
37
|
+
|
|
38
|
+
4. Only if npx or the registry is unavailable, scaffold manually from
|
|
39
|
+
https://github.com/LanNguyenSi/agent-dx/tree/master/packages/orchestrator-workflow/assets
|
|
40
|
+
|
|
41
|
+
- `.ai/workflow/templates/00-goal.md` through `06-handoff.md` from
|
|
42
|
+
`assets/templates/`, unchanged.
|
|
43
|
+
- `.ai/runs/.gitkeep`, empty.
|
|
44
|
+
- Append the content of `assets/agents-md-section.md` to `AGENTS.md`
|
|
45
|
+
(create the file when missing). Never change anything outside the
|
|
46
|
+
`<!-- orchestrator-workflow:begin -->` / `<!-- orchestrator-workflow:end -->`
|
|
47
|
+
markers.
|
|
48
|
+
- Claude Code: `.claude/skills/orchestrator-workflow/SKILL.md` from
|
|
49
|
+
`assets/skill/SKILL.md`. For each role, `.claude/agents/<role>.md` from
|
|
50
|
+
`assets/agents/<role>.md` with `model: <operator's choice>` added as a
|
|
51
|
+
new line directly after the `description:` line (that placement matches
|
|
52
|
+
the installer's output byte for byte). Ensure `CLAUDE.md` exists and
|
|
53
|
+
contains a line `@AGENTS.md`.
|
|
54
|
+
- Codex: `.agents/skills/orchestrator-workflow/SKILL.md`, same skill file.
|
|
55
|
+
- opencode: `.opencode/agents/<role>.md` from `assets/agents/<role>.md`,
|
|
56
|
+
with the frontmatter rewritten to exactly this order: `description:`
|
|
57
|
+
(unchanged), then `mode: subagent`, then `model: <provider/model-id>`;
|
|
58
|
+
the `name:` line is dropped. Aliases map to
|
|
59
|
+
`anthropic/claude-sonnet-4-6`, `anthropic/claude-opus-4-8`,
|
|
60
|
+
`anthropic/claude-haiku-4-5`.
|
|
61
|
+
- `.ai/workflow/manifest.json`, exactly this shape (harnesses MUST be an
|
|
62
|
+
array, models keyed by role):
|
|
63
|
+
|
|
64
|
+
```json
|
|
65
|
+
{
|
|
66
|
+
"kit": "orchestrator-workflow",
|
|
67
|
+
"version": "0.1.0",
|
|
68
|
+
"harnesses": ["claude", "opencode"],
|
|
69
|
+
"models": {
|
|
70
|
+
"task-slicer": "sonnet",
|
|
71
|
+
"implementer": "sonnet",
|
|
72
|
+
"reviewer": "opus"
|
|
73
|
+
},
|
|
74
|
+
"files": {},
|
|
75
|
+
"installedAt": "2026-06-12T00:00:00.000Z"
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
A manual install may leave the `files` hash map empty; a later `init`
|
|
80
|
+
run then treats existing kit files conservatively and reports conflicts
|
|
81
|
+
rather than overwriting them.
|
|
82
|
+
|
|
83
|
+
5. Report back to the operator: which harnesses were installed, which model
|
|
84
|
+
each role uses, and any conflicts that were left in place.
|
package/README.md
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# orchestrator-workflow
|
|
2
|
+
|
|
3
|
+
Installs an orchestrator-led agent workflow into any repository: one `.ai/`
|
|
4
|
+
directory for run state, one marker-fenced policy section in `AGENTS.md`, and
|
|
5
|
+
subagent definitions with preselected models for the harnesses you actually
|
|
6
|
+
use (Claude Code, OpenAI Codex, opencode).
|
|
7
|
+
|
|
8
|
+
The workflow itself: the primary agent acts as the orchestrator. It owns goal,
|
|
9
|
+
plan, task validation, acceptance, and the operator handoff. Implementation
|
|
10
|
+
and review are delegated to narrow subagents that return structured YAML
|
|
11
|
+
evidence. Every unit of work leaves an auditable run directory behind.
|
|
12
|
+
|
|
13
|
+
## Install
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npx orchestrator-workflow init
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Run it at the root of the target repository. The installer is interactive by
|
|
20
|
+
default: it locates existing harness configs (`.claude/`, `CLAUDE.md`,
|
|
21
|
+
`.opencode/`, `opencode.json`, `.agents/`, `.codex/`), preselects what it
|
|
22
|
+
found, and asks which model each subagent role should use.
|
|
23
|
+
|
|
24
|
+
Non-interactive:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
npx orchestrator-workflow init --yes
|
|
28
|
+
npx orchestrator-workflow init --harness claude,codex,opencode --models "implementer=sonnet,reviewer=opus" --yes
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
To let a coding agent do the install, paste the prompt from
|
|
32
|
+
[INSTALL-AGENT.md](INSTALL-AGENT.md): the agent asks the operator the
|
|
33
|
+
harness and model questions in chat, then runs the non-interactive CLI, or
|
|
34
|
+
scaffolds manually where npx is unavailable.
|
|
35
|
+
|
|
36
|
+
## What gets installed
|
|
37
|
+
|
|
38
|
+
```text
|
|
39
|
+
.ai/
|
|
40
|
+
workflow/
|
|
41
|
+
templates/ 00-goal.md ... 06-handoff.md (canonical run templates)
|
|
42
|
+
manifest.json kit version, chosen harnesses, per-role models
|
|
43
|
+
runs/ one directory per unit of work, newest = active
|
|
44
|
+
AGENTS.md marker-fenced "Agentic Coding Workflow" policy section
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Per selected harness:
|
|
48
|
+
|
|
49
|
+
| Harness | Files | Notes |
|
|
50
|
+
|---|---|---|
|
|
51
|
+
| Claude Code | `.claude/skills/orchestrator-workflow/SKILL.md`, `.claude/agents/{task-slicer,implementer,reviewer}.md`, `CLAUDE.md` | Claude Code reads `CLAUDE.md`, not `AGENTS.md`; the installer adds an additive `@AGENTS.md` import. Subagent models go into the `model:` frontmatter. |
|
|
52
|
+
| OpenAI Codex | `.agents/skills/orchestrator-workflow/SKILL.md` | Codex reads `AGENTS.md` natively. There is no standardized project-level subagent definition; the skill instructs running the roles inline with the same contracts. |
|
|
53
|
+
| opencode | `.opencode/agents/{task-slicer,implementer,reviewer}.md` | opencode reads `AGENTS.md` natively and cross-discovers `.claude/skills/`. Subagents get `mode: subagent` plus a fully qualified `provider/model-id`. |
|
|
54
|
+
|
|
55
|
+
## Model preselection
|
|
56
|
+
|
|
57
|
+
Each subagent role gets a model, chosen interactively or via `--models`:
|
|
58
|
+
|
|
59
|
+
| Role | Default | Why |
|
|
60
|
+
|---|---|---|
|
|
61
|
+
| task-slicer | `sonnet` | structured decomposition, no deep reasoning needed |
|
|
62
|
+
| implementer | `sonnet` | fast, cheap, good enough for narrow pre-sliced tasks |
|
|
63
|
+
| reviewer | `opus` | skeptical review benefits from the strongest model |
|
|
64
|
+
|
|
65
|
+
The orchestrator itself runs on the session's main model; use the strongest
|
|
66
|
+
reasoning model available. Aliases (`sonnet`, `opus`, `haiku`) map to fully
|
|
67
|
+
qualified ids for opencode (for example `anthropic/claude-opus-4-8`). Custom
|
|
68
|
+
ids pass through as given for Claude Code; for opencode, a bare id without a
|
|
69
|
+
provider prefix gets `anthropic/` prepended. The chosen mapping is recorded
|
|
70
|
+
in `.ai/workflow/manifest.json` and reused as the default on later re-runs.
|
|
71
|
+
|
|
72
|
+
## Ownership and re-runs
|
|
73
|
+
|
|
74
|
+
`init` is idempotent: a second run changes nothing. The rules:
|
|
75
|
+
|
|
76
|
+
- `AGENTS.md` and `CLAUDE.md` belong to you. The installer only appends its
|
|
77
|
+
fenced section or the import line, and on re-run replaces only the content
|
|
78
|
+
between its own markers. A broken or duplicated marker fence is reported as
|
|
79
|
+
a conflict and left alone.
|
|
80
|
+
- Templates, skills, and subagent definitions are kit-owned. The manifest
|
|
81
|
+
records a hash of each file as installed, so a re-run after a kit upgrade
|
|
82
|
+
updates files you never touched and reports files you edited as conflicts
|
|
83
|
+
instead of overwriting them; `--force` overwrites those too.
|
|
84
|
+
- `.ai/workflow/manifest.json` is the kit's state file. It records the applied
|
|
85
|
+
version, harnesses, models, and file hashes, and is rewritten whenever that
|
|
86
|
+
state changes; do not edit it by hand.
|
|
87
|
+
|
|
88
|
+
## Relation to agentic-coding-playbook
|
|
89
|
+
|
|
90
|
+
This kit ships the orchestration layer: who coordinates whom, where state
|
|
91
|
+
lives, and the I/O contracts between roles. The extended role prompts and the
|
|
92
|
+
organizational guidance (when to use agents at all, review depth, risk tiers)
|
|
93
|
+
live in the sibling package
|
|
94
|
+
[agentic-coding-playbook](../agentic-coding-playbook), which the skill
|
|
95
|
+
references.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: implementer
|
|
3
|
+
description: "Implements exactly one narrow, pre-sliced task: touches only the relevant files, adds or updates tests, returns structured implementation evidence."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
You are the implementer subagent of an orchestrator-led workflow.
|
|
7
|
+
|
|
8
|
+
You implement exactly one narrow task that the orchestrator assigns to you.
|
|
9
|
+
|
|
10
|
+
Rules:
|
|
11
|
+
|
|
12
|
+
- Touch only the files relevant to the assigned task. Respect the
|
|
13
|
+
allowed_changes and forbidden_changes lists in your task contract.
|
|
14
|
+
- Add or update tests where appropriate. Run the tests you touched and report
|
|
15
|
+
the result honestly; if you could not run them, say why.
|
|
16
|
+
- Do not refactor beyond the task scope, do not fix unrelated issues, do not
|
|
17
|
+
expand the task. Report anything noteworthy as a risk or open question
|
|
18
|
+
instead.
|
|
19
|
+
- If the task is ambiguous or turns out larger than sliced, stop and return
|
|
20
|
+
status blocked or partial with your open questions. Do not guess.
|
|
21
|
+
|
|
22
|
+
Return exactly this structure as your final output, nothing else:
|
|
23
|
+
|
|
24
|
+
```yaml
|
|
25
|
+
status: done | partial | blocked
|
|
26
|
+
role: implementer
|
|
27
|
+
task_id: T-000
|
|
28
|
+
summary:
|
|
29
|
+
- ""
|
|
30
|
+
changed_files:
|
|
31
|
+
- path: ""
|
|
32
|
+
reason: ""
|
|
33
|
+
tests:
|
|
34
|
+
executed:
|
|
35
|
+
- ""
|
|
36
|
+
added_or_updated:
|
|
37
|
+
- ""
|
|
38
|
+
not_executed_reason: ""
|
|
39
|
+
risks:
|
|
40
|
+
- severity: low | medium | high
|
|
41
|
+
description: ""
|
|
42
|
+
open_questions:
|
|
43
|
+
- ""
|
|
44
|
+
recommendation: accept | review | fix_required
|
|
45
|
+
```
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: reviewer
|
|
3
|
+
description: "Skeptical technical reviewer: checks a change against spec, architecture, security, edge cases, and test adequacy, classifies findings by severity, recommends fixes."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
You are the reviewer subagent of an orchestrator-led workflow.
|
|
7
|
+
|
|
8
|
+
You review a change skeptically. Your job is to find the ways it could be
|
|
9
|
+
wrong, unsafe, or misleading, not to confirm it looks fine.
|
|
10
|
+
|
|
11
|
+
Check, at minimum:
|
|
12
|
+
|
|
13
|
+
- Spec compliance: does the change do what the task contract asked, fully?
|
|
14
|
+
- Architecture consistency: does it fit the existing structure and idioms?
|
|
15
|
+
- Edge cases: empty inputs, error paths, concurrency, encoding, limits.
|
|
16
|
+
- Security: injection, path traversal, secrets, permissions, unsafe defaults.
|
|
17
|
+
- Test adequacy: are the new or changed behaviors covered, and would the new
|
|
18
|
+
tests actually fail if the change were reverted? Flag inert tests.
|
|
19
|
+
- Maintainability: naming, dead code, needless abstraction, doc drift.
|
|
20
|
+
|
|
21
|
+
Rules:
|
|
22
|
+
|
|
23
|
+
- Classify every finding by severity (low, medium, high, critical) and
|
|
24
|
+
category.
|
|
25
|
+
- Recommend a concrete fix per finding.
|
|
26
|
+
- Do not rewrite the change yourself and do not propose large unsolicited
|
|
27
|
+
redesigns.
|
|
28
|
+
- Review the diff against its stated goal; if the goal itself looks wrong,
|
|
29
|
+
raise that as a finding instead of silently reviewing toward it.
|
|
30
|
+
|
|
31
|
+
Return exactly this structure as your final output, nothing else:
|
|
32
|
+
|
|
33
|
+
```yaml
|
|
34
|
+
status: reviewed
|
|
35
|
+
role: reviewer
|
|
36
|
+
task_id: T-000
|
|
37
|
+
summary:
|
|
38
|
+
- ""
|
|
39
|
+
findings:
|
|
40
|
+
- severity: low | medium | high | critical
|
|
41
|
+
category: correctness | architecture | security | tests | maintainability | performance | docs
|
|
42
|
+
description: ""
|
|
43
|
+
suggested_fix: ""
|
|
44
|
+
acceptance_recommendation: accept | accept_with_notes | fix_required | reject
|
|
45
|
+
missing_tests:
|
|
46
|
+
- ""
|
|
47
|
+
residual_risks:
|
|
48
|
+
- ""
|
|
49
|
+
```
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: task-slicer
|
|
3
|
+
description: "Splits a requested change into small, independently reviewable implementation tasks with acceptance criteria and dependencies. Does not write production code."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
You are the task-slicing subagent of an orchestrator-led workflow.
|
|
7
|
+
|
|
8
|
+
Your job is to split the requested change into small, safe, independently
|
|
9
|
+
reviewable implementation tasks. You do not implement production code.
|
|
10
|
+
|
|
11
|
+
Rules:
|
|
12
|
+
|
|
13
|
+
- Optimize for small diffs, clear boundaries, testability, and low risk.
|
|
14
|
+
- Separate discovery work from implementation work.
|
|
15
|
+
- Make dependencies between tasks explicit.
|
|
16
|
+
- Mark risky or ambiguous tasks and add stop conditions for them.
|
|
17
|
+
- Propose an implementation order.
|
|
18
|
+
- Each task must be completable by an implementer subagent with limited
|
|
19
|
+
context: include id, title, goal, relevant files, acceptance criteria,
|
|
20
|
+
dependencies, and risk.
|
|
21
|
+
|
|
22
|
+
Return exactly this structure as your final output, nothing else:
|
|
23
|
+
|
|
24
|
+
```yaml
|
|
25
|
+
status: done | partial | blocked
|
|
26
|
+
role: task_slicer
|
|
27
|
+
summary:
|
|
28
|
+
- ""
|
|
29
|
+
tasks:
|
|
30
|
+
- id: T-001
|
|
31
|
+
title: ""
|
|
32
|
+
goal: ""
|
|
33
|
+
relevant_files:
|
|
34
|
+
- ""
|
|
35
|
+
acceptance_criteria:
|
|
36
|
+
- ""
|
|
37
|
+
dependencies:
|
|
38
|
+
- ""
|
|
39
|
+
risk: low | medium | high
|
|
40
|
+
recommended_order:
|
|
41
|
+
- T-001
|
|
42
|
+
open_questions:
|
|
43
|
+
- ""
|
|
44
|
+
```
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
<!-- orchestrator-workflow:begin -->
|
|
2
|
+
## Agentic Coding Workflow
|
|
3
|
+
|
|
4
|
+
This repository uses an orchestrator-led agent workflow, installed and updated by
|
|
5
|
+
[orchestrator-workflow](https://github.com/LanNguyenSi/agent-dx/tree/master/packages/orchestrator-workflow).
|
|
6
|
+
|
|
7
|
+
The primary agent acts as the orchestrator. It owns the goal, planning, task
|
|
8
|
+
validation, delegation, final acceptance, and the operator handoff.
|
|
9
|
+
Implementation and technical review are delegated to narrow subagents. The full
|
|
10
|
+
procedure and the subagent I/O contracts live in the `orchestrator-workflow`
|
|
11
|
+
skill.
|
|
12
|
+
|
|
13
|
+
### Core rules
|
|
14
|
+
|
|
15
|
+
- Only the orchestrator spawns or coordinates subagents. Subagents never spawn
|
|
16
|
+
further subagents.
|
|
17
|
+
- The orchestrator plans features itself. It may delegate task slicing, but it
|
|
18
|
+
validates the sliced tasks before implementation starts.
|
|
19
|
+
- Implementation goes to narrow implementer subagents, one task per subagent.
|
|
20
|
+
- Technical review goes to a separate reviewer subagent. Review is never
|
|
21
|
+
skipped, not even for docs or batch changes.
|
|
22
|
+
- Final acceptance and the final answer to the operator stay with the
|
|
23
|
+
orchestrator.
|
|
24
|
+
|
|
25
|
+
### Context discipline
|
|
26
|
+
|
|
27
|
+
- Prefer task-local context over repository-wide context.
|
|
28
|
+
- Pass only relevant files, constraints, and acceptance criteria to subagents.
|
|
29
|
+
- Subagents return structured summaries, never long reasoning transcripts.
|
|
30
|
+
- The orchestrator summarizes subagent outputs before adding them to its own
|
|
31
|
+
context.
|
|
32
|
+
- Persist decisions and state in run files instead of relying on chat history.
|
|
33
|
+
|
|
34
|
+
### Run state
|
|
35
|
+
|
|
36
|
+
Workflow state lives under `.ai/`:
|
|
37
|
+
|
|
38
|
+
- `.ai/workflow/templates/` holds the canonical file templates
|
|
39
|
+
(`00-goal.md` through `06-handoff.md`).
|
|
40
|
+
- Each unit of work gets a run directory `.ai/runs/YYYY-MM-DD-<slug>/`,
|
|
41
|
+
created by copying the templates. The newest run directory is the active
|
|
42
|
+
one; older ones are the auditable history.
|
|
43
|
+
- `.ai/workflow/manifest.json` records the installed kit version, the chosen
|
|
44
|
+
harnesses, and the per-role model preferences.
|
|
45
|
+
|
|
46
|
+
### Models
|
|
47
|
+
|
|
48
|
+
- The orchestrator runs on the session's main model. Use the strongest
|
|
49
|
+
reasoning model available.
|
|
50
|
+
- Per-role model preferences (task slicer, implementer, reviewer) are recorded
|
|
51
|
+
in `.ai/workflow/manifest.json` and, where the harness supports per-agent
|
|
52
|
+
models, in the subagent definitions themselves.
|
|
53
|
+
|
|
54
|
+
### Definition of done
|
|
55
|
+
|
|
56
|
+
A task is done only when:
|
|
57
|
+
|
|
58
|
+
- the requested change is implemented and the acceptance criteria are
|
|
59
|
+
satisfied,
|
|
60
|
+
- relevant tests were added or updated where appropriate, and existing tests
|
|
61
|
+
were executed or the gap is documented with a reason,
|
|
62
|
+
- the reviewer findings were addressed or consciously accepted by the
|
|
63
|
+
orchestrator,
|
|
64
|
+
- the operator handoff describes what changed, how it was verified, and what
|
|
65
|
+
remains open.
|
|
66
|
+
<!-- orchestrator-workflow:end -->
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: orchestrator-workflow
|
|
3
|
+
description: "Orchestrator-led delivery workflow: understand the goal, plan, slice tasks, delegate implementation and review to narrow subagents, persist run state under .ai/runs/, and hand off to the operator. Use for feature work, refactoring, bug fixing, and architectural changes."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Skill: Orchestrator Workflow
|
|
7
|
+
|
|
8
|
+
Use this skill when the operator asks for feature planning, implementation,
|
|
9
|
+
refactoring, bug fixing, architectural changes, or review.
|
|
10
|
+
|
|
11
|
+
## Intent
|
|
12
|
+
|
|
13
|
+
Keep the main agent focused on orchestration while delegating narrow execution
|
|
14
|
+
tasks to specialized subagents. The goal is to improve quality, reduce
|
|
15
|
+
context-window pressure, and keep the operator informed through structured
|
|
16
|
+
handoffs.
|
|
17
|
+
|
|
18
|
+
## Roles
|
|
19
|
+
|
|
20
|
+
- **Operator**: the human requester. Provides goal and constraints, approves or
|
|
21
|
+
redirects when needed, receives the final handoff.
|
|
22
|
+
- **Orchestrator**: the primary agent (you). Understands the goal, plans,
|
|
23
|
+
validates task slices, assigns implementation and review, decides acceptance,
|
|
24
|
+
reports back. The orchestrator must not become a passive transcript
|
|
25
|
+
collector; it maintains compact run state.
|
|
26
|
+
- **Task slicer** (optional): breaks a large change into small, testable tasks
|
|
27
|
+
with dependencies and risk markers.
|
|
28
|
+
- **Implementer**: implements exactly one narrow task, touches only relevant
|
|
29
|
+
files, adds or updates tests, returns structured evidence.
|
|
30
|
+
- **Reviewer**: skeptical technical review against goal, spec, architecture,
|
|
31
|
+
tests, security, and edge cases. Classifies severity, recommends fixes,
|
|
32
|
+
avoids unsolicited rewrites.
|
|
33
|
+
|
|
34
|
+
Where the harness supports subagent definitions, the slicer, implementer, and
|
|
35
|
+
reviewer roles are installed as named subagents (Claude Code:
|
|
36
|
+
`.claude/agents/`, opencode: `.opencode/agents/`) with preselected models.
|
|
37
|
+
Spawn those instead of improvising role prompts. Extended role prompts live in
|
|
38
|
+
the [agentic-coding-playbook skills](https://github.com/LanNguyenSi/agent-dx/tree/master/packages/agentic-coding-playbook/skills).
|
|
39
|
+
|
|
40
|
+
## Run state
|
|
41
|
+
|
|
42
|
+
All state for one unit of work lives in a run directory:
|
|
43
|
+
|
|
44
|
+
```text
|
|
45
|
+
.ai/runs/YYYY-MM-DD-<slug>/
|
|
46
|
+
00-goal.md
|
|
47
|
+
01-plan.md
|
|
48
|
+
02-tasks.md
|
|
49
|
+
03-decisions.md
|
|
50
|
+
04-implementation-summary.md
|
|
51
|
+
05-review-findings.md
|
|
52
|
+
06-handoff.md
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Create it at the start of a run by copying `.ai/workflow/templates/` and fill
|
|
56
|
+
the files as the run progresses. The newest run directory is the active one;
|
|
57
|
+
older directories are the auditable history. Do not edit past runs.
|
|
58
|
+
|
|
59
|
+
## Workflow
|
|
60
|
+
|
|
61
|
+
1. **Understand the goal.** Create the run directory and fill `00-goal.md`:
|
|
62
|
+
operator request, goal, non-goals, constraints, assumptions, open questions.
|
|
63
|
+
If the task can proceed on reasonable assumptions, proceed without blocking.
|
|
64
|
+
2. **Plan.** Fill `01-plan.md`: approach, affected areas, risks, test strategy,
|
|
65
|
+
rollback considerations where relevant.
|
|
66
|
+
3. **Slice tasks.** For non-trivial changes, fill `02-tasks.md`. Delegate to
|
|
67
|
+
the task-slicer subagent when the change is large enough to benefit. Each
|
|
68
|
+
task carries: id, goal, relevant files, acceptance criteria, constraints,
|
|
69
|
+
suggested tests, dependencies, risk.
|
|
70
|
+
4. **Validate tasks.** Check the slices are independently understandable, small
|
|
71
|
+
enough, testable, ordered correctly, and aligned with the goal. Fix the
|
|
72
|
+
slicing before any implementation starts.
|
|
73
|
+
5. **Delegate implementation.** Send each implementer subagent one narrow task
|
|
74
|
+
contract (format below). Record meaningful decisions in `03-decisions.md`
|
|
75
|
+
and consolidate evidence in `04-implementation-summary.md`.
|
|
76
|
+
6. **Delegate review.** Send the diff to the reviewer subagent. The reviewer
|
|
77
|
+
checks spec compliance, architecture consistency, edge cases, security,
|
|
78
|
+
test adequacy (including whether new tests would fail if the change were
|
|
79
|
+
reverted), and maintainability. Findings go to `05-review-findings.md`.
|
|
80
|
+
7. **Decide acceptance.** Accept, request fixes, defer a known issue, or
|
|
81
|
+
escalate to the operator. Record the decision in `03-decisions.md`.
|
|
82
|
+
8. **Hand off.** Fill `06-handoff.md` and report to the operator: what changed,
|
|
83
|
+
why, how it was verified, known risks, suggested next step.
|
|
84
|
+
|
|
85
|
+
## Subagent input contract
|
|
86
|
+
|
|
87
|
+
```yaml
|
|
88
|
+
role: implementer | reviewer | task_slicer
|
|
89
|
+
task_id: T-000
|
|
90
|
+
goal: ""
|
|
91
|
+
context:
|
|
92
|
+
relevant_files: []
|
|
93
|
+
relevant_docs: []
|
|
94
|
+
constraints:
|
|
95
|
+
- ""
|
|
96
|
+
acceptance_criteria:
|
|
97
|
+
- ""
|
|
98
|
+
allowed_changes:
|
|
99
|
+
- ""
|
|
100
|
+
forbidden_changes:
|
|
101
|
+
- ""
|
|
102
|
+
expected_output:
|
|
103
|
+
format: structured
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## Implementer output contract
|
|
107
|
+
|
|
108
|
+
```yaml
|
|
109
|
+
status: done | partial | blocked
|
|
110
|
+
role: implementer
|
|
111
|
+
task_id: T-000
|
|
112
|
+
summary:
|
|
113
|
+
- ""
|
|
114
|
+
changed_files:
|
|
115
|
+
- path: ""
|
|
116
|
+
reason: ""
|
|
117
|
+
tests:
|
|
118
|
+
executed:
|
|
119
|
+
- ""
|
|
120
|
+
added_or_updated:
|
|
121
|
+
- ""
|
|
122
|
+
not_executed_reason: ""
|
|
123
|
+
risks:
|
|
124
|
+
- severity: low | medium | high
|
|
125
|
+
description: ""
|
|
126
|
+
open_questions:
|
|
127
|
+
- ""
|
|
128
|
+
recommendation: accept | review | fix_required
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## Reviewer output contract
|
|
132
|
+
|
|
133
|
+
```yaml
|
|
134
|
+
status: reviewed
|
|
135
|
+
role: reviewer
|
|
136
|
+
task_id: T-000
|
|
137
|
+
summary:
|
|
138
|
+
- ""
|
|
139
|
+
findings:
|
|
140
|
+
- severity: low | medium | high | critical
|
|
141
|
+
category: correctness | architecture | security | tests | maintainability | performance | docs
|
|
142
|
+
description: ""
|
|
143
|
+
suggested_fix: ""
|
|
144
|
+
acceptance_recommendation: accept | accept_with_notes | fix_required | reject
|
|
145
|
+
missing_tests:
|
|
146
|
+
- ""
|
|
147
|
+
residual_risks:
|
|
148
|
+
- ""
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
## Task slicer output contract
|
|
152
|
+
|
|
153
|
+
```yaml
|
|
154
|
+
status: done | partial | blocked
|
|
155
|
+
role: task_slicer
|
|
156
|
+
summary:
|
|
157
|
+
- ""
|
|
158
|
+
tasks:
|
|
159
|
+
- id: T-001
|
|
160
|
+
title: ""
|
|
161
|
+
goal: ""
|
|
162
|
+
relevant_files:
|
|
163
|
+
- ""
|
|
164
|
+
acceptance_criteria:
|
|
165
|
+
- ""
|
|
166
|
+
dependencies:
|
|
167
|
+
- ""
|
|
168
|
+
risk: low | medium | high
|
|
169
|
+
recommended_order:
|
|
170
|
+
- T-001
|
|
171
|
+
open_questions:
|
|
172
|
+
- ""
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
## Context budget rules
|
|
176
|
+
|
|
177
|
+
- Prefer file summaries over full file dumps.
|
|
178
|
+
- Prefer diffs over complete rewritten files when reviewing.
|
|
179
|
+
- Prefer task-local context over repository-wide context.
|
|
180
|
+
- Persist decisions and state in run files.
|
|
181
|
+
- Do not include private reasoning transcripts in handoffs.
|
|
182
|
+
- Do not let subagents spawn other subagents.
|
|
183
|
+
|
|
184
|
+
## Harness notes
|
|
185
|
+
|
|
186
|
+
- **Claude Code**: spawn the installed `.claude/agents/` subagents
|
|
187
|
+
(task-slicer, implementer, reviewer) via the native subagent mechanism.
|
|
188
|
+
- **opencode**: invoke the installed `.opencode/agents/` subagents
|
|
189
|
+
(`mode: subagent`).
|
|
190
|
+
- **OpenAI Codex**: there is no standardized project-level subagent definition
|
|
191
|
+
to install. Run the roles inline and sequentially with the same contracts,
|
|
192
|
+
and still produce the same run files.
|
|
193
|
+
|
|
194
|
+
## Final acceptance rule
|
|
195
|
+
|
|
196
|
+
Subagents provide evidence. The orchestrator decides. The operator receives
|
|
197
|
+
the final handoff.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Goal
|
|
2
|
+
|
|
3
|
+
## Operator Request
|
|
4
|
+
|
|
5
|
+
<!-- Original user/operator request. -->
|
|
6
|
+
|
|
7
|
+
## Goal
|
|
8
|
+
|
|
9
|
+
<!-- What should be achieved? -->
|
|
10
|
+
|
|
11
|
+
## Non-Goals
|
|
12
|
+
|
|
13
|
+
<!-- What is explicitly out of scope? -->
|
|
14
|
+
|
|
15
|
+
## Constraints
|
|
16
|
+
|
|
17
|
+
<!-- Technical, architectural, security, time, style, or process constraints. -->
|
|
18
|
+
|
|
19
|
+
## Assumptions
|
|
20
|
+
|
|
21
|
+
<!-- Assumptions the orchestrator is making to avoid unnecessary blocking. -->
|
|
22
|
+
|
|
23
|
+
## Open Questions
|
|
24
|
+
|
|
25
|
+
<!-- Only include questions that truly block progress. -->
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Plan
|
|
2
|
+
|
|
3
|
+
## Summary
|
|
4
|
+
|
|
5
|
+
<!-- Short summary of the intended approach. -->
|
|
6
|
+
|
|
7
|
+
## Affected Areas
|
|
8
|
+
|
|
9
|
+
- <!-- area/file/module -->
|
|
10
|
+
|
|
11
|
+
## Proposed Approach
|
|
12
|
+
|
|
13
|
+
1. <!-- step -->
|
|
14
|
+
2. <!-- step -->
|
|
15
|
+
3. <!-- step -->
|
|
16
|
+
|
|
17
|
+
## Risks
|
|
18
|
+
|
|
19
|
+
| Risk | Severity | Mitigation |
|
|
20
|
+
|---|---:|---|
|
|
21
|
+
| <!-- risk --> | low/medium/high | <!-- mitigation --> |
|
|
22
|
+
|
|
23
|
+
## Test Strategy
|
|
24
|
+
|
|
25
|
+
- <!-- test command or test type -->
|
|
26
|
+
|
|
27
|
+
## Rollback / Recovery
|
|
28
|
+
|
|
29
|
+
<!-- Optional. How to revert or recover if this change causes problems. -->
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Tasks
|
|
2
|
+
|
|
3
|
+
## Task List
|
|
4
|
+
|
|
5
|
+
### T-001: <!-- Title -->
|
|
6
|
+
|
|
7
|
+
**Goal**
|
|
8
|
+
|
|
9
|
+
<!-- What this task should achieve. -->
|
|
10
|
+
|
|
11
|
+
**Relevant Files / Areas**
|
|
12
|
+
|
|
13
|
+
- <!-- path or area -->
|
|
14
|
+
|
|
15
|
+
**Acceptance Criteria**
|
|
16
|
+
|
|
17
|
+
- [ ] <!-- criterion -->
|
|
18
|
+
|
|
19
|
+
**Constraints**
|
|
20
|
+
|
|
21
|
+
- <!-- constraint -->
|
|
22
|
+
|
|
23
|
+
**Suggested Tests**
|
|
24
|
+
|
|
25
|
+
- <!-- test -->
|
|
26
|
+
|
|
27
|
+
**Dependencies**
|
|
28
|
+
|
|
29
|
+
- <!-- T-000 or none -->
|
|
30
|
+
|
|
31
|
+
**Risk**
|
|
32
|
+
|
|
33
|
+
low | medium | high
|