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
@@ -31,7 +31,7 @@ Verifier runs on **GitHub Actions** (default) or **GitLab** via `prebuild` → `
31
31
 
32
32
  With `init --ci gitlab --spec-verify` or `init --ci github --spec-verify`, an **AI Spec Verifier** also runs on MRs/PRs changing `src/`: an Amp agent checks the changed code against `openspec/specs/` and a **BLOCKED verdict fails the pipeline** (gate `spec-verify-blocking` in `.agents/orchestrator.yaml`).
33
33
 
34
- Both CI fragments also run `agent-orchestrator-kit gate-check` — a deterministic check that fails the pipeline when `src/` changed but the active change has no `review.md` with `Verdict: APPROVE` (when `require_spec_review: true`), and optionally requires `design-brief.md` (when `require_design_brief: true`, unless `proposal.md` has `Design: none`). Run `agent-orchestrator-kit status` at the start of any session to see task progress, review verdict, design brief, and archive readiness for every active change without querying `openspec` per change.
34
+ Both CI fragments also run `npx agent-orchestrator-kit gate-check` — a deterministic check that fails the pipeline when `src/` changed but the active change has no `review.md` with `Verdict: APPROVE` (when `require_spec_review: true`), and optionally requires `design-brief.md` (when `require_design_brief: true`, unless `proposal.md` has `Design: none`). At session start run `npx agent-orchestrator-kit status` (not a bare global binary — Amp PATH often lacks it; see `.agents/rules/cli-via-npm.mdc`).
35
35
 
36
36
  ## Hard Rules
37
37
 
@@ -48,10 +48,10 @@ Both CI fragments also run `agent-orchestrator-kit gate-check` — a determinist
48
48
  | explore → design | UI change needs a brief; change name chosen |
49
49
  | explore → propose | Decision brief written; change name chosen (skip design if non-UI) |
50
50
  | design → propose | `design-brief.md` (+ `assets/`) written |
51
- | propose → review | `openspec validate --strict` passes ✓ |
51
+ | propose → review | `npx openspec validate <name> --strict --type change` passes ✓ |
52
52
  | review → apply | Reviewer writes explicit **Approve** — enforced in CI by `gate-check` |
53
53
  | apply → verify | All `tasks.md` checkboxes `[x]`; local build OK |
54
- | verify → archive | CI green; PR merged — check `agent-orchestrator status` for "ready to archive" |
54
+ | verify → archive | CI green; PR merged — check `npx agent-orchestrator-kit status` for "ready to archive" |
55
55
 
56
56
  ## Context to Pin per Role
57
57
 
@@ -67,6 +67,18 @@ Both CI fragments also run `agent-orchestrator-kit gate-check` — a determinist
67
67
 
68
68
  See `.agents/orchestrator.yaml` for role config, pipeline flags, and MCP baseline.
69
69
 
70
+ ### Optional: Figma personal token
71
+
72
+ For design intake against private Figma files, each developer configures a local token (never commit, never paste into chat):
73
+
74
+ ```bash
75
+ npx agent-orchestrator-kit figma-setup
76
+ # edit .agents/figma.local.env → FIGMA_ACCESS_TOKEN=...
77
+ npx agent-orchestrator-kit figma-status
78
+ ```
79
+
80
+ MCP starts via `scripts/figma-mcp-launcher.cjs` (secret stays out of `.mcp.json`). See kit README → **Figma token**.
81
+
70
82
  ## Skills & Commands
71
83
 
72
84
  All skills live in `.agents/skills/` (committed to git).
@@ -34,11 +34,12 @@ Use `/skill-name` or let Claude auto-load based on context.
34
34
  ## Key Rules for This Session
35
35
 
36
36
  - Check `.agents/orchestrator.yaml` for project-specific pipeline config.
37
- - One active change at a time — run `openspec list` to confirm.
37
+ - One active change at a time — run `npx openspec list` / `npx agent-orchestrator-kit status` to confirm.
38
38
  - No code edits in explore, design, or review mode.
39
39
  - Design Intake writes only `design-brief.md` and `assets/` — never `src/`.
40
40
  - After completing apply: run build/lint before declaring done.
41
- - Use `openspec validate --all --strict` to verify change artifacts.
41
+ - Use `npx openspec validate --all --strict` or `npx openspec validate <name> --strict --type change`.
42
+ - Never bare `openspec` / `agent-orchestrator-kit` without `npx` (Amp PATH → exit 127). See `.agents/rules/cli-via-npm.mdc`.
42
43
 
43
44
  ## File Locations
44
45
 
@@ -55,10 +55,25 @@ mcp:
55
55
  baseline:
56
56
  - memory
57
57
  optional:
58
+ - figma
58
59
  - github
59
60
  - browser
60
61
 
62
+ figma:
63
+ env_file: .agents/figma.local.env
64
+ token_key: FIGMA_ACCESS_TOKEN
65
+ mcp_launcher: scripts/figma-mcp-launcher.cjs
66
+
61
67
  verifier:
62
68
  lint_command: "npm run lint"
63
69
  build_command: "npm run build"
64
70
  test_command: ""
71
+
72
+ # Amp/Cursor often lack global bins — agents must use npx/npm (see .agents/rules/cli-via-npm.mdc)
73
+ cli:
74
+ status: npx agent-orchestrator-kit status
75
+ gate_check: npx agent-orchestrator-kit gate-check
76
+ openspec_list: npx openspec list
77
+ openspec_validate_change: npx openspec validate <name> --strict --type change
78
+ openspec_validate_all: npx openspec validate --all --strict
79
+ openspec_status: npx openspec status --change <name> --json
@@ -0,0 +1,67 @@
1
+ #!/usr/bin/env node
2
+ const { spawn } = require('child_process');
3
+ const { existsSync, readFileSync } = require('fs');
4
+ const { join } = require('path');
5
+
6
+ const projectDir = join(__dirname, '..');
7
+ const envPath = join(projectDir, '.agents', 'figma.local.env');
8
+
9
+ function readLocalToken() {
10
+ if (!existsSync(envPath)) {
11
+ console.error(
12
+ `[figma-mcp-launcher] Missing ${envPath}. Copy .agents/figma.local.env.example → .agents/figma.local.env and add FIGMA_ACCESS_TOKEN (do not paste the token into chat).`
13
+ );
14
+ process.exit(1);
15
+ }
16
+
17
+ const raw = readFileSync(envPath, 'utf-8');
18
+ const values = {};
19
+ for (const line of raw.split(/\r?\n/)) {
20
+ const trimmed = line.trim();
21
+ if (!trimmed || trimmed.startsWith('#')) continue;
22
+ const eq = trimmed.indexOf('=');
23
+ if (eq === -1) continue;
24
+ const key = trimmed.slice(0, eq).trim();
25
+ let value = trimmed.slice(eq + 1).trim();
26
+ if (
27
+ (value.startsWith('"') && value.endsWith('"')) ||
28
+ (value.startsWith("'") && value.endsWith("'"))
29
+ ) {
30
+ value = value.slice(1, -1);
31
+ }
32
+ values[key] = value;
33
+ }
34
+
35
+ return values.FIGMA_ACCESS_TOKEN || values.FIGMA_API_KEY || '';
36
+ }
37
+
38
+ const token = readLocalToken();
39
+ if (!token) {
40
+ console.error(
41
+ '[figma-mcp-launcher] FIGMA_ACCESS_TOKEN is empty in .agents/figma.local.env. Add your Figma personal access token locally (never in chat).'
42
+ );
43
+ process.exit(1);
44
+ }
45
+
46
+ const child = spawn('npx', ['-y', 'figma-developer-mcp', '--stdio'], {
47
+ stdio: 'inherit',
48
+ env: {
49
+ ...process.env,
50
+ FIGMA_API_KEY: token,
51
+ FIGMA_ACCESS_TOKEN: token,
52
+ },
53
+ shell: process.platform === 'win32',
54
+ });
55
+
56
+ child.on('exit', (code, signal) => {
57
+ if (signal) {
58
+ process.kill(process.pid, signal);
59
+ return;
60
+ }
61
+ process.exit(code == null ? 1 : code);
62
+ });
63
+
64
+ child.on('error', (error) => {
65
+ console.error(`[figma-mcp-launcher] Failed to start figma-developer-mcp: ${error.message}`);
66
+ process.exit(1);
67
+ });
@@ -21,18 +21,59 @@ echo ""
21
21
  echo "sync-local-agent-skills"
22
22
  echo "-----------------------"
23
23
 
24
+ # ── Amp subagent skill wrappers ────────────────────────────────────────
25
+ # Amp has no file-based subagents; it loads skills from .agents/skills/.
26
+ # Generate a skill wrapper per subagent so they work in Amp too.
27
+ if [ -d .agents/subagents ]; then
28
+ echo ""
29
+ info "Generating Amp skill wrappers from .agents/subagents/"
30
+
31
+ for old in .agents/skills/subagent-*; do
32
+ [ -d "$old" ] && rm -rf "$old"
33
+ done
34
+
35
+ for sub in .agents/subagents/*.md; do
36
+ [ -f "$sub" ] || continue
37
+ NAME="$(awk '/^---$/{c++; next} c==1 && /^name:/{sub(/^name:[ \t]*/,""); print; exit}' "$sub")"
38
+ DESC="$(awk '/^---$/{c++; next} c==1 && /^description:/{sub(/^description:[ \t]*/,""); print; exit}' "$sub")"
39
+ if [ -z "$NAME" ] || [ -z "$DESC" ]; then
40
+ warn "skip (no name/description): $sub"
41
+ continue
42
+ fi
43
+ DIR=".agents/skills/subagent-${NAME}"
44
+ mkdir -p "$DIR"
45
+ {
46
+ echo "---"
47
+ echo "name: subagent-${NAME}"
48
+ echo "description: ${DESC}"
49
+ echo "---"
50
+ echo ""
51
+ echo "<!-- AUTO-GENERATED from ${sub} — edit the source file, then re-run this script -->"
52
+ echo ""
53
+ awk '/^---$/{c++; next} c>=2{print}' "$sub"
54
+ } > "$DIR/SKILL.md"
55
+ ok "$DIR/SKILL.md"
56
+ done
57
+ fi
58
+
24
59
  # ── Cursor ─────────────────────────────────────────────────────────────
25
60
  echo ""
26
61
  info "Syncing → .cursor/ (Cursor)"
27
- mkdir -p .cursor/skills .cursor/rules
62
+ mkdir -p .cursor/skills .cursor/rules .cursor/agents
28
63
 
29
- rsync -a --delete .agents/skills/ .cursor/skills/
64
+ rsync -a --delete --exclude 'subagent-*' .agents/skills/ .cursor/skills/
65
+ rm -rf .cursor/skills/subagent-*
30
66
  ok ".cursor/skills/"
31
67
 
32
68
  for rule in .agents/rules/*.mdc; do
33
69
  [ -f "$rule" ] && cp "$rule" .cursor/rules/ && ok ".cursor/rules/$(basename "$rule")"
34
70
  done
35
71
 
72
+ if [ -d .agents/subagents ]; then
73
+ rsync -a --delete .agents/subagents/ .cursor/agents/
74
+ ok ".cursor/agents/"
75
+ fi
76
+
36
77
  if [ ! -f .mcp.json ] && [ -f .agents/mcp.json.example ]; then
37
78
  cp .agents/mcp.json.example .mcp.json
38
79
  ok ".mcp.json created from example"
@@ -43,11 +84,17 @@ fi
43
84
  # ── Claude Code ────────────────────────────────────────────────────────
44
85
  echo ""
45
86
  info "Syncing → .claude/ (Claude Code)"
46
- mkdir -p .claude/skills
87
+ mkdir -p .claude/skills .claude/agents
47
88
 
48
- rsync -a --delete .agents/skills/ .claude/skills/
89
+ rsync -a --delete --exclude 'subagent-*' .agents/skills/ .claude/skills/
90
+ rm -rf .claude/skills/subagent-*
49
91
  ok ".claude/skills/"
50
92
 
93
+ if [ -d .agents/subagents ]; then
94
+ rsync -a --delete .agents/subagents/ .claude/agents/
95
+ ok ".claude/agents/"
96
+ fi
97
+
51
98
  if [ -f CLAUDE.md ]; then
52
99
  cp CLAUDE.md .claude/CLAUDE.md
53
100
  ok ".claude/CLAUDE.md"
@@ -55,7 +102,7 @@ fi
55
102
 
56
103
  # ── Amp Code ───────────────────────────────────────────────────────────
57
104
  echo ""
58
- info "Amp Code reads .agents/ directly — no sync needed"
105
+ info "Amp Code reads .agents/ directly — subagents exposed via skill wrappers"
59
106
  mkdir -p .amp
60
107
  if [ ! -f .amp/settings.json ] && [ -f .agents/amp.settings.json.example ]; then
61
108
  cp .agents/amp.settings.json.example .amp/settings.json