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
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-orchestrator-kit",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Universal AI agent orchestration kit for Cursor, Claude Code, and Amp Code — spec-driven OpenSpec pipeline, conductor subagents, durable session handoff
|
|
3
|
+
"version": "0.4.0",
|
|
4
|
+
"description": "Universal AI agent orchestration kit for Cursor, Claude Code, and Amp Code — spec-driven OpenSpec pipeline, conductor subagents, durable session handoff, factory gates and MCP setup, cloud-agent handoff, and optional local Figma PAT setup",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai-agent",
|
|
7
7
|
"cursor",
|
|
@@ -10,6 +10,7 @@ pipeline:
|
|
|
10
10
|
require_design_brief: false
|
|
11
11
|
max_active_changes: 1
|
|
12
12
|
archive_after_merge: true
|
|
13
|
+
task_contract: warn
|
|
13
14
|
|
|
14
15
|
roles:
|
|
15
16
|
explorer:
|
|
@@ -48,7 +49,7 @@ handoff:
|
|
|
48
49
|
persist_on_exit: true
|
|
49
50
|
emit_next_session_prompt: true
|
|
50
51
|
prompt_self_contained: true
|
|
51
|
-
spawn_handoff_subagent:
|
|
52
|
+
spawn_handoff_subagent: false
|
|
52
53
|
|
|
53
54
|
memory:
|
|
54
55
|
enabled: true
|
|
@@ -60,6 +61,22 @@ mcp:
|
|
|
60
61
|
- memory
|
|
61
62
|
optional:
|
|
62
63
|
- figma
|
|
64
|
+
- github
|
|
65
|
+
- gitlab
|
|
66
|
+
- browser
|
|
67
|
+
|
|
68
|
+
skills:
|
|
69
|
+
kit:
|
|
70
|
+
- agent-orchestration
|
|
71
|
+
- openspec-howto
|
|
72
|
+
- openspec-explore
|
|
73
|
+
- openspec-propose
|
|
74
|
+
- openspec-apply-change
|
|
75
|
+
- openspec-archive-change
|
|
76
|
+
- openspec-sync-specs
|
|
77
|
+
- spec-workflow-openspec
|
|
78
|
+
stack: []
|
|
79
|
+
external: ""
|
|
63
80
|
|
|
64
81
|
figma:
|
|
65
82
|
env_file: .agents/figma.local.env
|
|
@@ -12,6 +12,8 @@ rules:
|
|
|
12
12
|
- Acceptance criteria — 3–5 перевірних пунктів
|
|
13
13
|
tasks:
|
|
14
14
|
- 3–7 атомарних задач
|
|
15
|
+
- "Контракт таска: індентовані поля Files: (реальні шляхи; нові — з префіксом new file:), Do: (конкретна зміна, 1–3 рядки), Done-when: (перевірна умова або команда)"
|
|
16
|
+
- Таск самодостатній без design.md; без неконкретних формулювань («as needed», «if necessary», «за потреби»)
|
|
15
17
|
- Останній пункт: build + lint
|
|
16
18
|
specs:
|
|
17
19
|
- Опційно для MVP — пропускай якщо change тривіальний
|
|
@@ -15,6 +15,7 @@ pipeline:
|
|
|
15
15
|
max_active_changes: 3
|
|
16
16
|
archive_after_merge: false
|
|
17
17
|
quick_mode_enabled: true
|
|
18
|
+
task_contract: off
|
|
18
19
|
|
|
19
20
|
roles:
|
|
20
21
|
explorer:
|
|
@@ -55,7 +56,7 @@ handoff:
|
|
|
55
56
|
persist_on_exit: true
|
|
56
57
|
emit_next_session_prompt: true
|
|
57
58
|
prompt_self_contained: true
|
|
58
|
-
spawn_handoff_subagent:
|
|
59
|
+
spawn_handoff_subagent: false
|
|
59
60
|
|
|
60
61
|
memory:
|
|
61
62
|
enabled: true
|
|
@@ -67,6 +68,22 @@ mcp:
|
|
|
67
68
|
- memory
|
|
68
69
|
optional:
|
|
69
70
|
- figma
|
|
71
|
+
- github
|
|
72
|
+
- gitlab
|
|
73
|
+
- browser
|
|
74
|
+
|
|
75
|
+
skills:
|
|
76
|
+
kit:
|
|
77
|
+
- agent-orchestration
|
|
78
|
+
- openspec-howto
|
|
79
|
+
- openspec-explore
|
|
80
|
+
- openspec-propose
|
|
81
|
+
- openspec-apply-change
|
|
82
|
+
- openspec-archive-change
|
|
83
|
+
- openspec-sync-specs
|
|
84
|
+
- spec-workflow-openspec
|
|
85
|
+
stack: []
|
|
86
|
+
external: ""
|
|
70
87
|
|
|
71
88
|
figma:
|
|
72
89
|
env_file: .agents/figma.local.env
|
|
@@ -13,6 +13,7 @@ pipeline:
|
|
|
13
13
|
require_design_brief: false
|
|
14
14
|
max_active_changes: 1
|
|
15
15
|
archive_after_merge: true
|
|
16
|
+
task_contract: warn
|
|
16
17
|
|
|
17
18
|
roles:
|
|
18
19
|
explorer:
|
|
@@ -35,7 +36,6 @@ roles:
|
|
|
35
36
|
command: /opsx:apply
|
|
36
37
|
mode: code
|
|
37
38
|
model_hint: strong
|
|
38
|
-
notes: "Use javascript-core, javascript-node, javascript-testing skills during apply"
|
|
39
39
|
verifier:
|
|
40
40
|
type: ci
|
|
41
41
|
gates:
|
|
@@ -53,7 +53,7 @@ handoff:
|
|
|
53
53
|
persist_on_exit: true
|
|
54
54
|
emit_next_session_prompt: true
|
|
55
55
|
prompt_self_contained: true
|
|
56
|
-
spawn_handoff_subagent:
|
|
56
|
+
spawn_handoff_subagent: false
|
|
57
57
|
|
|
58
58
|
memory:
|
|
59
59
|
enabled: true
|
|
@@ -65,6 +65,25 @@ mcp:
|
|
|
65
65
|
- memory
|
|
66
66
|
optional:
|
|
67
67
|
- figma
|
|
68
|
+
- github
|
|
69
|
+
- gitlab
|
|
70
|
+
- browser
|
|
71
|
+
|
|
72
|
+
skills:
|
|
73
|
+
kit:
|
|
74
|
+
- agent-orchestration
|
|
75
|
+
- openspec-howto
|
|
76
|
+
- openspec-explore
|
|
77
|
+
- openspec-propose
|
|
78
|
+
- openspec-apply-change
|
|
79
|
+
- openspec-archive-change
|
|
80
|
+
- openspec-sync-specs
|
|
81
|
+
- spec-workflow-openspec
|
|
82
|
+
stack:
|
|
83
|
+
- javascript-core
|
|
84
|
+
- javascript-node
|
|
85
|
+
- javascript-testing
|
|
86
|
+
external: frontend-agent-skills
|
|
68
87
|
|
|
69
88
|
figma:
|
|
70
89
|
env_file: .agents/figma.local.env
|
|
@@ -15,6 +15,8 @@ rules:
|
|
|
15
15
|
- Описуй зміни на рівні компонентів, stores, API
|
|
16
16
|
tasks:
|
|
17
17
|
- Розбивай на задачі до ~2 годин
|
|
18
|
+
- "Контракт таска: індентовані поля Files: (реальні шляхи; нові — з префіксом new file:), Do: (конкретна зміна, 1–3 рядки), Done-when: (перевірна умова або команда)"
|
|
19
|
+
- Таск самодостатній без design.md; без неконкретних формулювань («as needed», «if necessary», «за потреби»)
|
|
18
20
|
- Останній пункт: build + lint без помилок
|
|
19
21
|
specs:
|
|
20
22
|
- Delta format: ADDED / MODIFIED / REMOVED
|
|
@@ -13,6 +13,7 @@ pipeline:
|
|
|
13
13
|
require_design_brief: false
|
|
14
14
|
max_active_changes: 1
|
|
15
15
|
archive_after_merge: true
|
|
16
|
+
task_contract: warn
|
|
16
17
|
|
|
17
18
|
roles:
|
|
18
19
|
explorer:
|
|
@@ -35,7 +36,6 @@ roles:
|
|
|
35
36
|
command: /opsx:apply
|
|
36
37
|
mode: code
|
|
37
38
|
model_hint: strong
|
|
38
|
-
notes: "Use vue-core, vue-pinia, vue-axios, vue-router skills during apply"
|
|
39
39
|
verifier:
|
|
40
40
|
type: ci
|
|
41
41
|
gates:
|
|
@@ -52,7 +52,7 @@ handoff:
|
|
|
52
52
|
persist_on_exit: true
|
|
53
53
|
emit_next_session_prompt: true
|
|
54
54
|
prompt_self_contained: true
|
|
55
|
-
spawn_handoff_subagent:
|
|
55
|
+
spawn_handoff_subagent: false
|
|
56
56
|
|
|
57
57
|
memory:
|
|
58
58
|
enabled: true
|
|
@@ -65,8 +65,26 @@ mcp:
|
|
|
65
65
|
optional:
|
|
66
66
|
- figma
|
|
67
67
|
- github
|
|
68
|
+
- gitlab
|
|
68
69
|
- browser
|
|
69
70
|
|
|
71
|
+
skills:
|
|
72
|
+
kit:
|
|
73
|
+
- agent-orchestration
|
|
74
|
+
- openspec-howto
|
|
75
|
+
- openspec-explore
|
|
76
|
+
- openspec-propose
|
|
77
|
+
- openspec-apply-change
|
|
78
|
+
- openspec-archive-change
|
|
79
|
+
- openspec-sync-specs
|
|
80
|
+
- spec-workflow-openspec
|
|
81
|
+
stack:
|
|
82
|
+
- vue-core
|
|
83
|
+
- vue-pinia
|
|
84
|
+
- vue-axios
|
|
85
|
+
- vue-router
|
|
86
|
+
external: frontend-agent-skills
|
|
87
|
+
|
|
70
88
|
figma:
|
|
71
89
|
env_file: .agents/figma.local.env
|
|
72
90
|
token_key: FIGMA_ACCESS_TOKEN
|
|
@@ -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
|
}
|
|
@@ -5,15 +5,17 @@ category: Workflow
|
|
|
5
5
|
description: Implement tasks from an OpenSpec change (Experimental)
|
|
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 Implementer role.
|
|
11
11
|
|
|
12
12
|
Implement tasks from an OpenSpec change.
|
|
13
13
|
|
|
14
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.
|
|
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
|
|
|
@@ -28,16 +30,7 @@ Implement tasks from an OpenSpec change.
|
|
|
28
30
|
|
|
29
31
|
1.5. **Check review gate**
|
|
30
32
|
|
|
31
|
-
Read `.agents/orchestrator.yaml` → `pipeline.require_spec_review`.
|
|
32
|
-
|
|
33
|
-
If `true` (default for generic/vue3/node):
|
|
34
|
-
- Look for `openspec/changes/<name>/review.md` with `Verdict: APPROVE`
|
|
35
|
-
- OR explicit **APPROVE ✓** from `/opsx:review <name>` in this session (user pasted verdict)
|
|
36
|
-
- OR Memory MCP entity `Change:<name>` with `status: spec-approved`
|
|
37
|
-
- If none found → **STOP**. Tell user:
|
|
38
|
-
> "Spec review required. Run `/opsx:review <name>` in a separate read-only session, then start a new apply session after **Approve ✓`."
|
|
39
|
-
|
|
40
|
-
If `false` (mvp profile) or user confirms quick/demo mode → proceed.
|
|
33
|
+
Read `.agents/orchestrator.yaml` → `pipeline.require_spec_review`. If `true` (default for generic/vue3/node), require one of: `review.md` with `Verdict: APPROVE`, a pasted **APPROVE ✓** verdict from `/opsx:review <name>`, or Memory `Change:<name>` with `status: spec-approved`. If none found → **STOP** and tell the user to run `/opsx:review <name>` in a separate read-only session first. If `false` (mvp profile) or quick/demo mode is confirmed → proceed.
|
|
41
34
|
|
|
42
35
|
2. **Check status to understand the schema**
|
|
43
36
|
```bash
|
|
@@ -67,12 +60,9 @@ Implement tasks from an OpenSpec change.
|
|
|
67
60
|
|
|
68
61
|
**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.
|
|
69
62
|
|
|
70
|
-
4. **Read
|
|
63
|
+
4. **Read the working set**
|
|
71
64
|
|
|
72
|
-
Read
|
|
73
|
-
The files depend on the schema being used:
|
|
74
|
-
- **spec-driven**: proposal, specs, design, tasks
|
|
75
|
-
- Other schemas: follow the contextFiles from CLI output
|
|
65
|
+
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.
|
|
76
66
|
|
|
77
67
|
5. **Show current progress**
|
|
78
68
|
|
|
@@ -86,17 +76,12 @@ Implement tasks from an OpenSpec change.
|
|
|
86
76
|
|
|
87
77
|
For each pending task:
|
|
88
78
|
- Show which task is being worked on
|
|
89
|
-
-
|
|
90
|
-
- Verify
|
|
91
|
-
-
|
|
92
|
-
- Only then, as conductor, mark the task complete in the tasks file: `- [ ]` → `- [x]`
|
|
79
|
+
- Implement it in the parent session from its Files/Do/Done-when contract (subagent rules: see "Parent-driven apply" above)
|
|
80
|
+
- Verify the task's Done-when condition actually holds
|
|
81
|
+
- Mark the task complete in the tasks file: `- [ ]` → `- [x]`
|
|
93
82
|
- Continue to next task
|
|
94
83
|
|
|
95
|
-
**
|
|
96
|
-
- Task is unclear → ask for clarification
|
|
97
|
-
- Implementation reveals a design issue → suggest updating artifacts
|
|
98
|
-
- Error or blocker encountered → report and wait for guidance
|
|
99
|
-
- User interrupts
|
|
84
|
+
**STOP if:** the escape valve triggers (see above), an error or blocker is encountered (report and wait), or the user interrupts.
|
|
100
85
|
|
|
101
86
|
7. **On completion or pause, show status**
|
|
102
87
|
|
|
@@ -114,10 +99,6 @@ Implement tasks from an OpenSpec change.
|
|
|
114
99
|
Working on task 3/7: <task description>
|
|
115
100
|
[...implementation happening...]
|
|
116
101
|
✓ Task complete
|
|
117
|
-
|
|
118
|
-
Working on task 4/7: <task description>
|
|
119
|
-
[...implementation happening...]
|
|
120
|
-
✓ Task complete
|
|
121
102
|
```
|
|
122
103
|
|
|
123
104
|
**Output On Completion**
|
|
@@ -159,24 +140,15 @@ What would you like to do?
|
|
|
159
140
|
|
|
160
141
|
## Session Exit (HARD STOP)
|
|
161
142
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
1. Spawn `session-handoff` in persist mode (Amp: isolated `subagent-session-handoff`). If spawn fails, persist in the parent — never skip.
|
|
165
|
-
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 in Done.
|
|
166
|
-
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.
|
|
167
|
-
4. If Memory MCP tools work, also update `Change:<name>`, `Handoff:<name>`, and new `Decision:*`.
|
|
168
|
-
5. Paste CLI stdout into chat as one fenced block beginning with the next `/opsx:*` role command. Keep it complete. No banner.
|
|
169
|
-
6. Stop. Never start archive in this apply chat.
|
|
143
|
+
Close via the canonical Session Exit protocol in `.agents/rules/session-handoff.mdc`. Include task and build/lint status in Done. Never start archive in this apply chat.
|
|
170
144
|
|
|
171
145
|
**Guardrails**
|
|
172
146
|
- Keep going through tasks until done or blocked
|
|
173
|
-
- Always read
|
|
174
|
-
- If task is
|
|
175
|
-
-
|
|
176
|
-
-
|
|
177
|
-
-
|
|
178
|
-
- Pause on errors, blockers, or unclear requirements - don't guess
|
|
179
|
-
- Use contextFiles from CLI output, don't assume specific file names
|
|
147
|
+
- Always read `tasks.md` + `apply-notes.md` before starting
|
|
148
|
+
- If a task contract is insufficient, STOP via the escape valve — don't guess or improvise
|
|
149
|
+
- Keep code changes minimal and scoped to each task's `Files:` list
|
|
150
|
+
- Never let a spawned specialist update `tasks.md`; the parent checks a box only after verifying Done-when
|
|
151
|
+
- Pause on errors and blockers
|
|
180
152
|
|
|
181
153
|
**Fluid Workflow Integration**
|
|
182
154
|
|
|
@@ -2,180 +2,27 @@
|
|
|
2
2
|
name: /opsx-archive
|
|
3
3
|
id: opsx-archive
|
|
4
4
|
category: Workflow
|
|
5
|
-
description: Archive a completed change
|
|
5
|
+
description: Archive a completed change via the agent-orchestrator-kit CLI
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Session Start / Session Exit: follow the protocol in `.agents/rules/session-handoff.mdc`. Announce the Archiver role.
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
Archive a completed change in the experimental workflow.
|
|
13
|
-
|
|
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.
|
|
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.
|
|
10
|
+
Archive is fully deterministic — one CLI call, no phase subagents.
|
|
17
11
|
|
|
18
12
|
**Steps**
|
|
19
13
|
|
|
20
|
-
1. **
|
|
21
|
-
|
|
22
|
-
Run `npx openspec list --json` to get available changes. Use the **AskUserQuestion tool** to let the user select.
|
|
23
|
-
|
|
24
|
-
Show only active changes (not already archived).
|
|
25
|
-
Include the schema used for each change if available.
|
|
26
|
-
|
|
27
|
-
**IMPORTANT**: Do NOT guess or auto-select a change. Always let the user choose.
|
|
28
|
-
|
|
29
|
-
2. **Check artifact completion status**
|
|
30
|
-
|
|
31
|
-
Run `npx openspec status --change "<name>" --json` to check artifact completion.
|
|
32
|
-
|
|
33
|
-
Parse the JSON to understand:
|
|
34
|
-
- `schemaName`: The workflow being used
|
|
35
|
-
- `planningHome`, `changeRoot`, `artifactPaths`, and `actionContext`: path and scope context
|
|
36
|
-
- `artifacts`: List of artifacts with their status (`done` or other)
|
|
37
|
-
|
|
38
|
-
If status reports `actionContext.mode: "workspace-planning"`, explain that workspace archive is not supported in this slice and STOP. Do not move workspace changes into repo-local archives or edit linked repos.
|
|
39
|
-
|
|
40
|
-
**If any artifacts are not `done`:**
|
|
41
|
-
- Display warning listing incomplete artifacts
|
|
42
|
-
- Prompt user for confirmation to continue
|
|
43
|
-
- Proceed if user confirms
|
|
44
|
-
|
|
45
|
-
3. **Check task completion status**
|
|
46
|
-
|
|
47
|
-
Read the tasks file (typically `tasks.md`) to check for incomplete tasks.
|
|
48
|
-
|
|
49
|
-
Count tasks marked with `- [ ]` (incomplete) vs `- [x]` (complete).
|
|
50
|
-
|
|
51
|
-
**If incomplete tasks found:**
|
|
52
|
-
- Display warning showing count of incomplete tasks
|
|
53
|
-
- Prompt user for confirmation to continue
|
|
54
|
-
- Proceed if user confirms
|
|
55
|
-
|
|
56
|
-
**If no tasks file exists:** Proceed without task-related warning.
|
|
57
|
-
|
|
58
|
-
4. **Assess delta spec sync state**
|
|
59
|
-
|
|
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.
|
|
61
|
-
|
|
62
|
-
**If delta specs exist:**
|
|
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
|
|
66
|
-
|
|
67
|
-
**Prompt options:**
|
|
68
|
-
- If changes needed: "Sync now (recommended)", "Archive without syncing"
|
|
69
|
-
- If already synced: "Archive now", "Sync anyway", "Cancel"
|
|
70
|
-
|
|
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**
|
|
74
|
-
|
|
75
|
-
Spawn `spec-archiver`, require `## Subagent report: spec-archiver`, and delegate the sync/archive operations below. Do not run them in the parent session.
|
|
76
|
-
|
|
77
|
-
Create an `archive` directory under `planningHome.changesDir` if it doesn't exist:
|
|
78
|
-
```bash
|
|
79
|
-
mkdir -p "<planningHome.changesDir>/archive"
|
|
80
|
-
```
|
|
14
|
+
1. **Resolve the change name.** Use the name after `/opsx:archive`. If omitted or ambiguous, run `npx openspec list --json` and use the **AskUserQuestion tool** to let the user pick an active change. Never guess.
|
|
81
15
|
|
|
82
|
-
|
|
16
|
+
2. **Decide on delta-spec sync.** If the change has delta specs, ask the user: merge them into main specs (`--sync`, recommended) or archive without merging (`--no-sync --force`).
|
|
83
17
|
|
|
84
|
-
|
|
85
|
-
- If yes: Fail with error, suggest renaming existing archive or using different date
|
|
86
|
-
- If no: Move `changeRoot` to the archive directory
|
|
18
|
+
3. **Run the CLI:**
|
|
87
19
|
|
|
88
20
|
```bash
|
|
89
|
-
|
|
21
|
+
npx agent-orchestrator-kit archive <name> [--sync | --no-sync --force]
|
|
90
22
|
```
|
|
91
23
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
The conductor verifies `Status: done`, the reported archive path, and modified main specs before reporting completion.
|
|
95
|
-
|
|
96
|
-
Show archive completion summary including:
|
|
97
|
-
- Change name
|
|
98
|
-
- Schema that was used
|
|
99
|
-
- Archive location
|
|
100
|
-
- Spec sync status (synced / sync skipped / no delta specs)
|
|
101
|
-
- Note about any warnings (incomplete artifacts/tasks)
|
|
102
|
-
|
|
103
|
-
**Output On Success**
|
|
104
|
-
|
|
105
|
-
```
|
|
106
|
-
## Archive Complete
|
|
107
|
-
|
|
108
|
-
**Change:** <change-name>
|
|
109
|
-
**Schema:** <schema-name>
|
|
110
|
-
**Archived to:** the archive path derived from `planningHome.changesDir`/YYYY-MM-DD-<name>/
|
|
111
|
-
**Specs:** ✓ Synced to main specs
|
|
112
|
-
|
|
113
|
-
All artifacts complete. All tasks complete.
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
**Output On Success (No Delta Specs)**
|
|
117
|
-
|
|
118
|
-
```
|
|
119
|
-
## Archive Complete
|
|
120
|
-
|
|
121
|
-
**Change:** <change-name>
|
|
122
|
-
**Schema:** <schema-name>
|
|
123
|
-
**Archived to:** the archive path derived from `planningHome.changesDir`/YYYY-MM-DD-<name>/
|
|
124
|
-
**Specs:** No delta specs
|
|
125
|
-
|
|
126
|
-
All artifacts complete. All tasks complete.
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
**Output On Success With Warnings**
|
|
130
|
-
|
|
131
|
-
```
|
|
132
|
-
## Archive Complete (with warnings)
|
|
133
|
-
|
|
134
|
-
**Change:** <change-name>
|
|
135
|
-
**Schema:** <schema-name>
|
|
136
|
-
**Archived to:** the archive path derived from `planningHome.changesDir`/YYYY-MM-DD-<name>/
|
|
137
|
-
**Specs:** Sync skipped (user chose to skip)
|
|
138
|
-
|
|
139
|
-
**Warnings:**
|
|
140
|
-
- Archived with 2 incomplete artifacts
|
|
141
|
-
- Archived with 3 incomplete tasks
|
|
142
|
-
- Delta spec sync was skipped (user chose to skip)
|
|
143
|
-
|
|
144
|
-
Review the archive if this was not intentional.
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
**Output On Error (Archive Exists)**
|
|
148
|
-
|
|
149
|
-
```
|
|
150
|
-
## Archive Failed
|
|
151
|
-
|
|
152
|
-
**Change:** <change-name>
|
|
153
|
-
**Target:** the archive path derived from `planningHome.changesDir`/YYYY-MM-DD-<name>/
|
|
154
|
-
|
|
155
|
-
Target archive directory already exists.
|
|
156
|
-
|
|
157
|
-
**Options:**
|
|
158
|
-
1. Rename the existing archive
|
|
159
|
-
2. Delete the existing archive if it's a duplicate
|
|
160
|
-
3. Wait until a different date to archive
|
|
161
|
-
```
|
|
162
|
-
|
|
163
|
-
## Session Exit (HARD STOP)
|
|
164
|
-
|
|
165
|
-
You have NOT finished until every step succeeds. Do not say done/готово and do not omit the fenced next-thread prompt when another role is required.
|
|
24
|
+
The CLI checks gates (review APPROVE, all tasks `[x]`, no existing target), merges delta specs on `--sync`, moves the change to `openspec/changes/archive/YYYY-MM-DD-<name>`, runs `npx openspec validate --all --strict` with full rollback on failure, and writes the final `handoff.md` (`next_command: none`) plus memory upsert.
|
|
166
25
|
|
|
167
|
-
|
|
168
|
-
2. Write the final handoff state at the archived change path 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>` from the archived path context when possible, or write Memory JSON via the same CLI against the active name before the move. Require exit 0 when the change dir still exists.
|
|
170
|
-
4. If Memory MCP tools work, also update `Change:<name>`, `Handoff:<name>`, and new `Decision:*`.
|
|
171
|
-
5. When another role is required, paste CLI stdout as one fenced `/opsx:*` prompt. Keep it complete. No banner.
|
|
172
|
-
6. Stop. Do not start another phase in this chat.
|
|
26
|
+
4. **Show the CLI stdout as-is.** On exit ≠ 0, report the failed gate from stderr and stop — do not merge or move anything manually.
|
|
173
27
|
|
|
174
|
-
|
|
175
|
-
- Always prompt for change selection if not provided
|
|
176
|
-
- Use artifact graph (openspec status --json) for completion checking
|
|
177
|
-
- Don't block archive on warnings - just inform and confirm
|
|
178
|
-
- Preserve .openspec.yaml when moving to archive (it moves with the directory)
|
|
179
|
-
- Show clear summary of what happened
|
|
180
|
-
- If sync is requested, use the Skill tool to invoke `openspec-sync-specs` (agent-driven)
|
|
181
|
-
- If delta specs exist, always run the sync assessment and show the combined summary before prompting
|
|
28
|
+
The pipeline ends here: no next-thread prompt is required after a successful archive.
|
|
@@ -5,9 +5,9 @@ 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
|
|
8
|
+
## Session Start
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
Follow the canonical Session Start protocol in `.agents/rules/session-handoff.mdc`, then announce the Design Intake role.
|
|
11
11
|
|
|
12
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.
|
|
13
13
|
|
|
@@ -130,14 +130,7 @@ For non-UI changes: do not invent a brief. Tell the Architect to add a line `Des
|
|
|
130
130
|
|
|
131
131
|
## Session Exit (HARD STOP)
|
|
132
132
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
1. Spawn `session-handoff` in persist mode (Amp: isolated `subagent-session-handoff`). If spawn fails, persist in the parent — never skip.
|
|
136
|
-
2. Write `openspec/changes/<name>/handoff.md` with: Closed role, Change, Done, Decisions, Blocked, Next command, Next role, Attach, Subagents to spawn, Constraints.
|
|
137
|
-
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.
|
|
138
|
-
4. If Memory MCP tools work, also update `Change:<name>`, `Handoff:<name>`, and new `Decision:*`.
|
|
139
|
-
5. Paste CLI stdout into chat as one fenced block beginning `/opsx:propose <name>`. Keep it complete. No banner.
|
|
140
|
-
6. Stop. Do not start propose in this chat.
|
|
133
|
+
Close via the canonical Session Exit protocol in `.agents/rules/session-handoff.mdc`. First line of the pasted prompt is `/opsx:propose <name>`. Do not start propose in this chat.
|
|
141
134
|
|
|
142
135
|
## Guardrails
|
|
143
136
|
|
|
@@ -5,9 +5,9 @@ category: Workflow
|
|
|
5
5
|
description: "Enter explore mode - think through ideas, investigate problems, clarify requirements"
|
|
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 Explorer role.
|
|
11
11
|
|
|
12
12
|
Enter explore mode. Think deeply. Visualize freely. Follow the conversation wherever it goes.
|
|
13
13
|
|
|
@@ -168,14 +168,7 @@ When things crystallize, you might offer a summary - but it's optional. Sometime
|
|
|
168
168
|
|
|
169
169
|
## Session Exit (HARD STOP)
|
|
170
170
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
1. Spawn `session-handoff` in persist mode (Amp: isolated `subagent-session-handoff`). If spawn fails, persist in the parent — never skip.
|
|
174
|
-
2. Write `openspec/changes/<name>/handoff.md` with: Closed role, Change, Done, Decisions, Blocked, Next command, Next role, Attach, Subagents to spawn, Constraints.
|
|
175
|
-
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.
|
|
176
|
-
4. If Memory MCP tools work, also update `Change:<name>`, `Handoff:<name>`, and new `Decision:*`.
|
|
177
|
-
5. Paste CLI stdout into chat as one fenced block. Keep it complete. No banner. First line is `/opsx:design <name>` or `/opsx:propose <name>`.
|
|
178
|
-
6. Stop. Do not start that phase in this chat.
|
|
171
|
+
Close via the canonical Session Exit protocol in `.agents/rules/session-handoff.mdc`. First line of the pasted prompt is `/opsx:design <name>` or `/opsx:propose <name>`. Do not start that phase in this chat.
|
|
179
172
|
|
|
180
173
|
## Guardrails
|
|
181
174
|
|
|
@@ -5,9 +5,9 @@ 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
|
|
8
|
+
## Session Start
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
Follow the canonical Session Start protocol in `.agents/rules/session-handoff.mdc`, then announce the Architect role.
|
|
11
11
|
|
|
12
12
|
Propose a new change - create the change and generate all artifacts in one step.
|
|
13
13
|
|
|
@@ -24,6 +24,17 @@ When ready to implement, run /opsx:apply
|
|
|
24
24
|
|
|
25
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
26
|
|
|
27
|
+
**Task contract (mandatory tasks.md format):** every task must carry indented `Files:`, `Do:`, `Done-when:` fields:
|
|
28
|
+
|
|
29
|
+
```markdown
|
|
30
|
+
- [ ] 2.1 Short title
|
|
31
|
+
Files: src/router/index.js, new file: src/stores/auth.js
|
|
32
|
+
Do: concrete change in 1–3 lines — no vague wording ("as needed", "if necessary", "as appropriate")
|
|
33
|
+
Done-when: verifiable condition or command
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Each task must be self-contained for a blind implementer — executable without reading design.md. `Files:` paths must exist unless prefixed with `new file:`. Lint: `npx agent-orchestrator-kit gate-check --tasks <name>` (mode via `pipeline.task_contract: warn|strict|off`).
|
|
37
|
+
|
|
27
38
|
**Steps**
|
|
28
39
|
|
|
29
40
|
1. **If no input provided, ask what they want to build**
|
|
@@ -103,14 +114,7 @@ After completing all artifacts, summarize:
|
|
|
103
114
|
|
|
104
115
|
## Session Exit (HARD STOP)
|
|
105
116
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
1. Spawn `session-handoff` in persist mode (Amp: isolated `subagent-session-handoff`). If spawn fails, persist in the parent — never skip.
|
|
109
|
-
2. Write `openspec/changes/<name>/handoff.md` with: Closed role, Change, Done, Decisions, Blocked, Next command, Next role, Attach, Subagents to spawn, Constraints.
|
|
110
|
-
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.
|
|
111
|
-
4. If Memory MCP tools work, also update `Change:<name>`, `Handoff:<name>`, and new `Decision:*`.
|
|
112
|
-
5. Paste CLI stdout into chat as one fenced block beginning `/opsx:review <name>`. Keep it complete. No banner.
|
|
113
|
-
6. Stop. Do not start review in this chat.
|
|
117
|
+
Close via the canonical Session Exit protocol in `.agents/rules/session-handoff.mdc`. First line of the pasted prompt is `/opsx:review <name>`. Do not start review in this chat.
|
|
114
118
|
|
|
115
119
|
**Artifact Creation Guidelines**
|
|
116
120
|
|