agent-orchestrator-kit 0.1.12 → 0.1.13

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.
Files changed (37) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/README.md +54 -28
  3. package/bin/agent-orchestrator.js +2 -0
  4. package/package.json +2 -2
  5. package/profiles/generic/orchestrator.yaml +3 -0
  6. package/profiles/mvp/orchestrator.yaml +3 -0
  7. package/profiles/node/orchestrator.yaml +3 -0
  8. package/profiles/vue3/orchestrator.yaml +3 -0
  9. package/templates/.agents/commands/opsx-apply.md +15 -4
  10. package/templates/.agents/commands/opsx-archive.md +21 -7
  11. package/templates/.agents/commands/opsx-design.md +21 -5
  12. package/templates/.agents/commands/opsx-explore.md +12 -2
  13. package/templates/.agents/commands/opsx-propose.md +22 -6
  14. package/templates/.agents/commands/opsx-quick.md +18 -2
  15. package/templates/.agents/commands/opsx-review.md +20 -4
  16. package/templates/.agents/rules/agent-orchestration.mdc +39 -0
  17. package/templates/.agents/rules/memory-mcp-autosetup.mdc +13 -6
  18. package/templates/.agents/skills/agent-orchestration/SKILL.md +72 -15
  19. package/templates/.agents/skills/openspec-apply-change/SKILL.md +7 -4
  20. package/templates/.agents/skills/openspec-archive-change/SKILL.md +13 -7
  21. package/templates/.agents/skills/openspec-explore/SKILL.md +4 -2
  22. package/templates/.agents/skills/openspec-propose/SKILL.md +14 -6
  23. package/templates/.agents/subagents/code-reviewer.md +12 -1
  24. package/templates/.agents/subagents/code-writer.md +13 -2
  25. package/templates/.agents/subagents/codebase-explorer.md +31 -0
  26. package/templates/.agents/subagents/design-implementer.md +13 -2
  27. package/templates/.agents/subagents/design-intake.md +31 -0
  28. package/templates/.agents/subagents/openspec-guide.md +12 -1
  29. package/templates/.agents/subagents/setup-doctor.md +11 -2
  30. package/templates/.agents/subagents/spec-architect.md +32 -0
  31. package/templates/.agents/subagents/spec-archiver.md +31 -0
  32. package/templates/.agents/subagents/spec-reviewer.md +32 -0
  33. package/templates/.agents/subagents/test-writer.md +13 -2
  34. package/templates/AGENTS.md +32 -3
  35. package/templates/CLAUDE.md +21 -0
  36. package/templates/orchestrator.yaml +3 -0
  37. package/templates/scripts/sync-local-agent-skills.sh +2 -0
package/CHANGELOG.md CHANGED
@@ -4,6 +4,16 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.1.13] - 2026-08-13
8
+
9
+ ### Added
10
+ - **Pipeline subagent conductor** — every `/opsx:*` parent session now delegates through an exclusive phase/signal routing table, with five new stage specialists for explore, design, propose, spec review, and archive (`codebase-explorer`, `design-intake`, `spec-architect`, `spec-reviewer`, `spec-archiver`)
11
+ - **Durable session handoff** — sessions restore and persist `Change:*`, `Handoff:*`, and `Decision:*` Memory entities, mirror state in `openspec/changes/<name>/handoff.md`, and emit one next-session prompt in `project.agent_language` (no service banner, no duplicated summary)
12
+
13
+ ### Changed
14
+ - Amp `subagent-*` wrappers now require isolated fresh-context execution and return only a structured specialist report
15
+ - OpenSpec commands, orchestration rules, skills, profiles, and documentation now enforce conductor-only task marking and phase separation
16
+
7
17
  ## [0.1.12] - 2026-07-21
8
18
 
9
19
  ### Added
package/README.md CHANGED
@@ -13,7 +13,7 @@ A portable kit that installs a **role-separated AI pipeline** into any project:
13
13
  explore → [design] → propose → review → apply → verify → archive
14
14
  ```
15
15
 
16
- Each role runs in a **separate agent session** with dedicated permissions, model hints, and handoff gates. The `openspec/changes/` folder acts as the **contract between agents** no shared memory between sessions, only files.
16
+ Each role runs in a **separate agent session**. The parent `/opsx:*` session is a conductor: it restores state, spawns the routed specialist, verifies its report, and does not perform specialist work itself. OpenSpec files remain the requirements/tasks source of truth; Memory MCP and `openspec/changes/<name>/handoff.md` index phase state and the next command.
17
17
 
18
18
  **Figma PAT setup (v0.1.11+)** — local `.agents/figma.local.env` + MCP launcher (token never in chat / committed MCP JSON). See [Figma token](#figma-token-optional).
19
19
 
@@ -27,10 +27,26 @@ Each role runs in a **separate agent session** with dedicated permissions, model
27
27
  | `test-writer` | Automated tests for recently changed code |
28
28
  | `setup-doctor` | Orchestrator / MCP / sync diagnosis and repair |
29
29
  | `design-implementer` | Pixel-accurate Figma / screenshot → production UI |
30
+ | `codebase-explorer` | Read-only repository investigation for explore |
31
+ | `design-intake` | Design source → durable brief + assets |
32
+ | `spec-architect` | Proposal, design, delta specs, and tasks |
33
+ | `spec-reviewer` | Pre-apply artifact gate + `review.md` |
34
+ | `spec-archiver` | Delta merge and completed-change archive |
35
+
36
+ The conductor uses one exclusive route per signal:
37
+
38
+ | Phase / signal | Subagent |
39
+ |----------------|----------|
40
+ | Status / gates / next command | `openspec-guide` |
41
+ | Kit / MCP / sync repair | `setup-doctor` |
42
+ | Explore repository research | `codebase-explorer` |
43
+ | Design / propose / spec review | `design-intake` / `spec-architect` / `spec-reviewer` |
44
+ | Apply UI / ordinary task / tests / pre-PR review | `design-implementer` / `code-writer` / `test-writer` / `code-reviewer` |
45
+ | Archive | `spec-archiver` |
30
46
 
31
47
  - **Cursor** → `.cursor/agents/` (native subagents)
32
48
  - **Claude Code** → `.claude/agents/` (native subagents)
33
- - **Amp Code** → auto-generated `subagent-*` skill wrappers in `.agents/skills/` (Amp has no file-based subagents)
49
+ - **Amp Code** → auto-generated `subagent-*` skill wrappers in `.agents/skills/`; each wrapper requires the parent to spawn an isolated subagent, never execute it in the main thread
34
50
 
35
51
  Works with:
36
52
  - [Cursor](https://cursor.sh) — via `.cursor/rules/` + `.cursor/skills/` + `.cursor/agents/`
@@ -55,7 +71,7 @@ npx agent-orchestrator-kit@latest init --profile generic --ci gitlab --spec-veri
55
71
 
56
72
  See [Installation](#installation) for profile/CI options.
57
73
 
58
- **🔄 Already have the kit installed? Upgrade to latest (Figma PAT in v0.1.11+, subagents in v0.1.10+):**
74
+ **🔄 Already have the kit installed? Upgrade to latest (conductor + session handoff in v0.1.13+, Figma PAT in v0.1.11+):**
59
75
 
60
76
  ```bash
61
77
  npx agent-orchestrator-kit@latest update
@@ -146,9 +162,9 @@ your-project/
146
162
  │ ├── orchestrator.yaml
147
163
  │ ├── mcp.json.example # Cursor MCP template
148
164
  │ ├── amp.settings.json.example # Amp MCP template
149
- │ ├── commands/ # 6 /opsx:* commands
150
- │ ├── rules/ # 3 auto-applied rules
151
- │ ├── subagents/ # 6 default custom subagents (Cursor/Claude/Amp)
165
+ │ ├── commands/ # /opsx:* role commands
166
+ │ ├── rules/ # auto-applied orchestration rules
167
+ │ ├── subagents/ # 11 stage/custom subagents (Cursor/Claude/Amp)
152
168
  │ └── skills/
153
169
  │ ├── agent-orchestration/ # Pipeline orchestration
154
170
  │ ├── openspec-howto/
@@ -169,7 +185,7 @@ your-project/
169
185
  | Orchestration | 5-role pipeline, `AGENTS.md`, `orchestrator.yaml`, review command |
170
186
  | OpenSpec skills | All 7 skills for `/opsx:*` workflow |
171
187
  | IDE sync | Cursor + Claude Code sync script (`--delete` semantics — removes stale skills/subagents) |
172
- | Subagents | `openspec-guide`, `code-writer`, `code-reviewer`, `test-writer`, `setup-doctor`, `design-implementer` — native in Cursor (`.cursor/agents/`) + Claude Code (`.claude/agents/`), exposed to Amp as auto-generated `subagent-*` skill wrappers in `.agents/skills/` |
188
+ | Subagents | 11 exclusive routes: guide/setup, explore/design/propose/review/archive stage agents, and apply implementation/test/code-review agents — native in Cursor + Claude Code, isolated Amp `subagent-*` wrappers |
173
189
  | CLI gates | `npx agent-orchestrator-kit status` / `gate-check` — deterministic review-gate checks (always via `npx`; see `cli-via-npm.mdc`) |
174
190
  | CI | `agent-verify.yml` — GitHub (default) or GitLab fragment + `prebuild` hook, both run `gate-check` |
175
191
  | AI Spec Verifier | `spec-verify.yml` + verifier scripts — GitLab or GitHub, opt-in (`--spec-verify`) |
@@ -205,7 +221,7 @@ cp .agents/amp.settings.json.example .amp/settings.json
205
221
 
206
222
  Or run `./scripts/sync-local-agent-skills.sh` — it creates `.amp/settings.json` automatically.
207
223
 
208
- **Subagents in Amp:** Amp has no file-based custom subagents (only skills and plugin agents), so the kit exposes every `.agents/subagents/<name>.md` as an auto-generated skill `subagent-<name>` in `.agents/skills/`. These wrappers are committed to git, so Amp picks them up with zero local setup just say "use the subagent-design-implementer skill" or let Amp auto-load it from the description. Edit the source file in `.agents/subagents/` (never the wrapper) and re-run `sync` to regenerate.
224
+ **Subagents in Amp:** the kit exposes every `.agents/subagents/<name>.md` as an auto-generated `subagent-<name>` skill. The conductor MUST run the wrapper as an isolated subagent with fresh context and MUST NOT execute its body in the main thread. Edit only the source file and re-run `sync` to regenerate wrappers.
209
225
 
210
226
  4. Use commands directly:
211
227
 
@@ -237,7 +253,7 @@ Switch modes in Amp CLI: `Ctrl+O` → `mode`.
237
253
  - `.claude/skills/` — all skills from `.agents/skills/` (excluding Amp `subagent-*` wrappers)
238
254
  - `.claude/agents/` — custom subagents from `.agents/subagents/` (native Claude Code subagents)
239
255
  3. Skills are auto-loaded by Claude Code from `.claude/skills/`.
240
- 4. Invoke directly: `/agent-orchestration`, `/openspec-howto`, etc. Subagents are delegated automatically by description or on request ("use the design-implementer subagent").
256
+ 4. Invoke `/opsx:*` or the orchestration skill. The conductor delegates using the mandatory phase/signal routing table rather than relying on description-only selection.
241
257
 
242
258
  **CLAUDE.md tiers used:**
243
259
  - Project level: `.claude/CLAUDE.md` (synced from `CLAUDE.md`)
@@ -262,10 +278,10 @@ You can add `context: fork` to explore/review skills for isolated subagent sessi
262
278
  2. Creates:
263
279
  - `.cursor/skills/` — all skills
264
280
  - `.cursor/rules/` — `.mdc` rule files
265
- - `.cursor/agents/` — custom subagents (`openspec-guide`, `code-writer`, `code-reviewer`, `test-writer`, `setup-doctor`, `design-implementer`)
281
+ - `.cursor/agents/` — all 11 custom/stage subagents
266
282
  - `.mcp.json` — from `mcp.json.example` (if not present)
267
283
  3. Rules are applied automatically per `alwaysApply: true`.
268
- 4. Subagents are invoked by name in chat (e.g. "use the code-reviewer subagent on this diff") or delegated to automatically by Cursor when their `description` matches the task. Add project-specific subagents by dropping `.md` files into `.agents/subagents/` and re-running sync.
284
+ 4. `/opsx:*` sessions use the mandatory conductor routing table to spawn subagents. Add project-specific subagents in `.agents/subagents/`, add an exclusive route, and re-run sync.
269
285
 
270
286
  **Memory + optional Figma MCP for Cursor** (`.mcp.json`):
271
287
 
@@ -295,6 +311,8 @@ Token lives in `.agents/figma.local.env` — see [Figma token](#figma-token-opti
295
311
  **Model:** fast/cheap.
296
312
  **Purpose:** Understand the problem. Surface options. Choose a direction.
297
313
 
314
+ The conductor spawns `codebase-explorer` for repository investigation and stays read-only.
315
+
298
316
  **Exit criteria (before starting Architect):**
299
317
  - Problem stated in 3–5 sentences
300
318
  - 2–3 solution options + recommendation
@@ -313,6 +331,8 @@ Token lives in `.agents/figma.local.env` — see [Figma token](#figma-token-opti
313
331
  **Model:** strong reasoning.
314
332
  **Purpose:** Create all change artifacts: proposal, design, tasks, delta specs.
315
333
 
334
+ The conductor spawns `spec-architect`; it does not write artifacts in the parent session.
335
+
316
336
  **Exit gate:**
317
337
  ```bash
318
338
  npx openspec validate <name> --strict --type change # must be ✓
@@ -330,6 +350,8 @@ npx openspec validate <name> --strict --type change # must be ✓
330
350
  **Model:** medium or strong.
331
351
  **Purpose:** Review artifacts. Output **Approve ✓** or **Request Changes ✗**.
332
352
 
353
+ The conductor spawns `spec-reviewer` (not `code-reviewer`) and verifies its `review.md`.
354
+
333
355
  Checks:
334
356
  - Acceptance criteria are testable
335
357
  - Tasks ≤ ~2 hours each
@@ -346,7 +368,7 @@ Checks:
346
368
 
347
369
  ### Role 4: Implementer — `/opsx:apply <name>`
348
370
 
349
- **Mode:** writes `src/`. Marks `tasks.md [x]`.
371
+ **Mode:** conductor; routed specialists write `src/` and tests. Only the conductor marks `tasks.md [x]` after a verified `Status: done` report.
350
372
  **Model:** strong. Use fast for simple mechanical tasks.
351
373
  **Purpose:** Implement tasks. One session = 1–3 tasks (not all 15 at once).
352
374
 
@@ -640,21 +662,18 @@ npx agent-orchestrator-kit figma-setup
640
662
 
641
663
  ## Memory MCP — Shared State Between Sessions
642
664
 
643
- Each role starts a fresh session. Memory MCP persists orchestration state across sessions so you don't re-explain context every time.
665
+ Each role starts a fresh session. OpenSpec artifacts remain the source of truth; Memory MCP and `openspec/changes/<name>/handoff.md` are the phase index used to resume without re-explanation.
644
666
 
645
667
  **Standard entities to save:**
646
668
 
647
669
  ```
648
- Change:add-bulk-export status: spec-approved, tasks: 0/7
670
+ Change:add-bulk-export status: spec-approved, tasks: 0/7, last_role: reviewer, review: APPROVE
649
671
  Decision:export-format chosen: xlsx, reason: matches existing reports
650
- Convention:api-errors use ApiError class, not raw Error
651
- Handoff:add-bulk-export next_role: implementer, session_count: 1
672
+ Handoff:add-bulk-export next_role: implementer, next_command: /opsx:apply add-bulk-export,
673
+ session_count: 2, summary: ..., blocked: none
652
674
  ```
653
675
 
654
- At the start of each implementer/reviewer session, read relevant memory:
655
- ```
656
- What do we know about Change:add-bulk-export?
657
- ```
676
+ Every `/opsx:*` session reads `Change:<name>`, `Handoff:<name>`, and `Decision:*` before specialist work, falling back to `handoff.md` if Memory is unavailable. At exit it writes Memory, mirrors `handoff.md`, then prints one fenced prompt beginning `/opsx:*`, localized to `project.agent_language`, with no service banner or duplicated summary. The next phase always starts in a new chat.
658
677
 
659
678
  ## Amp Code — Deep Integration Notes
660
679
 
@@ -667,21 +686,22 @@ Amp is the **primary target** of this kit. It reads `.agents/skills/` and `AGENT
667
686
  | `AGENTS.md` subtree loading | Per-domain AGENTS.md in `openspec/` subtree |
668
687
  | `.agents/skills/` | All orchestration + domain skills |
669
688
  | `mcp.json` in skill dir | Lazy MCP loading (Memory only when needed) |
670
- | Subagents | Explore and Review skills use forked subagents |
689
+ | Subagents | Conductor routing + isolated `subagent-*` wrappers |
671
690
  | Amp modes (rush/smart/deep) | Per-role model hints in AGENTS.md |
672
691
 
673
- **Amp subagent in skill** (`.agents/skills/openspec-explore/SKILL.md`):
692
+ **Amp generated wrapper** (`.agents/skills/subagent-codebase-explorer/SKILL.md`):
674
693
 
675
694
  ```yaml
676
695
  ---
677
- name: openspec-explore
678
- description: Enter explore mode — read-only thinking partner
679
- disable-model-invocation: false
680
- allowed-tools: Read, Bash
696
+ name: subagent-codebase-explorer
697
+ description: Read-only repository research specialist...
681
698
  ---
699
+
700
+ Parent MUST spawn this skill as an isolated subagent with fresh context.
701
+ Do not execute it in the main thread.
682
702
  ```
683
703
 
684
- Amp will run this skill as a subagent when invoked.
704
+ The conductor invokes the wrapper in isolation and consumes only its structured report.
685
705
 
686
706
  **Team workflow with Amp:**
687
707
 
@@ -750,11 +770,17 @@ CLAUDE.md # Committed — synced to .claude/CLAUDE.md
750
770
  openspec/ # Committed — spec-driven workflow
751
771
  config.yaml # Project context for AI
752
772
  specs/ # Source of truth after archive
753
- changes/ # Active work
773
+ changes/ # Active work; <name>/handoff.md indexes session state
754
774
  ```
755
775
 
756
776
  ## Changelog
757
777
 
778
+ ### 0.1.13
779
+ - Pipeline **conductor**: `/opsx:*` parent spawns the routed specialist and does not do that work itself
780
+ - Five new stage subagents: `codebase-explorer`, `design-intake`, `spec-architect`, `spec-reviewer`, `spec-archiver`
781
+ - Session handoff: Memory → `handoff.md` → next-session prompt in `project.agent_language` (read Memory on start)
782
+ - Amp `subagent-*` wrappers must run as isolated subagents, not in the main thread
783
+
758
784
  ### 0.1.12
759
785
  - `figma-fetch --depth <n>` for large frames
760
786
  - Write large Figma JSON as raw API text (avoids `Invalid string length` on huge trees)
@@ -643,6 +643,8 @@ function generateAmpSubagentSkills(projectDir) {
643
643
  '',
644
644
  `<!-- AUTO-GENERATED from .agents/subagents/${file} — edit the source file, then run: npx agent-orchestrator-kit sync -->`,
645
645
  '',
646
+ 'Parent MUST spawn this skill as an isolated subagent with fresh context. Do not execute it in the main thread. Return only the structured subagent report.',
647
+ '',
646
648
  parsed[2].trim(),
647
649
  '',
648
650
  ].join('\n');
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "agent-orchestrator-kit",
3
- "version": "0.1.12",
4
- "description": "Universal AI agent orchestration kit for Cursor, Claude Code, and Amp Code — spec-driven OpenSpec pipeline, cross-IDE subagents, and optional local Figma PAT setup (figma-setup / figma-status / figma-fetch)",
3
+ "version": "0.1.13",
4
+ "description": "Universal AI agent orchestration kit for Cursor, Claude Code, and Amp Code — spec-driven OpenSpec pipeline, conductor subagents, session handoff, and optional local Figma PAT setup",
5
5
  "keywords": [
6
6
  "ai-agent",
7
7
  "cursor",
@@ -44,6 +44,9 @@ handoff:
44
44
  propose_to_review: validate_strict
45
45
  review_to_apply: explicit_approve
46
46
  apply_to_verify: all_tasks_checked
47
+ restore_on_start: true
48
+ persist_on_exit: true
49
+ emit_next_session_prompt: true
47
50
 
48
51
  memory:
49
52
  enabled: true
@@ -51,6 +51,9 @@ handoff:
51
51
  explore_to_propose: decision_brief
52
52
  propose_to_apply: validate_or_quick
53
53
  apply_to_verify: all_tasks_checked
54
+ restore_on_start: true
55
+ persist_on_exit: true
56
+ emit_next_session_prompt: true
54
57
 
55
58
  memory:
56
59
  enabled: true
@@ -49,6 +49,9 @@ handoff:
49
49
  propose_to_review: validate_strict
50
50
  review_to_apply: explicit_approve
51
51
  apply_to_verify: all_tasks_checked
52
+ restore_on_start: true
53
+ persist_on_exit: true
54
+ emit_next_session_prompt: true
52
55
 
53
56
  memory:
54
57
  enabled: true
@@ -48,6 +48,9 @@ handoff:
48
48
  propose_to_review: validate_strict
49
49
  review_to_apply: explicit_approve
50
50
  apply_to_verify: all_tasks_checked
51
+ restore_on_start: true
52
+ persist_on_exit: true
53
+ emit_next_session_prompt: true
51
54
 
52
55
  memory:
53
56
  enabled: true
@@ -5,10 +5,16 @@ category: Workflow
5
5
  description: Implement tasks from an OpenSpec change (Experimental)
6
6
  ---
7
7
 
8
+ ## Session Start (Before Any Work)
9
+
10
+ Honor the pasted command and announce the Implementer role. Run `npx agent-orchestrator-kit status` or `npx openspec list --json`, then read Memory `Change:<name>`, `Handoff:<name>`, and `Decision:*`. If Memory is unavailable or empty, read `openspec/changes/<name>/handoff.md`; this fallback is not a blocker. For free-form “continue” / “next” with one active change, execute its `Handoff.next_command` instead of asking for the phase. Only then continue and spawn specialists.
11
+
8
12
  Implement tasks from an OpenSpec change.
9
13
 
10
14
  **Input**: Optionally specify a change name (e.g., `/opsx:apply add-auth`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
11
15
 
16
+ **Conductor delegation is mandatory:** the parent MUST NOT implement code or tests. For each task spawn `design-implementer` when a design brief/Figma/image signal exists, otherwise `code-writer`; after implementation spawn `test-writer` when tests are required, and before PR/MR spawn `code-reviewer`. Require each structured report. Only the conductor may edit `tasks.md` checkboxes.
17
+
12
18
  **Steps**
13
19
 
14
20
  1. **Select the change**
@@ -80,9 +86,10 @@ Implement tasks from an OpenSpec change.
80
86
 
81
87
  For each pending task:
82
88
  - Show which task is being worked on
83
- - Make the code changes required
84
- - Keep changes minimal and focused
85
- - Mark task complete in the tasks file: `- [ ]` → `- [x]`
89
+ - Spawn the routed implementation subagent with one self-contained task; do not make code changes in the parent
90
+ - Verify `Status: done` and that every reported file exists
91
+ - Spawn `test-writer` for required test work and verify its report
92
+ - Only then, as conductor, mark the task complete in the tasks file: `- [ ]` → `- [x]`
86
93
  - Continue to next task
87
94
 
88
95
  **Pause if:**
@@ -150,13 +157,17 @@ All tasks complete! You can archive this change with `/opsx:archive`.
150
157
  What would you like to do?
151
158
  ```
152
159
 
160
+ ## Session Exit (Mandatory Order)
161
+
162
+ When apply completes or pauses: (1) attempt to update Memory `Change:<name>`, `Handoff:<name>`, and new `Decision:*`, including task and build/lint status; (2) write `openspec/changes/<name>/handoff.md` using the orchestration skill template even if Memory fails; (3) print one fenced prompt beginning with the next `/opsx:*` role command. Use `project.agent_language`, tell the next session to read Memory and the file fallback, omit banner labels and the full summary. Never start archive in this apply chat.
163
+
153
164
  **Guardrails**
154
165
  - Keep going through tasks until done or blocked
155
166
  - Always read context files before starting (from the apply instructions output)
156
167
  - If task is ambiguous, pause and ask before implementing
157
168
  - If implementation reveals issues, pause and suggest artifact updates
158
169
  - Keep code changes minimal and scoped to each task
159
- - Update task checkbox immediately after completing each task
170
+ - Never let a specialist update `tasks.md`; the conductor updates a checkbox only after a verified `done` report
160
171
  - Pause on errors, blockers, or unclear requirements - don't guess
161
172
  - Use contextFiles from CLI output, don't assume specific file names
162
173
 
@@ -5,10 +5,16 @@ category: Workflow
5
5
  description: Archive a completed change in the experimental workflow
6
6
  ---
7
7
 
8
+ ## Session Start (Before Any Work)
9
+
10
+ Honor the pasted command and announce the Archiver role. Run `npx agent-orchestrator-kit status` or `npx openspec list --json`, then read Memory `Change:<name>`, `Handoff:<name>`, and `Decision:*`. If Memory is unavailable or empty, read `openspec/changes/<name>/handoff.md`; this fallback is not a blocker. For free-form “continue” / “next” with one active change, execute its `Handoff.next_command` instead of asking for the phase. Only then continue and spawn specialists.
11
+
8
12
  Archive a completed change in the experimental workflow.
9
13
 
10
14
  **Input**: Optionally specify a change name after `/opsx:archive` (e.g., `/opsx:archive add-auth`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
11
15
 
16
+ **Conductor delegation is mandatory:** after resolving the change and confirming archive gates, spawn `spec-archiver` with a self-contained prompt. The parent MUST NOT merge main specs or move the change itself; it only verifies the structured report, archive path, and validation result.
17
+
12
18
  **Steps**
13
19
 
14
20
  1. **If no change name provided, prompt for selection**
@@ -51,20 +57,22 @@ Archive a completed change in the experimental workflow.
51
57
 
52
58
  4. **Assess delta spec sync state**
53
59
 
54
- Use `artifactPaths.specs.existingOutputPaths` from status JSON to check for delta specs. If none exist, proceed without sync prompt.
60
+ Use `artifactPaths.specs.existingOutputPaths` from status JSON to identify delta specs. Pass these paths and the user's sync preference to `spec-archiver`; the parent MUST NOT compare or merge specs itself.
55
61
 
56
62
  **If delta specs exist:**
57
- - Compare each delta spec with its corresponding main spec at `openspec/specs/<capability>/spec.md`
58
- - Determine what changes would be applied (adds, modifications, removals, renames)
59
- - Show a combined summary before prompting
63
+ - Ask whether main specs should be synced before archive
64
+ - Include the delta and main spec paths in the `spec-archiver` prompt
65
+ - Have `spec-archiver` return the combined sync summary in its report
60
66
 
61
67
  **Prompt options:**
62
68
  - If changes needed: "Sync now (recommended)", "Archive without syncing"
63
69
  - If already synced: "Archive now", "Sync anyway", "Cancel"
64
70
 
65
- If user chooses sync, use Task tool (subagent_type: "general-purpose", prompt: "Use Skill tool to invoke openspec-sync-specs for change '<name>'. Delta spec analysis: <include the analyzed delta spec summary>"). Proceed to archive regardless of choice.
71
+ The `spec-archiver` performs any requested comparison and sync as part of its isolated work; do not spawn a generic sync agent.
72
+
73
+ 5. **Spawn the specialist and perform the archive**
66
74
 
67
- 5. **Perform the archive**
75
+ Spawn `spec-archiver`, require `## Subagent report: spec-archiver`, and delegate the sync/archive operations below. Do not run them in the parent session.
68
76
 
69
77
  Create an `archive` directory under `planningHome.changesDir` if it doesn't exist:
70
78
  ```bash
@@ -81,7 +89,9 @@ Archive a completed change in the experimental workflow.
81
89
  mv "<changeRoot>" "<planningHome.changesDir>/archive/YYYY-MM-DD-<name>"
82
90
  ```
83
91
 
84
- 6. **Display summary**
92
+ 6. **Verify the report and display summary**
93
+
94
+ The conductor verifies `Status: done`, the reported archive path, and modified main specs before reporting completion.
85
95
 
86
96
  Show archive completion summary including:
87
97
  - Change name
@@ -150,6 +160,10 @@ Target archive directory already exists.
150
160
  3. Wait until a different date to archive
151
161
  ```
152
162
 
163
+ ## Session Exit (Mandatory Order)
164
+
165
+ Before closing archive: (1) attempt to update Memory `Change:<name>`, `Handoff:<name>`, and new `Decision:*`; (2) write the final handoff state at the archived change path using the orchestration skill template even if Memory fails; (3) when another role is required, print one fenced `/opsx:*` prompt using `project.agent_language`, Memory keys, and the file fallback, without a banner label or duplicated summary. Do not start another phase in this chat.
166
+
153
167
  **Guardrails**
154
168
  - Always prompt for change selection if not provided
155
169
  - Use artifact graph (openspec status --json) for completion checking
@@ -5,12 +5,18 @@ category: Workflow
5
5
  description: Capture design from any source into a durable design brief for an OpenSpec change
6
6
  ---
7
7
 
8
+ ## Session Start (Before Any Work)
9
+
10
+ Honor the pasted command and announce the Design Intake role. Run `npx agent-orchestrator-kit status` or `npx openspec list --json`, then read Memory `Change:<name>`, `Handoff:<name>`, and `Decision:*`. If Memory is unavailable or empty, read `openspec/changes/<name>/handoff.md`; this fallback is not a blocker. For free-form “continue” / “next” with one active change, execute its `Handoff.next_command` instead of asking for the phase. Only then continue and spawn specialists.
11
+
8
12
  Capture design into a durable brief for an OpenSpec change. One-shot intake from Figma, exports, screenshots, or photos — then apply never needs live design tools.
9
13
 
10
14
  **IMPORTANT: You must NEVER edit any file in `src/` or any source code. You may write only `openspec/changes/<name>/design-brief.md` and files under `openspec/changes/<name>/assets/`.**
11
15
 
12
16
  **Input**: Optionally specify a change name (e.g., `/opsx:design add-login-form`). If omitted, auto-select if one active change exists, otherwise list and ask. If the change does not exist yet, create the change directory when writing the brief (after explore chose the name).
13
17
 
18
+ **Conductor delegation is mandatory:** after resolving the change and source, spawn `design-intake` with a self-contained prompt. The parent MUST NOT inspect the design source or write the brief/assets itself; it only verifies the structured report and reported files.
19
+
14
20
  ---
15
21
 
16
22
  ## Steps
@@ -24,7 +30,11 @@ If name provided — use it. Otherwise:
24
30
 
25
31
  Announce: "Design intake for change: **<name>**"
26
32
 
27
- ### 2. Choose source (fallback ladder)
33
+ ### 2. Spawn the specialist
34
+
35
+ Spawn `design-intake` and delegate steps 3–6 below. Require `## Subagent report: design-intake`. Do not perform those steps in the parent session.
36
+
37
+ ### 3. Choose source (fallback ladder)
28
38
 
29
39
  Use the first available source; do not climb the ladder twice:
30
40
 
@@ -35,14 +45,14 @@ Use the first available source; do not climb the ladder twice:
35
45
 
36
46
  Ask the user for the source if unclear. Prefer Figma when a `figma.com` URL is given.
37
47
 
38
- ### 3. Capture into assets/
48
+ ### 4. Capture into assets/
39
49
 
40
50
  Save reference images under `openspec/changes/<name>/assets/`:
41
51
  - Prefer compressed PNG; ~1–2 images per breakpoint
42
52
  - Do not commit raw video, PSD, or huge originals
43
53
  - Name files clearly: `desktop.png`, `mobile.png`, `hero-detail.png`
44
54
 
45
- ### 4. Write design-brief.md
55
+ ### 5. Write design-brief.md
46
56
 
47
57
  Create or overwrite `openspec/changes/<name>/design-brief.md` using this template:
48
58
 
@@ -89,14 +99,16 @@ Create or overwrite `openspec/changes/<name>/design-brief.md` using this templat
89
99
  - Inferred (screenshot/photo): mark each inferred value with a confidence marker, e.g. `~8px (medium confidence)` or `color ≈ #1a1a1a (low confidence)`
90
100
  ```
91
101
 
92
- ### 5. Confidence markers for raster sources
102
+ ### 6. Confidence markers for raster sources
93
103
 
94
104
  When the source is a **screenshot** or **photo** (not Figma MCP / vector export):
95
105
  - Do not present guessed spacing, colors, or type sizes as facts
96
106
  - Mark every inferred token/value with a confidence note in **Confidence notes** and inline in **Tokens** where useful
97
107
  - Prefer ranges or approximations over fake precision
98
108
 
99
- ### 6. Handoff
109
+ ### 7. Verify report and handoff
110
+
111
+ The conductor verifies `Status: done` and that every reported brief/asset path exists, then outputs the handoff summary.
100
112
 
101
113
  Output a short summary:
102
114
 
@@ -116,6 +128,10 @@ For non-UI changes: do not invent a brief. Tell the Architect to add a line `Des
116
128
 
117
129
  ---
118
130
 
131
+ ## Session Exit (Mandatory Order)
132
+
133
+ Before closing design: (1) attempt to update Memory `Change:<name>`, `Handoff:<name>`, and new `Decision:*`; (2) write `openspec/changes/<name>/handoff.md` using the orchestration skill template even if Memory fails; (3) print one fenced prompt beginning `/opsx:propose <name>`. Use `project.agent_language`, tell the next session to read Memory and the file fallback, omit banner labels and the full summary. Do not start propose in this chat.
134
+
119
135
  ## Guardrails
120
136
 
121
137
  - **Never** edit source code or `src/`
@@ -5,9 +5,15 @@ category: Workflow
5
5
  description: "Enter explore mode - think through ideas, investigate problems, clarify requirements"
6
6
  ---
7
7
 
8
+ ## Session Start (Before Any Work)
9
+
10
+ Honor the pasted command and announce the Explorer role. Run `npx agent-orchestrator-kit status` or `npx openspec list --json`, then read Memory `Change:<name>`, `Handoff:<name>`, and `Decision:*`. If Memory is unavailable or empty, read `openspec/changes/<name>/handoff.md`; this fallback is not a blocker. For free-form “continue” / “next” with one active change, execute its `Handoff.next_command` instead of asking for the phase. Only then continue and spawn specialists.
11
+
8
12
  Enter explore mode. Think deeply. Visualize freely. Follow the conversation wherever it goes.
9
13
 
10
- **IMPORTANT: Explore mode is for thinking, not implementing.** You may read files, search code, and investigate the codebase, but you must NEVER write code or implement features. If the user asks you to implement something, remind them to exit explore mode first and create a change proposal. You MAY create OpenSpec artifacts (proposals, designs, specs) if the user asks—that's capturing thinking, not implementing.
14
+ **IMPORTANT: Explore mode is read-only thinking, not implementation or artifact authoring.** You may discuss evidence returned by the specialist, but you must NEVER write code or OpenSpec artifacts. If the user asks you to implement or formalize the change, end explore with a handoff to a fresh propose session.
15
+
16
+ **Conductor delegation is mandatory:** for any repository investigation, spawn `codebase-explorer` with a self-contained question and require its structured report. Do not search or trace the codebase in the parent session, and do not let the subagent write specs or code. The parent may synthesize the report and continue the exploratory conversation.
11
17
 
12
18
  **This is a stance, not a workflow.** There are no fixed steps, no required sequence, no mandatory outputs. You're a thinking partner helping the user explore.
13
19
 
@@ -160,9 +166,13 @@ When things crystallize, you might offer a summary - but it's optional. Sometime
160
166
 
161
167
  ---
162
168
 
169
+ ## Session Exit (Mandatory Order)
170
+
171
+ Before closing explore: (1) attempt to update Memory `Change:<name>`, `Handoff:<name>`, and new `Decision:*`; (2) write `openspec/changes/<name>/handoff.md` using the orchestration skill template even if Memory fails; (3) print one fenced prompt whose first line is the chosen `/opsx:design <name>` or `/opsx:propose <name>`. Use `project.agent_language`, tell the next session to read Memory and the file fallback, omit banner labels and the full summary. Do not start that phase in this chat.
172
+
163
173
  ## Guardrails
164
174
 
165
- - **Don't implement** - Never write code or implement features. Creating OpenSpec artifacts is fine, writing application code is not.
175
+ - **Don't implement or author artifacts** - Never write code or OpenSpec files in explore.
166
176
  - **Don't fake understanding** - If something is unclear, dig deeper
167
177
  - **Don't rush** - Discovery is thinking time, not task time
168
178
  - **Don't force structure** - Let patterns emerge naturally
@@ -5,6 +5,10 @@ category: Workflow
5
5
  description: Propose a new change - create it and generate all artifacts in one step
6
6
  ---
7
7
 
8
+ ## Session Start (Before Any Work)
9
+
10
+ Honor the pasted command and announce the Architect role. Run `npx agent-orchestrator-kit status` or `npx openspec list --json`, then read Memory `Change:<name>`, `Handoff:<name>`, and `Decision:*`. If Memory is unavailable or empty, read `openspec/changes/<name>/handoff.md`; this fallback is not a blocker. For free-form “continue” / “next” with one active change, execute its `Handoff.next_command` instead of asking for the phase. Only then continue and spawn specialists.
11
+
8
12
  Propose a new change - create the change and generate all artifacts in one step.
9
13
 
10
14
  I'll create a change with artifacts:
@@ -18,6 +22,8 @@ When ready to implement, run /opsx:apply
18
22
 
19
23
  **Input**: The argument after `/opsx:propose` is the change name (kebab-case), OR a description of what the user wants to build.
20
24
 
25
+ **Conductor delegation is mandatory:** spawn `spec-architect` with the resolved name, decision brief, design brief if present, and artifact instructions. The parent MUST NOT create or edit proposal/design/specs/tasks; after the structured report it may only verify files, run status, and run strict validation.
26
+
21
27
  **Steps**
22
28
 
23
29
  1. **If no input provided, ask what they want to build**
@@ -29,13 +35,17 @@ When ready to implement, run /opsx:apply
29
35
 
30
36
  **IMPORTANT**: Do NOT proceed without understanding what the user wants to build.
31
37
 
32
- 2. **Create the change directory**
38
+ 2. **Spawn the specialist**
39
+
40
+ Spawn `spec-architect` with a self-contained prompt and require `## Subagent report: spec-architect`. Delegate steps 3–5 to it; do not perform artifact creation in the parent session.
41
+
42
+ 3. **Create the change directory**
33
43
  ```bash
34
44
  npx openspec new change "<name>"
35
45
  ```
36
46
  This creates a scaffolded change in the planning home resolved by the CLI with `.openspec.yaml`.
37
47
 
38
- 3. **Get the artifact build order**
48
+ 4. **Get the artifact build order**
39
49
  ```bash
40
50
  npx openspec status --change "<name>" --json
41
51
  ```
@@ -44,7 +54,7 @@ When ready to implement, run /opsx:apply
44
54
  - `artifacts`: list of all artifacts with their status and dependencies
45
55
  - `planningHome`, `changeRoot`, `artifactPaths`, and `actionContext`: path and scope context. Use these instead of assuming repo-local paths.
46
56
 
47
- 4. **Create artifacts in sequence until apply-ready**
57
+ 5. **Create artifacts in sequence until apply-ready**
48
58
 
49
59
  Use the **TodoWrite tool** to track progress through the artifacts.
50
60
 
@@ -76,7 +86,9 @@ When ready to implement, run /opsx:apply
76
86
  - Use **AskUserQuestion tool** to clarify
77
87
  - Then continue with creation
78
88
 
79
- 5. **Show final status**
89
+ 6. **Verify the report and show final status**
90
+
91
+ The conductor verifies `Status: done` and each reported artifact path, then runs:
80
92
  ```bash
81
93
  npx openspec status --change "<name>"
82
94
  ```
@@ -86,8 +98,12 @@ When ready to implement, run /opsx:apply
86
98
  After completing all artifacts, summarize:
87
99
  - Change name and location
88
100
  - List of artifacts created with brief descriptions
89
- - What's ready: "All artifacts created! Ready for implementation."
90
- - Prompt: "Run `/opsx:apply` to start implementing."
101
+ - What's ready: "All artifacts created and validated! Ready for spec review."
102
+ - Prompt: "Run `/opsx:review <name>` in a fresh session."
103
+
104
+ ## Session Exit (Mandatory Order)
105
+
106
+ After strict validation passes: (1) attempt to update Memory `Change:<name>`, `Handoff:<name>`, and new `Decision:*`; (2) write `openspec/changes/<name>/handoff.md` using the orchestration skill template even if Memory fails; (3) print one fenced prompt beginning `/opsx:review <name>`. Use `project.agent_language`, tell the next session to read Memory and the file fallback, omit banner labels and the full summary. Do not start review in this chat.
91
107
 
92
108
  **Artifact Creation Guidelines**
93
109