agent-orchestrator-kit 0.2.0 → 0.4.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/CHANGELOG.md +35 -0
- package/README.md +208 -20
- package/bin/agent-orchestrator.js +1303 -90
- package/package.json +2 -2
- package/profiles/generic/orchestrator.yaml +18 -1
- package/profiles/mvp/openspec-config.yaml.example +2 -0
- package/profiles/mvp/orchestrator.yaml +18 -1
- package/profiles/node/orchestrator.yaml +21 -2
- package/profiles/vue3/openspec-config.yaml.example +2 -0
- package/profiles/vue3/orchestrator.yaml +20 -2
- package/templates/.agents/amp.settings.json.example +12 -0
- package/templates/.agents/commands/opsx-apply.md +18 -46
- package/templates/.agents/commands/opsx-archive.md +10 -163
- package/templates/.agents/commands/opsx-design.md +3 -10
- package/templates/.agents/commands/opsx-explore.md +3 -10
- package/templates/.agents/commands/opsx-propose.md +14 -10
- package/templates/.agents/commands/opsx-quick.md +3 -10
- package/templates/.agents/commands/opsx-review.md +27 -55
- package/templates/.agents/commands/opsx-sync.md +2 -0
- package/templates/.agents/github.local.env.example +10 -0
- package/templates/.agents/gitlab.local.env.example +12 -0
- package/templates/.agents/mcp.json.example +12 -0
- package/templates/.agents/rules/agent-orchestration.mdc +15 -16
- package/templates/.agents/rules/memory-mcp-autosetup.mdc +1 -1
- package/templates/.agents/rules/session-handoff.mdc +22 -17
- package/templates/.agents/skills/agent-orchestration/SKILL.md +32 -29
- package/templates/.agents/skills/openspec-apply-change/SKILL.md +15 -20
- package/templates/.agents/skills/openspec-archive-change/SKILL.md +12 -99
- package/templates/.agents/skills/openspec-propose/SKILL.md +11 -0
- package/templates/.agents/subagents/session-handoff.md +12 -10
- package/templates/.agents/subagents/spec-architect.md +1 -1
- package/templates/.agents/subagents/spec-archiver.md +1 -1
- package/templates/.agents/subagents/spec-reviewer.md +11 -7
- package/templates/.cursor/memory.json +11 -0
- package/templates/AGENTS.md +3 -3
- package/templates/CLAUDE.md +2 -2
- package/templates/orchestrator.yaml +18 -1
- package/templates/scripts/browser-mcp-launcher.cjs +21 -0
- package/templates/scripts/github-mcp-launcher.cjs +66 -0
- package/templates/scripts/gitlab-mcp-launcher.cjs +70 -0
- package/templates/scripts/pre-commit-gate-check.sh +4 -0
|
@@ -5,9 +5,9 @@ category: Workflow
|
|
|
5
5
|
description: Fast path for MVP/demo — propose artifacts and apply in one session (skips review gate)
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
## Session Start
|
|
8
|
+
## Session Start
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
Follow the canonical Session Start protocol in `.agents/rules/session-handoff.mdc`, then announce the Quick conductor role.
|
|
11
11
|
|
|
12
12
|
Quick mode for **small changes, demos, and hypothesis testing**. Combines propose + apply in one session.
|
|
13
13
|
|
|
@@ -75,14 +75,7 @@ Quick mode for **small changes, demos, and hypothesis testing**. Combines propos
|
|
|
75
75
|
|
|
76
76
|
## Session Exit (HARD STOP)
|
|
77
77
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
1. Spawn `session-handoff` in persist mode (Amp: isolated `subagent-session-handoff`). If spawn fails, persist in the parent — never skip.
|
|
81
|
-
2. Write `openspec/changes/<name>/handoff.md` with: Closed role, Change, Done, Decisions, Blocked, Next command, Next role, Attach, Subagents to spawn, Constraints. Include task and build/lint status.
|
|
82
|
-
3. Run `npx agent-orchestrator-kit handoff <name>` and require exit 0. The CLI upserts Memory JSON (absolute path) and prints the expanded self-contained prompt on stdout.
|
|
83
|
-
4. If Memory MCP tools work, also update `Change:<name>`, `Handoff:<name>`, and new `Decision:*`.
|
|
84
|
-
5. Paste exactly one fenced prompt for verify/archive. Keep it complete. No banner.
|
|
85
|
-
6. Stop. This is the session's only next-session prompt.
|
|
78
|
+
Close via the canonical Session Exit protocol in `.agents/rules/session-handoff.mdc` at the end of the whole quick session only — no mid-session prompt between propose and apply. Include task and build/lint status in Done. Paste exactly one fenced prompt (verify/archive). Do not start archive in this chat.
|
|
86
79
|
|
|
87
80
|
**Guardrails**
|
|
88
81
|
- Max ~3 hours of work — if bigger, switch to full pipeline
|
|
@@ -5,9 +5,9 @@ category: Workflow
|
|
|
5
5
|
description: Read-only spec review of an OpenSpec change — approve or request changes before apply
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
## Session Start
|
|
8
|
+
## Session Start
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
Follow the canonical Session Start protocol in `.agents/rules/session-handoff.mdc`, then announce the Spec Reviewer role.
|
|
11
11
|
|
|
12
12
|
Review an OpenSpec change. Read artifacts, validate structure, output Approve or Request Changes.
|
|
13
13
|
|
|
@@ -15,7 +15,7 @@ Review an OpenSpec change. Read artifacts, validate structure, output Approve or
|
|
|
15
15
|
|
|
16
16
|
**Input**: Optionally specify a change name (e.g., `/opsx:review add-auth`). If omitted, auto-select if one active change exists, otherwise list and ask.
|
|
17
17
|
|
|
18
|
-
**
|
|
18
|
+
**Review is two-tiered:** Tier 1 is a deterministic script (`gate-check --review`) run by the parent **before** any artifact is read by an LLM. Tier 2 is the `spec-reviewer` subagent with a shortened, LLM-only checklist. Spawning `spec-reviewer` is mandatory only when Tier 1 passes. The parent MUST NOT review artifacts or write `review.md` itself when Tier 2 runs. Never substitute `code-reviewer`.
|
|
19
19
|
|
|
20
20
|
---
|
|
21
21
|
|
|
@@ -30,59 +30,36 @@ If name provided — use it. Otherwise:
|
|
|
30
30
|
|
|
31
31
|
Announce: "Reviewing change: **<name>**"
|
|
32
32
|
|
|
33
|
-
### 2.
|
|
34
|
-
|
|
35
|
-
Spawn `spec-reviewer` and delegate steps 3–6 below. Require `## Subagent report: spec-reviewer`. Do not perform the review in the parent session.
|
|
36
|
-
|
|
37
|
-
### 3. Validate structure
|
|
33
|
+
### 2. Tier 1 — deterministic gate-check
|
|
38
34
|
|
|
39
35
|
```bash
|
|
40
|
-
npx
|
|
36
|
+
npx agent-orchestrator-kit gate-check --review <name>
|
|
41
37
|
```
|
|
42
38
|
|
|
43
|
-
|
|
39
|
+
The script runs `openspec validate --strict --type change`, the task-contract lint (Files/Do/Done-when), the `Non-goals` / `Acceptance criteria` proposal sections check, and non-empty ADDED/MODIFIED/REMOVED delta-spec sections check. Add `--json` for a `{pass, errors[]}` report.
|
|
44
40
|
|
|
45
|
-
|
|
41
|
+
**If Tier 1 fails (exit ≠ 0):** do NOT spawn `spec-reviewer` and do NOT read the artifacts. Write `openspec/changes/<name>/review.md` with `Verdict: REQUEST CHANGES` listing the gate-check errors (source: gate-check), output the Request Changes verdict in chat, and go straight to Session Exit.
|
|
46
42
|
|
|
47
|
-
|
|
48
|
-
npx openspec status --change "<name>" --json
|
|
49
|
-
```
|
|
43
|
+
### 3. Tier 2 — spawn the specialist
|
|
50
44
|
|
|
51
|
-
|
|
52
|
-
- `proposal.md`
|
|
53
|
-
- `design.md`
|
|
54
|
-
- `tasks.md`
|
|
55
|
-
- all `specs/<domain>/spec.md` files
|
|
45
|
+
Only after Tier 1 passes: spawn `spec-reviewer` with the complete change paths, project constraints, and the shortened checklist below. Require `## Subagent report: spec-reviewer`. Do not perform the review in the parent session.
|
|
56
46
|
|
|
57
|
-
|
|
47
|
+
### 4. Review checklist (Tier 2 — LLM-only)
|
|
58
48
|
|
|
59
|
-
|
|
49
|
+
Do NOT re-check what Tier 1 already covered (strict validation, contract field presence, proposal sections, delta-spec section structure). Evaluate each item. Mark ✓ or ✗:
|
|
60
50
|
|
|
61
|
-
|
|
51
|
+
**Consistency**
|
|
52
|
+
- [ ] proposal ↔ design ↔ tasks tell the same story — no contradictions or drift
|
|
53
|
+
- [ ] Delta specs cover all changed/added behavior described in design
|
|
62
54
|
|
|
63
|
-
**
|
|
64
|
-
- [ ]
|
|
65
|
-
- [ ] Non-goals are listed
|
|
66
|
-
- [ ] Acceptance criteria are present and testable (not "should work" — must be verifiable)
|
|
67
|
-
- [ ] Scope matches a ~1–3 day change
|
|
55
|
+
**Main specs**
|
|
56
|
+
- [ ] No conflicts with existing `openspec/specs/` requirements
|
|
68
57
|
|
|
69
|
-
**
|
|
70
|
-
- [ ] Approach is concrete (not "we will handle this")
|
|
71
|
-
- [ ] Trade-offs or alternatives mentioned
|
|
72
|
-
- [ ] Does not contradict existing `openspec/specs/` domain specs
|
|
58
|
+
**Scope**
|
|
73
59
|
- [ ] No scope creep vs proposal Non-goals
|
|
74
60
|
|
|
75
|
-
**
|
|
76
|
-
- [ ]
|
|
77
|
-
- [ ] Each task has a clear done condition
|
|
78
|
-
- [ ] Tasks are in logical implementation order
|
|
79
|
-
- [ ] No task requires information not in design/spec
|
|
80
|
-
- [ ] No task says "update X as needed" (must be specific)
|
|
81
|
-
|
|
82
|
-
**Delta Specs**
|
|
83
|
-
- [ ] Cover all changed/added behavior
|
|
84
|
-
- [ ] ADDED/MODIFIED/REMOVED sections used correctly
|
|
85
|
-
- [ ] No conflicts with main `openspec/specs/`
|
|
61
|
+
**Task self-sufficiency**
|
|
62
|
+
- [ ] A blind implementer can execute each task from Files/Do/Done-when alone, without reading design.md
|
|
86
63
|
|
|
87
64
|
**Vue 3** (when `project.stack: vue3` in `.agents/orchestrator.yaml`)
|
|
88
65
|
- [ ] Components use `<script setup>` + Composition API (no Options API)
|
|
@@ -91,7 +68,7 @@ Evaluate each item. Mark ✓ or ✗:
|
|
|
91
68
|
- [ ] Tasks reference concrete component/store paths under `src/`
|
|
92
69
|
- [ ] No scope creep into unrelated UI refactors
|
|
93
70
|
|
|
94
|
-
###
|
|
71
|
+
### 5. Write and report the verdict
|
|
95
72
|
|
|
96
73
|
#### If all ✓ (or only minor notes):
|
|
97
74
|
|
|
@@ -131,11 +108,13 @@ Create or update `openspec/changes/<name>/review.md`:
|
|
|
131
108
|
<optional notes>
|
|
132
109
|
```
|
|
133
110
|
|
|
134
|
-
|
|
111
|
+
On **APPROVE**, `spec-reviewer` also writes `openspec/changes/<name>/apply-notes.md` (≤ 20 lines): critical constraints, pitfalls, what NOT to touch, verification commands. It is the distilled input for `/opsx:apply` and the **second allowed file** next to `review.md`.
|
|
112
|
+
|
|
113
|
+
For **REQUEST CHANGES**, write only `review.md` with `Verdict: REQUEST CHANGES` and the issues list.
|
|
135
114
|
|
|
136
|
-
|
|
115
|
+
`review.md` (always) and `apply-notes.md` (on APPROVE) are the **only files** you may write during review (not `src/`, not `tasks.md` checkboxes).
|
|
137
116
|
|
|
138
|
-
The conductor verifies the subagent's `Status: done`, checks that `review.md` exists with the reported verdict, and relays the result without editing
|
|
117
|
+
The conductor verifies the subagent's `Status: done`, checks that `review.md` exists with the reported verdict (and `apply-notes.md` on APPROVE), and relays the result without editing them.
|
|
139
118
|
|
|
140
119
|
#### If any ✗:
|
|
141
120
|
|
|
@@ -162,19 +141,12 @@ Fix the above, then re-run `/opsx:review <name>`.
|
|
|
162
141
|
|
|
163
142
|
## Session Exit (HARD STOP)
|
|
164
143
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
1. Spawn `session-handoff` in persist mode (Amp: isolated `subagent-session-handoff`). If spawn fails, persist in the parent — never skip.
|
|
168
|
-
2. Write `openspec/changes/<name>/handoff.md` with: Closed role, Change, Done, Decisions, Blocked, Next command, Next role, Attach, Subagents to spawn, Constraints.
|
|
169
|
-
3. Run `npx agent-orchestrator-kit handoff <name>` and require exit 0. The CLI upserts Memory JSON (absolute path) and prints the expanded self-contained prompt on stdout.
|
|
170
|
-
4. If Memory MCP tools work, also update `Change:<name>`, `Handoff:<name>`, and new `Decision:*`.
|
|
171
|
-
5. Paste CLI stdout into chat as one fenced block beginning with the next `/opsx:*` command (`/opsx:apply <name>` only after APPROVE). Keep it complete. No banner.
|
|
172
|
-
6. Stop. Do not start the next phase in this chat.
|
|
144
|
+
Close via the canonical Session Exit protocol in `.agents/rules/session-handoff.mdc`. First line of the pasted prompt is the next `/opsx:*` command (`/opsx:apply <name>` only after APPROVE). Do not start the next phase in this chat.
|
|
173
145
|
|
|
174
146
|
## Guardrails
|
|
175
147
|
|
|
176
148
|
- **Never** edit source code, `src/`, or `tasks.md` checkboxes
|
|
177
|
-
- **May write only** `openspec/changes/<name>/review.md` (verdict record for apply gate)
|
|
149
|
+
- **May write only** `openspec/changes/<name>/review.md` (verdict record for apply gate) and, on APPROVE, `openspec/changes/<name>/apply-notes.md`
|
|
178
150
|
- **Never** run apply commands
|
|
179
151
|
- Ask for clarification only if a critical artifact is missing or unreadable
|
|
180
152
|
- If proposal is ambiguous on scope, flag as ✗ — do not assume intent
|
|
@@ -7,6 +7,8 @@ description: Sync delta specs from a change to main specs
|
|
|
7
7
|
|
|
8
8
|
Sync delta specs from a change to main specs.
|
|
9
9
|
|
|
10
|
+
If run as a standalone `/opsx:*` session, follow the canonical Session Start / Session Exit protocol in `.agents/rules/session-handoff.mdc`.
|
|
11
|
+
|
|
10
12
|
This is an **agent-driven** operation - you will read delta specs and directly edit main specs to apply the changes. This allows intelligent merging (e.g., adding a scenario without copying the entire requirement).
|
|
11
13
|
|
|
12
14
|
**Input**: Optionally specify a change name after `/opsx:sync` (e.g., `/opsx:sync add-auth`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# GitHub Personal Access Token (local only — never commit this file)
|
|
2
|
+
# Create: GitHub → Settings → Developer settings → Personal access tokens
|
|
3
|
+
# Recommended scopes: repo (private) or public_repo, plus pull requests as needed
|
|
4
|
+
#
|
|
5
|
+
# 1. Copy: cp .agents/github.local.env.example .agents/github.local.env
|
|
6
|
+
# 2. Paste your token below (do NOT paste it into AI chat)
|
|
7
|
+
# 3. Restart Cursor / Amp after saving
|
|
8
|
+
# 4. Check: npx agent-orchestrator-kit status
|
|
9
|
+
|
|
10
|
+
GITHUB_PERSONAL_ACCESS_TOKEN=
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# GitLab Personal Access Token (local only — never commit this file)
|
|
2
|
+
# Create: GitLab → Preferences → Access Tokens (api or read_api as needed)
|
|
3
|
+
# Self-hosted: set GITLAB_API_URL to https://<hostname>/api/v4
|
|
4
|
+
# mcp-setup writes GITLAB_API_URL from git remote origin when it detects GitLab
|
|
5
|
+
#
|
|
6
|
+
# 1. Copy: cp .agents/gitlab.local.env.example .agents/gitlab.local.env
|
|
7
|
+
# 2. Paste your token below (do NOT paste it into AI chat)
|
|
8
|
+
# 3. Restart Cursor / Amp after saving
|
|
9
|
+
# 4. Check: npx agent-orchestrator-kit status
|
|
10
|
+
|
|
11
|
+
GITLAB_PERSONAL_ACCESS_TOKEN=
|
|
12
|
+
GITLAB_API_URL=
|
|
@@ -7,6 +7,18 @@
|
|
|
7
7
|
"figma": {
|
|
8
8
|
"command": "node",
|
|
9
9
|
"args": ["scripts/figma-mcp-launcher.cjs"]
|
|
10
|
+
},
|
|
11
|
+
"github": {
|
|
12
|
+
"command": "node",
|
|
13
|
+
"args": ["scripts/github-mcp-launcher.cjs"]
|
|
14
|
+
},
|
|
15
|
+
"gitlab": {
|
|
16
|
+
"command": "node",
|
|
17
|
+
"args": ["scripts/gitlab-mcp-launcher.cjs"]
|
|
18
|
+
},
|
|
19
|
+
"browser": {
|
|
20
|
+
"command": "node",
|
|
21
|
+
"args": ["scripts/browser-mcp-launcher.cjs"]
|
|
10
22
|
}
|
|
11
23
|
}
|
|
12
24
|
}
|
|
@@ -10,22 +10,21 @@ Spec-driven pipeline. Read `.agents/orchestrator.yaml`. Details: skill `agent-or
|
|
|
10
10
|
## Commands
|
|
11
11
|
`/opsx:explore` read-only · `/opsx:design <name>` brief+assets only · `/opsx:propose <name>` change artifacts · `/opsx:review <name>` review.md · `/opsx:apply <name>` code (blocked without Approve when `require_spec_review`) · `/opsx:quick <name>` MVP propose+apply · `/opsx:archive`
|
|
12
12
|
|
|
13
|
-
The parent `/opsx:*` session is the **conductor**.
|
|
14
|
-
|
|
15
|
-
|
|
|
16
|
-
|
|
17
|
-
| Status / gate / next command | `openspec-guide` |
|
|
18
|
-
| Restore
|
|
19
|
-
| Broken kit / MCP / sync | `setup-doctor` |
|
|
20
|
-
| `/opsx:explore` | `codebase-explorer` |
|
|
21
|
-
| `/opsx:design` | `design-intake` |
|
|
22
|
-
| `/opsx:propose` | `spec-architect` |
|
|
23
|
-
| `/opsx:review` | `spec-reviewer` |
|
|
24
|
-
| Apply + design brief/Figma/image | `design-implementer` |
|
|
25
|
-
| Apply
|
|
26
|
-
| Apply
|
|
27
|
-
|
|
|
28
|
-
| `/opsx:archive` | `spec-archiver` |
|
|
13
|
+
The parent `/opsx:*` session is the **conductor**. Delegation is differentiated by phase: propose/review MUST spawn their specialist; apply is parent-driven with optional subagents; archive is a CLI call with phase subagents forbidden. Only the parent marks `tasks.md`. `spec-reviewer` ≠ `code-reviewer`.
|
|
14
|
+
|
|
15
|
+
| Phase / signal | Subagent | Status |
|
|
16
|
+
|--------|------------|--------|
|
|
17
|
+
| Status / gate / next command | `openspec-guide` | optional |
|
|
18
|
+
| Restore/persist when handoff CLI failed | `session-handoff` | fallback only |
|
|
19
|
+
| Broken kit / MCP / sync | `setup-doctor` | on signal |
|
|
20
|
+
| `/opsx:explore` | `codebase-explorer` | mandatory |
|
|
21
|
+
| `/opsx:design` | `design-intake` | mandatory |
|
|
22
|
+
| `/opsx:propose` | `spec-architect` | mandatory |
|
|
23
|
+
| `/opsx:review` (after `gate-check --review` passes) | `spec-reviewer` | mandatory |
|
|
24
|
+
| Apply + design brief/Figma/image | `design-implementer` | mandatory on signal |
|
|
25
|
+
| Apply: ≥ 2 independent tasks, no shared files, or explicit request | `code-writer` / `test-writer` | optional |
|
|
26
|
+
| Apply pre-PR | `code-reviewer` | optional |
|
|
27
|
+
| `/opsx:archive` | — use `npx agent-orchestrator-kit archive <name>` | CLI; subagent forbidden (`spec-archiver` = CLI-failure fallback only) |
|
|
29
28
|
|
|
30
29
|
## Session
|
|
31
30
|
Start: honor pasted `/opsx:*` → `npx agent-orchestrator-kit status` → `handoff --restore`. Spawn `session-handoff` restore **only if** restore CLI failed or printed no briefing (Amp: isolated `subagent-session-handoff`). Then spawn the phase specialist isolated. Free-form continue → `Handoff.next_command`.
|
|
@@ -9,4 +9,4 @@ If `.mcp.json` / `.amp/settings.json` lacks `memory`, or `MEMORY_FILE_PATH` is r
|
|
|
9
9
|
|
|
10
10
|
Use `node scripts/memory-mcp-launcher.cjs` (no relative `MEMORY_FILE_PATH`). Shared file: `.cursor/memory.json` (gitignored). Do not delete other MCP servers.
|
|
11
11
|
|
|
12
|
-
Entities: `Change:<name>` (status, tasks n/m, last_role, review) · `Handoff:<name>` (next_role, next_command, session_count, summary, blocked) · `Decision:<topic>` (chosen, reason). Writer: `npx agent-orchestrator-kit handoff <name
|
|
12
|
+
Entities: `Change:<name>` (status, tasks n/m, last_role, review) · `Handoff:<name>` (next_role, next_command, session_count, summary, blocked) · `Decision:<topic>` (chosen, reason) — mirror of git-tracked `openspec/changes/<name>/decisions.md` (file → Memory only; never Memory → file). Writer: `npx agent-orchestrator-kit handoff <name>` (same command appends `decisions.md`). Notify once: “Memory MCP connected.”
|
|
@@ -1,28 +1,33 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
2
|
+
description: Canonical Session Start and Session Exit protocol for every /opsx:* session
|
|
3
3
|
alwaysApply: true
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# Session Handoff — HARD STOP
|
|
6
|
+
# Session Handoff — canonical protocol (HARD STOP)
|
|
7
7
|
|
|
8
|
-
A `/opsx:*` session is incomplete without persist + the fenced next-thread prompt. FORBIDDEN until persist succeeds: done/готово, next phase, or omitting the prompt.
|
|
8
|
+
This rule is the single source of the Session Start / Session Exit protocol. Commands reference it; they do not duplicate it. A `/opsx:*` session is incomplete without persist + the fenced next-thread prompt. FORBIDDEN until persist succeeds: done/готово, next phase, or omitting the prompt.
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
Agents (local or cloud) write session artifacts only to git-tracked paths — never `/tmp`, never gitignored caches.
|
|
11
|
+
|
|
12
|
+
## Session Start (before any work)
|
|
13
|
+
1. Honor pasted `/opsx:<phase> <name>` and announce the role.
|
|
12
14
|
2. `npx agent-orchestrator-kit status`
|
|
13
|
-
3. `npx agent-orchestrator-kit handoff --restore` (or `handoff <name> --restore`)
|
|
14
|
-
4.
|
|
15
|
-
5.
|
|
16
|
-
6.
|
|
17
|
-
7.
|
|
18
|
-
8. Free-form continue/next/«далі» with one active change → execute `Handoff.next_command`.
|
|
15
|
+
3. `npx agent-orchestrator-kit handoff --restore` (or `handoff <name> --restore`). The CLI briefing is canonical — it already reads memory.json and handoff.md; accumulated decisions print from git-tracked `openspec/changes/<name>/decisions.md`, not from Memory. No separate Memory MCP read step.
|
|
16
|
+
4. If the restore CLI failed → read `openspec/changes/<name>/handoff.md` directly.
|
|
17
|
+
5. Spawn `session-handoff` in restore mode ONLY if both the CLI and handoff.md are unavailable (Amp: isolated `subagent-session-handoff`). This is a fallback, never a routine step.
|
|
18
|
+
6. Free-form continue/next/«далі» with one active change → execute `Handoff.next_command`.
|
|
19
|
+
7. Only then start phase work (spawn a specialist when the phase routing requires one).
|
|
19
20
|
|
|
20
|
-
## Exit (order)
|
|
21
|
-
1.
|
|
22
|
-
2.
|
|
23
|
-
3. `
|
|
24
|
-
4.
|
|
21
|
+
## Session Exit (order)
|
|
22
|
+
1. The parent writes `openspec/changes/<name>/handoff.md` itself: Closed role, Change, Done, Decisions, Blocked, Next command, Next role, Attach, Subagents to spawn, Constraints, Runtime.
|
|
23
|
+
2. `npx agent-orchestrator-kit handoff <name>` — require exit 0 (appends non-empty Decisions into append-only `openspec/changes/<name>/decisions.md`, upserts absolute-path Memory JSON, prints the expanded prompt on stdout). `decisions.md` is the git canon of change decisions; Memory `Decision:*` is a file→Memory mirror only. Cloud sessions pass `--runtime cloud` (or set `AOK_RUNTIME=cloud` / `AOK_AGENT_ID` in the cloud-agent environment).
|
|
24
|
+
3. Spawn `session-handoff` in persist mode ONLY if step 2 failed (Amp: isolated `subagent-session-handoff`). Fallback, never routine.
|
|
25
|
+
4. Memory MCP is an optional mirror: if tools are available, update `Change:<name>`, `Handoff:<name>`, `Decision:*` in one call; unavailability never blocks closing.
|
|
25
26
|
5. Paste CLI stdout as one fenced block. First line `/opsx:…`. Body uses `project.agent_language`. Self-contained (Done/Decisions/Blocked/spawn/HARD STOP). No banner.
|
|
26
|
-
6.
|
|
27
|
+
6. If runtime is cloud: after persist, `git add openspec/changes/<name>/` → `git commit` → `git push` → `npx agent-orchestrator-kit handoff <name> --cloud-check` (exit 0 required). Closing without this is an incomplete handoff. Persist prints these steps on stderr; the CLI never runs `git commit` / `git push`.
|
|
28
|
+
7. Stop. Next role = new chat.
|
|
29
|
+
|
|
30
|
+
## Archive exception
|
|
31
|
+
`npx agent-orchestrator-kit archive <name>` writes the final `handoff.md` (`next_command: none`) in the archive folder and upserts memory itself. After a successful archive no fenced next-prompt is required — the pipeline is complete.
|
|
27
32
|
|
|
28
33
|
Memory MCP: launcher `node scripts/memory-mcp-launcher.cjs`, never a relative `MEMORY_FILE_PATH`.
|
|
@@ -42,26 +42,25 @@ Read `.agents/orchestrator.yaml` for project-specific config (language, flags, M
|
|
|
42
42
|
| Quick (MVP) | `/opsx:quick <name>` | specs+code | strong | `openspec/changes/` + `src/` |
|
|
43
43
|
| Verifier | CI / local scripts | — | — | exit codes |
|
|
44
44
|
|
|
45
|
-
## Conductor Routing (
|
|
46
|
-
|
|
47
|
-
The parent `/opsx:*` session is the conductor.
|
|
48
|
-
|
|
49
|
-
| Phase / signal |
|
|
50
|
-
|
|
51
|
-
| Status, gate failure, next command | `openspec-guide` |
|
|
52
|
-
|
|
|
53
|
-
| Broken kit, MCP, or generated-file sync | `setup-doctor` |
|
|
54
|
-
| `/opsx:explore` repository investigation | `codebase-explorer` |
|
|
55
|
-
| `/opsx:design` | `design-intake` |
|
|
56
|
-
| `/opsx:propose` | `spec-architect` |
|
|
57
|
-
| `/opsx:review` | `spec-reviewer` |
|
|
58
|
-
| Apply task with design brief/Figma/image | `design-implementer` |
|
|
59
|
-
| Apply
|
|
60
|
-
| Apply
|
|
61
|
-
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
`spec-reviewer` is not `code-reviewer`. During apply, specialists MUST NOT edit `tasks.md`; only the conductor may mark a checkbox after a `Status: done` report and verification that the reported files exist.
|
|
45
|
+
## Conductor Routing (Differentiated by Phase)
|
|
46
|
+
|
|
47
|
+
The parent `/opsx:*` session is the conductor. Delegation cost must match phase uncertainty: **propose and review MUST spawn their specialist** (the parent never writes artifacts or the verdict); **apply is parent-driven** — the parent writes code and tests itself from `tasks.md` + `apply-notes.md`, subagents are optional; **archive is one CLI call** — phase subagents are forbidden.
|
|
48
|
+
|
|
49
|
+
| Phase / signal | Subagent | Status |
|
|
50
|
+
|----------------|------------|--------|
|
|
51
|
+
| Status, gate failure, next command | `openspec-guide` | optional |
|
|
52
|
+
| Restore/persist when handoff CLI failed | `session-handoff` | fallback only |
|
|
53
|
+
| Broken kit, MCP, or generated-file sync | `setup-doctor` | on signal |
|
|
54
|
+
| `/opsx:explore` repository investigation | `codebase-explorer` | mandatory |
|
|
55
|
+
| `/opsx:design` | `design-intake` | mandatory |
|
|
56
|
+
| `/opsx:propose` | `spec-architect` | mandatory |
|
|
57
|
+
| `/opsx:review` (Tier 2, after `gate-check --review` passes) | `spec-reviewer` | mandatory |
|
|
58
|
+
| Apply task with design brief/Figma/image | `design-implementer` | mandatory on signal |
|
|
59
|
+
| Apply: ≥ 2 independent tasks with no shared files, or explicit user request | `code-writer` / `test-writer` | optional |
|
|
60
|
+
| Apply before PR/MR | `code-reviewer` | optional |
|
|
61
|
+
| `/opsx:archive` | — run `npx agent-orchestrator-kit archive <name>` | CLI; phase subagent forbidden (`spec-archiver` = CLI-failure fallback only) |
|
|
62
|
+
|
|
63
|
+
`spec-reviewer` is not `code-reviewer`. Spawned specialists MUST NOT edit `tasks.md`; the parent checks a box only after verifying the task's Done-when condition. If an apply task requires information beyond its Files/Do/Done-when contract + `apply-notes.md` + referenced artifacts, STOP: record the gap in `handoff.md` and route back to `/opsx:propose <name>` — improvisation is forbidden.
|
|
65
64
|
|
|
66
65
|
## Handoff Protocol
|
|
67
66
|
|
|
@@ -127,13 +126,14 @@ After PR merged + CI green:
|
|
|
127
126
|
```
|
|
128
127
|
/opsx:archive <name>
|
|
129
128
|
```
|
|
129
|
+
Archive is one deterministic CLI call — `npx agent-orchestrator-kit archive <name> [--sync | --no-sync --force]` — which checks gates, merges delta specs on `--sync`, moves the change to the dated archive, validates with rollback, and writes the final handoff. No phase subagent.
|
|
130
130
|
|
|
131
131
|
## Session Rules
|
|
132
132
|
|
|
133
133
|
**Start of each session:**
|
|
134
134
|
1. Honor the pasted `/opsx:<phase> <name>` command and announce that role.
|
|
135
135
|
2. Run `npx agent-orchestrator-kit status` (or `npx openspec list --json`) and read `orchestrator.yaml`; resolve the active change and gates.
|
|
136
|
-
3. Run `npx agent-orchestrator-kit handoff --restore` (or `handoff <name> --restore`).
|
|
136
|
+
3. Run `npx agent-orchestrator-kit handoff --restore` (or `handoff <name> --restore`). Accumulated decisions print from git-tracked `openspec/changes/<name>/decisions.md`, not from Memory.
|
|
137
137
|
4. Read Memory entities `Change:<name>`, `Handoff:<name>`, and `Decision:*` when MCP works.
|
|
138
138
|
5. If restore CLI fails and Memory is empty, read `openspec/changes/<name>/handoff.md`; Memory failure alone is not a blocker.
|
|
139
139
|
6. Spawn `session-handoff` in restore mode **only if** `handoff --restore` failed or printed no briefing (Amp: isolated `subagent-session-handoff`). Skip this spawn when CLI restore exits 0.
|
|
@@ -145,12 +145,11 @@ After PR merged + CI green:
|
|
|
145
145
|
- Never edit files outside your role's allowed output
|
|
146
146
|
|
|
147
147
|
**End of each session (HARD STOP — you are NOT done):**
|
|
148
|
-
1.
|
|
149
|
-
2.
|
|
150
|
-
3.
|
|
151
|
-
4.
|
|
152
|
-
5.
|
|
153
|
-
6. Do not start the next phase in this chat. If apply, include build/lint status in the persisted Done section.
|
|
148
|
+
1. Write `openspec/changes/<name>/handoff.md` in the parent using the template below.
|
|
149
|
+
2. Run `npx agent-orchestrator-kit handoff <name>` and require exit 0. The CLI appends non-empty Decisions into append-only `openspec/changes/<name>/decisions.md` (the git canon), upserts Memory JSON with an absolute path (`Decision:*` is a file→Memory mirror only), and prints the expanded self-contained prompt on stdout. Spawn `session-handoff` in persist mode ONLY if this CLI step failed.
|
|
150
|
+
3. If Memory MCP tools are available, mirror `Change:<name>`, `Handoff:<name>`, and new `Decision:<topic>` entities in one call — optional; its absence never blocks closing.
|
|
151
|
+
4. Paste the CLI stdout as one fenced next-session prompt. First line is `/opsx:<next> <name>`; body uses `project.agent_language`; keep Done/Decisions/Blocked/spawn/HARD STOP complete. No banner. Do not emit a thin “read Memory” stub.
|
|
152
|
+
5. Do not start the next phase in this chat. If apply, include build/lint status in the persisted Done section.
|
|
154
153
|
|
|
155
154
|
`handoff.md` template:
|
|
156
155
|
|
|
@@ -194,6 +193,10 @@ After PR merged + CI green:
|
|
|
194
193
|
- do not mix phases
|
|
195
194
|
- conductor must spawn specialists
|
|
196
195
|
|
|
196
|
+
## Runtime
|
|
197
|
+
- runtime: <local | cloud>
|
|
198
|
+
- agent_id: <id | none>
|
|
199
|
+
|
|
197
200
|
## Prompt
|
|
198
201
|
|
|
199
202
|
The Prompt section is overwritten by `npx agent-orchestrator-kit handoff <name>`. Do not hand-write a thin stub.
|
|
@@ -213,9 +216,9 @@ The Prompt section is overwritten by `npx agent-orchestrator-kit handoff <name>`
|
|
|
213
216
|
|
|
214
217
|
## Mandatory Memory and Handoff Protocol
|
|
215
218
|
|
|
216
|
-
Before specialist work, the
|
|
219
|
+
Before specialist work, the parent MUST restore context in order: honor the pasted `/opsx:*` command; run `npx agent-orchestrator-kit handoff --restore` (the CLI briefing is canonical — no separate Memory MCP read step); if the CLI failed, read `openspec/changes/<name>/handoff.md`; spawn `session-handoff` in restore mode ONLY when both failed. Missing Memory MCP never blocks a session. With one active change, free-form “continue” uses `Handoff.next_command` instead of asking for the phase. Amp spawns any needed subagent as an isolated `subagent-*` skill.
|
|
217
220
|
|
|
218
|
-
Before declaring a session closed, the
|
|
221
|
+
Before declaring a session closed, the parent MUST, in order: (1) write `openspec/changes/<name>/handoff.md` itself, (2) run `npx agent-orchestrator-kit handoff <name>` (exit 0) — this CLI appends `decisions.md` and mirrors `Decision:*` file→Memory; spawn `session-handoff` persist ONLY if this CLI step failed, (3) paste the CLI stdout prompt whose first line is `/opsx:<next> <name>`. Memory MCP mirroring is an optional single call. Never write Memory back into `decisions.md`. The prompt has no `NEXT_SESSION_PROMPT` label, uses `project.agent_language`, and MUST be self-contained (Done, Decisions, Blocked, attach, spawn, HARD STOP) so the next thread can run if Memory MCP is ignored. Never start the next phase in the current chat. Write session artifacts only to git-tracked paths (never `/tmp`, never gitignored caches). If runtime is cloud: after persist, commit → push → `npx agent-orchestrator-kit handoff <name> --cloud-check` with exit 0; closing without that is an incomplete handoff.
|
|
219
222
|
|
|
220
223
|
| Entity | Required fields |
|
|
221
224
|
|--------|-----------------|
|
|
@@ -13,7 +13,9 @@ Implement tasks from an OpenSpec change.
|
|
|
13
13
|
|
|
14
14
|
**Input**: Optionally specify a change name. If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
|
|
15
15
|
|
|
16
|
-
**
|
|
16
|
+
**Parent-driven apply:** the parent reads `tasks.md` + `apply-notes.md` (open `design.md`/`proposal.md` only when a task explicitly references them or a contract field is incomplete) and writes code and tests itself, task by task, checking its own `tasks.md` checkboxes. Subagents are optional: spawn `code-writer`/`test-writer` for ≥ 2 independent tasks with no shared files (parallelization) or on explicit user request. `design-implementer` remains mandatory for tasks with a design-brief/Figma signal.
|
|
17
|
+
|
|
18
|
+
**Escape valve (STOP — improvisation is forbidden):** if a task requires information beyond its Files/Do/Done-when + `apply-notes.md` + artifacts it explicitly references, STOP: record the gap in `handoff.md`, set the next command to `/opsx:propose <name>` (plan amendment), and end the session. Do not guess.
|
|
17
19
|
|
|
18
20
|
**Steps**
|
|
19
21
|
|
|
@@ -54,12 +56,9 @@ Implement tasks from an OpenSpec change.
|
|
|
54
56
|
|
|
55
57
|
**Workspace guard:** If status JSON reports `actionContext.mode: "workspace-planning"` and `allowedEditRoots` is empty, explain that full workspace apply is not supported in this slice. Treat linked repos and folders as read-only context, ask the user to select an affected area through an explicit implementation workflow, and STOP before editing files.
|
|
56
58
|
|
|
57
|
-
4. **Read
|
|
59
|
+
4. **Read the working set**
|
|
58
60
|
|
|
59
|
-
Read
|
|
60
|
-
The files depend on the schema being used:
|
|
61
|
-
- **spec-driven**: proposal, specs, design, tasks
|
|
62
|
-
- Other schemas: follow the contextFiles from CLI output
|
|
61
|
+
Read `tasks.md` and `apply-notes.md` — they are the primary input for apply. Open `design.md`, `proposal.md`, or delta specs only when a task explicitly references them or a contract field is incomplete. For non-spec-driven schemas, follow `contextFiles` from the CLI output.
|
|
63
62
|
|
|
64
63
|
5. **Show current progress**
|
|
65
64
|
|
|
@@ -73,15 +72,13 @@ Implement tasks from an OpenSpec change.
|
|
|
73
72
|
|
|
74
73
|
For each pending task:
|
|
75
74
|
- Show which task is being worked on
|
|
76
|
-
-
|
|
77
|
-
- Verify
|
|
78
|
-
-
|
|
79
|
-
- Only then, as conductor, mark the task complete in the tasks file: `- [ ]` → `- [x]`
|
|
75
|
+
- Implement it in the parent session from its Files/Do/Done-when contract (spawn `code-writer`/`test-writer` only for ≥ 2 independent tasks with no shared files, or on explicit user request; `design-implementer` for design-brief/Figma tasks)
|
|
76
|
+
- Verify the task's Done-when condition actually holds
|
|
77
|
+
- Mark the task complete in the tasks file: `- [ ]` → `- [x]`
|
|
80
78
|
- Continue to next task
|
|
81
79
|
|
|
82
|
-
**
|
|
83
|
-
-
|
|
84
|
-
- Implementation reveals a design issue → suggest updating artifacts
|
|
80
|
+
**STOP (escape valve) if:**
|
|
81
|
+
- The task requires information beyond its contract + `apply-notes.md` + referenced artifacts → record the gap in `handoff.md`, next command `/opsx:propose <name>` — never improvise
|
|
85
82
|
- Error or blocker encountered → report and wait for guidance
|
|
86
83
|
- User interrupts
|
|
87
84
|
|
|
@@ -146,13 +143,11 @@ What would you like to do?
|
|
|
146
143
|
|
|
147
144
|
**Guardrails**
|
|
148
145
|
- Keep going through tasks until done or blocked
|
|
149
|
-
- Always read
|
|
150
|
-
- If task is
|
|
151
|
-
-
|
|
152
|
-
-
|
|
153
|
-
-
|
|
154
|
-
- Pause on errors, blockers, or unclear requirements - don't guess
|
|
155
|
-
- Use contextFiles from CLI output, don't assume specific file names
|
|
146
|
+
- Always read `tasks.md` + `apply-notes.md` before starting
|
|
147
|
+
- If a task contract is insufficient, STOP via the escape valve — don't guess or improvise
|
|
148
|
+
- Keep code changes minimal and scoped to each task's `Files:` list
|
|
149
|
+
- Never let a spawned specialist update `tasks.md`; the parent checks a box only after verifying Done-when
|
|
150
|
+
- Pause on errors and blockers
|
|
156
151
|
|
|
157
152
|
**Fluid Workflow Integration**
|
|
158
153
|
|