agent-orchestrator-kit 0.1.9 → 0.1.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/README.md +107 -16
  3. package/bin/agent-orchestrator.js +373 -9
  4. package/package.json +7 -2
  5. package/profiles/generic/orchestrator.yaml +7 -0
  6. package/profiles/mvp/orchestrator.yaml +7 -0
  7. package/profiles/node/orchestrator.yaml +7 -0
  8. package/profiles/vue3/orchestrator.yaml +6 -0
  9. package/templates/.agents/amp.settings.json.example +4 -0
  10. package/templates/.agents/commands/opsx-apply.md +3 -3
  11. package/templates/.agents/commands/opsx-archive.md +2 -2
  12. package/templates/.agents/commands/opsx-design.md +2 -2
  13. package/templates/.agents/commands/opsx-explore.md +2 -2
  14. package/templates/.agents/commands/opsx-propose.md +5 -5
  15. package/templates/.agents/commands/opsx-quick.md +2 -2
  16. package/templates/.agents/commands/opsx-review.md +3 -3
  17. package/templates/.agents/commands/opsx-sync.md +2 -2
  18. package/templates/.agents/figma.local.env.example +10 -0
  19. package/templates/.agents/mcp.json.example +4 -0
  20. package/templates/.agents/rules/agent-orchestration.mdc +1 -0
  21. package/templates/.agents/rules/cli-via-npm.mdc +40 -0
  22. package/templates/.agents/rules/figma-token-setup.mdc +35 -0
  23. package/templates/.agents/rules/openspec-workflow.mdc +8 -5
  24. package/templates/.agents/skills/agent-orchestration/SKILL.md +8 -7
  25. package/templates/.agents/skills/openspec-apply-change/SKILL.md +3 -3
  26. package/templates/.agents/skills/openspec-archive-change/SKILL.md +2 -2
  27. package/templates/.agents/skills/openspec-explore/SKILL.md +2 -2
  28. package/templates/.agents/skills/openspec-howto/SKILL.md +4 -0
  29. package/templates/.agents/skills/openspec-propose/SKILL.md +5 -5
  30. package/templates/.agents/skills/openspec-sync-specs/SKILL.md +2 -2
  31. package/templates/.agents/subagents/code-reviewer.md +32 -0
  32. package/templates/.agents/subagents/code-writer.md +21 -0
  33. package/templates/.agents/subagents/design-implementer.md +28 -0
  34. package/templates/.agents/subagents/openspec-guide.md +24 -0
  35. package/templates/.agents/subagents/setup-doctor.md +26 -0
  36. package/templates/.agents/subagents/test-writer.md +17 -0
  37. package/templates/.github/workflows/agent-verify.yml +3 -3
  38. package/templates/.github/workflows/spec-verify.yml +3 -3
  39. package/templates/AGENTS.md +15 -3
  40. package/templates/CLAUDE.md +3 -2
  41. package/templates/orchestrator.yaml +15 -0
  42. package/templates/scripts/figma-mcp-launcher.cjs +67 -0
  43. package/templates/scripts/sync-local-agent-skills.sh +52 -5
package/CHANGELOG.md CHANGED
@@ -2,6 +2,36 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [Unreleased]
6
+
7
+ ## [0.1.11] - 2026-07-21
8
+
9
+ ### Added
10
+ - **Figma personal token setup** — local `.agents/figma.local.env` (gitignored) + committed `.agents/figma.local.env.example`
11
+ - **`scripts/figma-mcp-launcher.cjs`** — starts `figma-developer-mcp` with token from the env file (no secret in `.mcp.json`)
12
+ - **CLI** — `figma-setup`, `figma-status`, `figma-fetch` (REST file/nodes JSON via `X-Figma-Token`)
13
+ - Cursor/Amp MCP examples include optional `figma` server pointing at the launcher
14
+ - Agent rule `figma-token-setup.mdc`; setup-doctor + `/opsx:design` guidance (never ask for token in chat)
15
+ - `orchestrator.yaml` / profiles: `mcp.optional` includes `figma` + `figma.env_file` metadata
16
+
17
+ ### Fixed
18
+ - **Amp / agent PATH** — templates now document and require `npx` / `npm run` for OpenSpec and `agent-orchestrator-kit` CLIs (bare binaries often exit 127 in Amp shells)
19
+ - Added always-apply rule `templates/.agents/rules/cli-via-npm.mdc`; updated openspec skills/commands, `AGENTS.md`, `CLAUDE.md`, `orchestrator.yaml` `cli.*` hints
20
+ - Never recommend `openspec validate --strict` without `<name>` / `--all`
21
+
22
+ ## [0.1.10] - 2026-07-15
23
+
24
+ ### Added
25
+ - **Custom subagents** — new `.agents/subagents/` asset category, synced to `.cursor/agents/` and `.claude/agents/` (like skills/rules, delete-stale semantics on `sync`)
26
+ - 6 default subagents: `openspec-guide` (pipeline navigator, read-only), `code-writer` (scoped task implementation), `code-reviewer` (spec-compliance + convention review), `test-writer` (test authoring), `setup-doctor` (orchestrator setup diagnosis/repair), `design-implementer` (pixel-accurate Figma/screenshot → code, honors design-brief priority)
27
+ - **Amp support via skill wrappers** — Amp has no file-based subagents, so `init`/`update`/`sync` auto-generate a committed `.agents/skills/subagent-<name>/SKILL.md` wrapper per subagent (Amp loads `.agents/skills/` natively); wrappers are excluded from `.cursor/`/`.claude/` skill sync and removed when the source subagent is deleted
28
+ - `update` and `sync --target cursor|claude|all` now manage `.agents/subagents/` alongside skills and rules
29
+ - `scripts/sync-local-agent-skills.sh` generates Amp wrappers and rsyncs `.agents/subagents/` → `.cursor/agents/` and `.claude/agents/`
30
+
31
+ ### Fixed
32
+ - `update` no longer resurrects a CI workflow file the project deleted (e.g. `.github/workflows/agent-verify.yml` after switching to GitLab CI) — CI files are refreshed only when already present
33
+ - `update` keeps `scripts/sync-local-agent-skills.sh` executable
34
+
5
35
  ## [0.1.9] - 2026-07-12
6
36
 
7
37
  ### Added
package/README.md CHANGED
@@ -1,24 +1,41 @@
1
1
  # agent-orchestrator-kit
2
2
 
3
- Universal AI agent orchestration kit for **Cursor**, **Claude Code**, and **Amp Code** — spec-driven pipeline built on [OpenSpec](https://github.com/fission-ai/openspec).
3
+ Universal AI agent orchestration kit for **Cursor**, **Claude Code**, and **Amp Code** — spec-driven OpenSpec pipeline with **cross-IDE custom subagents**.
4
4
 
5
5
  [![npm version](https://img.shields.io/npm/v/agent-orchestrator-kit)](https://www.npmjs.com/package/agent-orchestrator-kit)
6
6
  [![license](https://img.shields.io/npm/l/agent-orchestrator-kit)](LICENSE)
7
7
 
8
8
  ## What It Is
9
9
 
10
- A portable kit that installs a **5-role AI pipeline** into any project:
10
+ A portable kit that installs a **role-separated AI pipeline** into any project:
11
11
 
12
12
  ```
13
- explore → propose → review → apply → verify → archive
13
+ explore → [design] → propose → review → apply → verify → archive
14
14
  ```
15
15
 
16
16
  Each role runs in a **separate agent session** with dedicated permissions, model hints, and handoff gates. The `openspec/changes/` folder acts as the **contract between agents** — no shared memory between sessions, only files.
17
17
 
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
+
20
+ **Custom subagents (v0.1.10+)** ship with the kit and work in all three IDEs:
21
+
22
+ | Subagent | Role |
23
+ |----------|------|
24
+ | `openspec-guide` | Pipeline navigator — status, gates, next `/opsx:*` command |
25
+ | `code-writer` | Scoped task implementation against stack conventions |
26
+ | `code-reviewer` | Spec-compliance + convention review of the resulting code |
27
+ | `test-writer` | Automated tests for recently changed code |
28
+ | `setup-doctor` | Orchestrator / MCP / sync diagnosis and repair |
29
+ | `design-implementer` | Pixel-accurate Figma / screenshot → production UI |
30
+
31
+ - **Cursor** → `.cursor/agents/` (native subagents)
32
+ - **Claude Code** → `.claude/agents/` (native subagents)
33
+ - **Amp Code** → auto-generated `subagent-*` skill wrappers in `.agents/skills/` (Amp has no file-based subagents)
34
+
18
35
  Works with:
19
- - [Cursor](https://cursor.sh) — via `.cursor/rules/` + `.cursor/skills/`
20
- - [Claude Code](https://code.claude.com) — via `CLAUDE.md` + `.claude/skills/`
21
- - [Amp Code](https://ampcode.com) — via `AGENTS.md` + `.agents/skills/` (native, no sync needed)
36
+ - [Cursor](https://cursor.sh) — via `.cursor/rules/` + `.cursor/skills/` + `.cursor/agents/`
37
+ - [Claude Code](https://code.claude.com) — via `CLAUDE.md` + `.claude/skills/` + `.claude/agents/`
38
+ - [Amp Code](https://ampcode.com) — via `AGENTS.md` + `.agents/skills/` (native, including `subagent-*` wrappers)
22
39
 
23
40
  ## Why
24
41
 
@@ -38,15 +55,16 @@ npx agent-orchestrator-kit@latest init --profile generic --ci gitlab --spec-veri
38
55
 
39
56
  See [Installation](#installation) for profile/CI options.
40
57
 
41
- **🔄 Already have the kit installed? Get `status` / `gate-check` / GitHub Spec Verifier (v0.1.7+):**
58
+ **🔄 Already have the kit installed? Upgrade to latest (Figma PAT in v0.1.11+, subagents in v0.1.10+):**
42
59
 
43
60
  ```bash
44
61
  npx agent-orchestrator-kit@latest update
45
- ./scripts/sync-local-agent-skills.sh
46
- npx agent-orchestrator-kit@latest status # try it right away
62
+ npx agent-orchestrator-kit@latest sync # or: ./scripts/sync-local-agent-skills.sh
63
+ npx agent-orchestrator-kit@latest figma-setup # optional local Figma token
64
+ npx agent-orchestrator-kit@latest status
47
65
  ```
48
66
 
49
- See [Upgrading an existing project](#upgrading-an-existing-project-to-v017-status--gate-check--github-spec-verifier) for what changes and what stays opt-in.
67
+ This refreshes kit-managed files, installs `.agents/subagents/`, generates Amp `subagent-*` skill wrappers, and syncs agents into `.cursor/agents/` + `.claude/agents/`. See [Changelog](#changelog) for the full list.
50
68
 
51
69
  ## Installation
52
70
 
@@ -130,6 +148,7 @@ your-project/
130
148
  │ ├── amp.settings.json.example # Amp MCP template
131
149
  │ ├── commands/ # 6 /opsx:* commands
132
150
  │ ├── rules/ # 3 auto-applied rules
151
+ │ ├── subagents/ # 6 default custom subagents (Cursor/Claude/Amp)
133
152
  │ └── skills/
134
153
  │ ├── agent-orchestration/ # Pipeline orchestration
135
154
  │ ├── openspec-howto/
@@ -149,8 +168,9 @@ your-project/
149
168
  |----------|----------|
150
169
  | Orchestration | 5-role pipeline, `AGENTS.md`, `orchestrator.yaml`, review command |
151
170
  | OpenSpec skills | All 7 skills for `/opsx:*` workflow |
152
- | IDE sync | Cursor + Claude Code sync script (`--delete` semantics — removes stale skills) |
153
- | CLI gates | `agent-orchestrator status` / `gate-check` — deterministic review-gate checks |
171
+ | IDE sync | Cursor + Claude Code sync script (`--delete` semantics — removes stale skills/subagents) |
172
+ | Subagents | `openspec-guide`, `code-writer`, `code-reviewer`, `test-writer`, `setup-doctor`, `design-implementer` native in Cursor (`.cursor/agents/`) + Claude Code (`.claude/agents/`), exposed to Amp as auto-generated `subagent-*` skill wrappers in `.agents/skills/` |
173
+ | CLI gates | `npx agent-orchestrator-kit status` / `gate-check` — deterministic review-gate checks (always via `npx`; see `cli-via-npm.mdc`) |
154
174
  | CI | `agent-verify.yml` — GitHub (default) or GitLab fragment + `prebuild` hook, both run `gate-check` |
155
175
  | AI Spec Verifier | `spec-verify.yml` + verifier scripts — GitLab or GitHub, opt-in (`--spec-verify`) |
156
176
  | MCP templates | Memory MCP for Cursor and Amp |
@@ -173,6 +193,8 @@ Local only (not committed): `.cursor/` `.claude/` `.amp/`
173
193
 
174
194
  Amp reads `.agents/skills/` and `AGENTS.md` **natively** — no sync needed.
175
195
 
196
+ **CLI note:** Amp shells often lack global `openspec` / `agent-orchestrator-kit` on PATH (exit 127). Agents must use `npx …` / `npm run …` — see always-apply rule `.agents/rules/cli-via-npm.mdc`.
197
+
176
198
  1. Install the kit → `AGENTS.md` is created automatically.
177
199
  2. Amp picks up skills from `.agents/skills/` on session start.
178
200
  3. Copy Amp MCP config (on first sync):
@@ -183,6 +205,8 @@ cp .agents/amp.settings.json.example .amp/settings.json
183
205
 
184
206
  Or run `./scripts/sync-local-agent-skills.sh` — it creates `.amp/settings.json` automatically.
185
207
 
208
+ **Subagents in Amp:** Amp has no file-based custom subagents (only skills and plugin agents), so the kit exposes every `.agents/subagents/<name>.md` as an auto-generated skill `subagent-<name>` in `.agents/skills/`. These wrappers are committed to git, so Amp picks them up with zero local setup — just say "use the subagent-design-implementer skill" or let Amp auto-load it from the description. Edit the source file in `.agents/subagents/` (never the wrapper) and re-run `sync` to regenerate.
209
+
186
210
  4. Use commands directly:
187
211
 
188
212
  ```
@@ -210,9 +234,10 @@ Switch modes in Amp CLI: `Ctrl+O` → `mode`.
210
234
  1. Run sync: `./scripts/sync-local-agent-skills.sh`
211
235
  2. This creates:
212
236
  - `.claude/CLAUDE.md` — project context
213
- - `.claude/skills/` — all skills from `.agents/skills/`
237
+ - `.claude/skills/` — all skills from `.agents/skills/` (excluding Amp `subagent-*` wrappers)
238
+ - `.claude/agents/` — custom subagents from `.agents/subagents/` (native Claude Code subagents)
214
239
  3. Skills are auto-loaded by Claude Code from `.claude/skills/`.
215
- 4. Invoke directly: `/agent-orchestration`, `/openspec-howto`, etc.
240
+ 4. Invoke directly: `/agent-orchestration`, `/openspec-howto`, etc. Subagents are delegated automatically by description or on request ("use the design-implementer subagent").
216
241
 
217
242
  **CLAUDE.md tiers used:**
218
243
  - Project level: `.claude/CLAUDE.md` (synced from `CLAUDE.md`)
@@ -237,10 +262,12 @@ You can add `context: fork` to explore/review skills for isolated subagent sessi
237
262
  2. Creates:
238
263
  - `.cursor/skills/` — all skills
239
264
  - `.cursor/rules/` — `.mdc` rule files
265
+ - `.cursor/agents/` — custom subagents (`openspec-guide`, `code-writer`, `code-reviewer`, `test-writer`, `setup-doctor`, `design-implementer`)
240
266
  - `.mcp.json` — from `mcp.json.example` (if not present)
241
267
  3. Rules are applied automatically per `alwaysApply: true`.
268
+ 4. Subagents are invoked by name in chat (e.g. "use the code-reviewer subagent on this diff") or delegated to automatically by Cursor when their `description` matches the task. Add project-specific subagents by dropping `.md` files into `.agents/subagents/` and re-running sync.
242
269
 
243
- **Memory MCP for Cursor** (`.mcp.json`):
270
+ **Memory + optional Figma MCP for Cursor** (`.mcp.json`):
244
271
 
245
272
  ```json
246
273
  {
@@ -249,11 +276,17 @@ You can add `context: fork` to explore/review skills for isolated subagent sessi
249
276
  "command": "npx",
250
277
  "args": ["-y", "@modelcontextprotocol/server-memory"],
251
278
  "env": { "MEMORY_FILE_PATH": ".cursor/memory.json" }
279
+ },
280
+ "figma": {
281
+ "command": "node",
282
+ "args": ["scripts/figma-mcp-launcher.cjs"]
252
283
  }
253
284
  }
254
285
  }
255
286
  ```
256
287
 
288
+ Token lives in `.agents/figma.local.env` — see [Figma token](#figma-token-optional).
289
+
257
290
  ## The Pipeline in Detail
258
291
 
259
292
  ### Role 1: Explorer — `/opsx:explore`
@@ -282,7 +315,7 @@ You can add `context: fork` to explore/review skills for isolated subagent sessi
282
315
 
283
316
  **Exit gate:**
284
317
  ```bash
285
- openspec validate <name> --strict --type change # must be ✓
318
+ npx openspec validate <name> --strict --type change # must be ✓
286
319
  ```
287
320
 
288
321
  ```
@@ -560,6 +593,49 @@ npx frontend-agent-skills install --agent all --yes
560
593
 
561
594
  > **Migrating from `vue-cursor-skills`?** Renamed to `frontend-agent-skills` v2 — same package, old CLI alias still works.
562
595
 
596
+ ## Figma token (optional)
597
+
598
+ Personal Access Token for design intake (`/opsx:design`) and the optional Framelink `figma-developer-mcp` server. **Never paste the token into AI chat.**
599
+
600
+ ### Setup (each developer, once)
601
+
602
+ ```bash
603
+ npx agent-orchestrator-kit figma-setup
604
+ # open .agents/figma.local.env in the IDE and set:
605
+ # FIGMA_ACCESS_TOKEN=figd_...
606
+ npx agent-orchestrator-kit figma-status
607
+ ```
608
+
609
+ Then restart Cursor / Amp.
610
+
611
+ | Path | Purpose | Git |
612
+ |------|---------|-----|
613
+ | `.agents/figma.local.env` | Your token (`FIGMA_ACCESS_TOKEN`) | **ignored** |
614
+ | `.agents/figma.local.env.example` | Template | committed |
615
+ | `scripts/figma-mcp-launcher.cjs` | Starts MCP with token from the env file | committed |
616
+ | `.mcp.json` → `figma` | Points at the launcher (no secret inline) | committed OK |
617
+
618
+ Create a token: Figma → Settings → Security → Personal access tokens (file content read as needed).
619
+
620
+ ### CLI
621
+
622
+ ```bash
623
+ npx agent-orchestrator-kit figma-setup
624
+ npx agent-orchestrator-kit figma-status
625
+ npx agent-orchestrator-kit figma-fetch --url "https://www.figma.com/design/FILE_KEY/Name?node-id=1-2" \
626
+ --out openspec/changes/<name>/assets/figma-nodes.json
627
+ ```
628
+
629
+ `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`.
630
+
631
+ ### Upgrade existing projects
632
+
633
+ ```bash
634
+ npx agent-orchestrator-kit@latest update
635
+ npx agent-orchestrator-kit figma-setup
636
+ ./scripts/sync-local-agent-skills.sh
637
+ ```
638
+
563
639
  ## Memory MCP — Shared State Between Sessions
564
640
 
565
641
  Each role starts a fresh session. Memory MCP persists orchestration state across sessions so you don't re-explain context every time.
@@ -648,16 +724,20 @@ npx agent-orchestrator-kit gate-check [change-name] [options]
648
724
  .agents/ # Committed — source of truth for all IDEs
649
725
  commands/ # /opsx:* command definitions
650
726
  rules/ # Auto-applied rules for Cursor
727
+ subagents/ # Custom subagents (source of truth, all IDEs)
651
728
  skills/ # Skills for Cursor, Claude Code, Amp
729
+ # subagent-*/ — auto-generated Amp wrappers (do not edit)
652
730
  orchestrator.yaml # Project pipeline config
653
731
 
654
732
  .cursor/ # Local only — Cursor IDE runtime
655
733
  skills/ # Synced from .agents/skills/
656
734
  rules/ # Synced from .agents/rules/
735
+ agents/ # Synced from .agents/subagents/
657
736
  memory.json # Memory MCP data
658
737
 
659
738
  .claude/ # Local only — Claude Code runtime
660
739
  skills/ # Synced from .agents/skills/
740
+ agents/ # Synced from .agents/subagents/
661
741
  CLAUDE.md # Synced from root CLAUDE.md
662
742
 
663
743
  .amp/ # Local only — Amp config
@@ -673,6 +753,17 @@ openspec/ # Committed — spec-driven workflow
673
753
 
674
754
  ## Changelog
675
755
 
756
+ ### 0.1.11
757
+ - Optional **Figma personal token** setup: `.agents/figma.local.env` (gitignored) + `figma-mcp-launcher.cjs` (no secret in `.mcp.json`)
758
+ - CLI: `figma-setup`, `figma-status`, `figma-fetch` (REST nodes/file JSON)
759
+ - Agent rule + docs: never paste Figma tokens into chat
760
+ - Amp PATH hardening: prefer `npx` / `npm run` for OpenSpec and kit CLIs (`cli-via-npm` rule)
761
+
762
+ ### 0.1.10
763
+ - Custom subagents (`.agents/subagents/`) synced to `.cursor/agents/` + `.claude/agents/`, exposed to Amp via auto-generated `subagent-*` skill wrappers
764
+ - 6 default subagents: `openspec-guide`, `code-writer`, `code-reviewer`, `test-writer`, `setup-doctor`, `design-implementer`
765
+ - `update` no longer resurrects deleted CI workflow files
766
+
676
767
  ### 0.1.9
677
768
  - Design intake — `/opsx:design` captures design into `design-brief.md` + `assets/` (Figma / export / screenshot / photo)
678
769
  - Role `design_intake` + opt-in `pipeline.require_design_brief` (default `false`) in all profiles