agent-orchestrator-kit 0.1.14 → 0.2.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 +3 -0
- package/package.json +1 -1
- package/templates/.agents/rules/agent-orchestration.mdc +28 -75
- package/templates/.agents/rules/figma-token-setup.mdc +1 -1
- package/templates/.agents/rules/memory-mcp-autosetup.mdc +4 -67
- package/templates/.agents/rules/session-handoff.mdc +23 -41
- package/templates/.agents/skills/agent-orchestration/SKILL.md +1 -1
- package/templates/AGENTS.md +22 -124
- package/templates/CLAUDE.md +6 -68
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,9 @@ All notable changes to this project will be documented in this file.
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
### Changed
|
|
8
|
+
- **Context budget** — thinned always-apply rules and `AGENTS.md` / `CLAUDE.md`; details stay in on-demand skills. `figma-token-setup.mdc` is no longer `alwaysApply`. Restore spawn of `session-handoff` is skipped when `handoff --restore` already printed a briefing.
|
|
9
|
+
|
|
7
10
|
## [0.1.14] - 2026-08-13
|
|
8
11
|
|
|
9
12
|
### Added
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-orchestrator-kit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Universal AI agent orchestration kit for Cursor, Claude Code, and Amp Code — spec-driven OpenSpec pipeline, conductor subagents, durable session handoff CLI, and optional local Figma PAT setup",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai-agent",
|
|
@@ -5,78 +5,31 @@ alwaysApply: true
|
|
|
5
5
|
|
|
6
6
|
# Agent Orchestration Rules
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
##
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
|
24
|
-
|
|
25
|
-
|
|
|
26
|
-
|
|
|
27
|
-
|
|
|
28
|
-
| `/opsx:
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
| `/opsx:archive` | `spec-archiver` | Delta merge and archive move |
|
|
37
|
-
|
|
38
|
-
`spec-reviewer` is never interchangeable with `code-reviewer`. During apply, only the conductor may mark a `tasks.md` checkbox, and only after a subagent reports `Status: done` and the conductor verifies the reported files.
|
|
39
|
-
|
|
40
|
-
## Session Start Protocol (Before Any Specialist Work)
|
|
41
|
-
|
|
42
|
-
1. Honor the pasted `/opsx:<phase> <name>` command and announce that role.
|
|
43
|
-
2. Run `npx agent-orchestrator-kit status` or `npx openspec list --json`; resolve the active change without exceeding `max_active_changes`.
|
|
44
|
-
3. Run `npx agent-orchestrator-kit handoff --restore` (or `handoff <name> --restore`). Use the printed briefing.
|
|
45
|
-
4. Read Memory entities `Change:<name>`, `Handoff:<name>`, and `Decision:*` when MCP works.
|
|
46
|
-
5. If restore CLI fails and Memory is empty, read `openspec/changes/<name>/handoff.md`. Memory failure alone MUST NOT block the session when the file exists.
|
|
47
|
-
6. Spawn `session-handoff` in restore mode when context is incomplete (Amp: isolated `subagent-session-handoff`, never the main thread).
|
|
48
|
-
7. Only after context is restored, spawn the routed phase specialist. Amp MUST spawn `subagent-<name>` isolated.
|
|
49
|
-
|
|
50
|
-
If the user says “continue” / “next” / «продовжуй» / «далі» without a command and exactly one active change has `Handoff.next_command` (from Memory, CLI restore, or `handoff.md`), execute that command instead of asking which phase to run.
|
|
51
|
-
|
|
52
|
-
Follow `.agents/rules/session-handoff.mdc`.
|
|
53
|
-
|
|
54
|
-
## Session Exit Protocol (HARD STOP)
|
|
55
|
-
|
|
56
|
-
A phase is not closed until the conductor performs these steps in order. FORBIDDEN: saying done/готово, starting the next phase, or omitting the fenced prompt.
|
|
57
|
-
|
|
58
|
-
1. Spawn `session-handoff` in persist mode (Amp: isolated `subagent-session-handoff`). If spawn fails, persist in the parent — never skip.
|
|
59
|
-
2. Write `openspec/changes/<name>/handoff.md` with sections **Closed role**, **Change**, **Done**, **Decisions**, **Blocked**, **Next command**, **Next role**, **Attach**, **Subagents to spawn**, and **Constraints**. Do this even if Memory MCP is unavailable.
|
|
60
|
-
3. Run `npx agent-orchestrator-kit handoff <name>` and require exit 0. The CLI upserts `.cursor/memory.json` with an absolute path and prints the expanded self-contained next-session prompt on stdout.
|
|
61
|
-
4. If Memory MCP tools work, also update `Change:<name>` (`status`, `tasks n/m`, `last_role`, `review`), `Handoff:<name>` (`next_role`, `next_command`, `session_count`, `summary`, `blocked`), and each new `Decision:<topic>` (`chosen`, `reason`).
|
|
62
|
-
5. Paste the CLI stdout as one fenced copy/paste prompt. First line MUST be `/opsx:<next> <name>`; body MUST use `project.agent_language`; MUST keep Done/Decisions/Blocked/spawn/HARD STOP complete. Do not add a banner or shorten the prompt. Amp often skips Memory MCP — the pasted prompt is the next thread's operating brief.
|
|
63
|
-
6. Do NOT start the next phase in this chat.
|
|
64
|
-
|
|
65
|
-
## Session Rules
|
|
66
|
-
- One active change at a time (unless mvp profile: up to 3)
|
|
67
|
-
- Each role = new chat session (except `/opsx:quick` combines propose+apply)
|
|
68
|
-
- No code in explore, design, or review sessions
|
|
69
|
-
- Design Intake may write only `openspec/changes/<name>/design-brief.md` and `assets/`
|
|
70
|
-
- No apply without review when `pipeline.require_spec_review: true` — check `review.md` or Approve in context
|
|
71
|
-
- When `require_design_brief: true` and the change touches UI — need `design-brief.md`, or `Design: none` in `proposal.md` for non-UI
|
|
72
|
-
- Apply uses the design brief, not live Figma MCP
|
|
73
|
-
- After apply: build + lint before PR
|
|
74
|
-
- After merge: run `/opsx:archive` (when `archive_after_merge: true`)
|
|
75
|
-
- CLI: `npx agent-orchestrator-kit status`, `npx openspec …` — never bare globals (see `cli-via-npm.mdc`)
|
|
76
|
-
|
|
77
|
-
## Never
|
|
78
|
-
- Mix propose and apply in one session
|
|
79
|
-
- Edit `src/` during explore, design, or review
|
|
80
|
-
- Skip spec review before apply
|
|
81
|
-
- Call live Figma MCP during apply when a design brief exists
|
|
82
|
-
- Leave changes un-archived after merge
|
|
8
|
+
Spec-driven pipeline. Read `.agents/orchestrator.yaml`. Details: skill `agent-orchestration`. Handoff: `.agents/rules/session-handoff.mdc`. CLI: `npx` only (`.agents/rules/cli-via-npm.mdc`).
|
|
9
|
+
|
|
10
|
+
## Commands
|
|
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
|
+
|
|
13
|
+
The parent `/opsx:*` session is the **conductor**. It MUST spawn the one routed specialist, verify the structured report, and MUST NOT do that specialist's work. Only the conductor marks `tasks.md`, after `Status: done` and file check. `spec-reviewer` ≠ `code-reviewer`.
|
|
14
|
+
|
|
15
|
+
| Signal | MUST spawn |
|
|
16
|
+
|--------|------------|
|
|
17
|
+
| Status / gate / next command | `openspec-guide` |
|
|
18
|
+
| Restore if CLI briefing missing; persist on exit | `session-handoff` |
|
|
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 ordinary task | `code-writer` |
|
|
26
|
+
| Apply tests | `test-writer` |
|
|
27
|
+
| Apply pre-PR | `code-reviewer` |
|
|
28
|
+
| `/opsx:archive` | `spec-archiver` |
|
|
29
|
+
|
|
30
|
+
## Session
|
|
31
|
+
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`.
|
|
32
|
+
|
|
33
|
+
Exit HARD STOP: persist via `session-handoff` → `handoff.md` → `npx agent-orchestrator-kit handoff <name>` (exit 0) → paste CLI stdout as one fenced `/opsx:*` prompt. Do not start the next phase here.
|
|
34
|
+
|
|
35
|
+
Never mix propose+apply (except `/opsx:quick`). No `src/` in explore/design/review. Skip live Figma during apply when a brief exists.
|
|
@@ -3,73 +3,10 @@ description: Memory MCP auto-setup for Cursor and Amp
|
|
|
3
3
|
alwaysApply: true
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# Memory MCP
|
|
6
|
+
# Memory MCP
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
If `memory` MCP is absent or uses a **relative** `MEMORY_FILE_PATH` — run `npx agent-orchestrator-kit memory-setup` silently.
|
|
8
|
+
If `.mcp.json` / `.amp/settings.json` lacks `memory`, or `MEMORY_FILE_PATH` is relative: run `npx agent-orchestrator-kit memory-setup`. Relative paths resolve inside npx `dist/` and look like “memory ignored”.
|
|
10
9
|
|
|
11
|
-
|
|
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.
|
|
12
11
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
## Cursor (.mcp.json)
|
|
16
|
-
|
|
17
|
-
```json
|
|
18
|
-
"memory": {
|
|
19
|
-
"command": "node",
|
|
20
|
-
"args": ["scripts/memory-mcp-launcher.cjs"]
|
|
21
|
-
}
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
## Amp (.amp/settings.json)
|
|
25
|
-
|
|
26
|
-
```json
|
|
27
|
-
"amp.mcpServers": {
|
|
28
|
-
"memory": {
|
|
29
|
-
"command": "node",
|
|
30
|
-
"args": ["scripts/memory-mcp-launcher.cjs"]
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
If Amp CLI is available and memory is missing:
|
|
36
|
-
|
|
37
|
-
```bash
|
|
38
|
-
npx agent-orchestrator-kit memory-setup
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
Do not run `amp mcp add` with a relative `MEMORY_FILE_PATH`.
|
|
42
|
-
|
|
43
|
-
## .gitignore
|
|
44
|
-
|
|
45
|
-
Ensure present (do not duplicate):
|
|
46
|
-
```
|
|
47
|
-
.cursor/memory.json
|
|
48
|
-
.amp/settings.json
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
## Memory Entity Format
|
|
52
|
-
|
|
53
|
-
Use these keys and fields for orchestration state:
|
|
54
|
-
|
|
55
|
-
| Key | Required fields |
|
|
56
|
-
|-----|-----------------|
|
|
57
|
-
| `Change:<name>` | `status`, `tasks n/m`, `last_role`, `review` |
|
|
58
|
-
| `Handoff:<name>` | `next_role`, `next_command`, `session_count`, `summary`, `blocked` |
|
|
59
|
-
| `Decision:<topic>` | `chosen`, `reason` |
|
|
60
|
-
| `Convention:<area>` | project-specific rules |
|
|
61
|
-
|
|
62
|
-
The deterministic writer is `npx agent-orchestrator-kit handoff <name>` — it upserts `.cursor/memory.json` even when MCP tools are ignored. Also call Memory MCP create/update when tools work.
|
|
63
|
-
|
|
64
|
-
## Session Lifecycle
|
|
65
|
-
|
|
66
|
-
At the start of every `/opsx:*` role session, after resolving the change and before specialist work: `npx agent-orchestrator-kit handoff --restore`, then read `Change:<name>`, `Handoff:<name>`, and `Decision:*`. If Memory MCP is unavailable or those entities are empty, read `openspec/changes/<name>/handoff.md` and continue; Memory failure is not a blocker.
|
|
67
|
-
|
|
68
|
-
At session exit, spawn `session-handoff` (Amp: isolated `subagent-session-handoff`), write `handoff.md`, then run `npx agent-orchestrator-kit handoff <name>` (exit 0 required). Paste the CLI stdout prompt complete. Only after that attempt Memory MCP updates. You are not done without the fenced prompt.
|
|
69
|
-
|
|
70
|
-
## Rules
|
|
71
|
-
- Do not overwrite existing correct launcher config
|
|
72
|
-
- Do not delete other MCP servers
|
|
73
|
-
- Notify once: "Memory MCP connected."
|
|
74
|
-
- Never treat unavailable Memory MCP as a reason to skip `handoff.md` or the CLI
|
|
75
|
-
- Never leave a relative `MEMORY_FILE_PATH` in Cursor or Amp config
|
|
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>`. Notify once: “Memory MCP connected.”
|
|
@@ -3,44 +3,26 @@ description: Mandatory session restore, Memory persist, subagent spawn, and next
|
|
|
3
3
|
alwaysApply: true
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# Session Handoff — HARD STOP
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
1. Spawn `session-handoff` in persist mode (Amp: isolated `subagent-session-handoff`). If spawn fails, do the persist steps in the parent — never skip.
|
|
30
|
-
2. Write `openspec/changes/<name>/handoff.md` with: Closed role, Change, Done, Decisions, Blocked, Next command, Next role, Attach, Subagents to spawn, Constraints.
|
|
31
|
-
3. Run `npx agent-orchestrator-kit handoff <name>` and require exit 0. The CLI upserts `.cursor/memory.json` with an absolute path and prints the expanded prompt on stdout.
|
|
32
|
-
4. If Memory MCP tools work, also update `Change:<name>`, `Handoff:<name>`, `Decision:*` to match.
|
|
33
|
-
5. Paste the CLI stdout into chat as one fenced block. Keep it complete. No `NEXT_SESSION_PROMPT` banner. First line is `/opsx:…`. Body uses `project.agent_language`.
|
|
34
|
-
6. Stop. The next role starts in a **new** chat with that pasted prompt.
|
|
35
|
-
|
|
36
|
-
## Next-thread prompt must be self-contained
|
|
37
|
-
|
|
38
|
-
The prompt is the next thread’s operating brief. It MUST include: role, change name, language, hard constraints, start checklist, which subagent to spawn (including Amp isolated wrapper name), full Done / Decisions / Blocked / tasks / review / attach, and the exit HARD STOP. Do not emit a thin “read Memory” stub. Amp often skips Memory MCP; the pasted prompt must still be enough to work.
|
|
39
|
-
|
|
40
|
-
## Memory path
|
|
41
|
-
|
|
42
|
-
Never configure Memory MCP with a relative `MEMORY_FILE_PATH`. Relative `.cursor/memory.json` resolves inside npx `dist/` and looks like “memory ignored”. Use `node scripts/memory-mcp-launcher.cjs` (Cursor `.mcp.json` and Amp `.amp/settings.json`). Run `npx agent-orchestrator-kit memory-setup` when the launcher is missing or the path is relative.
|
|
43
|
-
|
|
44
|
-
## Amp isolation
|
|
45
|
-
|
|
46
|
-
Every `subagent-*` skill MUST be spawned as an isolated subagent with fresh context. Running the wrapper body in the main Amp thread is a protocol violation. If spawn is unavailable, STOP and report blocked — do not impersonate the specialist.
|
|
6
|
+
# Session Handoff — HARD STOP
|
|
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.
|
|
9
|
+
|
|
10
|
+
## Start (before specialist work)
|
|
11
|
+
1. Honor pasted `/opsx:<phase> <name>`.
|
|
12
|
+
2. `npx agent-orchestrator-kit status`
|
|
13
|
+
3. `npx agent-orchestrator-kit handoff --restore` (or `handoff <name> --restore`)
|
|
14
|
+
4. Read Memory `Change:<name>`, `Handoff:<name>`, `Decision:*` when MCP works
|
|
15
|
+
5. If restore CLI failed and Memory is empty → `openspec/changes/<name>/handoff.md`. Memory failure is not a blocker when the file exists.
|
|
16
|
+
6. Spawn `session-handoff` restore **only if** step 3 failed or printed no briefing (Amp: isolated `subagent-session-handoff`). Skip this spawn when CLI restore exit 0.
|
|
17
|
+
7. Spawn the routed phase specialist. Amp: isolated `subagent-<name>`. Do not do specialist work in the parent.
|
|
18
|
+
8. Free-form continue/next/«далі» with one active change → execute `Handoff.next_command`.
|
|
19
|
+
|
|
20
|
+
## Exit (order)
|
|
21
|
+
1. Spawn `session-handoff` persist (Amp isolated). If spawn fails, persist in the parent — never skip.
|
|
22
|
+
2. Write `handoff.md`: Closed role, Change, Done, Decisions, Blocked, Next command, Next role, Attach, Subagents to spawn, Constraints.
|
|
23
|
+
3. `npx agent-orchestrator-kit handoff <name>` — require exit 0 (upserts absolute-path Memory JSON, prints the prompt).
|
|
24
|
+
4. Update Memory entities when tools work.
|
|
25
|
+
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. Stop. Next role = new chat.
|
|
27
|
+
|
|
28
|
+
Memory MCP: launcher `node scripts/memory-mcp-launcher.cjs`, never a relative `MEMORY_FILE_PATH`.
|
|
@@ -136,7 +136,7 @@ After PR merged + CI green:
|
|
|
136
136
|
3. Run `npx agent-orchestrator-kit handoff --restore` (or `handoff <name> --restore`).
|
|
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
|
-
6. Spawn `session-handoff` in restore mode
|
|
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.
|
|
140
140
|
7. Only after restoration, spawn the routed phase specialist. If the user said “continue” / “next” and exactly one active change has `Handoff.next_command`, execute it instead of asking for a phase.
|
|
141
141
|
|
|
142
142
|
**During session:**
|
package/templates/AGENTS.md
CHANGED
|
@@ -2,138 +2,36 @@
|
|
|
2
2
|
|
|
3
3
|
> Powered by [agent-orchestrator-kit](https://github.com/makshc2/agent-orchestrator-kit) v{{KIT_VERSION}}
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
Every feature follows the same cycle regardless of stack or IDE.
|
|
7
|
-
|
|
8
|
-
## Pipeline
|
|
5
|
+
Spec-driven OpenSpec pipeline. Each phase is a **separate chat**. The parent `/opsx:*` session is a **conductor**: restore, spawn the specialist, verify the report — never do specialist work in-thread.
|
|
9
6
|
|
|
10
7
|
```
|
|
11
8
|
explore → [design] → propose → review → apply → verify → archive
|
|
12
9
|
```
|
|
13
10
|
|
|
14
|
-
`[design]` is optional
|
|
15
|
-
|
|
16
|
-
Each phase runs in a **separate agent session** with a dedicated role, model hint, and permissions.
|
|
17
|
-
Never mix phases in one chat — this is the single most important rule.
|
|
18
|
-
|
|
19
|
-
The parent `/opsx:*` session is a **conductor**: it restores handoff state, spawns the required specialist, verifies the structured report, and never performs the specialist's work itself.
|
|
20
|
-
|
|
21
|
-
## Roles
|
|
22
|
-
|
|
23
|
-
| Role | Command | Mode | Model hint |
|
|
24
|
-
|------|---------|------|------------|
|
|
25
|
-
| Explorer | `/opsx:explore` | read-only | fast |
|
|
26
|
-
| Design Intake | `/opsx:design <name>` | writes `design-brief.md` + `assets/` only | strong |
|
|
27
|
-
| Architect | `/opsx:propose <name>` | conductor; `spec-architect` writes change artifacts | strong |
|
|
28
|
-
| Spec Reviewer | `/opsx:review <name>` | conductor; `spec-reviewer` writes only `review.md` | medium/strong |
|
|
29
|
-
| Implementer | `/opsx:apply <name>` | conductor; apply specialists write code/tests | strong |
|
|
30
|
-
| Verifier | CI (automatic) | scripts only | — |
|
|
31
|
-
|
|
32
|
-
## Conductor Routing
|
|
33
|
-
|
|
34
|
-
| Phase / signal | Subagent |
|
|
35
|
-
|----------------|----------|
|
|
36
|
-
| Status, gate failure, next command | `openspec-guide` |
|
|
37
|
-
| Session start restore / session exit persist | `session-handoff` |
|
|
38
|
-
| Broken kit, MCP, or sync | `setup-doctor` |
|
|
39
|
-
| `/opsx:explore` repository research | `codebase-explorer` |
|
|
40
|
-
| `/opsx:design` | `design-intake` |
|
|
41
|
-
| `/opsx:propose` | `spec-architect` |
|
|
42
|
-
| `/opsx:review` | `spec-reviewer` |
|
|
43
|
-
| Apply with design evidence | `design-implementer` |
|
|
44
|
-
| Apply ordinary task | `code-writer` |
|
|
45
|
-
| Apply tests | `test-writer` |
|
|
46
|
-
| Apply pre-PR review | `code-reviewer` |
|
|
47
|
-
| `/opsx:archive` | `spec-archiver` |
|
|
48
|
-
|
|
49
|
-
This routing is mandatory and exclusive. `spec-reviewer` is not `code-reviewer`; only the conductor marks `tasks.md` after a verified `Status: done` report.
|
|
50
|
-
|
|
51
|
-
Verifier runs on **GitHub Actions** (default) or **GitLab** via `prebuild` → `verify:openspec` when using `init --ci gitlab`. GitLab projects do not use `.github/workflows/`.
|
|
52
|
-
|
|
53
|
-
With `init --ci gitlab --spec-verify` or `init --ci github --spec-verify`, an **AI Spec Verifier** also runs on MRs/PRs changing `src/`: an Amp agent checks the changed code against `openspec/specs/` and a **BLOCKED verdict fails the pipeline** (gate `spec-verify-blocking` in `.agents/orchestrator.yaml`).
|
|
54
|
-
|
|
55
|
-
Both CI fragments also run `npx agent-orchestrator-kit gate-check` — a deterministic check that fails the pipeline when `src/` changed but the active change has no `review.md` with `Verdict: APPROVE` (when `require_spec_review: true`), and optionally requires `design-brief.md` (when `require_design_brief: true`, unless `proposal.md` has `Design: none`). At session start run `npx agent-orchestrator-kit status` (not a bare global binary — Amp PATH often lacks it; see `.agents/rules/cli-via-npm.mdc`).
|
|
56
|
-
|
|
57
|
-
## Hard Rules
|
|
58
|
-
|
|
59
|
-
- **One active change per developer** at a time.
|
|
60
|
-
- **No apply without spec-review approval** (explicit Approve in chat).
|
|
61
|
-
- **No code edits** during explore, design-intake, or spec-review sessions.
|
|
62
|
-
- **Archive after every merge** (`/opsx:archive`).
|
|
63
|
-
- **Always run local build/lint** before opening a PR.
|
|
64
|
-
- **Conductor MUST spawn** the routed specialist and MUST NOT do specialist work in the parent session.
|
|
65
|
-
|
|
66
|
-
## Handoff Gates
|
|
67
|
-
|
|
68
|
-
| Transition | Gate |
|
|
69
|
-
|------------|------|
|
|
70
|
-
| explore → design | UI change needs a brief; change name chosen |
|
|
71
|
-
| explore → propose | Decision brief written; change name chosen (skip design if non-UI) |
|
|
72
|
-
| design → propose | `design-brief.md` (+ `assets/`) written |
|
|
73
|
-
| propose → review | `npx openspec validate <name> --strict --type change` passes ✓ |
|
|
74
|
-
| review → apply | Reviewer writes explicit **Approve** — enforced in CI by `gate-check` |
|
|
75
|
-
| apply → verify | All `tasks.md` checkboxes `[x]`; local build OK |
|
|
76
|
-
| verify → archive | CI green; PR merged — check `npx agent-orchestrator-kit status` for "ready to archive" |
|
|
77
|
-
|
|
78
|
-
## Context to Pin per Role
|
|
79
|
-
|
|
80
|
-
| Role | Attach (`@`) |
|
|
81
|
-
|------|-------------|
|
|
82
|
-
| Explorer | `@openspec/specs/` + relevant `@src/` subtree |
|
|
83
|
-
| Design Intake | design source (Figma URL / images) + `@openspec/changes/<name>/` |
|
|
84
|
-
| Architect | `@openspec/config.yaml` + explore brief (+ `@design-brief.md` if present) |
|
|
85
|
-
| Reviewer | entire `@openspec/changes/<name>/` |
|
|
86
|
-
| Implementer | `@openspec/changes/<name>/tasks.md` + `@openspec/changes/<name>/design-brief.md` |
|
|
87
|
-
|
|
88
|
-
## Configuration
|
|
89
|
-
|
|
90
|
-
See `.agents/orchestrator.yaml` for role config, pipeline flags, and MCP baseline.
|
|
91
|
-
|
|
92
|
-
## Session Handoff
|
|
93
|
-
|
|
94
|
-
**HARD STOP.** A `/opsx:*` session is incomplete without persist + the fenced next-thread prompt. Amp often skips Memory MCP and in-thread specialist work — use the CLI and isolated `subagent-*` spawns.
|
|
95
|
-
|
|
96
|
-
At session start, before specialist work: honor the pasted `/opsx:*` command, run `npx agent-orchestrator-kit status`, run `npx agent-orchestrator-kit handoff --restore`, read Memory `Change:<name>`, `Handoff:<name>`, `Decision:*`, then fall back to `openspec/changes/<name>/handoff.md`. Spawn `session-handoff` in restore mode when context is incomplete (Amp: isolated `subagent-session-handoff`). Then spawn the routed phase specialist (Amp: isolated wrapper, never the main thread).
|
|
97
|
-
|
|
98
|
-
At exit, in order: spawn `session-handoff` persist → write `handoff.md` → `npx agent-orchestrator-kit handoff <name>` (exit 0, upserts absolute-path Memory JSON) → paste the CLI stdout prompt as one fenced block. The prompt body uses `project.agent_language`, has no service banner, and MUST be self-contained (Done, Decisions, Blocked, attach, which subagent to spawn, HARD STOP). Never start the next phase in the current chat.
|
|
99
|
-
|
|
100
|
-
OpenSpec artifacts remain the source of truth for requirements and tasks. Memory and `handoff.md` index the phase. The pasted prompt is the next thread's operating brief even if Memory is ignored.
|
|
101
|
-
|
|
102
|
-
Memory MCP MUST use `node scripts/memory-mcp-launcher.cjs` (never a relative `MEMORY_FILE_PATH`). Run `npx agent-orchestrator-kit memory-setup` when the launcher is missing.
|
|
103
|
-
|
|
104
|
-
### Optional: Figma personal token
|
|
105
|
-
|
|
106
|
-
For design intake against private Figma files, each developer configures a local token (never commit, never paste into chat):
|
|
107
|
-
|
|
108
|
-
```bash
|
|
109
|
-
npx agent-orchestrator-kit figma-setup
|
|
110
|
-
# edit .agents/figma.local.env → FIGMA_ACCESS_TOKEN=...
|
|
111
|
-
npx agent-orchestrator-kit figma-status
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
MCP starts via `scripts/figma-mcp-launcher.cjs` (secret stays out of `.mcp.json`). See kit README → **Figma token**.
|
|
11
|
+
`[design]` is optional (`/opsx:design`). Non-UI: `Design: none` in `proposal.md` when `require_design_brief: true`. MVP: `/opsx:quick` when `require_spec_review: false`.
|
|
115
12
|
|
|
116
|
-
|
|
13
|
+
Routing table, HARD STOP, and CLI forms: `.agents/rules/` (`agent-orchestration`, `session-handoff`, `cli-via-npm`). Config: `.agents/orchestrator.yaml`.
|
|
117
14
|
|
|
118
|
-
|
|
119
|
-
|
|
15
|
+
## Commands
|
|
16
|
+
| Role | Command |
|
|
17
|
+
|------|---------|
|
|
18
|
+
| Explorer | `/opsx:explore` |
|
|
19
|
+
| Design Intake | `/opsx:design <name>` |
|
|
20
|
+
| Architect | `/opsx:propose <name>` |
|
|
21
|
+
| Spec Reviewer | `/opsx:review <name>` |
|
|
22
|
+
| Implementer | `/opsx:apply <name>` |
|
|
23
|
+
| Quick (MVP) | `/opsx:quick <name>` |
|
|
24
|
+
| Archive | `/opsx:archive` |
|
|
120
25
|
|
|
121
|
-
|
|
122
|
-
|-------|------|
|
|
123
|
-
| `agent-orchestration` | Pipeline decisions, role selection, handoff |
|
|
124
|
-
| `openspec-howto` | OpenSpec CLI, cycle, naming |
|
|
125
|
-
| `openspec-propose` | Creating change artifacts |
|
|
126
|
-
| `openspec-apply-change` | Implementing tasks |
|
|
127
|
-
| `openspec-archive-change` | Archiving after merge |
|
|
26
|
+
Start: `npx agent-orchestrator-kit status` then `handoff --restore`. Spawn `session-handoff` restore only if that CLI failed. Then spawn the routed specialist (Amp: isolated `subagent-<name>`).
|
|
128
27
|
|
|
129
|
-
|
|
28
|
+
Exit HARD STOP: persist `session-handoff` → `handoff.md` → `npx agent-orchestrator-kit handoff <name>` (exit 0) → paste the CLI `/opsx:*` prompt. Do not start the next phase here.
|
|
130
29
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
| CI fails on PR | ≤ 1 |
|
|
30
|
+
## Hard rules
|
|
31
|
+
- One active change (unless mvp profile).
|
|
32
|
+
- No apply without explicit Approve when `require_spec_review: true`.
|
|
33
|
+
- No `src/` in explore, design, or review.
|
|
34
|
+
- Archive after merge. Build/lint before PR.
|
|
35
|
+
- Memory MCP: `node scripts/memory-mcp-launcher.cjs` (never relative `MEMORY_FILE_PATH`).
|
|
138
36
|
|
|
139
|
-
|
|
37
|
+
Pin only the files for the current role (`tasks.md`, the change folder, relevant `src/` subtree) — not entire `openspec/specs/`.
|
package/templates/CLAUDE.md
CHANGED
|
@@ -1,77 +1,15 @@
|
|
|
1
1
|
# {{PROJECT_NAME}} — Claude Code Context
|
|
2
2
|
|
|
3
|
-
> agent-orchestrator-kit v{{KIT_VERSION}} |
|
|
3
|
+
> agent-orchestrator-kit v{{KIT_VERSION}} | OpenSpec pipeline
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
See `AGENTS.md` for the full orchestration pipeline, roles, and hard rules.
|
|
8
|
-
See `openspec/config.yaml` for stack context and agent language.
|
|
9
|
-
|
|
10
|
-
## Skills
|
|
11
|
-
|
|
12
|
-
Project skills live in `.claude/skills/` (synced from `.agents/skills/`).
|
|
13
|
-
Use `/skill-name` or let Claude auto-load based on context.
|
|
14
|
-
|
|
15
|
-
| Skill | Command | When |
|
|
16
|
-
|-------|---------|------|
|
|
17
|
-
| Agent Orchestration | `/agent-orchestration` | Role selection, pipeline, handoff decisions |
|
|
18
|
-
| OpenSpec Howto | `/openspec-howto` | CLI, cycle, naming |
|
|
19
|
-
| OpenSpec Propose | `/openspec-propose` | Creating change artifacts |
|
|
20
|
-
| OpenSpec Apply | `/openspec-apply-change` | Implementing tasks |
|
|
21
|
-
| OpenSpec Archive | `/openspec-archive-change` | Archiving after merge |
|
|
22
|
-
|
|
23
|
-
## Pipeline Commands
|
|
5
|
+
See `AGENTS.md` and `.agents/rules/` for routing, HARD STOP, and CLI (`npx` only). Config: `.agents/orchestrator.yaml`.
|
|
24
6
|
|
|
25
7
|
```
|
|
26
|
-
/opsx:explore
|
|
27
|
-
/opsx:design — capture design into design-brief.md + assets/ (optional)
|
|
28
|
-
/opsx:propose — create change artifacts
|
|
29
|
-
/opsx:review — spec review (read-only, no code)
|
|
30
|
-
/opsx:apply — implement tasks
|
|
31
|
-
/opsx:archive — archive after merge
|
|
8
|
+
/opsx:explore · /opsx:design · /opsx:propose · /opsx:review · /opsx:apply · /opsx:archive
|
|
32
9
|
```
|
|
33
10
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
| Signal | Subagent |
|
|
37
|
-
|--------|----------|
|
|
38
|
-
| Status / next command | `openspec-guide` |
|
|
39
|
-
| Session restore / persist / next-thread prompt | `session-handoff` |
|
|
40
|
-
| Kit / MCP / sync failure | `setup-doctor` |
|
|
41
|
-
| Explore research | `codebase-explorer` |
|
|
42
|
-
| Design intake | `design-intake` |
|
|
43
|
-
| Propose | `spec-architect` |
|
|
44
|
-
| Spec review | `spec-reviewer` |
|
|
45
|
-
| Apply UI / ordinary task / tests / pre-PR review | `design-implementer` / `code-writer` / `test-writer` / `code-reviewer` |
|
|
46
|
-
| Archive | `spec-archiver` |
|
|
47
|
-
|
|
48
|
-
## Key Rules for This Session
|
|
49
|
-
|
|
50
|
-
- Check `.agents/orchestrator.yaml` for project-specific pipeline config.
|
|
51
|
-
- One active change at a time — run `npx openspec list` / `npx agent-orchestrator-kit status` to confirm.
|
|
52
|
-
- No code edits in explore, design, or review mode.
|
|
53
|
-
- Design Intake writes only `design-brief.md` and `assets/` — never `src/`.
|
|
54
|
-
- After completing apply: run build/lint before declaring done.
|
|
55
|
-
- Only the conductor marks `tasks.md`, after a specialist reports `Status: done` and its files are verified.
|
|
56
|
-
- Use `npx openspec validate --all --strict` or `npx openspec validate <name> --strict --type change`.
|
|
57
|
-
- Never bare `openspec` / `agent-orchestrator-kit` without `npx` (Amp PATH → exit 127). See `.agents/rules/cli-via-npm.mdc`.
|
|
58
|
-
|
|
59
|
-
## Session Handoff
|
|
60
|
-
|
|
61
|
-
**HARD STOP.** Before work: `npx agent-orchestrator-kit handoff --restore`, then Memory `Change:<name>`, `Handoff:<name>`, `Decision:*`; if unavailable, `openspec/changes/<name>/handoff.md`. Spawn `session-handoff` restore when needed (Amp: isolated `subagent-session-handoff`). Spawn the phase specialist isolated — never in the Amp main thread.
|
|
62
|
-
|
|
63
|
-
At exit: persist via `session-handoff` → `handoff.md` → `npx agent-orchestrator-kit handoff <name>` (exit 0) → paste the full CLI stdout `/opsx:*` prompt. The prompt MUST be self-contained. Do not begin the next phase in the same chat.
|
|
64
|
-
|
|
65
|
-
OpenSpec files are the requirements/tasks source of truth. Memory and `handoff.md` index phase state. The pasted prompt is the next thread's operating brief.
|
|
11
|
+
Conductor session: restore with `npx agent-orchestrator-kit handoff --restore`, spawn the phase specialist, do not do specialist work here. Spawn `session-handoff` restore only if CLI restore failed.
|
|
66
12
|
|
|
67
|
-
|
|
13
|
+
Exit: persist → `handoff.md` → `npx agent-orchestrator-kit handoff <name>` (exit 0) → paste the CLI prompt. Do not start the next phase in this chat.
|
|
68
14
|
|
|
69
|
-
|
|
70
|
-
|------|-------|
|
|
71
|
-
| Active changes | `openspec/changes/` |
|
|
72
|
-
| Design brief | `openspec/changes/<name>/design-brief.md` + `assets/` |
|
|
73
|
-
| Session handoff index | `openspec/changes/<name>/handoff.md` |
|
|
74
|
-
| Specs (source of truth) | `openspec/specs/` |
|
|
75
|
-
| Project config | `openspec/config.yaml` |
|
|
76
|
-
| Orchestration config | `.agents/orchestrator.yaml` |
|
|
77
|
-
| Skills | `.claude/skills/` |
|
|
15
|
+
One active change. No `src/` in explore/design/review. After apply: build/lint. Skills: `.claude/skills/` (synced from `.agents/skills/`).
|