agent-orchestrator-kit 0.1.11 → 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.
- package/CHANGELOG.md +19 -0
- package/README.md +60 -28
- package/bin/agent-orchestrator.js +37 -10
- package/package.json +2 -2
- package/profiles/generic/orchestrator.yaml +3 -0
- package/profiles/mvp/orchestrator.yaml +3 -0
- package/profiles/node/orchestrator.yaml +3 -0
- package/profiles/vue3/orchestrator.yaml +3 -0
- package/templates/.agents/commands/opsx-apply.md +15 -4
- package/templates/.agents/commands/opsx-archive.md +21 -7
- package/templates/.agents/commands/opsx-design.md +21 -5
- package/templates/.agents/commands/opsx-explore.md +12 -2
- package/templates/.agents/commands/opsx-propose.md +22 -6
- package/templates/.agents/commands/opsx-quick.md +18 -2
- package/templates/.agents/commands/opsx-review.md +20 -4
- package/templates/.agents/rules/agent-orchestration.mdc +39 -0
- package/templates/.agents/rules/memory-mcp-autosetup.mdc +13 -6
- package/templates/.agents/skills/agent-orchestration/SKILL.md +72 -15
- package/templates/.agents/skills/openspec-apply-change/SKILL.md +7 -4
- package/templates/.agents/skills/openspec-archive-change/SKILL.md +13 -7
- package/templates/.agents/skills/openspec-explore/SKILL.md +4 -2
- package/templates/.agents/skills/openspec-propose/SKILL.md +14 -6
- package/templates/.agents/subagents/code-reviewer.md +12 -1
- package/templates/.agents/subagents/code-writer.md +13 -2
- package/templates/.agents/subagents/codebase-explorer.md +31 -0
- package/templates/.agents/subagents/design-implementer.md +13 -2
- package/templates/.agents/subagents/design-intake.md +31 -0
- package/templates/.agents/subagents/openspec-guide.md +12 -1
- package/templates/.agents/subagents/setup-doctor.md +11 -2
- package/templates/.agents/subagents/spec-architect.md +32 -0
- package/templates/.agents/subagents/spec-archiver.md +31 -0
- package/templates/.agents/subagents/spec-reviewer.md +32 -0
- package/templates/.agents/subagents/test-writer.md +13 -2
- package/templates/AGENTS.md +32 -3
- package/templates/CLAUDE.md +21 -0
- package/templates/orchestrator.yaml +3 -0
- package/templates/scripts/sync-local-agent-skills.sh +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,25 @@ 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
|
+
|
|
17
|
+
## [0.1.12] - 2026-07-21
|
|
18
|
+
|
|
19
|
+
### Added
|
|
20
|
+
- **`figma-fetch --depth <n>`** — limit Figma node tree depth for large frames (omit = full tree)
|
|
21
|
+
|
|
22
|
+
### Fixed
|
|
23
|
+
- **`figma-fetch` large payloads** — write API response text as-is instead of pretty-printing via `JSON.stringify` (avoids `Invalid string length` on huge trees)
|
|
24
|
+
- Clearer error when Figma API returns a non-JSON body
|
|
25
|
+
|
|
7
26
|
## [0.1.11] - 2026-07-21
|
|
8
27
|
|
|
9
28
|
### 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
|
|
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
|
|
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 (
|
|
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/ #
|
|
150
|
-
│ ├── rules/ #
|
|
151
|
-
│ ├── subagents/ #
|
|
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 |
|
|
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:**
|
|
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
|
|
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
|
|
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.
|
|
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:**
|
|
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
|
|
|
@@ -624,6 +646,8 @@ npx agent-orchestrator-kit figma-setup
|
|
|
624
646
|
npx agent-orchestrator-kit figma-status
|
|
625
647
|
npx agent-orchestrator-kit figma-fetch --url "https://www.figma.com/design/FILE_KEY/Name?node-id=1-2" \
|
|
626
648
|
--out openspec/changes/<name>/assets/figma-nodes.json
|
|
649
|
+
# large frames: limit tree depth
|
|
650
|
+
npx agent-orchestrator-kit figma-fetch --file FILE_KEY --nodes 1:2 --depth 2 --out figma-nodes.json
|
|
627
651
|
```
|
|
628
652
|
|
|
629
653
|
`figma-fetch` uses the Figma REST API (`X-Figma-Token`) and writes JSON for design-brief capture. Live Figma is for design-intake only — apply uses `design-brief.md`.
|
|
@@ -638,21 +662,18 @@ npx agent-orchestrator-kit figma-setup
|
|
|
638
662
|
|
|
639
663
|
## Memory MCP — Shared State Between Sessions
|
|
640
664
|
|
|
641
|
-
Each role starts a fresh session. Memory MCP
|
|
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.
|
|
642
666
|
|
|
643
667
|
**Standard entities to save:**
|
|
644
668
|
|
|
645
669
|
```
|
|
646
|
-
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
|
|
647
671
|
Decision:export-format chosen: xlsx, reason: matches existing reports
|
|
648
|
-
|
|
649
|
-
|
|
672
|
+
Handoff:add-bulk-export next_role: implementer, next_command: /opsx:apply add-bulk-export,
|
|
673
|
+
session_count: 2, summary: ..., blocked: none
|
|
650
674
|
```
|
|
651
675
|
|
|
652
|
-
|
|
653
|
-
```
|
|
654
|
-
What do we know about Change:add-bulk-export?
|
|
655
|
-
```
|
|
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.
|
|
656
677
|
|
|
657
678
|
## Amp Code — Deep Integration Notes
|
|
658
679
|
|
|
@@ -665,21 +686,22 @@ Amp is the **primary target** of this kit. It reads `.agents/skills/` and `AGENT
|
|
|
665
686
|
| `AGENTS.md` subtree loading | Per-domain AGENTS.md in `openspec/` subtree |
|
|
666
687
|
| `.agents/skills/` | All orchestration + domain skills |
|
|
667
688
|
| `mcp.json` in skill dir | Lazy MCP loading (Memory only when needed) |
|
|
668
|
-
| Subagents |
|
|
689
|
+
| Subagents | Conductor routing + isolated `subagent-*` wrappers |
|
|
669
690
|
| Amp modes (rush/smart/deep) | Per-role model hints in AGENTS.md |
|
|
670
691
|
|
|
671
|
-
**Amp
|
|
692
|
+
**Amp generated wrapper** (`.agents/skills/subagent-codebase-explorer/SKILL.md`):
|
|
672
693
|
|
|
673
694
|
```yaml
|
|
674
695
|
---
|
|
675
|
-
name:
|
|
676
|
-
description:
|
|
677
|
-
disable-model-invocation: false
|
|
678
|
-
allowed-tools: Read, Bash
|
|
696
|
+
name: subagent-codebase-explorer
|
|
697
|
+
description: Read-only repository research specialist...
|
|
679
698
|
---
|
|
699
|
+
|
|
700
|
+
Parent MUST spawn this skill as an isolated subagent with fresh context.
|
|
701
|
+
Do not execute it in the main thread.
|
|
680
702
|
```
|
|
681
703
|
|
|
682
|
-
|
|
704
|
+
The conductor invokes the wrapper in isolation and consumes only its structured report.
|
|
683
705
|
|
|
684
706
|
**Team workflow with Amp:**
|
|
685
707
|
|
|
@@ -748,11 +770,21 @@ CLAUDE.md # Committed — synced to .claude/CLAUDE.md
|
|
|
748
770
|
openspec/ # Committed — spec-driven workflow
|
|
749
771
|
config.yaml # Project context for AI
|
|
750
772
|
specs/ # Source of truth after archive
|
|
751
|
-
changes/ # Active work
|
|
773
|
+
changes/ # Active work; <name>/handoff.md indexes session state
|
|
752
774
|
```
|
|
753
775
|
|
|
754
776
|
## Changelog
|
|
755
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
|
+
|
|
784
|
+
### 0.1.12
|
|
785
|
+
- `figma-fetch --depth <n>` for large frames
|
|
786
|
+
- Write large Figma JSON as raw API text (avoids `Invalid string length` on huge trees)
|
|
787
|
+
|
|
756
788
|
### 0.1.11
|
|
757
789
|
- Optional **Figma personal token** setup: `.agents/figma.local.env` (gitignored) + `figma-mcp-launcher.cjs` (no secret in `.mcp.json`)
|
|
758
790
|
- CLI: `figma-setup`, `figma-status`, `figma-fetch` (REST nodes/file JSON)
|
|
@@ -260,13 +260,17 @@ async function figmaApiGet(token, path) {
|
|
|
260
260
|
try {
|
|
261
261
|
data = JSON.parse(text);
|
|
262
262
|
} catch {
|
|
263
|
-
data =
|
|
263
|
+
data = null;
|
|
264
264
|
}
|
|
265
265
|
if (!response.ok) {
|
|
266
|
-
const message =
|
|
266
|
+
const message =
|
|
267
|
+
(data && (data.err || data.message)) || response.statusText || `HTTP ${response.status}`;
|
|
267
268
|
throw new Error(String(message));
|
|
268
269
|
}
|
|
269
|
-
|
|
270
|
+
if (!data) {
|
|
271
|
+
throw new Error('Figma API returned non-JSON response');
|
|
272
|
+
}
|
|
273
|
+
return { data, text };
|
|
270
274
|
}
|
|
271
275
|
|
|
272
276
|
function resolveTemplate(templateName, profile) {
|
|
@@ -639,6 +643,8 @@ function generateAmpSubagentSkills(projectDir) {
|
|
|
639
643
|
'',
|
|
640
644
|
`<!-- AUTO-GENERATED from .agents/subagents/${file} — edit the source file, then run: npx agent-orchestrator-kit sync -->`,
|
|
641
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
|
+
'',
|
|
642
648
|
parsed[2].trim(),
|
|
643
649
|
'',
|
|
644
650
|
].join('\n');
|
|
@@ -1063,6 +1069,7 @@ program
|
|
|
1063
1069
|
.option('--url <url>', 'Figma design URL (file key + optional node-id)')
|
|
1064
1070
|
.option('--file <key>', 'Figma file key')
|
|
1065
1071
|
.option('--nodes <ids>', 'Comma-separated node ids (1:2 or 1-2)')
|
|
1072
|
+
.option('--depth <n>', 'Limit node tree depth (use for large frames; omit = full tree)')
|
|
1066
1073
|
.option('--out <path>', 'Output JSON path', 'figma-nodes.json')
|
|
1067
1074
|
.action(async (opts) => {
|
|
1068
1075
|
const projectDir = process.cwd();
|
|
@@ -1096,16 +1103,36 @@ program
|
|
|
1096
1103
|
.filter(Boolean)
|
|
1097
1104
|
.map((id) => id.replace(/-/g, ':'));
|
|
1098
1105
|
|
|
1106
|
+
const query = [];
|
|
1107
|
+
if (nodeIds.length) {
|
|
1108
|
+
query.push(`ids=${encodeURIComponent(nodeIds.join(','))}`);
|
|
1109
|
+
}
|
|
1110
|
+
if (opts.depth != null && String(opts.depth).trim() !== '') {
|
|
1111
|
+
const depth = Number(opts.depth);
|
|
1112
|
+
if (!Number.isInteger(depth) || depth < 1) {
|
|
1113
|
+
log.err('--depth must be a positive integer');
|
|
1114
|
+
process.exitCode = 1;
|
|
1115
|
+
return;
|
|
1116
|
+
}
|
|
1117
|
+
query.push(`depth=${depth}`);
|
|
1118
|
+
}
|
|
1119
|
+
|
|
1099
1120
|
try {
|
|
1100
|
-
const
|
|
1101
|
-
? `/files/${encodeURIComponent(fileKey)}/nodes?
|
|
1102
|
-
: `/files/${encodeURIComponent(fileKey)}`;
|
|
1103
|
-
log.info(
|
|
1104
|
-
|
|
1121
|
+
const apiPath = nodeIds.length
|
|
1122
|
+
? `/files/${encodeURIComponent(fileKey)}/nodes${query.length ? `?${query.join('&')}` : ''}`
|
|
1123
|
+
: `/files/${encodeURIComponent(fileKey)}${query.length ? `?${query.join('&')}` : ''}`;
|
|
1124
|
+
log.info(
|
|
1125
|
+
nodeIds.length
|
|
1126
|
+
? `Fetching ${nodeIds.length} node(s)${opts.depth ? ` (depth ${opts.depth})` : ''}…`
|
|
1127
|
+
: `Fetching full file${opts.depth ? ` (depth ${opts.depth})` : ''}…`
|
|
1128
|
+
);
|
|
1129
|
+
const { data, text } = await figmaApiGet(token, apiPath);
|
|
1105
1130
|
const outPath = join(projectDir, opts.out);
|
|
1106
1131
|
mkdirSync(dirname(outPath), { recursive: true });
|
|
1107
|
-
|
|
1108
|
-
|
|
1132
|
+
// Write API payload as-is — pretty-print of huge trees can throw "Invalid string length"
|
|
1133
|
+
writeFileSync(outPath, text.endsWith('\n') ? text : `${text}\n`);
|
|
1134
|
+
const nodeCount = data.nodes ? Object.keys(data.nodes).length : 0;
|
|
1135
|
+
log.ok(`Wrote ${opts.out}${nodeCount ? ` (${nodeCount} node key(s))` : ''}`);
|
|
1109
1136
|
} catch (error) {
|
|
1110
1137
|
log.err(`Figma API error: ${error.message}`);
|
|
1111
1138
|
process.exitCode = 1;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-orchestrator-kit",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "Universal AI agent orchestration kit for Cursor, Claude Code, and Amp Code — spec-driven OpenSpec pipeline,
|
|
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",
|
|
@@ -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
|
-
-
|
|
84
|
-
-
|
|
85
|
-
-
|
|
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
|
-
-
|
|
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
|
|
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
|
-
-
|
|
58
|
-
-
|
|
59
|
-
-
|
|
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
|
-
|
|
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
|
-
|
|
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. **
|
|
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.
|
|
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
|
-
###
|
|
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
|
-
###
|
|
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
|
-
###
|
|
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
|
-
###
|
|
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
|
|
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
|
|
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
|