# agent-orchestrator-kit

Universal AI agent orchestration kit for **Cursor**, **Claude Code**, and **Amp Code** — spec-driven OpenSpec pipeline with **cross-IDE custom subagents**.

[![npm version](https://img.shields.io/npm/v/agent-orchestrator-kit)](https://www.npmjs.com/package/agent-orchestrator-kit)
[![license](https://img.shields.io/npm/l/agent-orchestrator-kit)](LICENSE)

## What It Is

A portable kit that installs a **role-separated AI pipeline** into any project:

```
explore → [design] → propose → review → apply → verify → archive
```

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.

**Figma PAT setup** — local `.agents/figma.local.env` + MCP launcher (token never in chat / committed MCP JSON). See [Figma token](#figma-token-optional).

**Custom subagents** ship with the kit and work in all three IDEs:

| Subagent | Role |
|----------|------|
| `openspec-guide` | Pipeline navigator — status, gates, next `/opsx:*` command |
| `code-writer` | Scoped task implementation against stack conventions |
| `code-reviewer` | Spec-compliance + convention review of the resulting code |
| `test-writer` | Automated tests for recently changed code |
| `setup-doctor` | Orchestrator / MCP / sync diagnosis and repair |
| `design-implementer` | Pixel-accurate Figma / screenshot → production UI |
| `codebase-explorer` | Read-only repository investigation for explore |
| `design-intake` | Design source → durable brief + assets |
| `spec-architect` | Proposal, design, delta specs, and tasks |
| `spec-reviewer` | Pre-apply artifact gate + `review.md` |
| `spec-archiver` | Delta merge and completed-change archive |
| `session-handoff` | Restore/persist Memory + `handoff.md` + expanded next-thread prompt |

Delegation is **differentiated per phase** (lean model): thinking-heavy phases spawn a mandatory specialist, apply is parent-driven, archive is a deterministic CLI:

| Phase / signal | Delegation |
|----------------|------------|
| Status / gates / next command | `openspec-guide` |
| Session start restore / session exit persist | parent-driven CLI (`handoff --restore` / `handoff <name>`); `session-handoff` is a fallback only |
| Kit / MCP / sync repair | `setup-doctor` |
| Explore repository research | `codebase-explorer` (mandatory) |
| Design / propose / spec review | `design-intake` / `spec-architect` / `spec-reviewer` (mandatory) |
| Apply | parent implements from `tasks.md` + `apply-notes.md`; `code-writer` / `test-writer` optional for ≥ 2 independent tasks or explicit request; `design-implementer` for design-brief/Figma tasks |
| Pre-PR code review | `code-reviewer` |
| Archive | `npx agent-orchestrator-kit archive <name>` (CLI — no subagent; `spec-archiver` is a fallback when the CLI is unavailable) |

- **Cursor** → `.cursor/agents/` (native subagents)
- **Claude Code** → `.claude/agents/` (native subagents)
- **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

Works with:
- [Cursor](https://cursor.sh) — via `.cursor/rules/` + `.cursor/skills/` + `.cursor/agents/`
- [Claude Code](https://code.claude.com) — via `CLAUDE.md` + `.claude/skills/` + `.claude/agents/`
- [Amp Code](https://ampcode.com) — via `AGENTS.md` + `.agents/skills/` (native, including `subagent-*` wrappers)

## Why

Without role separation, AI agents tend to mix thinking with implementation, skip spec review, and accumulate context debt across one long chat. This kit enforces the discipline at the filesystem level: each role has explicit allowed files, a checklist, and a handoff gate before the next role starts.

The `AGENTS.md` / `CLAUDE.md` files tell each IDE exactly what the roles are, so you don't repeat yourself every session.

## Quickstart

**🆕 New project:**

```bash
npm i -D @fission-ai/openspec && npx openspec init
npx agent-orchestrator-kit@latest init --profile generic          # default: GitHub Actions CI
./scripts/sync-local-agent-skills.sh
```

GitLab-hosted project with the opt-in AI Spec Verifier (needs the Amp CLI, `AMP_API_KEY`, and a GitLab token in CI):

```bash
npx agent-orchestrator-kit@latest init --profile generic --ci gitlab --spec-verify
```

See [Installation](#installation) for profile/CI options.

**🔄 Already have the kit installed? Upgrade to latest (v0.22.0: skill Session Start/Exit and routing are generated from the rules on `init`/`update`/`sync`; `handoff.md` drops `## Metrics`; specialists own their build steps):**

```bash
npx agent-orchestrator-kit@latest update
npx agent-orchestrator-kit@latest sync         # or: ./scripts/sync-local-agent-skills.sh
npx agent-orchestrator-kit@latest mcp-setup    # optional — GitHub/GitLab from origin + browser
npx agent-orchestrator-kit@latest figma-setup  # optional — local Figma token
npx agent-orchestrator-kit@latest hooks-setup  # optional — pre-commit review gate
npx agent-orchestrator-kit@latest status
```

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.

## Installation

### Prerequisites

- Node.js ≥ 18
- [OpenSpec](https://github.com/fission-ai/openspec) installed in the project:

```bash
npm i -D @fission-ai/openspec
npx openspec init
```

> **Important:** `agent-orchestrator-kit init` does **not** install OpenSpec automatically. Install OpenSpec first (or ensure it exists in the repo), then run kit init.

### Install the kit

```bash
npx agent-orchestrator-kit init
```

With a stack profile:

```bash
npx agent-orchestrator-kit init --profile vue3
npx agent-orchestrator-kit init --profile node
npx agent-orchestrator-kit init --profile generic
npx agent-orchestrator-kit init --profile mvp    # demos / spikes — no review gate
```

With options:

```bash
npx agent-orchestrator-kit init \
  --profile vue3 \
  --name "My Project" \
  --lang uk
```

For GitLab-hosted projects (verify via `prebuild` hook — no GitHub Actions):

```bash
npx agent-orchestrator-kit init --ci gitlab
```

This installs `.gitlab/agent-verify.yml`, injects `verify:openspec` and PM-aware `prebuild` into `package.json`. When DevOps runs `npm run build` (or yarn/pnpm build), npm lifecycle runs `prebuild` first → `npx openspec validate --all --strict` executes automatically.

Optional dev-controlled CI before DevOps setup: copy `templates/.gitlab-ci.starter.yml.example` from the kit to `.gitlab-ci.yml` and adjust stages as needed.

Skip CI files entirely:

```bash
npx agent-orchestrator-kit init --ci none
```

Default remains GitHub Actions (`--ci github`).

### Sync to local IDEs

After init (and after every update):

```bash
./scripts/sync-local-agent-skills.sh
```

This copies `.agents/` to your local IDE directories (not committed to git).

The CLI commands `init`, `update` and `sync` also regenerate the `session-start`, `session-exit` and `routing` blocks of `.agents/skills/agent-orchestration/SKILL.md` from `.agents/rules/session-handoff.mdc` and `agent-orchestration.mdc`; edit the rule, not the block. `./scripts/sync-local-agent-skills.sh` only copies files and does not regenerate the blocks, so after editing a rule run `npx agent-orchestrator-kit sync`. A project installed before the blocks existed has a skill without markers: run `npx agent-orchestrator-kit update` once.

## What Gets Installed

```
your-project/
├── AGENTS.md
├── CLAUDE.md
├── .github/workflows/agent-verify.yml   # CI (default --ci github)
├── .github/workflows/spec-verify.yml    # AI Spec Verifier (--ci github --spec-verify, opt-in)
├── .gitlab/agent-verify.yml             # CI fragment (--ci gitlab)
├── .gitlab/spec-verify.yml              # AI Spec Verifier (--ci gitlab --spec-verify, opt-in)
├── openspec/config.yaml.example         # only when openspec/config.yaml does not exist yet
├── .agents/
│   ├── orchestrator.yaml
│   ├── mcp.json.example                 # Cursor / Claude Code MCP template (.mcp.json)
│   ├── amp.settings.json.example        # Amp MCP template (.amp/settings.json)
│   ├── figma.local.env.example          # + github/gitlab.local.env.example (token templates)
│   ├── commands/                        # /opsx:* role commands
│   ├── rules/                           # auto-applied orchestration rules
│   ├── subagents/                       # 12 stage/custom subagents (Cursor/Claude/Amp)
│   └── skills/
│       ├── agent-orchestration/         # Pipeline orchestration
│       ├── openspec-howto/
│       ├── openspec-explore/
│       ├── openspec-propose/
│       ├── openspec-apply-change/
│       ├── openspec-archive-change/
│       ├── openspec-sync-specs/
│       └── spec-workflow-openspec/
├── scripts/sync-local-agent-skills.sh
├── scripts/{memory,figma,github,gitlab,browser}-mcp-launcher.cjs   # stdio MCP launchers (always)
├── scripts/cursor-spend-hook.cjs + cursor-spend-collect.cjs        # Cursor spend capture (always)
├── scripts/pre-commit-gate-check.sh     # installed unconnected; wire with hooks-setup / --hooks
├── scripts/post-pr-verdict-github.sh    # always copied; used only by the GitHub Spec Verifier
├── scripts/verify-specs.sh + post-mr-verdict.sh   # (--spec-verify, opt-in)
├── .mcp.json                            # seeded from mcp.json.example if missing (memory + figma; mcp-setup adds VCS/browser); no secrets, committing is fine
├── .amp/settings.json                   # local only — seeded from amp.settings.json.example the same way
└── .cursor/hooks.json + .cursor/memory.json       # local only — spend hook entries + Memory MCP store
```

### Included in kit

| Category | Contents |
|----------|----------|
| Orchestration | Role-separated pipeline (explore → design → propose → review → apply → verify → archive), `AGENTS.md`, `orchestrator.yaml`, review command |
| OpenSpec skills | All 7 skills for `/opsx:*` workflow |
| IDE sync | Cursor + Claude Code sync script (`--delete` semantics — removes stale skills/subagents/commands) |
| Subagents | 12 exclusive routes: guide/setup/session-handoff, explore/design/propose/review/archive stage agents, and apply implementation/test/code-review agents — native in Cursor + Claude Code, isolated Amp `subagent-*` wrappers |
| CLI gates | `npx agent-orchestrator-kit status` / `gate-check` / `archive` / `handoff` / `metrics` / `memory-setup` — deterministic review-gate, archive, session-handoff, and change metrics (always via `npx`; see `cli-via-npm.mdc`) |
| CI | `agent-verify.yml` — GitHub (default) or GitLab fragment + `prebuild` hook, both run `gate-check` |
| AI Spec Verifier | `spec-verify.yml` + verifier scripts — GitLab or GitHub, opt-in (`--spec-verify`) |
| MCP templates | `.agents/mcp.json.example` (Cursor / Claude Code `.mcp.json`) and `.agents/amp.settings.json.example` (Amp) — five stdio launchers: `memory`, `figma`, `github`, `gitlab`, `browser` |

### Not included (install separately)

| What | How |
|------|-----|
| OpenSpec CLI | `npm i -D @fission-ai/openspec && npx openspec init` |
| Stack skills (Vue, JS, Vite) | `npx frontend-agent-skills install` for vue3 profile |
| Project conventions | Create `.agents/project-conventions/SKILL.md` manually |
| Domain specs | Live in `openspec/specs/` per project |

Git-committed: `.agents/` + `AGENTS.md` + `CLAUDE.md` + `scripts/` + `.github/`
Local only (not committed): `.cursor/` `.claude/` `.amp/`

## IDE Integration

### Amp Code (primary — zero config)

Amp reads `.agents/skills/` and `AGENTS.md` **natively** — no sync needed.

**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`.

1. Install the kit → `AGENTS.md` is created automatically.
2. Amp picks up skills from `.agents/skills/` on session start.
3. Copy Amp MCP config (on first sync):

```bash
cp .agents/amp.settings.json.example .amp/settings.json
```

Or run `./scripts/sync-local-agent-skills.sh` — it creates `.amp/settings.json` automatically.

**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.

4. Use commands directly:

```
/opsx:explore
/opsx:propose add-feature-name
/opsx:review add-feature-name
/opsx:apply add-feature-name
/opsx:archive
/opsx:sync add-feature-name      # agent-driven merge of the change's delta specs into openspec/specs/ without archiving
```

**Model hints per role** (Amp modes):

| Role | Recommended Amp mode |
|------|---------------------|
| explore | `low` |
| propose | `high` or `ultra` |
| review | `high` or `ultra` |
| apply (complex) | `high` or `ultra` |
| apply (simple task) | `low` |

Switch modes in Amp CLI: `Ctrl+O` → `mode`.

### Claude Code

1. Run sync: `./scripts/sync-local-agent-skills.sh`
2. This creates:
   - `.claude/CLAUDE.md` — project context
   - `.claude/skills/` — all skills from `.agents/skills/` (excluding Amp `subagent-*` wrappers)
   - `.claude/agents/` — custom subagents from `.agents/subagents/` (native Claude Code subagents)
   - `.claude/commands/opsx/` — `/opsx:*` commands from `.agents/commands/`
3. Skills are auto-loaded by Claude Code from `.claude/skills/`. The `.agents/rules/*.mdc` files are synced only to Cursor (`.cursor/rules/`); Claude Code reaches them through the references in `CLAUDE.md` / `AGENTS.md`.
4. Invoke `/opsx:*` or the orchestration skill. The conductor delegates using the mandatory phase/signal routing table rather than relying on description-only selection.

**CLAUDE.md tiers used:**
- Project level: `.claude/CLAUDE.md` (synced from `CLAUDE.md`)
- Personal (optional): `~/.claude/CLAUDE.md` for preferences

**Claude Code subagent config** (optional, in skill frontmatter):

```yaml
---
name: openspec-explore
context: fork
agent: Explore
allowed-tools: Read, Bash
---
```

You can add `context: fork` to explore/review skills for isolated subagent sessions.

### Cursor

1. Run sync: `./scripts/sync-local-agent-skills.sh`
2. Creates:
   - `.cursor/skills/` — all skills
   - `.cursor/rules/` — `.mdc` rule files
   - `.cursor/agents/` — all 12 custom/stage subagents
   - `.mcp.json` — from `mcp.json.example` (if not present)
3. Rules are applied automatically per `alwaysApply: true`.
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.

**Memory + optional Figma MCP for Cursor** (`.mcp.json`):

```json
{
  "mcpServers": {
    "memory": {
      "command": "node",
      "args": ["scripts/memory-mcp-launcher.cjs"]
    },
    "figma": {
      "command": "node",
      "args": ["scripts/figma-mcp-launcher.cjs"]
    }
  }
}
```

Token lives in `.agents/figma.local.env` — see [Figma token](#figma-token-optional).

## The Pipeline in Detail

### Role 1: Explorer — `/opsx:explore`

**Mode:** read-only. Cannot edit any files.
**Model:** fast/cheap.
**Purpose:** Understand the problem. Surface options. Choose a direction.

The conductor spawns `codebase-explorer` for repository investigation and stays read-only.

**Exit criteria (before starting Architect):**
- Problem stated in 3–5 sentences
- 2–3 solution options + recommendation
- kebab-case change name chosen
- Non-goals listed

```
/opsx:explore How should we handle bulk camera export?
```

---

### Role 2: Architect — `/opsx:propose <name>`

**Mode:** writes `openspec/changes/<name>/` only. Cannot touch `src/`.
**Model:** strong reasoning.
**Purpose:** Create all change artifacts: proposal, design, tasks, delta specs.

The conductor spawns `spec-architect`; it does not write artifacts in the parent session. It is a thin conductor: it does not research the repo itself, passes the decision brief by path, and after the report only runs the exit gate below without re-reading the artifacts.

**Exit gate:**
```bash
npx openspec validate <name> --strict --type change  # must be ✓
npx agent-orchestrator-kit gate-check --review <name>  # Tier 1 pre-gate: exit 0 before /opsx:review
```

```
/opsx:propose add-bulk-camera-export
```

---

### Role 3: Spec Reviewer — `/opsx:review <name>`

**Mode:** read-only. No code edits.
**Model:** strong (same level as propose).
**Purpose:** Review artifacts. Output **Approve ✓** or **Request Changes ✗**.

Review is **two-tiered**. Tier 1 is deterministic: `npx agent-orchestrator-kit gate-check --review <name>` runs strict OpenSpec validation, the task-contract lint, and structural checks (Non-goals / Acceptance criteria in `proposal.md`, non-empty delta-spec sections); it also warns when the artifacts outgrow the size budget. If Tier 1 fails, the verdict is REQUEST CHANGES without spawning anyone. Only on a Tier 1 pass does the conductor spawn `spec-reviewer` (not `code-reviewer`) for Tier 2 judgment and verify its `review.md` with `gate-check --review-md <name>`. On APPROVE the reviewer also writes `apply-notes.md` (≤ 20 lines of constraints and pitfalls for the implementer).

Tier 2 checks (judgment only — no duplication of Tier 1):
- Consistency proposal ↔ design ↔ tasks
- No scope creep vs Non-goals
- No conflicts with existing domain specs
- Tasks self-sufficient for a blind implementer (Files / Do / Done-when)

```
/opsx:review add-bulk-camera-export
```

**Only after explicit APPROVE can apply start.**

---

### Role 4: Implementer — `/opsx:apply <name>`

**Mode:** conductor; routed specialists write `src/` and tests. Only the conductor marks `tasks.md [x]` after a verified `Status: done` report.
**Model:** strong. Use fast for simple mechanical tasks.
**Purpose:** Implement tasks. One session covers the tasks of the change; split only at a blocker or a context limit.

**Exit gate:**
```bash
npm run build   # must pass
npm run lint    # must pass
# tests: verifier.test_command runs once before the last task is ticked; Done records "tests: N/N" (empty command = skipped with a warning)
```

```
/opsx:apply add-bulk-camera-export
```

---

### Role 5: Verifier — CI (automatic)

**GitHub (default `--ci github`):** installed at `.github/workflows/agent-verify.yml`:

```yaml
- run: npx openspec validate --all --strict
- run: npm run lint --if-present
- run: npm run build --if-present
- run: npm test --if-present
```

**GitLab (`--ci gitlab`):** verify runs through the package manager build lifecycle — no GitHub Actions:

```json
"verify:openspec": "npx openspec validate --all --strict",
"prebuild": "npm run verify:openspec"
```

When CI or a developer runs `npm run build`, npm executes `prebuild` first. DevOps pipelines that already call `npm run build` get OpenSpec validate with zero config changes.

Optional: include `.gitlab/agent-verify.yml` in `.gitlab-ci.yml` for full lint/build/test verify before DevOps owns the root CI file. See kit `templates/.gitlab-ci.starter.yml.example`.

Blocks merge if any gate fails.

Both consumer CI templates (`templates/.github/workflows/agent-verify.yml` and `templates/.gitlab/agent-verify.yml`, installed as `agent-verify.yml`) also run `npx agent-orchestrator-kit gate-check` — see [Deterministic gates](#deterministic-gates-status--gate-check) below. It never fails the pipeline for projects without `.agents/orchestrator.yaml`. (The kit's own repository CI runs only `openspec validate` + `npm test`.)

#### AI Spec Verifier (GitLab or GitHub, opt-in)

```bash
npx agent-orchestrator-kit init --ci gitlab --spec-verify
npx agent-orchestrator-kit init --ci github --spec-verify
```

Installs an AI verification layer on top of the deterministic gates: on every merge/pull request that changes `src/`, an Amp agent reads `openspec/specs/`, checks the changed code against every relevant requirement, posts a **PASS / BLOCKED** comment to the MR/PR, and **fails the pipeline on BLOCKED** — specs become an enforceable merge contract, not just documentation.

Installed files (GitLab):

| File | Purpose |
|------|---------|
| `.gitlab/spec-verify.yml` | CI fragment — hidden `.spec-verify-base` + blocking `spec-verify` job (MR + `src/**/*` only) |
| `scripts/verify-specs.sh` | Collects changed files + specs, builds prompt (project context from `openspec/config.yaml`), calls `amp -x`, writes `artifacts/verdict.json` |
| `scripts/post-mr-verdict.sh` | Posts the verdict as an MR comment via GitLab API |

Installed files (GitHub):

| File | Purpose |
|------|---------|
| `.github/workflows/spec-verify.yml` | Workflow triggered on `pull_request` for `src/**` — same verdict evaluation, `permissions: pull-requests: write` |
| `scripts/verify-specs.sh` | Same script as GitLab — stack-agnostic, reused as-is |
| `scripts/post-pr-verdict-github.sh` | Posts the verdict as a PR comment via `gh pr comment` |

The flag also adds `spec-verify-blocking` to `roles.verifier.gates` in `.agents/orchestrator.yaml`.

Setup after install (GitLab):

1. Include the fragment from `.gitlab-ci.yml`:

```yaml
include:
  - local: '.gitlab/spec-verify.yml'
```

2. Add CI/CD variables (Settings → CI/CD → Variables, masked): `AMP_API_KEY`, `GITLAB_VERIFIER_TOKEN` (project access token with `api` scope).

Setup after install (GitHub): the workflow runs automatically on `pull_request` — just add the repo secret `AMP_API_KEY` (Settings → Secrets and variables → Actions). `GITHUB_TOKEN` is provided by Actions automatically.

Verdict schema (`artifacts/verdict.json`): `pass`, `score` (0–100), `summary`, `findings[]` with `severity` (`error` fails the job), `spec`, `requirement`, `message`, `file`, `line`. The script degrades gracefully — no `src/` changes, no specs, missing `amp` CLI, or missing `AMP_API_KEY` produce a skipped passing verdict and never block the pipeline. Secrets are never logged; `.env`/key/token files are excluded from prompts.

**Conformance report (additive).** The verdict also carries three arrays: `implemented[]` (provided code satisfies a relevant requirement; `message` is the evidence), `missing[]` (a positive requirement is absent or incomplete in a provided file where it is expected) and `scope_creep[]` (provided code does what a requirement or an explicit boundary forbids: SHALL NOT, MUST NOT, an explicit exclusion or non-goal). Each item has `spec`, `requirement`, `message`, `file` (a provided source path or `null`) and `line` (a positive 1-based line of that file or `null`):

```json
{
  "pass": true,
  "score": 97,
  "summary": "Login works; lockout reset is incomplete.",
  "findings": [
    { "severity": "warning", "spec": "openspec/specs/auth/spec.md", "requirement": "Lockout", "message": "Counter is never reset", "file": "src/auth.js", "line": 42 }
  ],
  "implemented": [
    { "spec": "openspec/specs/auth/spec.md", "requirement": "Login", "message": "Password is compared with the stored hash", "file": "src/auth.js", "line": 17 }
  ],
  "missing": [
    { "spec": "openspec/specs/auth/spec.md", "requirement": "Lockout", "message": "Counter is never reset", "file": "src/auth.js", "line": 42 }
  ],
  "scope_creep": []
}
```

- **Classification.** One discrepancy goes to exactly one group: an unmet positive requirement is `missing`, a violated prohibition or exclusion is `scope_creep`. `missing` needs a provided file (`line` may be `null`); when the verifier cannot name one, it writes a warning/info finding about the uncertainty instead. `scope_creep` needs an explicit prohibition, so it is rare; a changed file without a related spec stays an info finding. An empty group does not prove absence: conclusions are limited to the changed source files in the prompt, and behaviour in an unchanged file is outside the verifier's view.
- **Findings stay the gate.** `pass` and `score` are computed from `findings[]` only (unchanged severity gate: any `error` blocks). Every `missing` / `scope_creep` item has exactly one mirrored finding with the same `spec`, `requirement`, `file` and `line`: `missing` → `error` when a SHALL/MUST behaviour is wholly absent from that file, otherwise `warning`; `scope_creep` → `error` for SHALL NOT / MUST NOT, otherwise `warning`. The arrays themselves never change `pass` or `score`; `implemented` items have no finding.
- **Coordinates.** Changed source files are numbered in the prompt from line 1 (blank lines included), so `line` refers to the file in `HEAD`, not to a diff. `"line": null` means the location is unknown; a `null` file means the path is unknown too. The comments show `file:line` only for a known file with a positive integer line, otherwise just the file or `—`.
- **Comments.** The MR/PR comment keeps Summary, Score, status and Findings, then adds `### Implemented`, `### Missing` and `### Scope creep` (columns Spec / Requirement / Evidence / File). A group shows `_None reported._` when the verifier returned an empty array, `_Not reported by this verifier._` when the field is absent, `null` or not an array (a legacy verdict), `_Not checked — verification skipped._` for a skipped verdict and `_Not checked — verifier response was inconclusive._` when the verifier did not return valid JSON (the fallback verdict is marked `"inconclusive": true`, keeps `pass: true` and `score: 50`).
- **Legacy compatibility.** Verdicts without the arrays are read as before, without migration; older consumers ignore the new fields.

Known limitations:

- A response where the JSON object starts on the same line as other text (`Verdict: {…}`) is treated as invalid and gives the inconclusive fallback; the object must start on its own line (markdown fences are fine).
- GitHub limits a comment to 65 536 characters. Large reports can exceed it; `gh pr comment` then fails, the script only prints `Failed to post PR comment` and exits 0.
- The GitLab comment is sent from a temporary file (`curl --data-binary @file`), so the 131 072-byte limit of a single command-line argument does not apply. A refusal by the GitLab API (non-2xx) is only printed; the script exits 0.
- A valid JSON object without a boolean `pass` is stored as is and evaluates as PASS (existing behaviour; no schema validation).

**Warning-only rollout (Phase 1):** uncomment `allow_failure: true` (GitLab) or `continue-on-error: true` (GitHub) to keep the pipeline green while the team builds trust in verdicts, then remove it to enforce blocking (Phase 2).

`update` refreshes the spec-verify files only in projects that already installed them — the feature stays opt-in. Projects that installed spec-verify earlier get the conformance report through the same `update`; no new CI permissions, dependencies or verdict migration are needed.

---

### Deterministic gates: `status` / `gate-check`

Orchestration hard rules (review approval, one active change) used to rely entirely on the agent remembering to check them in chat. Two CLI commands make them checkable and CI-enforceable:

```bash
npx agent-orchestrator-kit status
```

Prints an `archive_after_merge: <true|false>` policy line under the title (when `.agents/orchestrator.yaml` exists), then every active OpenSpec change with task progress (`N/M tasks`), review verdict (`APPROVE` / `REQUEST CHANGES` / `none`), design brief (`brief: yes/no`), a `ready to archive` flag once all tasks are `[x]`, and an **MCP health** section (launcher / env / live config — never prints token values). VCS tools that do not match `git remote origin` show as `skipped (no origin match)`.

```bash
npx agent-orchestrator-kit gate-check [change-name] [--src-glob src/] [--base HEAD~1] [--staged]
```

Fails (non-zero exit) when `pipeline.require_spec_review: true`, the diff against `--base` (or **staged** files with `--staged`) touches `--src-glob`, and the active change has no `review.md` with `Verdict: APPROVE`. When `pipeline.require_design_brief: true` and `src/` changed, it also requires `design-brief.md` (or a `Design: none` line in `proposal.md` for non-UI changes). It degrades gracefully to exit 0 (with a message, not silently) when: `.agents/orchestrator.yaml` is missing, neither review nor design brief is required, the diff can't be computed (e.g. shallow clone), or nothing under `--src-glob` changed. It also warns (never fails) when active changes exceed `pipeline.max_active_changes`. Both consumer `agent-verify.yml` templates (GitHub and GitLab, installed by `init --ci`) call `gate-check` automatically. Pre-commit uses `--staged` so it checks the index, not `HEAD~1`.

```bash
npx agent-orchestrator-kit gate-check --tasks <change-name>
```

Lints the task contract in `tasks.md`: every task needs `Files:` / `Do:` / `Done-when:`, no vague phrasing (`as needed`, `if necessary`, …), and every `Files:` path must exist unless prefixed `new file:`. Behavior follows `pipeline.task_contract` in `orchestrator.yaml`: `warn` (default) exits 0 with warnings, `strict` exits 1 on violations, `off` skips the lint.

```bash
npx agent-orchestrator-kit gate-check --review <change-name> [--json]
```

Deterministic Tier 1 of the review phase: strict OpenSpec validation, the task-contract lint, `Non-goals` / `Acceptance criteria` sections in `proposal.md`, non-empty ADDED/MODIFIED/REMOVED sections in delta specs, and the same heading checks `archive --sync` enforces (a MODIFIED/REMOVED title must exist in the main spec, an ADDED title must not). Human-readable stdout, or `--json` for a `{pass, errors[]}` report.

After change validation and heading checks pass, the gate builds a temporary copy of **all main specs**, overlays the planned delta sync, and runs `openspec validate --specs --strict --json` with the project's installed OpenSpec. The working specs stay untouched; the preview is removed on success and failure. Diagnostics identify specs **after delta sync** or **existing main specs outside this change**. This catches a long MODIFIED requirement and existing blockers before apply, instead of first discovering them at archive. The preview does not validate other active changes; archive still runs its final `--all --strict` check.

**500 characters means one requirement description**, excluding its heading and scenarios. Write one behavior per requirement, examples and edge cases in scenarios, and implementation details in design/tasks. OpenSpec 1.14.1 made this finding a WARNING, which fails `--strict`; older versions such as 1.4.1 emit INFO. The kit preserves the installed validator's severity; INFO is printed in human-readable output and does not fail the gate. Keep strict enabled. Migrate existing long descriptions separately, preserving all behavior and scenarios; do not truncate them or expand an unrelated change to silence a warning. When the gate reports an existing blocker outside the change, report that blocker and the migration needed rather than repeatedly rewriting the current delta.

It also measures `proposal.md`, `design.md`, `tasks.md` and the delta specs in bytes and reports `artifact budget: …` when `tasks.md` is over 60 000 B or their total is over 150 000 B, with the advice to split the change into slices. `pipeline.artifact_budget` sets the mode: `warn` (default) prints a warning and keeps the exit code, `strict` makes it an error (exit 1), `off` skips the measurement.

```bash
npx agent-orchestrator-kit gate-check --review-md <change-name> [--json]
```

Checks `review.md` against the `/opsx:review` schema after Tier 2: exactly one `Verdict:` line (APPROVE or REQUEST CHANGES), a `Previous findings` heading, on REQUEST CHANGES non-empty `Checklist`, `Findings` (Blocker / Major / Minor) and `Required Before Apply`, on APPROVE an `apply-notes.md` of at most 20 lines. A Tier 1 record (`**Source:** gate-check`, no Checklist) only has to be REQUEST CHANGES. Exit 1 with the error list, or `--json` for a `{pass, errors[]}` report. `/opsx:review` runs it after the `spec-reviewer` report instead of checking the headings by hand.

### Pre-commit review gate (optional)

`gate-check` already exists; it is **not** wired to `git commit` unless you opt in. The kit never writes `.git/hooks/` directly.

```bash
npx agent-orchestrator-kit hooks-setup
# or: npx agent-orchestrator-kit init --hooks
```

- If `.husky/` exists, a marked line `sh scripts/pre-commit-gate-check.sh` is appended to `.husky/pre-commit` (idempotent; existing content is kept). `core.hooksPath` is not changed.
- Otherwise the kit writes committed `.githooks/pre-commit` and runs `git config core.hooksPath .githooks`. If `core.hooksPath` is already set to something else, the command refuses and prints a manual line to add.
- Lefthook: add `sh scripts/pre-commit-gate-check.sh` to your pre-commit job yourself (no auto-write).
- `init` without `--hooks` still installs `scripts/pre-commit-gate-check.sh` as a managed file, unconnected.
- Disable: remove the marked line from `.husky/pre-commit`, or `git config --unset core.hooksPath`.
- MVP (`require_spec_review: false`): the hook is a no-op (exit 0).
- Keep `agent-orchestrator-kit` in the project's **devDependencies** so `npx agent-orchestrator-kit` on every commit does not cold-fetch from the registry.

Run `hooks-setup` on each machine (`git config` is local), same as `figma-setup`.

### Agent hook runtime (optional, off by default)

Separate from the Git pre-commit gate above. With `hooks.enabled: true` and `npx agent-orchestrator-kit hooks enable --client claude|cursor|amp`, lifecycle events deliver bound stack skills, give a metrics-neutral recovery briefing and keep a local audit. `hooks bind`, `hooks snapshot`, `hooks status` and `hooks disable` complete the set. Delivery is not compliance: the mandatory manual Read fallback stays. See [docs/agent-hooks.md](docs/agent-hooks.md).

Workflow checks, verification, completion, owned sync, and local notices stay off until each policy is enabled. `mode: observe` reports findings and does not block. `mode: enforce` applies a decision only when that client's verified capability can carry it. Policy `options` are a single-line JSON object. There is no supported switch that turns a lifecycle event into user authorization; Claude, Cursor, and Amp still need the manual resolution below.

Local observe-mode trial, from a project that already has the kit installed:

```bash
npx agent-orchestrator-kit hooks enable --client cursor
npx agent-orchestrator-kit hooks bind --change <name> --role implementer --task 1.1 --session <native-session-id>
npx agent-orchestrator-kit hooks verify --change <name> --session <native-session-id>
npx agent-orchestrator-kit hooks complete --change <name> --session <native-session-id> --confirm-handoff
npx agent-orchestrator-kit sync --owned --target all
```

Set `hooks.enabled: true` and `hooks.mode: observe` before the trial. `hooks verify` runs `verifier.test_command` when the session is bound and reuses a fresh record; an ordinary file write does not start that command. `hooks complete` only stores a receipt with `--confirm-handoff` after you have read the handoff. A later substantive outcome invalidates it, and an agent end stays pending until the worker rechecks. Cursor and Amp can ask for at most one follow-up per work epoch and two for that task and session. Claude's parent stop cannot do that, so rerun `hooks complete` yourself. `sync --owned` keeps a local edit and exits nonzero on a conflict; `update --sync` does the same delivery and skips the shell-sync hint.

Disable the trial without removing the Git pre-commit gate:

```bash
npx agent-orchestrator-kit hooks disable --client cursor
```

Then set `hooks.enabled: false`. Pending outcomes stay on disk until they expire. Notices are local diagnostics only. Merging a pull request, publishing the package, and rolling the kit out to other repositories stay separate actions. The opt-in after-merge archive job is the existing `archive --if-ready` workflow in [CI archive](#ci-archive-opt-in); this runtime does not call it.

### Optional MCP: GitHub, GitLab, browser

Same pattern as Figma: stdio launcher + gitignored env + committed `.example`. Tokens never go in chat or committed MCP JSON.

```bash
npx agent-orchestrator-kit mcp-setup
```

Detection uses `git remote get-url origin` (https and ssh). `--ci` is ignored.

| Origin hostname | Installed VCS MCP |
|-----------------|-------------------|
| `github.com` | GitHub only |
| `gitlab.com` or hostname contains `gitlab` (self-hosted) | GitLab only; `GITLAB_API_URL=https://<hostname>/api/v4` |
| missing / unrecognized | no VCS MCP (`status` shows skipped) |

Browser MCP (`@playwright/mcp`) is always added unless you pass `--no-browser`. Override detection with `--vcs github` or `--vcs gitlab`.

```bash
npx agent-orchestrator-kit mcp-setup --vcs gitlab --no-browser
```

Then put tokens **only** in the gitignored files (never in chat):

| Path | Git |
|------|-----|
| `.agents/github.local.env` | ignored |
| `.agents/gitlab.local.env` | ignored |
| `.agents/*.local.env.example` | committed |
| `scripts/*-mcp-launcher.cjs` | committed |

Cursor, Claude Code, and Amp all spawn the same launchers. Committed examples list all five servers (`memory`, `figma`, `github`, `gitlab`, `browser`); live `.mcp.json` / `.amp/settings.json` receive only the detected VCS plus browser.

`npx agent-orchestrator-kit status` prints MCP health (`ok` / `not configured` / `skipped`) without token values.

---

### Design intake: `/opsx:design`

Optional phase between explore and propose (or before apply) that captures design into a durable artifact so implement sessions do not depend on live Figma MCP:

```
/opsx:design add-login-form
```

Writes only:
- `openspec/changes/<name>/design-brief.md` — Source, Structure, Tokens, Reference images, Constraints, Confidence notes
- `openspec/changes/<name>/assets/` — reference PNGs

Source fallback: Figma MCP (one pass) → exported images → screenshots → photos. Raster sources must mark inferred values with confidence notes.

**Opt-in gate** (default off — existing projects unchanged):

```yaml
pipeline:
  require_design_brief: true   # gate-check fails without brief when src/ changed
```

Non-UI changes: add this line to `proposal.md`:

```
Design: none
```

**Existing projects after `update`:** the command file `opsx-design.md` is installed automatically. Your `orchestrator.yaml` is never overwritten — add the role and flag manually if you want the gate:

```yaml
pipeline:
  require_design_brief: false   # set true to enforce
roles:
  design_intake:
    command: /opsx:design
    mode: brief-only
    model_hint: strong
```

---

### Quick — `/opsx:quick <name>` for small changes

One session for a small change (1–3 files, one behaviour) that does not need a separate review cycle: propose → light review → apply, with no prompt pasting in between.

- `spec-architect` writes a short proposal (`## Why`, `## What Changes`, `## Non-goals`, `## Acceptance criteria`), contract tasks and a **minimal delta**: one requirement with one scenario. `openspec validate --strict` rejects a change without a delta.
- **`require_spec_review: true`** (node, vue3 and generic profiles): the light review is mandatory. The conductor runs `gate-check --review`, then spawns `spec-reviewer` in quick mode, which writes REQUEST CHANGES only on a Blocker; Major and Minor items go to `apply-notes.md`. The result is a real `review.md` (`**Mode:** quick`), checked with `gate-check --review-md`, so the CI gate and archive accept the change. After one more failed cycle the change moves to the full pipeline (`/opsx:propose <name>`).
- **`require_spec_review: false`** (mvp): no review step.
- Apply is the same as in `/opsx:apply`. The session closes with `## Closed role` `Implementer — quick`; a green quick prints the single `npx agent-orchestrator-kit archive <name> --sync` line.

---

### Archive — terminal first, `/opsx:archive` as fallback

After the PR is merged and CI is green, archive from a terminal — no chat needed:

```bash
npx agent-orchestrator-kit archive add-bulk-camera-export --sync
```

After a green apply (the Implementer closes, every task in `tasks.md` is `[x]`, `## Blocked` is `none`), `handoff <name>` prints exactly this line instead of a next-session prompt; run it once the PR is merged. `/opsx:archive <name>` stays as a fallback for when a terminal or CI was not available.

Archive is a **deterministic CLI**, not an agent workflow:

```bash
npx agent-orchestrator-kit archive <name> [--sync | --no-sync --force] [--if-ready] [--collect]
```

It first runs **Gate 0** and refuses a folder that already looks archived (`archivedAt` set in the change `metrics.json`, or `Next command: none` in `handoff.md`; for a re-opened copy clear the marker and re-run), then checks the gates (APPROVE in `review.md` when required, all tasks `[x]`, target folder free), merges delta specs into `openspec/specs/` (`--sync`: ADDED append, MODIFIED replace, REMOVED delete), moves the change to `openspec/changes/archive/YYYY-MM-DD-<name>`, and runs `npx openspec validate --all --strict` with a full rollback on failure (main specs restored, new spec files deleted, move reverted). With delta specs present you must decide: `--sync` merges, `--no-sync --force` archives without merging, and no flag refuses with exit 1. It finishes by writing the final `handoff.md` (`next_command: none`), updating memory, appending an Archiver session, and printing the same human metrics summary as `metrics <name>`. Archive collects the locked client (Cursor hook / Amp threads / Claude JSONL) in `[pending.startedAt, now]` plus leftover of the previous session — the same leftover-then-collect flow as persist. `--collect` still runs every adapter. A legacy `## Metrics` section in the change `handoff.md` is ignored. `/opsx:archive` is the chat fallback: a thin wrapper that calls this CLI, shows its output, and on a refusal prints it and stops; the `spec-archiver` subagent remains only as a fallback when the CLI is unavailable.

**`--if-ready`** is the CI mode of the same command. It prints one `skip: <reason>` line, exits 0 and changes nothing when `pipeline.archive_after_merge` is `false`, the change already looks archived (Gate 0), or it is not ready — the same blockers `status` prints (`tasks incomplete`, `no review.md`, …; a missing `tasks.md` counts as not ready). Otherwise it archives like a normal run, and real failures (an existing target folder, a delta-spec sync conflict, a failed validation) still exit 1. Without `--if-ready` a manual archive ignores `archive_after_merge`.

#### CI archive (opt-in)

A terminal stays the default. The CI templates (`agent-verify.yml`: GitHub job `archive`, GitLab job `agent-archive`) also contain an archive job that is off until you opt in:

1. Set the repository variable (GitLab: CI/CD variable) `AOK_ARCHIVE_ON_MERGE=true`. Without it the job is skipped.
2. Add the secret (GitLab: masked CI/CD variable) `AOK_ARCHIVE_TOKEN` — a token whose user may push to the protected default branch (a branch-protection bypass). On GitHub the job falls back to the workflow token, which can push only to an unprotected branch.
3. Keep `pipeline.archive_after_merge: true` in `.agents/orchestrator.yaml` (the `mvp` profile sets `false`).

On a push to the default branch the job waits for `verify`, runs `archive <name> --sync --if-ready` for every `openspec/changes/<name>/`, and pushes one `chore(openspec): archive merged change [skip ci]` commit with the moved change and its finalized `metrics.json`; `[skip ci]` keeps that push from starting another run.

Known caveats: a Cursor `sessionEnd` hook can append leftover usage to a *local* `metrics.json` after the last persist, which then conflicts with the CI commit (keep the archived copy when you resolve it); two merges in quick succession can make the first push fail as non-fast-forward (the next push to the default branch archives again, or archive from a terminal); the job runs the published `npx agent-orchestrator-kit`, so it needs a kit version that has `--if-ready`.

## Configuration

Edit `.agents/orchestrator.yaml` after init:

```yaml
project:
  name: "My Project"
  agent_language: uk      # response language for agents

pipeline:
  require_spec_review: true
  require_design_brief: false   # opt-in: require design-brief.md when src/ changed
  max_active_changes: 1
  archive_after_merge: true     # policy flag: `status` shows it; `archive --if-ready` and the opt-in CI job honour it; a manual archive ignores it
  task_contract: warn           # tasks.md lint mode for gate-check: warn | strict | off
  artifact_budget: warn         # change size budget for gate-check --review: warn | strict | off (a missing key means warn)
  review_fast_fix: off          # off | on
  src_glob: "src/"              # paths gate-check treats as product code (default for --src-glob)

verifier:
  lint_command: "npm run lint"
  build_command: "npm run build"
  test_command: "npm test"   # optional
```

## Update

When a new version of the kit is released:

```bash
npx agent-orchestrator-kit update
./scripts/sync-local-agent-skills.sh
```

`update` only touches kit-managed files (commands, rules, skills). It never overwrites:
- `orchestrator.yaml`
- `openspec/config.yaml`
- `openspec/specs/`
- `openspec/changes/`
- Any project-conventions skills

**Existing `openspec/config.yaml`:** `update` never touches it, and `init` skips `openspec/config.yaml.example` when `openspec/config.yaml` already exists (for example after `npx openspec init`). Add the proposal rule by hand, under `rules.proposal`, so `openspec instructions proposal` tells the architect about the Tier 1 headings:

```yaml
rules:
  proposal:
    - "Always include the exact level-2 headings '## Non-goals' and '## Acceptance criteria' (gate-check --review Tier 1 rejects the proposal without them)."
  specs:
    - "Keep each new requirement description between '### Requirement:' and its first '#### Scenario:' at most 500 characters; headings and scenarios do not count. Use one behavior per requirement."
    - "Preserve existing MODIFIED behavior and scenarios; split old long requirements only in an explicitly scoped migration."
```

Double-quote every rule: an unquoted item that contains `: ` makes OpenSpec drop the whole list for that artifact, and an unquoted ` #` silently cuts the rule short (YAML reads the rest as a comment). A fresh `init --profile node` or `init --profile generic` installs `openspec/config.yaml.example` with these rules from `templates/openspec-config.yaml.example`; `init --force` overwrites an existing `openspec/config.yaml`.

**OpenSpec version consistency:** pin a reviewed local version using `npm install --save-dev --save-exact @fission-ai/openspec@<version>`, commit the lockfile, and use `npm ci` in CI (or the equivalent frozen-lockfile install for your package manager). Avoid mixing a global CLI with a different local version. This kit's own development baseline stays pinned to 1.4.1; upgrading it and migrating existing main specs are separate work. The preview regression suite also supports checking another installed version via `AOK_TEST_OPENSPEC_MODULES=/path/to/node_modules node --test --test-concurrency=1 test/spec-preflight.test.js` without downloading packages during tests. Kit `update` distributes the new rules and skills, but does not upgrade OpenSpec or rewrite consumer specs/config.

### Upgrading from older versions

No re-`init` is needed — `update` + sync is the whole upgrade path:

```bash
npx agent-orchestrator-kit@latest update
npx agent-orchestrator-kit@latest sync   # or: ./scripts/sync-local-agent-skills.sh
npx agent-orchestrator-kit@latest status
```

- CI files are refreshed only where they already exist: `update` rewrites `.github/workflows/agent-verify.yml` / `.gitlab/agent-verify.yml` and the opt-in `spec-verify.yml` + verifier scripts when the project has them, and never creates a workflow for a provider you did not choose.
- Adding the AI Spec Verifier to a project that never had it is a separate opt-in — run it once, then add the `AMP_API_KEY` secret:
  ```bash
  npx agent-orchestrator-kit@latest init --ci github --spec-verify   # or --ci gitlab
  ```
- `update` never edits your CI root file. If `gate-check` does not seem to run on GitLab, check that `.gitlab-ci.yml` still `include`s `.gitlab/agent-verify.yml` (GitHub Actions picks up `.github/workflows/*.yml` automatically).

## Profiles

| Profile | Stack | Extra (separate install) |
|---------|-------|--------------------------|
| `generic` | Any | Orchestration + OpenSpec skills only. `init` still writes the detected JS package-manager commands (`npm`/`yarn`/`pnpm` `lint` / `build` / `test`) into `verifier.*` of `orchestrator.yaml` — non-Node projects edit those three commands after init |
| `vue3` | Vue 3 + Vite + JS | + `npx frontend-agent-skills install` |
| `node` | Node.js | + `npx frontend-agent-skills install --category javascript` |
| `mvp` | Vue 3 demo/spike | + frontend-agent-skills; use `/opsx:quick`, no review gate |

For `vue3`, after kit init also run:

```bash
# Amp (primary — installs directly to .agents/skills/)
npx frontend-agent-skills install --agent amp --yes

# Cursor + Claude Code users — sync local IDE dirs
./scripts/sync-local-agent-skills.sh
```

Or install for all IDEs at once:

```bash
npx frontend-agent-skills install --agent all --yes
```

> **Migrating from `vue-cursor-skills`?** Renamed to `frontend-agent-skills` v2 — same package, old CLI alias still works.

## Figma token (optional)

Personal Access Token for design intake (`/opsx:design`) and the optional Framelink `figma-developer-mcp` server. **Never paste the token into AI chat.**

### Setup (each developer, once)

```bash
npx agent-orchestrator-kit figma-setup
# open .agents/figma.local.env in the IDE and set:
# FIGMA_ACCESS_TOKEN=figd_...
npx agent-orchestrator-kit figma-status
```

Then restart Cursor / Claude Code / Amp.

| Path | Purpose | Git |
|------|---------|-----|
| `.agents/figma.local.env` | Your token (`FIGMA_ACCESS_TOKEN`) | **ignored** |
| `.agents/figma.local.env.example` | Template | committed |
| `scripts/figma-mcp-launcher.cjs` | Starts MCP with token from the env file | committed |
| `.mcp.json` → `figma` | Points at the launcher (no secret inline) | committed OK |

Create a token: Figma → Settings → Security → Personal access tokens (file content read as needed).

### CLI

```bash
npx agent-orchestrator-kit figma-setup
npx agent-orchestrator-kit figma-status
npx agent-orchestrator-kit figma-fetch --url "https://www.figma.com/design/FILE_KEY/Name?node-id=1-2" \
  --out openspec/changes/<name>/assets/figma-nodes.json
# large frames: limit tree depth
npx agent-orchestrator-kit figma-fetch --file FILE_KEY --nodes 1:2 --depth 2 --out figma-nodes.json
```

`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`.

### Upgrade existing projects

```bash
npx agent-orchestrator-kit@latest update
npx agent-orchestrator-kit figma-setup
./scripts/sync-local-agent-skills.sh
```

## Memory MCP — Shared State Between Sessions

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.

**Standard entities to save:**

```
Change:add-bulk-export     status: spec-approved, tasks: 0/7, last_role: reviewer, review: APPROVE
Decision:export-format     chosen: xlsx, reason: matches existing reports
Handoff:add-bulk-export    next_role: implementer, next_command: /opsx:apply add-bulk-export,
                           session_count: 2, summary: ..., blocked: none
```

Session boundaries are **parent-driven** (no routine subagent): every `/opsx:*` session restores via `npx agent-orchestrator-kit handoff --restore` (the CLI briefing already reads memory.json and `handoff.md`), falling back to reading `handoff.md` directly if the CLI fails. At exit the parent itself writes `handoff.md`, runs `npx agent-orchestrator-kit handoff <name>` (upserts `.cursor/memory.json` with an absolute path), and pastes the CLI stdout prompt. The `session-handoff` subagent is spawned only when the CLI path fails; Memory MCP is an optional mirror. The prompt is self-contained — Amp often skips Memory MCP, so the next thread must be able to work from the pasted text alone. Never configure Memory with a relative `MEMORY_FILE_PATH`; use `scripts/memory-mcp-launcher.cjs` (`npx agent-orchestrator-kit memory-setup`). The next phase always starts in a new chat. The canonical Session Start / Exit protocol lives in one place — `.agents/rules/session-handoff.mdc` — and the `/opsx:*` commands reference it instead of duplicating it.

### Change decisions (`decisions.md`)

Session decisions accumulate in git-tracked, append-only `openspec/changes/<name>/decisions.md`. That file is the canon visible in a PR/MR; Memory `Decision:*` is a **file → Memory** mirror only.

```bash
npx agent-orchestrator-kit handoff add-bulk-export
# appends dated bullets from handoff.md ## Decisions (skips duplicates; same topic + new text → new row)
npx agent-orchestrator-kit handoff add-bulk-export --restore
# prints decisions from the git file (or `decisions: none` if the file does not exist)
```

`Decisions: none` does not create the file. Re-running persist with the same handoff does not duplicate rows. A later revision of the same topic is a new line; the old line stays. `update` does not migrate historical Memory entities into the file.

### Checkpoint and recovery briefing

Checkpoint after a finished task, an important decision or a `code-reviewer` verdict:

```bash
npx agent-orchestrator-kit checkpoint add-bulk-export --task 2.1 --done "wired the exporter" --next "start 2.2"
```

State lives in git-tracked `openspec/changes/<name>/checkpoint.json` (atomic write, unchanged state is a no-op). Decisions stay there until Session Exit lists them under `## Decisions`; `checkpoint` never writes `decisions.md` and never touches `metrics.json`.

When `handoff <name> --restore` prints `UNPERSISTED SESSION`, a `RECOVERY BRIEFING` follows: facts, unknowns, contradictions, gaps and questions, each tagged with its source (`tasks.md`, `checkpoint.json`, `handoff.md`, `review.md`, `decisions.md`, git). Review currency needs a committed `review.md` plus git history; without both it is reported as unknown. The briefing is advisory and read-only - it changes no canonical file, and transcript or LLM extraction is not part of it.

### Cloud agent handoff (Phase 3)

Every persist writes a `## Runtime` section to `openspec/changes/<name>/handoff.md`:

```
## Runtime
- runtime: local|cloud
- agent_id: <id|none>
```

Detection is a fixed chain (no TTY / `CURSOR_AGENT` magic): `--runtime` → env `AOK_RUNTIME` → `CLOUD_ENV_MARKERS` (starts with `CURSOR_BACKGROUND_AGENT`) → existing `## Runtime` in the file → `local`. `agent_id` uses `--agent-id` → `AOK_AGENT_ID` → existing value → `none`. Invalid `--runtime` (not `local` or `cloud`) exits non-zero. Legacy files without Runtime stay valid; the next persist appends the section.

Configure a cloud agent once:

```
AOK_RUNTIME=cloud
AOK_AGENT_ID=<vm-or-run-id>
```

`--cloud-check` is a **separate** branch of `handoff`, never part of persist (persist has just rewritten `handoff.md`, so the tree is always dirty at that point). It verifies (1) `git status --porcelain -- openspec/changes/<name>/` is empty and (2) the current branch has an upstream with no unpushed commits. Verdict: `cloud` + any failure = non-zero; `local` + the same failure = warning + exit 0; clean = exit 0. The CLI never runs `git commit` or `git push`.

Cloud Session Exit order:

```bash
npx agent-orchestrator-kit handoff <name> --runtime cloud
git add openspec/changes/<name>/
git commit
git push
npx agent-orchestrator-kit handoff <name> --cloud-check   # require exit 0
```

Persist with `runtime: cloud` prints those four steps on stderr; stdout stays the pure `/opsx:` next-thread prompt. Local persist is unchanged.

### Change metrics

Every change accumulates git-tracked `openspec/changes/<name>/metrics.json` — the data source for planning the next feature: how long each phase took, how many sessions it needed, what it cost.

Schema v2 stores compact `sourceIds`, `sourceTotals`, and `byModel` per session instead of `sessions[].sources`. This is **BREAKING** for readers of the old event arrays. v1 files are normalized in memory without rewriting; run `npx agent-orchestrator-kit metrics <name> --migrate` for a schema-only rewrite that preserves existing numeric fields and aggregates.

- **`session.model`** — source product id wins when any collected source has a model; `--model` / `AOK_MODEL` apply only when sources have no model. Never a Closed role.
- **Session start** — `handoff --restore` writes a `pending` marker (`startedAt`, expected role).
- **Session end** — `handoff <name>` closes the pending session. Its collect lower bound is `--started-at` or `pending.startedAt` minus 120 seconds; without either it is the previous `endedAt`, or `createdAt` for the first session, with no open-ended scan. Amp usage totals and fresh Cost are authoritative; Claude JSONL is deduplicated by `message.id`, includes subagents, and accepts cwd descendants. Claude uses a versioned Anthropic list-price estimate with cache split; Amp without Cost uses the same model table or the $3/$15 fallback. Estimates never enter billed `costUsd`.
- **Archive** — successful `archive <name>` always creates or finalizes `metrics.json`, sets `archivedAt`, appends an Archiver session, collects the locked client (Cursor hook / Amp export+usage / Claude JSONL) in `[pending.startedAt, now]` plus leftover of the previous session, and prints the same human summary as `metrics <name>`. `--collect` still runs all three adapters. A legacy `## Metrics` section in `handoff.md` is ignored.
- **`sessionEnd` leftover** — `scripts/cursor-spend-collect.cjs` also reads the newest `openspec/changes/archive/*-<name>/metrics.json` when the active change folder is gone, so a late hook after archive still attaches. `stop` / `afterAgentResponse` run the same leftover after a successful jsonl append. When `last.threadId` is non-empty, leftover keeps only rows whose `conversationId` matches that id (empty/`null` threadId stays time-only). In a multi-root window leftover walks every candidate that has `openspec/changes`, reading that root’s jsonl. Aggregates write `costUsdEstimated` with 4 decimal places. Each `phases.<phase>` stores `startedAt` / `endedAt` / `leadTimeMs` from that phase’s sessions; `durationMs` stays the work-time sum and does not clone `totals.leadTimeMs`.
- **Leftover without `--collect`** — Scopes to `last.platform` and Amp thread identity from `threadId` or `sourceIds`. Sessions without a thread id are capped at `endedAt + 120s`; identified sessions may continue to the next pending boundary. Fresh Amp usage totals, Models, and Cost replace cached values.
- **Cursor `conversationId`** — restore writes `CURSOR_CONVERSATION_ID` into `pending.threadId`; Cursor collect and sessionEnd leftover skip rows whose `conversationId` does not match when a filter id is present (`last.threadId` on leftover).
- **Canonical role** — `session.role` and `pending.role` store the first known token (`Explorer`, `Architect`, `Spec Reviewer`, `Implementer`, `Archiver`, `Design Intake`); Closed role in `handoff.md` MAY keep a sentence after `—`.
- **Platform** — `--platform` → `AOK_PLATFORM` → **pending client from `--restore`** → host env (Amp / Cursor / Claude Code) → collected sources (`cursor|claude|amp` only). Invalid `--platform` fails before persist/move.
- **Locked client** — `--restore` records `pending.platform` and Amp `pending.threadId` before phase work. Persist follows that client’s flow even if persist runs in another shell (no `AMP_*` / `CURSOR_*`). Amp: `amp threads export` plus `amp threads usage --details` (`AOK_AMP_BIN`) and local `threads/*.json`. Export supplies `model` / tokens / `agentMode`; usage supplies billed `$`. If Amp runs tools over a pipe (`/dev/null`), thread id comes from `amp threads list`, not stale `session.json` `lastThreadId`. When env and Amp parent do not win, restore locks a fresh `session.json` `lastThreadId` as `amp-session-last`. Cursor: spend hook file. Claude: `~/.claude/projects`. `--collect` still runs all three adapters.
- **Cursor spend hook (optional)** — Cursor never writes token usage to disk, so the kit can install `scripts/cursor-spend-hook.cjs` plus `.cursor/hooks.json` entries (`stop` / `subagentStop` / `afterAgentResponse`) in `init` / `update` / `sync` / `mcp-setup`: the hook appends each turn's tokens to gitignored `.agents/spend/cursor-usage.jsonl`. After a successful `stop` / `afterAgentResponse` append the hook runs leftover (fail-open, no stdout). Hook and collect resolve the consumer in a multi-root window (not the first cwd with `.agents` or `openspec`). Persist auto-reads that file when the locked client is Cursor. Persist and restore do not self-heal the hook. `sessionEnd` still runs `scripts/cursor-spend-collect.cjs`. Restart Cursor once after the first install. `status` shows a `Spend capture` section. Claude JSONL remains a fallback. Amp web/CLI spend is taken from `amp threads export` (tokens, model, `agentMode`) and `amp threads usage` (billed USD).

Aggregates are recomputed on every write: per-phase totals (`startedAt`, `endedAt`, `leadTimeMs` from that phase’s sessions, `durationMs` = sum of session work time — not `totals.leadTimeMs` and not `endedAt − startedAt`, tokens, `costUsd`, `costUsdEstimated`, `costUsdTotal` to 4 decimals, `sessions`, `roles`, `models`) plus overall `totals` (`sessions`, `cloudSessions`, `durationMs` = sum of session work time, `leadTimeMs` = wall clock from first session start to last session end), `spend` (USD only), and separate **by platform** / **by model** tables. Numbers are null-honest: a metric nobody reported stays `null`, never a fake `0`. No single total that adds Amp credits to USD. `costUsdTotal` is the one USD figure per change, phase, platform, model, and session: each session contributes its billed `costUsd` when present, otherwise its `costUsdEstimated`, so a change that ran on Amp (billed) plus Cursor and Claude (estimated) sums all three platforms instead of showing only the billed part. Amp credits never enter it. The human `cost:` line prints it as `$21.08 ($14.48 billed + ~$6.60 est.)`.

Session metrics come from the persist call, not from `handoff.md`: pass `--model <llm-product-id>`, and `--platform` or the spend flags where client detection or an adapter has a gap (Cursor). A legacy `## Metrics` section in `handoff.md` is ignored and dropped on the next rewrite.

```bash
npx agent-orchestrator-kit handoff add-thing
npx agent-orchestrator-kit handoff add-thing --collect   # optional: Claude JSONL / Amp threads / Cursor hook
npx agent-orchestrator-kit metrics add-thing             # human summary: phases, tokens, cost, roles / models
npx agent-orchestrator-kit metrics add-thing --json      # raw metrics.json (works for archived changes too)
npx agent-orchestrator-kit metrics add-thing --summary-json # compact dashboard contract
npx agent-orchestrator-kit metrics add-thing --migrate   # rewrite v1 → v2 without numeric recompute
npx agent-orchestrator-kit archive add-thing --sync      # finalize + the same tables as metrics
```

#### For dashboards

Use only `phases.<phase>.startedAt`, `endedAt`, and `durationMs` for phase boundaries and duration. Use `totals.leadTimeMs` only for the whole change. Git log MUST NOT be used for phase boundaries; the kit does not provide per-phase commit counts. `metrics <name> --summary-json` returns only aggregate `totals`, `phases`, and spend maps, without sessions or commits. For the headline cost use `spend.costUsdTotal` (and `phases.<phase>.costUsdTotal`, `spendByPlatform.<platform>.costUsdTotal`, `spendByModel[].costUsdTotal`): `costUsd` alone is only the billed part and `costUsdEstimated` alone is only the estimated part, so picking one of them drops every platform that reported the other.

Recording is on by default and never a persist/archive/`gate-check` gate; opt out per persist with `--no-metrics`. Persist and archive collect the locked client without `--collect`; `--collect` runs every adapter. Flags (`--model`, `--platform`, `--input-tokens`, …) override session totals in `metrics.json`.

### Skill inventory

`.agents/orchestrator.yaml` carries a machine-readable `skills:` section (`kit` / `stack` / `external`) instead of hardcoded skill names in the CLI:

```yaml
skills:
  kit:
    - agent-orchestration
    - openspec-howto
    # ... remaining kit skills
  stack: []                 # vue3: vue-core, vue-pinia, vue-axios, vue-router
  external: ""              # vue3/node: frontend-agent-skills
```

`npx agent-orchestrator-kit status` prints **Skill health** after MCP health (`ok` / `missing` / `stale`) for kit + stack skills and Amp `subagent-*` wrappers. The section is warn-only: missing or stale skills never change the exit code. Repair with the existing commands — `sync` (stale IDE copies), `update` (missing kit files), or a manual stack install:

```bash
npx frontend-agent-skills install --agent all --yes
```

The CLI never auto-installs external skill packages. `.agents/orchestrator.yaml` is outside kit-managed paths, so `update` does **not** refresh `skills.kit` — after a kit skill is added or removed, edit that list by hand (or re-init with `--force`).

## Amp Code — Deep Integration Notes

Amp is the **primary target** of this kit. It reads `.agents/skills/` and `AGENTS.md` without any sync step — your team commits `.agents/` and everyone gets the same orchestration behavior automatically.

**Amp-specific features used:**

| Feature | How the kit uses it |
|---------|-------------------|
| `AGENTS.md` at the repo root | Roles, hard rules, and routing pointers (`.agents/rules/`) read on every session |
| `.agents/skills/` | All orchestration + domain skills |
| `.amp/settings.json` (`amp.mcpServers`) | Memory MCP via `scripts/memory-mcp-launcher.cjs`; seeded from `.agents/amp.settings.json.example` by `init` / `sync` |
| Subagents | Conductor routing + isolated `subagent-*` wrappers |
| Amp modes (low/medium/high/ultra) | Per-role model hints in AGENTS.md |

**Amp generated wrapper** (`.agents/skills/subagent-codebase-explorer/SKILL.md`):

```yaml
---
name: subagent-codebase-explorer
description: Read-only repository research specialist...
---

CRITICAL (Amp / Cursor / Claude): Parent MUST spawn this skill as an isolated subagent with fresh context.
Do not execute it in the main thread. If spawn is unavailable, STOP and report blocked.
```

The conductor invokes the wrapper in isolation and consumes only its structured report.

**Team workflow with Amp:**

1. Commit `.agents/` to git.
2. Team members clone — skills available immediately.
3. No `sync-local-agent-skills.sh` needed for Amp users.
4. Cursor/Claude Code users run sync once after clone.

## CLI Reference

```bash
npx agent-orchestrator-kit init [options]
  --profile <name>   Stack profile: generic | vue3 | node | mvp
  --lang <code>      Agent language: en | uk | ...
  --name <name>      Project name (default: directory name)
  --ci <provider>    CI provider: gitlab | github | none (default: github)
  --spec-verify      Install AI Spec Verifier blocking gate (GitLab or GitHub)
  --hooks            Opt-in: install pre-commit gate-check hook (husky-first)
  --force            Overwrite existing files

npx agent-orchestrator-kit update
  Updates kit-managed files, preserves project overlay

npx agent-orchestrator-kit sync [options]
  --target <ide>     cursor | claude | amp | all (default: all)
  Copies .agents/ to local IDE directories, removing skills/rules no longer
  present in .agents/. Also seeds local files it never overwrites: creates an
  empty .cursor/memory.json, seeds .mcp.json / .amp/settings.json from the
  .example files and upserts the memory server entry, writes the spend-hook
  entries into .cursor/hooks.json, merges .gitignore, and copies CLAUDE.md to
  .claude/CLAUDE.md. Existing user content in those files is kept.

npx agent-orchestrator-kit status
  Show the archive_after_merge policy line, progress, review verdict, archive-readiness, MCP health, and Skill health
  (warn-only; missing/stale skills do not fail the command)

npx agent-orchestrator-kit gate-check [change-name] [options]
  --src-glob <glob>  Source path filter used to detect code changes; a comma- or
                     space-separated list is passed to git as separate pathspecs
                     (default: pipeline.src_glob from orchestrator.yaml, else src/)
  --base <ref>       Git ref to diff against (default: HEAD~1)
  --staged           Check staged files (git diff --cached) instead of --base
  --tasks <name>     Lint task contracts (Files / Do / Done-when)
  --review <name>    Deterministic Tier 1 review (optional --json)
  --review-md <name> Check review.md against the /opsx:review schema (optional --json)
  Exit non-zero when require_spec_review is true, src/ changed, and the
  active change has no review.md with Verdict: APPROVE. Graceful no-op
  otherwise (missing config, review not required, no relevant diff).

npx agent-orchestrator-kit hooks-setup
  Opt-in pre-commit gate (husky-first, else core.hooksPath=.githooks)

npx agent-orchestrator-kit mcp-setup [--vcs github|gitlab] [--no-browser]
  Install GitHub/GitLab (from origin) and browser MCP launchers

npx agent-orchestrator-kit figma-setup
  Create local .agents/figma.local.env from the example, refresh the launcher,
  and add the figma MCP entry to .mcp.json / .amp/settings.json (never prints the token)

npx agent-orchestrator-kit figma-status
  Report whether a local Figma token is configured (never prints the token)

npx agent-orchestrator-kit figma-fetch [options]
  --url <url>        Figma design URL (file key + optional node-id)
  --file <key>       Figma file key
  --nodes <ids>      Comma-separated node ids (1:2 or 1-2)
  --depth <n>        Limit node tree depth (use for large frames; omit = full tree)
  --out <path>       Output JSON path (default: figma-nodes.json)
  Fetch Figma file/nodes JSON via the REST API using the local token

npx agent-orchestrator-kit memory-setup
  Install the memory MCP launcher and rewrite Cursor/Amp configs to use an
  absolute MEMORY_FILE_PATH

npx agent-orchestrator-kit archive <name> [--sync | --no-sync --force] [options]
  --model <name>     LLM product id recorded on the Archiver session
  --platform <id>    cursor | claude | amp
  --input-tokens <n> / --output-tokens <n> / --total-tokens <n>
                     Token spend for the Archiver session (total defaults to in+out)
  --cost-usd <usd>   Cost of the Archiver session in USD
  --collect          Collect all spend adapters (default: locked client only)
  --if-ready         CI mode: print "skip: <reason>" and exit 0 (nothing changed) when
                     archive_after_merge is false, the change already looks archived
                     (Gate 0) or is not ready; real failures still exit 1
  Refuse an already archived folder (Gate 0), gate-check a completed change, optionally merge delta specs, move to
  openspec/changes/archive/YYYY-MM-DD-<name>, validate, write final handoff,
  and print the change-wide metrics summary.

npx agent-orchestrator-kit checkpoint [change-name] [options]
  --task <id>        Task id finished at this checkpoint
  --role <role>      Role running the session
  --done <text>      What finished
  --blocked <text>   Current blocker
  --next <text>      Next step
  --decision <text>  Decision to keep (repeatable)
  Save progress, blocker, next step and decisions to openspec/changes/<name>/checkpoint.json
  (atomic write; an unchanged state is a no-op; each call replaces done, blocked and next).
  Never writes decisions.md - decisions stay in checkpoint.json until Session Exit lists them
  under ## Decisions. Never closes the session, starts a phase or touches metrics.json.

npx agent-orchestrator-kit handoff [change-name] [options]
  --restore          Print the restore briefing instead of persisting
                     (also records the session start into metrics.json)
                     When an UNPERSISTED SESSION warning is printed, a RECOVERY BRIEFING
                     (at most 40 lines and 4096 bytes: facts, unknowns, contradictions, gaps,
                     questions, each with its source) follows.
  --closed-role <role>      Closed role for persist
  --next-command <command>  Next /opsx:* command
  --next-role <role>        Next role or subagent name
  --summary <text>   Persisted summary (also fills Done when Done is empty)
  --done <text>      Done section
  --decisions <text> Decisions section
  --blocked <text>   Blocked section
  --attach <text>    Attach section
  --spawn <text>     Subagents to spawn
  --constraints <text>      Constraints section
  --status <status>  Change status observation
  --tasks <progress> Task progress n/m
  --review <verdict> Review verdict
  --session-count <n>       Handoff session_count
  --runtime <value>  local | cloud (invalid values exit non-zero)
  --agent-id <id>    Cloud agent identifier (default: none)
  --cloud-check      Verify change artifacts are committed and pushed
                     (cloud: non-zero on failure; local: warning, exit 0)
  --started-at <iso> Session start override when --restore was not run
  --model <name>     LLM product id (metrics.json); never a Closed role
  --platform <id>    cursor | claude | amp
  --input-tokens <n> / --output-tokens <n> / --total-tokens <n>
                     Token spend for this session (total defaults to in+out)
  --cost-usd <usd>   Session cost in USD
  --collect          Also run local spend adapters (off by default)
  --no-metrics       Skip recording this session into metrics.json
  After a green apply (Implementer, every task [x], Blocked none) stdout is the
  single archive command line instead of a next-session prompt.

npx agent-orchestrator-kit metrics [change-name] [options]
  --json             Print raw metrics.json
  --summary-json     Print compact aggregate JSON for dashboards
  --migrate          Rewrite metrics.json using the current schema without
                     recomputing numbers (v1 → v2)
  --collect          Backfill the last session from local spend adapters
                     without adding a new session
  Show recorded session metrics for a change (active or archived):
  time per phase, sessions, tokens, cost, roles, models, lead time.
```

## Directory Reference

```
.agents/                 # Committed — source of truth for all IDEs
  commands/              # /opsx:* command definitions
  rules/                 # Auto-applied rules for Cursor
  subagents/             # Custom subagents (source of truth, all IDEs)
  skills/                # Skills for Cursor, Claude Code, Amp
                         #   subagent-*/ — auto-generated Amp wrappers (do not edit)
  orchestrator.yaml      # Project pipeline config

.cursor/                 # Local only — Cursor IDE runtime
  skills/                # Synced from .agents/skills/
  rules/                 # Synced from .agents/rules/
  agents/                # Synced from .agents/subagents/
  commands/              # Synced from .agents/commands/ (flat — /opsx-apply)
  memory.json            # Memory MCP data

.claude/                 # Local only — Claude Code runtime
  skills/                # Synced from .agents/skills/
  agents/                # Synced from .agents/subagents/
  commands/opsx/         # Synced from .agents/commands/ (namespaced — /opsx:apply)
  CLAUDE.md              # Synced from root CLAUDE.md

.amp/                    # Local only — Amp config
  settings.json          # MCP servers (manual or via amp mcp add)

AGENTS.md                # Committed — read natively by Amp; CLAUDE.md is the Claude Code entry point
CLAUDE.md                # Committed — synced to .claude/CLAUDE.md
openspec/                # Committed — spec-driven workflow
  config.yaml            # Project context for AI
  specs/                 # Source of truth after archive
  changes/               # Active work; <name>/handoff.md + metrics.json index session state
```

## Roadmap

The kit moves toward an Agentic Factory in four phases. **One phase = one OpenSpec change**; the next phase does not start until the previous change is archived.
1. `add-factory-gates-and-mcp` — local review gate on commit and Figma-style MCP launchers (GitHub / GitLab / browser). Implemented: `hooks-setup`, `mcp-setup`, `gate-check --staged`, MCP health in `status`.
2. `add-factory-memory-and-skills` — git-canonical decisions with Memory MCP as a mirror, plus a machine skill inventory. Implemented: append-only `decisions.md`, Skill health in `status`.
3. `add-cloud-agent-handoff` — session artifacts exist only on git-tracked paths. Implemented: `## Runtime` in `handoff.md`, `--runtime` / `--agent-id` / `--cloud-check`, cloud Session Exit.
4. Phase 4 (`add-factory-control-plane`) is an opt-in platform decision, not the next sprint.
Phase bounds and non-goals: [`openspec/specs/agentic-factory-roadmap/spec.md`](openspec/specs/agentic-factory-roadmap/spec.md).

## Changelog

### 0.23.0
- **Opt-in agent hook runtime.** `hooks enable --client cursor|claude|amp` delivers bound stack skills, a metrics-neutral recovery briefing, and a local audit. Off by default, and separate from the Git pre-commit gate. See [Agent hook runtime](#agent-hook-runtime-optional-off-by-default).
- **Opt-in workflow commands.** `hooks verify` reuses fresh test evidence, `hooks complete --confirm-handoff` records a reviewed handoff, and `sync --owned` / `update --sync` copy managed IDE files without overwriting local edits. Policies stay disabled until enabled. No auto-approve, auto-commit, or fleet rollout.
- Upgrade: `npx agent-orchestrator-kit@latest update`, then `sh scripts/sync-local-agent-skills.sh`. Existing projects stay unchanged until `hooks.enabled` is set.

### 0.22.1
- **Writers explicitly read tech skills before authoring.** Code and test writers name the applicable Vue 3 skill files, use equivalent skills for other stacks, and report missing files without blocking. Both reports include `Skills:` immediately after `Status:`.
- Upgrade: run `npx agent-orchestrator-kit update`, then `sh scripts/sync-local-agent-skills.sh` to refresh Claude/Cursor agents and Amp wrappers. No configuration changes are required.

### 0.22.0
- **Generated skill mirror blocks.** `init`, `update` and `sync` regenerate the `session-start`, `session-exit` and `routing` blocks of the `agent-orchestration` skill from `session-handoff.mdc` and `agent-orchestration.mdc`; edit the rule, not the block. See [Sync to local IDEs](#sync-to-local-ides).
- **Specialists own their steps.** The artifact build loop lives in `spec-architect`, the design capture details in `design-intake`; `/opsx:propose` and `/opsx:design` only spawn and verify.
- **`code-reviewer` is on request and diff-gated** — `Blocked: no implementation diff` when nothing changed under `pipeline.src_glob`.
- **No `## Metrics` in `handoff.md`, no self-report step.** The CLI resolves model, platform and spend from adapters, flags and env; `spendSource` is never `self-report`; a legacy section is ignored. A bare `Reviewer` Closed role maps to `Spec Reviewer`.
- **Contradicting rules removed:** no quick-mode hour limit, no per-session task cap, review is `strong`, Amp hints use `low`/`high`/`ultra`.
- Upgrade: run `update` once to get the skill with mirror markers (until then `sync` warns `mirror blocks skipped`); it also refreshes rules, commands, skills, subagents, `AGENTS.md` and `CLAUDE.md`. No `orchestrator.yaml` key changes.

### 0.21.0
- **`/opsx:apply` runs the tests once, before the last box.** New step 6.5 reads `verifier.test_command`, runs it once and shows the last 20 lines. The outcome table fixes the last box and the `tests:` line in Done for every case: green and narrowed-green tick, an empty command is skipped with a warning and ticks, a red run stops with the box unticked, a pre-existing failure waits for the user, and a session that pauses earlier writes `tests: not run (paused: <k> tasks pending)`. Session Exit carries the `tests:` line; `/opsx:quick` inherits it. No hard gate.
- **Fix changes start with a failing regression test.** A guideline (not a lint) in `spec-architect`, `/opsx:propose`, the propose skill and the config example: when the name starts with `fix-` or the brief describes a bug fix, the first implementation task adds a regression test that fails on the unfixed code.
- **New `checkpoint [change-name]` command.** Saves task, role, done, blocker, next step and decisions to the git-tracked `openspec/changes/<name>/checkpoint.json` with an atomic write and an integrity digest. An unchanged state is a no-op; a corrupt file is replaced. It never closes the session, starts a phase or touches `decisions.md`, Memory JSON or `metrics.json` — decisions stay in `checkpoint.json` until Session Exit lists them under `## Decisions`. See [Checkpoint and recovery briefing](#checkpoint-and-recovery-briefing).
- **`handoff --restore` prints a recovery briefing.** After an `UNPERSISTED SESSION` warning: at most 40 lines and 4096 bytes of FACTS, UNKNOWN, CONTRADICTIONS, GAPS and QUESTIONS, each tagged with its source, built only from local files and git. A superseded checkpoint contributes only its decisions; review currency needs a committed `review.md` plus git history, otherwise it is reported unknown. Advisory and read-only.
- **An unreadable `handoff.md` or `decisions.md` no longer aborts `--restore`.**
- Upgrade: `update` refreshes the commands, skills and subagents; the `checkpoint` command and the briefing are in the CLI itself. No `orchestrator.yaml` key changes.

### 0.20.1
- **Skipped Session Exit is flagged.** `handoff <name> --restore` prints `UNPERSISTED SESSION` for an open `pending`, a change with artifacts but no `handoff.md`, or a `handoff.md` older than the artifacts. Advisory only; exit code and briefing are unchanged.
- **Explore no longer contradicts Session Exit.** The explore command and skill name `handoff.md` + the `handoff` CLI as the exception to «never write OpenSpec artifacts».
- Upgrade: `update` refreshes the commands and skills; the new check is in the CLI itself. No `orchestrator.yaml` key changes.

### 0.20.0
- **Spec verifier conformance report (opt-in).** `verify-specs.sh` asks for `implemented[]`, `missing[]` and `scope_creep[]` next to the findings; the GitHub and GitLab comments add `### Implemented`, `### Missing` and `### Scope creep`. `pass` / `score` still come from `findings` only, so the merge gate is unchanged.
- **Long verifier responses are no longer cut or lost.** The Amp response is kept in a file, and `post-mr-verdict.sh` sends the comment from a temporary file, so a payload over 131 072 bytes no longer fails with `Argument list too long`.
- **Main-spec failures surface before apply.** `gate-check --review` validates a temporary preview of all main specs after the planned delta sync with strict validation; new capabilities get a Purpose long enough for strict.
- **500-character requirement-description limit documented** in the architect, propose and howto templates.
- Upgrade: `update` refreshes the commands, skills and subagents, and the spec-verify scripts only in projects that already installed them. No `orchestrator.yaml` key changes.

### 0.19.0
- **`/opsx:quick` for small changes in every profile.** The architect writes a minimal delta (one requirement, one scenario), so `openspec validate --strict` passes. With `require_spec_review: true` the same session runs a light review: `gate-check --review`, then `spec-reviewer` in quick mode (REQUEST CHANGES only on a Blocker, `**Mode:** quick`), then `gate-check --review-md`. The CI gate and `archive` accept the resulting `review.md`. Apply is the same as `/opsx:apply`. The session closes as `Implementer — quick`, and a green quick prints the single archive line. See [Quick](#quick--opsxquick-name-for-small-changes).
- **`Code Writer` Closed role counts as `Implementer`** in metrics and in the green-apply check (it used to be stored as `"Code Writer (apply"`).
- Upgrade: `update` refreshes the commands, rules, skills and subagents, which carries the new `opsx-quick.md` and the quick mode of `spec-reviewer`. `AGENTS.md` is not refreshed; its new Quick wording reaches only new installs. No `orchestrator.yaml` key changes.

### 0.18.1
- **`gate-check` skips explore-only changes.** Auto-select no longer treats a folder without `proposal.md` and without `tasks.md` as the review target, so a research change does not block unrelated `src/` commits. `gate-check <name>` still checks the named change. A change that already has `proposal.md` or `tasks.md` still needs `review.md` with `APPROVE`.

### 0.18.0
- **Thin `/opsx:propose` conductor**: the parent does not research the repo. It reads the decision brief (by path), `status` and `handoff --restore`, spawns `spec-architect` within 5 tool calls, and after the report makes at most 3 tool calls without re-reading the artifacts on a green gate.
- **Artifact size budget in `gate-check --review`**: a warning when `tasks.md` is over 60 000 B or `proposal.md` + `design.md` + `tasks.md` + delta specs are over 150 000 B, with the advice to split the change into slices. `pipeline.artifact_budget: warn | strict | off` sets the mode (default `warn`; `strict` exits 1).
- **`gate-check --review-md <name>`** checks `review.md` against the `/opsx:review` schema (one `Verdict:` line, `Previous findings`, the REQUEST CHANGES sections, an `apply-notes.md` of at most 20 lines on APPROVE). `/opsx:review` runs it after the `spec-reviewer` report instead of checking the headings by hand.
- **Reading rules for the spec specialists**: `spec-architect` reads main specs by requirement heading; `spec-reviewer` reads the main spec of every capability the delta touches in full and may re-read a file when a finding depends on the exact wording; both read large repo files in line ranges and batch independent reads.
- Upgrade: `update` refreshes the commands, skills and subagents. It does not touch `orchestrator.yaml`: a missing `artifact_budget` reads as `warn`, so add the key under `pipeline:` by hand only to switch to `strict` or `off`.

### 0.17.0
- **Archive from a terminal, not a chat**: when the Implementer closes with every task `[x]` and `## Blocked` empty, `handoff <name>` prints exactly `npx agent-orchestrator-kit archive <name> --sync` (run it after the PR is merged) and sets `## Next role` to `none`; every other exit is unchanged. `/opsx:archive` is now a fallback that calls the same CLI and stops on a refusal.
- **Gate 0 in `archive`**: a folder whose `metrics.json` has `archivedAt`, or whose `handoff.md` has `Next command: none`, is refused before anything is written (absent or invalid files never refuse).
- **`archive --if-ready`** (CI mode): prints one `skip: <reason>` line and exits 0 without touching anything when `archive_after_merge` is `false`, the change already looks archived, or it is not ready (the same blockers `status` prints); real failures still exit 1. `pipeline.archive_after_merge` is now read (default `true`) and `status` prints it.
- **Opt-in CI archive job** in the CI templates (GitHub `archive`, GitLab `agent-archive`): off until the variable `AOK_ARCHIVE_ON_MERGE` is `true`; it pushes with the secret `AOK_ARCHIVE_TOKEN` and a `[skip ci]` commit. A terminal stays the default (see Archive → CI archive (opt-in)).
- **`gate-check --review` checks delta-spec headings** against the main specs (`MODIFIED` / `REMOVED` not found, `ADDED` already exists), and delta specs may use `## RENAMED Requirements`.
- **Metrics ledger integrity**: fail-open invariant warnings on persist and archive, adapter notes on stderr, nullable `cacheReadTokens` / `cacheCreationTokens`, `claude-opus-5-5` rates, and a contract test over newly archived `metrics.json`.
- **Next-session prompt follows the parent-driven protocol**: no Memory MCP read and no `session-handoff` spawn unless `handoff.spawn_handoff_subagent: true`; the prompt is ~1.5 KB instead of 3.3–4.3 KB, and `handoff --restore` prints only the last 10 `decisions.md` entries.
- **`gate-check` reads `pipeline.*` only inside the top-level `pipeline:` block** (comments stripped) and accepts a comma- or space-separated `src_glob`. Dead `roles.*.model_hint` keys are gone from the shipped `orchestrator.yaml` files.
- Upgrade: `update` refreshes the commands, rules, skills and subagents, and rewrites `.github/workflows/agent-verify.yml` / `.gitlab/agent-verify.yml` where they already exist (the new archive job stays off until `AOK_ARCHIVE_ON_MERGE=true`). It does not touch `AGENTS.md`, `CLAUDE.md` or `orchestrator.yaml`: the terminal-first wording and the policy comment above `archive_after_merge` reach new `init`s only, and a missing `archive_after_merge` reads as `true`.

### 0.16.0
- **Tier 1 pre-gate in `/opsx:propose`**: after the `spec-architect` report the conductor runs `npx agent-orchestrator-kit gate-check --review <name>`. On exit ≠ 0 it re-spawns the architect once with the full error list; if the gate still fails it closes with `## Blocked` and next command `/opsx:propose <name>`. Handoff to `/opsx:review` requires exit 0 for the first propose, re-propose, and structure-only re-propose.
- `spec-architect` requires the exact `## Non-goals` and `## Acceptance criteria` headings. Under `/opsx:propose` it runs `gate-check --review` itself and reports `**Gate:** gate-check --review exit <code>`; under `/opsx:quick` it writes `**Gate:** not run (/opsx:quick)` and adds a minimal delta (the quick conductor runs the gate when review is required). Done-when must check the new state, keep counts consistent with `Do:`, and avoid volatile repo values.
- `openspec-guide` routes a change that has `proposal.md` and no `review.md` by `gate-check --review`: exit 0 → `/opsx:review`, exit ≠ 0 → `/opsx:propose`.
- New `templates/openspec-config.yaml.example` is the stack-neutral fallback that `init` installs for `node` / `generic`. Every rule is double-quoted so OpenSpec keeps the lists. `init --force --profile node|generic` now overwrites an existing `openspec/config.yaml`.
- Upgrade: `update` refreshes the commands, skills, and subagents. It does not touch `AGENTS.md`, `CLAUDE.md`, or an existing `openspec/config.yaml`, so add the proposal rule by hand (see [Update](#update)).

### 0.15.0
- **`costUsdTotal`** on `spend`, `phases.*`, `spendByPlatform.*`, `spendByModel[]`, and sessions — billed `costUsd` when present, otherwise `costUsdEstimated`, per session; a change that ran on Amp (billed) plus Cursor and Claude (estimated) now sums all three platforms instead of showing only the billed part; the human `cost:` line prints `$21.08 ($14.48 billed + ~$6.60 est.)` and `--summary-json` carries the field
- Billed `costUsd` aggregates are rounded to 4 decimals like estimates (no more `4.4399999999999995` in `spendByModel`)
- Cache-split Claude cost estimates survive the session recompute instead of being re-billed at the full input rate (`$30.11` → `$5.16` on a 3.5M-token change)

### 0.14.1
- **Memory graph survives `handoff` persist** — JSONL graphs were misread as an aggregate document and returned empty, so each persist overwrote the file with only the current change; all `Decision:*`, other changes, and relations were lost
- `/opsx:*` commands now sync to `.cursor/commands/` (flat) and `.claude/commands/opsx/` (namespaced), so the documented slash commands exist in both IDEs
- `status` applies `require_spec_review` / `require_design_brief` before saying "ready to archive"; `gate-check` verifies the gate instead of exiting 0 when the diff is unknown, and reads `pipeline.src_glob` for code outside `src/`

### 0.14.0
- **BREAKING: compact metrics schema v2** — sessions persist `sourceIds` / `sourceTotals` / `byModel` instead of `sources`; `metrics --migrate` is schema-only; `metrics --summary-json` for dashboards
- Bounded persist/leftover windows, thread-scoped Amp usage + fresh Cost, Claude dedup/subagent capture, static Claude/Amp estimates
- Exhaustive Tier 2 punch list in kit templates; after REQUEST CHANGES next command is `/opsx:propose`; Spec review discovery loops ≤ 2

### 0.13.0
- Amp Cost-once rollup: `Cost: $N` once per qualifying session into `spend` / `spendByPlatform.amp` / `phases` (not ×N sources; several sessions accumulate)
- Restore without Amp parent locks a fresh `session.json` `lastThreadId` as `amp-session-last`
- Leftover without `--collect` scopes to `last.platform` and Amp thread / `T-…` prefix; leftover after `amp-usage` resyncs tokens and keeps billed Cost

### 0.12.0
- Cursor leftover after `stop` / `afterAgentResponse` (fail-open, idempotent `sessionEnd`); leftover filters `last.threadId` when it is set
- Multi-root hook/collect resolve the consumer window; leftover walks every candidate with `openspec/changes`
- `costUsdEstimated` aggregates write 4 decimals; `phases.<phase>` stores `startedAt` / `endedAt` / `leadTimeMs` (work-time `durationMs` is not `totals.leadTimeMs`)

### 0.11.0
- Session metrics attribution: persist collect is `[pending.startedAt, endedAt]`; a late hook stays leftover of that session; archive is `[pending.startedAt, now]` plus leftover of the previous session
- Source product id wins for `session.model`; `--model` / `## Metrics` / `AOK_MODEL` apply only when sources have none
- Cursor `sessionEnd` writes `costUsdEstimated`; `stop` + `afterAgentResponse` no longer double-count a turn

### 0.10.0
- `costUsdEstimated` is first-class on `metrics.json`; Cursor writes a labeled estimate whenever tokens exist — grok via xAI API (`costSource: api-estimate`), other models via versioned fallback $3/1M in + $15/1M out (or $3.50/1M when only `totalTokens`, `costSource: api-estimate-fallback`). The estimate is **not** an invoice and is never mixed into billed `costUsd`. Amp without a `Cost:` line leaves `costUsd: null`; self-report `cost_usd` stays billed.

### 0.9.0
- **UTC timestamps** in `metrics.json` (`…Z`; broken Amp stamps parsed and normalized)
- Amp `threads usage --details` billed `$` + `agentMode` (never stored as `session.model`)
- Cursor `costUsdEstimated` from xAI API rates for grok-4.6/4.5 — labeled, not mixed into billed `costUsd`
- **Archive auto-collect** — Archiver session picks up the locked client after the last session; leftover apply `## Metrics` is not double-counted

### 0.8.0
- Locked session client on `--restore`; persist collects only that client without `--collect`
- Amp CLI `threads export` + `threads list` when Amp runs over a pipe

### 0.7.0
- **`## Metrics` self-report** — persist reads the session section in `handoff.md`; `metrics.json` is the source of truth; CLI flags do not rewrite the section
- **BREAKING** — `--no-collect` removed; `handoff` and `archive` collect local adapters only with opt-in `--collect`
- Archive prints the same human summary as `metrics <name>` (by phase / platform / model, `spendSource`, unreported count)
- Cursor spend hook is optional setup (`init` / `update` / `sync` / `mcp-setup`); persist and restore no longer self-heal `.cursor/hooks.json`

### 0.6.0
- **Mandatory Cursor spend hook** — `scripts/cursor-spend-hook.cjs` + `.cursor/hooks.json` (`stop` / `subagentStop` / `afterAgentResponse`) write `.agents/spend/cursor-usage.jsonl`; `sessionEnd` + `metrics --collect` backfill the last session; installed by `init` / `update` / `sync` / `mcp-setup` and self-healed on `handoff`
- Persist/archive auto-collect local usage from Claude JSONL, Amp threads, and the Cursor hook file into `spendByPlatform` / `spendByModel`
- Amp source ids namespaced as `<threadId>:<messageId>` so thread-local counters do not collide
- `status` prints a `Spend capture` section

### 0.5.0
- **Change metrics** — git-tracked `openspec/changes/<name>/metrics.json` (session start on `handoff --restore`, close on persist)
- **`metrics` CLI** — human summary or `--json`; phases, tokens, cost, agents, models, lead time
- Optional persist spend flags: `--model`, `--input-tokens`, `--output-tokens`, `--total-tokens`, `--cost-usd`, `--started-at`, `--no-metrics`

### 0.4.0
- Factory phases 1–3: `hooks-setup` / `gate-check --staged`, `mcp-setup` (GitHub / GitLab / browser), MCP and Skill health in `status`
- Git-canonical append-only `decisions.md`; Memory `Decision:*` is a file→Memory mirror
- Cloud agent handoff: `## Runtime` in `handoff.md`, `--runtime` / `--agent-id` / `--cloud-check`

### 0.3.0
- **`archive` CLI** — deterministic archive with gates, `--sync` delta merge, and rollback on validate failure
- **Task contract** — `gate-check --tasks` enforces `Files:` / `Do:` / `Done-when:` (`pipeline.task_contract: warn|strict|off`)
- **Tiered review** — `gate-check --review` is machine Tier 1; `spec-reviewer` writes `apply-notes.md` on APPROVE
- Lean apply (parent-driven) and parent-driven session handoff; `opsx-archive.md` is a thin CLI wrapper

### 0.2.0
- Thinned always-apply rules and `AGENTS.md` / `CLAUDE.md` (context budget); details stay in on-demand skills

### 0.1.14
- **HARD STOP session handoff** — `session-handoff` subagent at start/exit; Amp isolated `subagent-session-handoff`
- **`handoff` CLI** — writes `handoff.md`, upserts `.cursor/memory.json` with an absolute path, prints an expanded self-contained next-thread prompt
- **`memory-setup` + `memory-mcp-launcher.cjs`** — never a relative `MEMORY_FILE_PATH` (Amp was reading the wrong graph)
- Next-thread prompt includes role, spawn instructions, Done/Decisions/Blocked, and exit HARD STOP

### 0.1.13
- Pipeline **conductor**: `/opsx:*` parent spawns the routed specialist and does not do that work itself
- Five new stage subagents: `codebase-explorer`, `design-intake`, `spec-architect`, `spec-reviewer`, `spec-archiver`
- Session handoff: Memory → `handoff.md` → next-session prompt in `project.agent_language` (read Memory on start)
- Amp `subagent-*` wrappers must run as isolated subagents, not in the main thread

### 0.1.12
- `figma-fetch --depth <n>` for large frames
- Write large Figma JSON as raw API text (avoids `Invalid string length` on huge trees)

### 0.1.11
- Optional **Figma personal token** setup: `.agents/figma.local.env` (gitignored) + `figma-mcp-launcher.cjs` (no secret in `.mcp.json`)
- CLI: `figma-setup`, `figma-status`, `figma-fetch` (REST nodes/file JSON)
- Agent rule + docs: never paste Figma tokens into chat
- Amp PATH hardening: prefer `npx` / `npm run` for OpenSpec and kit CLIs (`cli-via-npm` rule)

### 0.1.10
- Custom subagents (`.agents/subagents/`) synced to `.cursor/agents/` + `.claude/agents/`, exposed to Amp via auto-generated `subagent-*` skill wrappers
- 6 default subagents: `openspec-guide`, `code-writer`, `code-reviewer`, `test-writer`, `setup-doctor`, `design-implementer`
- `update` no longer resurrects deleted CI workflow files

### 0.1.9
- Design intake — `/opsx:design` captures design into `design-brief.md` + `assets/` (Figma / export / screenshot / photo)
- Role `design_intake` + opt-in `pipeline.require_design_brief` (default `false`) in all profiles
- `gate-check` enforces design brief when enabled (`Design: none` opt-out for non-UI); `status` shows `brief: yes/no`

### 0.1.8
- README — Quickstart (new vs existing project) and upgrade guide for adopting `status`, `gate-check`, and GitHub Spec Verifier

### 0.1.7
- `agent-orchestrator status` — dashboard for active OpenSpec changes: task progress, review verdict, archive readiness
- `agent-orchestrator gate-check` — deterministic review-gate check (exit non-zero without an approved `review.md`); wired into both `agent-verify.yml` CI fragments
- `init --ci github --spec-verify` — GitHub parity for the AI Spec Verifier (`.github/workflows/spec-verify.yml`, `scripts/post-pr-verdict-github.sh`), reusing the existing stack-agnostic `verify-specs.sh`
- `sync` (CLI) now removes skills/rules that no longer exist in `.agents/` — matches `sync-local-agent-skills.sh` (`rsync --delete`) behavior; leaves `memory.json`, `.mcp.json`, `CLAUDE.md`, `settings.json` untouched

### 0.1.6
- `init --ci gitlab --spec-verify` — opt-in AI Spec Verifier: blocking MR gate via Amp CLI
- Templates: `.gitlab/spec-verify.yml`, `scripts/verify-specs.sh`, `scripts/post-mr-verdict.sh`
- `spec-verify-blocking` gate auto-added to `roles.verifier.gates`
- `update` refreshes spec-verify files only where already installed

### 0.1.5
- `init --ci gitlab|github|none` — GitLab verify via prebuild hook + CI fragment
- PM-aware `verify:openspec` / `prebuild` injection for GitLab projects
- `.gitlab/agent-verify.yml` template + starter example
- `update` refreshes GitLab fragment; docs for GitLab verifier path

### 0.1.4
- Kit repo CI — `.github/workflows/agent-verify.yml`
- OpenSpec devDependency for local and CI validation

### 0.1.3
- Fix gitignore dedup (exact line match, not substring)
- Add `.claude` to gitignore on init
- `sync --target amp` — explicit Amp handling + settings.json bootstrap
- OpenSpec + frontend-agent-skills hints in init next steps
- Profile validation with warning for unknown profiles
- CI workflow: auto-detect npm / yarn / pnpm
- Package manager detection → updates verifier commands in orchestrator.yaml
- `openspec/config.yaml.example` from vue3/mvp profiles
- Review gate: `review.md` + apply checks `require_spec_review`
- Vue 3 checklist in `/opsx:review`
- New `/opsx:quick` command and **mvp** profile for demos/spikes

### 0.1.2
- Fix CLI: executable bit on `bin/agent-orchestrator.js` (`agent-orchestrator: not found`)
- Add `agent-orchestrator-kit` bin alias (matches package name for npx)

### 0.1.1
- Added all OpenSpec skills (`openspec-*`, `spec-workflow-openspec`)
- Added CI workflow template `.github/workflows/agent-verify.yml`
- Added `.agents/amp.settings.json.example` for Amp Code MCP
- `update` command now refreshes all kit-managed skills and CI
- Sync script auto-creates `.amp/settings.json` from example
- Removed unused `prompts` dependency

### 0.1.0
- Initial release: orchestration pipeline, `/opsx:*` commands, IDE sync

## License

MIT © [Maksim Shevyakov](https://github.com/makshc2)
