# Changelog

All notable changes to this project will be documented in this file.

## [Unreleased]

## [0.24.0] - 2026-11-18

### Added
- **Architect self-check.** Before reporting, the architect rechecks task and dependent Done-when conditions after Do edits, verifies code claims with `path:line` evidence, and runs grep conditions against the current code. Reports include `**Self-check:** done | not applicable`.
- **Review guidance.** Reviewers write `Task verdicts` for every task and collect all blockers in one pass. Optional `Fix During Apply` sections must be non-empty when present; approved tasks address those items within their Files/Do/Done-when contract.
- **Change size hint.** More than 8 tasks or 4 or more delta specs prompts a suggestion to split into two changes without blocking propose.
- **Opt-in `pipeline.review_fast_fix`.** Defaults to `off`; only exact `on` enables it. An accepted Tier 2 REQUEST CHANGES with local blockers in 1–2 tasks and no design or delta spec changes may be repaired in tasks.md and apply-notes.md. After a passing review gate and explicit user approval, the recorded verdict is APPROVE and the next command is `/opsx:apply <name>`. Tier 1 records do not qualify. Risks: edit side effects are not reviewed, the independent check is skipped, and `apply-notes.md` may be stale.

### Changed
- **Done-when quality.** Architect and propose templates and all three OpenSpec config examples prefer behavioral checks, allow grep only for non-numeric presence/absence, and forbid “exactly N” unless the task explains why the count is guaranteed; bad/good examples show the difference.
- **Repeat reviews and blockers.** Re-review checks Previous findings first, then runs the full existing Tier 2 checklist and an additional scan of the same defect classes. Blockers include unexecutable tasks, main spec or Non-goals conflicts, material contradictions between proposal/design/tasks/delta specs, and design behavior without delta or task coverage. Major/Minor items fixable within the approved task contract go to `Fix During Apply` and brief apply notes; without blockers the verdict is APPROVE.

## [0.23.0] - 2026-11-16

### Added
- **Opt-in local agent hook runtime.** `hooks.enabled: false` and `hooks.mode: observe` stay the default in every profile. `hooks enable --client claude|cursor|amp` installs only kit-owned client hooks and leaves Git pre-commit (`hooks-setup`) and foreign hooks alone. Bound sessions can receive stack skills, a metrics-neutral recovery briefing, and a local audit. `hooks bind`, `hooks snapshot`, `hooks status`, and `hooks disable` complete the set. Delivery is not compliance: the manual Read fallback stays. See [docs/agent-hooks.md](docs/agent-hooks.md).
- **Opt-in workflow checks on that runtime.** Six policies (`verification`, `completion`, `scope`, `checks`, `owned-sync`, `workflow-notifications`) ship disabled. A decision blocks or follows up only when global hooks and that policy are `enforce` and the client can carry it. `hooks verify` is the only full test run and reuses a fresh evidence record. `hooks complete --confirm-handoff` records a semantic handoff; a later substantive outcome invalidates it. Cursor and Amp may request one follow-up per work epoch and two per intent. Claude has no parent Stop follow-up, so the CLI stays the fallback. `sync --owned` and `update --sync` copy managed IDE files and keep foreign or modified files, exiting nonzero on a conflict. Notices stay local. No auto-approve, auto-commit, task ticking, publish, or fleet rollout.

### Changed
- Upgrade: `npx agent-orchestrator-kit@latest update`, then `sh scripts/sync-local-agent-skills.sh`. New `hooks.*` keys are already in the profile templates with every switch off, so existing projects keep the old behavior until `hooks.enabled` is set. `update` does not enable hooks.

## [0.22.1] - 2026-11-16

### Fixed
- **Implementation and test writers explicitly load tech skills.** `code-writer` now requires reading applicable skill files before writing code, with explicit Vue 3 paths for JavaScript, Vue core, Pinia, Axios, Router, composables, and Vite. `test-writer` requires Vue testing and JavaScript skills before writing tests. Both select equivalent skills for other stacks, report missing files without blocking, and include a `Skills:` audit field immediately after `Status:`.
- Existing generation propagates the updated prompts to Claude/Cursor agents and Amp skill wrappers for all four profiles. Upgrade each consumer with `npx agent-orchestrator-kit update`, then `sh scripts/sync-local-agent-skills.sh`. No configuration changes are required.

## [0.22.0] - 2026-11-09

### Added
- **Skill mirror blocks are generated from the rules.** The `session-start`, `session-exit` and `routing` blocks of `.agents/skills/agent-orchestration/SKILL.md` are now copied from `.agents/rules/session-handoff.mdc` and `agent-orchestration.mdc` between `<!-- aok:mirror:begin/end <id> -->` markers by the new `bin/instruction-mirrors.js`. `init`, `update` and `sync` regenerate them before the IDE copy, so a rule edit reaches the skill and `.claude/` / `.cursor/` on the next `sync`; only the text between the markers changes. A skill without markers is left byte-identical and `sync` warns `mirror blocks skipped … (run `update` …)`. The hand-written duplicates of Session Start/Exit and the routing table in the skill are gone. New capability: instruction-mirrors. Tests: `test/instruction-mirrors.test.js`, `test/instruction-text-consistency.test.js`. (`openspec/changes/instruction-mirror-consistency`)

### Changed
- **Specialists own their steps.** `spec-architect` carries the artifact build loop (`openspec new change`, `status --json`, `openspec instructions` per ready artifact); `/opsx:propose` and the propose skill only point to it. `design-intake` carries the capture details (source ladder, assets rules, the `design-brief.md` template, confidence markers); `/opsx:design` keeps select, spawn and verify. (`openspec/changes/instruction-mirror-consistency`)
- **`code-reviewer` is on request and diff-gated.** It is used on request or before a PR/MR (no longer `ALWAYS`), stops with `Blocked: no implementation diff` when `git diff HEAD`, the target-branch diff and untracked files under `pipeline.src_glob` are all empty, and reads `apply-notes.md` + `tasks.md` first. (`openspec/changes/instruction-mirror-consistency`)
- **Rules that contradicted the session data are removed.** `/opsx:quick` loses the «Max ~3 hours» guardrail; the skill drops the «All tasks in one apply session» anti-pattern and README the «1–3 tasks per session» line; review is `strong (same level as propose)`; Amp model hints use `low` / `high` / `ultra` instead of `rush` / `smart` / `deep`. (`openspec/changes/instruction-mirror-consistency`)
- **`handoff.md` has no `## Metrics` section and Session Exit has no self-report step.** The CLI collects model, platform and spend itself: model from adapters, then `--model`, then `AOK_MODEL`; spend from flags, then Amp usage, then adapters; `spendSource` is `flag`, `amp-usage`, `adapter` or `unreported` and never `self-report`. Only a `flag` session is frozen; the archive stale-copy guard and the `fill ## Metrics` warnings are gone. A legacy `## Metrics` section is ignored and dropped on the next rewrite — no migration needed. Rules, the skill, `session-handoff` / `spec-archiver` subagents, `AGENTS.md`, `CLAUDE.md` and README follow. (`openspec/changes/remove-metrics-self-report`)
- Upgrade: run `update` once — it reinstalls the skill with the mirror markers and refreshes the rules, commands, skills, subagents, `AGENTS.md` and `CLAUDE.md`; until then `sync` prints the `mirror blocks skipped` warning. `./scripts/sync-local-agent-skills.sh` only copies files; after editing a rule run `npx agent-orchestrator-kit sync`. No `orchestrator.yaml` key changes.

### Fixed
- **A bare `Reviewer` Closed role is canonicalized to `Spec Reviewer`**, as `Code Writer` already maps to `Implementer`, so the metrics ledger test no longer fails on it. (`openspec/changes/remove-metrics-self-report`)

## [0.21.0] - 2026-11-03

### Added
- **`/opsx:apply` runs the project's tests once, before the last box.** New step 6.5 in the apply command and its skill twin: when one task is left pending and its Done-when holds, the conductor reads `.agents/orchestrator.yaml` → `verifier.test_command`, runs it once from the project root and shows the last 20 lines with the command's own exit code. One outcome table fixes the last box, the `tests:` line in `## Done` and `## Blocked` for every case: a green or narrowed-green run ticks; an empty or missing command is skipped with a warning, writes `tests: skipped (no test_command)` and ticks (never guess `npm test`); a red run stops with the box unticked and `tests: red (see Blocked)`; a failure that already existed before the change waits for an explicit user decision and, when accepted, ticks with `tests: N-1/N (accepted by user: <name>)` and an empty `## Blocked`; nothing runnable leaves the box unticked; a session that pauses earlier writes `tests: not run (paused: <k> tasks pending)`. Session Exit now carries the `tests:` line in Done, and `/opsx:quick` inherits it. No hard gate is added. Specs: apply-test-discipline, session-handoff. Test: `test/apply-test-run-discipline.test.js`.
- **Fix changes start with a failing regression test (guideline).** `spec-architect`, `/opsx:propose`, the propose skill and `openspec-config.yaml.example` say that when a change 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, and its `Done-when:` states that it fails before the fix and passes after. When no automated test can reproduce the bug, `design.md` says why and the first task records the manual reproduction. Guidance for the architect, not a lint. Spec: task-contract.
- **New command `checkpoint [change-name]` saves mid-session progress.** `--task`, `--role`, `--done`, `--blocked`, `--next` and a repeatable `--decision` write a complete snapshot to the git-tracked `openspec/changes/<name>/checkpoint.json` (temp file plus atomic rename, integrity digest, leftover `.tmp` cleaned on every run). Each call replaces `done`, `blocked` and `next`, an unchanged state is a no-op that prints `checkpoint unchanged (seq <n>)`, and a corrupt file is reported and replaced with `seq` restarting at 1. It never closes the session, starts a phase, or writes `handoff.md`, `decisions.md`, Memory JSON or `metrics.json`: decisions stay verbatim in `checkpoint.json` until Session Exit lists them under `## Decisions` and persist records them, so the exclusive `decisions.md` write path is untouched. Input bounds: 500 characters and one line per text, 10 `--decision` values per call, 30 unrecorded decisions in total, a canonical `--role`, a `<n>.<n>` `--task`, and `--decision none` refused. New capability: session-checkpoint. Test: `test/session-checkpoint.test.js`.
- **`handoff --restore` prints a recovery briefing after an `UNPERSISTED SESSION` warning.** A deterministic, read-only summary of at most 40 lines and 4096 UTF-8 bytes built only from local files and git — the checkpoint, `handoff.md`, `decisions.md`, `tasks.md`, `review.md` and `git` — split into FACTS, UNKNOWN, CONTRADICTIONS, GAPS and QUESTIONS FOR THE USER, each item tagged with its source and a `DETAILS:` line naming the files and the git range. A checkpoint whose handoff digest no longer matches is superseded and contributes only its reported decisions. Review currency is a content-hash comparison against the last commit that touched `review.md` (checkbox-only edits of `tasks.md` do not stale a verdict); without a committed `review.md` or without git it is reported as unknown, never as current. No transcript is read and no LLM is called. Spec: session-handoff (ADDED). Test: `test/restore-recovery-briefing.test.js`.

### Fixed
- **An unreadable `handoff.md` or `decisions.md` no longer aborts `--restore`.** Both reads are guarded: the warning and the recovery briefing are printed before the existing early return, and an unreadable `decisions.md` becomes a GAPS item instead of a crash.

### Changed
- **README documents the new command and briefing.** `## CLI Reference` gains the `checkpoint` block and the `--restore` briefing note, and a new `### Checkpoint and recovery briefing` section covers when to checkpoint, the storage path, the review-currency evidence rule and the advisory, read-only nature of the briefing.
- Upgrade: `update` refreshes the commands, skills and subagents, which carries step 6.5, the checkpoint guidance and the fix-change guideline; the `checkpoint` command and the briefing are in the CLI itself. Always-apply rules and `templates/AGENTS.md` are untouched, and there are no `orchestrator.yaml` key changes.


## [0.20.1] - 2026-10-30

### Fixed
- **A skipped Session Exit no longer goes unnoticed.** `handoff <name> --restore` prints `UNPERSISTED SESSION` when the previous session left an open `pending` in `metrics.json`, when a change has artifacts but no `handoff.md`, or when `handoff.md` is older than the artifacts (2 s slack). It is advisory: exit code and briefing are unchanged, and it works the same in every client. The explore command and skill now name Session Exit as the exception to «never write OpenSpec artifacts» and no longer say «no mandatory outputs», the contradiction an agent cited when it skipped the persist. Spec: session-handoff. Test: `test/restore-unpersisted-warning.test.js`.

## [0.20.0] - 2026-10-30

### Added
- **Spec verifier conformance report.** The opt-in `verify-specs.sh` prompt asks for three additional arrays, `implemented[]`, `missing[]` and `scope_creep[]`, each item with `spec`, `requirement`, `message`, `file` and `line`. `missing` needs a provided file and `scope_creep` an explicit prohibition; one discrepancy lands in one group. Every `missing` / `scope_creep` item has one mirrored finding with a defined severity, and `pass` / `score` still come from `findings` only, so the merge gate is unchanged. Changed source files are numbered in the prompt from line 1 (`awk`, blank lines included), so `line` points at the file in `HEAD`. The GitHub and GitLab comments add `### Implemented`, `### Missing` and `### Scope creep` after Findings and tell an empty group (`_None reported._`) from a legacy verdict without groups (`_Not reported by this verifier._`) and from a skipped or inconclusive run (`_Not checked — …_`); the invalid-JSON fallback is marked `"inconclusive": true`. Cells escape `|` and line breaks, `file:line` appears only for a positive integer line, and malformed entries no longer raise. Projects with spec-verify already installed get the scripts through `update`; no new CI permissions, dependencies or verdict migration. (`openspec/changes/spec-verify-conformance-report`)

### Fixed
- **Long verifier responses are no longer cut or lost.** `verify-specs.sh` keeps the Amp response in a file instead of a shell variable, drops the 200-line cut and stores the first JSON object found at the start of a line as raw text; anything else gives the inconclusive fallback instead of aborting. `post-mr-verdict.sh` sends the comment payload from a temporary file (`--data-binary @file`), so a payload over 131 072 bytes no longer fails with `Argument list too long` and blocks a passing merge request. Both comment scripts read the verdict from the project root regardless of the working directory and print unencodable characters as `?`.
- **Main-spec failures surface before apply.** `gate-check --review` validates a temporary preview of all main specs after the planned delta sync with the consumer's installed OpenSpec, including unchanged specs. Strict failures identify the projected file and whether it is outside the current change. The preview never replaces working specs and is cleaned up on failure. Change validation and heading conflicts are checked first; archive retains its final strict validation and rollback. Newly created capabilities receive a Purpose long enough for strict validation even with short names.
- **Document the 500-character requirement-description limit at authoring time.** Architect, propose, workflow/howto, and profile config templates explain the boundary and preserve existing MODIFIED behavior/scenarios. Existing long specs require a separate migration; strict is not disabled. Pin the kit's existing OpenSpec development version to 1.4.1 and document local/CI version consistency.

## [0.19.0] - 2026-10-29

### Changed
- **`/opsx:quick` is a working path for small changes in every profile.** The architect now writes a minimal delta (one requirement, one scenario); the old "skip `specs/`" scope always failed `openspec validate --strict`. With `require_spec_review: true` the quick 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`. This writes a real `review.md`, so the CI gate and `archive` Gate 1 accept the change. One failed repeat cycle routes to `/opsx:propose <name>`. Apply follows the parent-driven `/opsx:apply`. The session closes as `Implementer — quick`, and a green quick prints the single archive line instead of the outdated `/opsx:archive` step. Specs: tiered-review (new requirement "Quick проходить легке рев'ю, коли review обов'язковий"), task-contract, session-handoff. Test: `test/opsx-quick.test.js`.

### Fixed
- **Closed role `Code Writer` counts as `Implementer`.** `canonicalRole` maps `Code Writer` / `code-writer` (the kit's apply subagent) to `Implementer`, like `Spec Architect` → `Architect`. Before this, `Code Writer (apply, 8/8 tasks)` was stored as `"Code Writer (apply"`: green-apply printed a full prompt instead of the archive line, and the ledger contract test failed on the archive.

### Development
- **Artifact mutation eval for Tier 1 (repo-only, not shipped).** `test/artifact-mutation-evals.test.js` applies 14 frozen mutations to a synthetic fixture and to a reconstruction of an archived change. It runs `gate-check --review` and the real local `openspec validate` in an isolated temp root and classifies each result as caught, missed or invalid. In the strict profile it catches 12 of 14. The two known gaps stay visible: Done-when semantics (S10) and a MODIFIED collision between two active changes (S11). The provenance and the procedure for adding a case are in `test/fixtures/mutations/README.md`. (`openspec/changes/artifact-mutation-evals`)

## [0.18.1] - 2026-10-14

### Fixed
- **`gate-check` no longer treats an explore-only change as the review target.** Auto-select skips a change that has neither `proposal.md` nor `tasks.md`. Staged or branch `src/` changes are not blocked by a research folder that has not entered propose. An explicit `gate-check <name>` still checks that change. A change that already has `tasks.md` or `proposal.md` still needs `review.md` with `APPROVE`.

## [0.18.0] - 2026-10-02

### Added
- **Artifact size budget in Tier 1.** `gate-check --review` measures `proposal.md`, `design.md`, `tasks.md` and the delta specs of a change in bytes (other change files are not counted) and reports `artifact budget: …` with the measured value, the limit and the advice to split the change into slices when `tasks.md` is over 60 000 B or the total is over 150 000 B (strict `>`). New `pipeline.artifact_budget: warn | strict | off`: `warn` (the default, also for a missing key, an unknown value or a missing `orchestrator.yaml`) prints warnings and keeps the exit code, `strict` adds them to `errors` (exit 1), `off` does not measure. The key is read like the other `pipeline.*` keys and `parsePipelineConfig` returns a new `artifactBudget` key; `templates/orchestrator.yaml` carries `artifact_budget: warn`, the profile files do not (a missing key means `warn`). The `--review --json` format stays `{pass, errors[]}`. (`openspec/changes/lean-conductor-protocol`)
- **`gate-check --review-md <name>` checks `review.md` against the `/opsx:review` schema.** Exactly one `Verdict:` line (a second one is an error, because `status` and `archive` read the first) that starts with APPROVE or REQUEST CHANGES; a `Previous findings` heading after any Tier 2 pass; on REQUEST CHANGES non-empty `Checklist`, `Findings` with Blocker / Major / Minor buckets and `Required Before Apply`; on APPROVE an `apply-notes.md` of at most 20 lines. A Tier 1 record (the exact line `**Source:** gate-check` and no Checklist) only has to be REQUEST CHANGES. Headings match at any level and in any case, extra sections are ignored. Exit 1 with the error list; `--json` prints `{pass, errors[]}`. A contract test runs the check over the kit's archived `review.md` files. Known limitation: a heading-like line inside a code fence (a column-0 `# comment`) ends a section. (`openspec/changes/lean-conductor-protocol`)

### Changed
- **The `/opsx:propose` conductor is thin.** `opsx-propose.md` and the `openspec-propose` skill gain a "Thin conductor" paragraph: the parent does not research the repo, reads only the decision brief (by path), `status` and `handoff --restore` (plus `review.md` on a re-propose after REQUEST CHANGES), spawns `spec-architect` within 5 tool calls passing the brief path instead of a digest of its own research, makes at most 3 tool calls after the report and does not re-read the artifacts on a green gate; a red gate adds only the one re-spawn and one more `gate-check --review`. An `artifact budget` warning is relayed verbatim with the advice to split the change. (`openspec/changes/lean-conductor-protocol`)
- **`/opsx:review` verifies `review.md` with the script.** The conductor compares the `Verdict:` line with the reported verdict and runs `gate-check --review-md <name>` instead of checking the headings by reading the file. On exit ≠ 0 it treats the file as rejected without rewriting it and re-spawns `spec-reviewer` once with the script's errors; after a second failure it closes with `## Blocked` and next command `/opsx:review <name>`. The APPROVE `review.md` example in `opsx-review.md` now has `## Previous findings`, so a copied example passes the check. (`openspec/changes/lean-conductor-protocol`)
- **Reading rules for `spec-architect` and `spec-reviewer`.** Both read repo files over 20 KB in line ranges (anchor ± 40 lines), read the change's own files in full once, batch independent reads into one call and do not re-read a file already read in the session. `spec-architect` lists the main-spec requirement headings and reads only the requirements the delta touches or could conflict with; it must not hide an `artifact budget` finding (`warn`: listed in `**Risks:**` with a proposed split; `strict`: `**Status:** blocked`). `spec-reviewer` writes `review.md` so that `gate-check --review-md` passes. (`openspec/changes/lean-conductor-protocol`)
- **`spec-reviewer` reads main specs for coverage.** It reads in full the main spec of every capability the delta touches, picks the requirements of the other main specs by heading and reads every one that could conflict ("when in doubt, read it"), and may re-read a file when its text is no longer in its context or a finding depends on the exact wording. The archived change gave the reviewer the architect's narrow main-spec rule; it was relaxed before this release, because a conflict with a main spec that the review misses is not caught by any later gate. Direct edit of `spec-reviewer.md` and of the `pipeline-subagents` spec, without an OpenSpec change.

## [0.17.0] - 2026-10-02

### Added
- **Archive from a terminal or opt-in CI, with an already-archived gate.** `archive <name>` first refuses a folder that already looks archived (Gate 0: `archivedAt` in the active `metrics.json`, or `Next command: none` in `handoff.md`; absent or invalid files never refuse). New `archive <name> --if-ready` is the CI mode: it prints `skip: <reason>` and exits 0 without touching anything when `archive_after_merge` is `false`, the change is already archived, or it is not ready (the same blockers `status` prints, now one shared helper); real failures still exit 1. `pipeline.archive_after_merge` is finally read (default `true`) and `status` prints it. The CI templates gain an opt-in archive job (GitHub `archive`, GitLab `agent-archive`, enabled by `AOK_ARCHIVE_ON_MERGE=true`, pushing with `AOK_ARCHIVE_TOKEN`, commit message `[skip ci]`); a terminal stays the default.
- **Tier 1 review checks delta-spec headings against the main specs.** `gate-check --review` now reports the same `MODIFIED` / `REMOVED` not found and `ADDED` already exists conflicts that `archive --sync` enforces, so a mismatched requirement title fails in the propose/review phase instead of at archive. Delta specs may use `## RENAMED Requirements` with `FROM:` / `TO:` lines. (`openspec/changes/tier1-delta-heading-check`)
- **Metrics ledger integrity.** Fail-open invariant warnings on persist and archive (stderr + `session.notes[]`), adapter notes printed to stderr, nullable `cacheReadTokens` / `cacheCreationTokens` on sessions, phases and `spendByModel` with a cache-hit line in the summaries, a contract test over newly archived `metrics.json`, `claude-opus-5-5` rates in the estimator and a 0.1× cache-read fallback for unknown models, `canonicalRole` maps `Spec Architect`. (`openspec/changes/metrics-ledger-integrity`)

### Changed
- **A green apply prints the archive command, and `/opsx:archive` is a fallback.** When the Implementer closes with every task `[x]` and `## Blocked` empty, `handoff <name>` prints exactly `npx agent-orchestrator-kit archive <name> --sync` (to run in a terminal after merge) instead of a next-session prompt, and sets `## Next role` to `none`; every other exit is unchanged. `templates/.agents/commands/opsx-archive.md` shrinks to a fallback that calls the CLI and stops on a refusal; the apply command and skill, the rules, `AGENTS.md`, `CLAUDE.md` and `openspec-guide` now point to the terminal. `parsePipelineConfig` returns a new `archiveAfterMerge` key.
- **Next-session prompt follows the parent-driven protocol.** `handoff <name>` no longer tells the next session to read Memory MCP or to spawn `session-handoff`; those fallback lines appear only when `handoff.spawn_handoff_subagent: true` in `orchestrator.yaml` (the flag is now actually read). The prompt is ~1.5 KB instead of 3.3–4.3 KB; `handoff --restore` prints the `Attach` section and only the last 10 entries of `decisions.md` with a trailer naming the older ones. `session-handoff.mdc`, `agent-orchestration.mdc`, the `agent-orchestration` skill and the `session-handoff` subagent were aligned; the kit's own `.agents/rules/session-handoff.mdc` is a copy of the template again. (`openspec/changes/fix-next-session-prompt`)
- **Dead `roles.*.model_hint` keys removed** from `templates/orchestrator.yaml` and `profiles/*/orchestrator.yaml` (never read by the CLI).

### Fixed
- **`gate-check` reads `pipeline.*` only inside the top-level `pipeline:` block** with comments stripped, so a commented-out `# require_spec_review: false` or the same key under another section no longer disables the review gate silently (files without a `pipeline:` block keep the old regex fallback). `pipeline.src_glob` / `--src-glob` accept a comma- or space-separated list passed to git as separate pathspecs. A byte-equality test keeps `scripts/*.cjs` in sync with `templates/scripts/`. (`openspec/changes/gate-check-config-parser-and-src-glob`)

## [0.16.0] - 2026-09-25

### Added
- **Stack-neutral `openspec/config.yaml.example` for the `node` and `generic` profiles.** New `templates/openspec-config.yaml.example` (English, `{{PROJECT_NAME}}` / `{{LANG}}`) is the fallback `init` installs when a profile has no own file: `rules.proposal` requires the exact `## Non-goals` and `## Acceptance criteria` headings, `rules.tasks` carries the Files/Do/Done-when contract and the Done-when quality rules, and every rule is double-quoted so OpenSpec does not drop the list. `update` and `init` without `--force` never touch an existing `openspec/config.yaml`: add the rule by hand (README → Update). Note: `init --force --profile node|generic` now overwrites an existing `openspec/config.yaml` with this template, as `init --force` already did for `vue3` / `mvp`.

### Changed
- **`/opsx:propose` runs the Tier 1 pre-gate.** After the `spec-architect` report the conductor runs `npx agent-orchestrator-kit gate-check --review <name>`; on exit ≠ 0 it re-spawns `spec-architect` once with the full error list, and 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; the `/opsx:review` prompt in Output and Session Exit is conditional on it. Review still runs Tier 1 itself; `gate-check` is unchanged.
- **`spec-architect` knows the mandatory proposal headings and Done-when quality rules.** It requires `## Non-goals` and `## Acceptance criteria`; when spawned by `/opsx:propose` it runs `gate-check --review` before its report and adds `**Gate:** gate-check --review exit <code>` (under `/opsx:quick` it writes `**Gate:** not run (/opsx:quick)`; a spawn prompt that does not mention quick counts as `/opsx:propose`). Done-when must check the new state, keep counts consistent with `Do:`, and avoid volatile repo values. The same rules are in the propose Task contract block.
- **`openspec-guide` routes a failed propose pre-gate back to propose.** For a change with `proposal.md` and no `review.md` it runs `gate-check --review <name>`: exit 0 → `/opsx:review <name>`, exit ≠ 0 → `/opsx:propose <name>`.

## [0.15.0] - 2026-09-08

### Added
- **`costUsdTotal` — one USD figure per change, phase, platform, model, and session.** Each session contributes its billed `costUsd` when present, otherwise its `costUsdEstimated`; sums are rounded to 4 decimals. A change that ran on Amp (billed `$14.48`) plus Claude (`~$5.16`) and Cursor (`~$1.43`) now carries `spend.costUsdTotal: 21.0779` instead of forcing a dashboard to pick `costUsd` and drop the estimated platforms. `costUsd` and `costUsdEstimated` stay separate fields and Amp credits stay out of every USD field. `metrics --summary-json` carries the field; the human `cost:` line prints `$21.08 ($14.48 billed + ~$6.60 est.)`.

### Fixed
- **Billed sums are rounded like estimates.** `spendByModel[].costUsd`, `spendByPlatform.*.costUsd`, `phases.*.costUsd`, and `spend.costUsd` stored raw float sums such as `4.4399999999999995` and `0.009000000000000001`; they are now `Math.round(x * 10000) / 10000`, the same rule `costUsdEstimated` already had.
- **Cache-split cost estimates survive the session recompute.** `applyCollectedSessionFields` recomputed `byModel[].costUsdEstimated` from `inputTokens` + `outputTokens` alone and overwrote the value the adapters had already produced. Since `inputTokens` includes `cache_read_*` / `cache_creation_*`, every cached token was billed at the full input rate: a real Claude change with 3.5M tokens estimated `$30.11` instead of `$5.16`, and Cursor rows lost their own rate table to the Claude `$3/$15` fallback. The recompute now only fills rows that have no adapter estimate, so ESTIMATE-ALL still covers Amp rows without `Cost:` while `claude-opus-5` with 100k input + 900k cache read + 10k output stays at `$1.20`.

## [0.14.1] - 2026-09-08

### Fixed
- **Memory graph survives `handoff` persist.** `loadMemoryItems` classified a memory file by its first character, so every JSONL graph (the format `@modelcontextprotocol/server-memory` reads and writes) was treated as an aggregate `{entities, relations}` document, failed to parse, and returned `[]` — the next persist then overwrote the whole file with just the current change's two entities. Everything the Memory MCP server had accumulated — all `Decision:*`, every other change, and all relations — was destroyed on each persist, leaving cross-session memory permanently one change deep. Detection is now by shape, `handoff --restore` reads JSONL graphs again instead of reporting "Memory JSON empty or missing", and a line that cannot be parsed is preserved verbatim rather than dropped.
- **`/opsx:*` commands reach the IDEs.** `.agents/commands/` was installed and documented but synced nowhere. `sync` now writes `.cursor/commands/opsx-<phase>.md` (flat, `/opsx-<phase>`) and `.claude/commands/opsx/<phase>.md` (namespaced, so the documented `/opsx:<phase>` exists in Claude Code), with the same stale-file deletion as skills and subagents. `sync-local-agent-skills.sh` matches.
- **`status` readiness mirrors the archive gates.** "ready to archive" was computed from `tasks.md` checkboxes alone, so it appeared on a change `archive` would refuse for a missing or non-APPROVE verdict. It now applies `require_spec_review` / `require_design_brief` and names the blockers.
- **`gate-check` no longer passes silently.** When the git diff cannot be computed (shallow clone, missing base ref, no commits) the review gate is verified instead of skipped.
- The next-thread prompt renders `- Change: <name>` instead of `- Change: - name: <name>`.

### Removed
- `templates/.cursor/memory.json` — an unused snapshot of the kit's own development memory. It was referenced by nothing (`init` writes an empty `.cursor/memory.json`), gitignored so it never showed up in a diff, yet the `files` allowlist still published it to npm. `files` now excludes `templates/.cursor` so it cannot ship again.

### Added
- `pipeline.src_glob` in `orchestrator.yaml` — the paths `gate-check` treats as product code. The hardcoded `src/` default silently disabled the review gate in repos whose code lives elsewhere; `--src-glob` still overrides.

## [0.14.0] - 2026-09-07

### Changed
- **BREAKING: compact metrics schema v2.** Sessions persist `sourceIds`, `sourceTotals`, and `byModel` instead of `sources`; v1 remains readable and `metrics --migrate` performs a schema-only rewrite.
- Collection now has bounded persist/leftover windows, thread-scoped Amp usage totals and fresh Cost, Claude message dedup/subagent capture, and static Claude/Amp cost estimates.
- Added `metrics --summary-json` as the aggregate dashboard contract; phase bounds come from `phases.*`, never git history.
- Kit templates require an exhaustive Tier 2 punch list (full scan before the verdict; schema Checklist / Findings / Required Before Apply / Previous findings). After REQUEST CHANGES the next command is `/opsx:propose`; `openspec-guide` no longer maps RC back to review. Metric: Spec review discovery loops ≤ 2.

## [0.13.0] - 2026-09-04

### Fixed
- **Amp Cost-once rollup, restore `amp-session-last`, leftover thread-scope.** After persist/recompute, Amp `Cost: $N` is added once **per qualifying session** into `spend.costUsd`, `spendByPlatform.amp.costUsd`, and `phases.*.costUsd` when that session’s `sources[].costUsd` are all null — never copied onto each source (not ×N); several Amp sessions accumulate. Restore without Amp parent locks a fresh `session.json` `lastThreadId` as `amp-session-last` (Amp parent without tty still uses `amp threads list`). Leftover without `--collect` scopes to `last.platform` and the Amp thread id / `T-…` prefix; an explicit `ampThreadId` does not add the env thread. Leftover after `amp-usage` resyncs tokens from sources and keeps billed Cost; `usageModels` stay unique to that thread; `pending.role` is the canonical token.

## [0.12.0] - 2026-09-02

### Fixed
- **Cursor leftover race, multi-root, 4-decimal estimates, and per-phase clock.** `stop` / `afterAgentResponse` run leftover immediately after a successful jsonl append (fail-open, no stdout); `sessionEnd` leftover stays and stays idempotent. Leftover filters `last.threadId` when it is non-empty and stays time-only when it is `null` or `''`. Hook and collect resolve the consumer in a multi-root window (not the first cwd with `.agents` or `openspec`); leftover walks every candidate that has `openspec/changes`. Written `costUsdEstimated` aggregates are rounded to 4 decimals after sums (`2.3911 + 2.8153 + 1.355 === 6.5614`). Each `phases.<phase>` now stores `startedAt` / `endedAt` / `leadTimeMs` from that phase’s sessions (epoch ms); `durationMs` remains the work-time sum and does not clone `totals.leadTimeMs`.

## [0.11.0] - 2026-09-02

### Changed
- **Session metrics attribution.** Persist collect is `[pending.startedAt, endedAt]`; a late hook goes to leftover of that session, not the next persist. Archive collect is `[pending.startedAt, now]` plus leftover of the previous session; `sessionEnd` reads the newest `openspec/changes/archive/*-<name>/metrics.json`. Source product id wins when sources have a model; `--model` / `## Metrics` / `AOK_MODEL` apply only when sources have none. Cursor collect filters by `conversationId` when a filter id is present. Canonical Closed role token is stored in `session.role`. Placeholder `unknown` plus `spend_source: self-report` does not freeze leftover totals.

### Fixed
- **Cursor `sessionEnd` collect writes `costUsdEstimated`.** `scripts/cursor-spend-collect.cjs` no longer copies tokens without an estimate: leftover hook rows keep `cacheReadTokens`, grok uses the xAI table (`costSource: api-estimate`, including `-fast` and the 200k cliff), other models use the `$3/$15` fallback, and aggregates (`spend`, platforms, models, phases) keep `costUsdEstimated`. Leftover rows after `pending.startedAt` stay off the last closed session. Persist / restore / `metrics --collect` also backfill estimates onto legacy cursor sources that already had tokens but `costUsdEstimated: null`. Amp credits stay self-report only; Amp billed USD still comes only from `amp threads usage` `Cost: $N`.
- **Cursor `stop` + `afterAgentResponse` no longer double-count a turn.** When Cursor omits `generation_id`, the spend hook used `Date.now()` and wrote two ids for the same tokens. The hook now uses a stable fallback id; persist and `sessionEnd` collect also collapse rows that share model + input/output/cache, prefer `stop`, skip leftover after `endedAt + 120s` when no session is pending, and resync adapter session totals from the remaining sources.

## [0.10.0] - 2026-08-31

### Added
- **`costUsdEstimated` first-class** in `metrics.json` (`spend`, platforms, models, sessions, sources). Cursor writes a labeled estimate whenever tokens exist: grok-4.5/4.6 keep xAI API rates (`costSource: "api-estimate"`); other models use a versioned fallback of $3/1M input + $15/1M output (or $3.50/1M when only `totalTokens` is present, `costSource: "api-estimate-fallback"`). This is **not** a Cursor invoice and is never mixed into billed `costUsd`. Self-report `cost_usd` stays billed and is not copied into `costUsdEstimated`. Amp without a `Cost:` line leaves `costUsd: null` (tokens are not converted to USD; credits stay separate). Archived `metrics.json` files are not backfilled.

## [0.9.0] - 2026-08-31

### Added
- **UTC timestamps in `metrics.json`** — `createdAt` / `updatedAt` / `archivedAt` / session times / source `at` are stored as ISO-8601 UTC (`2026-08-31T07:08:17.563Z`). Broken Amp stamps like `2026-08-31T07:08:17.563464.000Z` are parsed and normalized to UTC. Human `metrics` output still prints Kyiv wall time (`31.08.2026 10:08:17 (Київ +03:00)`).
- **Amp `threads usage`** — when the locked client is Amp, persist also runs `amp threads usage <id> --details` (fail-open) and writes the billed `costUsd`, per-model costs, and `agentMode` (`low` / `medium` / `high` / `ultra`) from `amp threads export`. Mode is never stored as `session.model`. Placeholder `amp-default` yields to the real LLM id from sources.
- **Cursor API-equivalent estimate** — hook tokens for `cursor-grok-4.6` / `4.5` (including `-fast`, 200k long-context cliff, cache reads when present) fill `costUsdEstimated` with `costSource: "api-estimate"`. This is **not** the Cursor invoice and is never mixed into billed `costUsd`.
- **Archive auto-collect** — `archive <name>` detects the current client (`resolveRestoreClient`) and records Archiver spend from that adapter (Cursor hook / Amp export+usage / Claude JSONL) in the window after the last session. Leftover apply `## Metrics` numbers are ignored when they match the previous session. `--collect` still runs all three adapters.

### Changed
- `metrics` / archive summary cost line shows `$1.30 billed + ~$8.98 est.` when both exist.

## [0.8.0] - 2026-08-31

### Added
- **Locked session client** — `handoff --restore` detects `cursor` / `claude` / `amp` (env, Amp parent process, or recent `session.json` tty mapping) and stores `pending.platform` + `pending.threadId`. Persist follows that client: Amp runs `amp threads export` plus local thread JSON; Cursor reads the spend hook; Claude reads `~/.claude/projects`. `--platform` / `AOK_PLATFORM` / `## Metrics` still override.
- **Amp CLI export adapter** (`amp-cli`) — when the locked client is Amp (or `--collect`), the kit calls `amp threads export <id>` (override `AOK_AMP_BIN`). Fail-open if Amp CLI is missing. `agentMode` (`low`/`medium`) is never stored as `session.model`.
- **Amp web / pipe restore** — if the parent process is `amp` and stdin is `/dev/null` (no pts), the kit takes the newest id from `amp threads list` instead of stale `session.json` `lastThreadId`.

### Changed
- Persist without `--collect` now collects **only the locked/resolved client**, not all three adapters. `--collect` still runs every adapter.

## [0.7.0] - 2026-08-30

### Breaking
- **`--no-collect` removed** — persist and archive no longer collect local spend adapters by default. Pass `--collect` to run Claude JSONL, Amp thread, and Cursor hook adapters. Scripts that still pass `--no-collect` fail as an unknown option.

### Added
- **`## Metrics` in `handoff.md`** — Session Exit self-report (`platform`, `model`, `input_tokens`, `output_tokens`, `cost_usd`, `amp_credits`, `spend_source`). Persist and archive resolve spend from flags → self-report → optional `--collect` sources. The section stays the agent's declaration; `metrics.json` is the source of truth.
- **`session.spendSource`** and **`session.ampCredits`** — origin of the numbers (`self-report` / `flag` / `adapter` / `unreported`, or a custom `spend_source`) and Amp credits kept out of USD totals.
- **Archive summary** — after finalize, `archive` prints the same human tables as `metrics <name>` (by phase / platform / model, unreported count).

### Changed
- **Resolve chains** — `model`: `--model` → `## Metrics` → `AOK_MODEL` → sources (with `--collect`) → `null`. `platform`: `--platform` → `## Metrics` → `AOK_PLATFORM` → host env → sources.
- **Cursor spend hook** — still installed by `init` / `update` / `sync` / `mcp-setup`; persist, restore, and `metrics` no longer self-heal `.cursor/hooks.json`.
- **`spendByPlatform` / `spendByModel`** — include session-level self-report; matching `sources` are counted once; buckets without adapters keep `source: "none"`.

### Fixed
- **Spend collect window** — persist no longer starts the collect window at `pending.startedAt`. Window is `[last session.endedAt || createdAt, endedAt]`.
- **Amp collect without trees** — a thread is no longer skipped solely because `env.initial.trees` is missing; cwd fields, `AMP_CURRENT_THREAD` / `AMP_THREAD_ID`, or an exact cwd mention still match.
- **Amp leftover after persist/archive** — persist and archive run the same last-session backfill as `metrics --collect`.

## [0.6.0] - 2026-08-29

### Added
- **Mandatory Cursor spend hook** — `scripts/cursor-spend-hook.cjs` (fail-open, silent) appends per-turn token usage from Cursor `stop` / `subagentStop` hook payloads to gitignored `.agents/spend/cursor-usage.jsonl`; `ensureCursorSpendHook` installs the script and merges `.cursor/hooks.json` in `init`, `update`, `sync`, `mcp-setup`, and self-heals on every `handoff` restore/persist (persist reports to stderr only) so every kit project records Cursor spend without manual flags; `status` prints a `Spend capture` section (cursor hook state + record count, local Claude/Amp data presence)

### Changed
- **Change metrics** — `session.model` resolves `--model` → `AOK_MODEL` → `null` (stderr warning); persist/archive auto-collect local usage from Claude JSONL, Amp threads, and the Cursor spend hook file (`.agents/spend/cursor-usage.jsonl`) into separate `spendByPlatform` / `spendByModel` figures (flags override session totals only; never merge Amp credits into USD); human `metrics` table prints `roles` and `models` plus platform/model tables; `archive` always creates or finalizes `metrics.json` with an Archiver session; Session Exit protocol requires `--model <llm-product-id>`
- **Cursor spend adapter** — replaced the dead `state.vscdb` probe (Cursor never writes token usage to its local DB) with reading the hook-generated `.agents/spend/cursor-usage.jsonl` (window by `at`, dedup by `generation_id`, cumulative loop repeats keep the largest record, `source: "cursor-hook"`)

### Fixed
- **Amp source ids** — `messageId` is a thread-local counter (1, 3, 5…), so dedup ids are now namespaced as `<threadId>:<messageId>` to prevent collisions across threads

## [0.5.0] - 2026-08-29

### Added
- **Change metrics** — git-tracked `openspec/changes/<name>/metrics.json`: `handoff --restore` records the session start (`pending` marker), `handoff <name>` closes the session (duration, closed role → phase `explore|design|spec|review|apply|archive`, runtime, tasks snapshot, optional `--model` / `--input-tokens` / `--output-tokens` / `--total-tokens` / `--cost-usd`, `--started-at` when restore was skipped, `--no-metrics` to opt out), `archive <name>` sets `archivedAt`; per-phase and total aggregates (durations, tokens, cost, agents, models, `leadTimeMs`) are recomputed on every write and unreported values stay null-honest
- **`npx agent-orchestrator-kit metrics [change-name] [--json]`** — human summary (phases table, spend, recent sessions) or raw JSON; resolves archived changes under `openspec/changes/archive/*-<name>` too

## [0.4.0] - 2026-08-28

### Added
- **Phase 3 cloud agent handoff** — persist writes `## Runtime` (`runtime: local|cloud`, `agent_id`) via `--runtime` → `AOK_RUNTIME` → `CLOUD_ENV_MARKERS` → existing section → `local`; `handoff <name> --cloud-check` blocks on uncommitted/unpushed artifacts for cloud (local: warning, exit 0); persist never commits/pushes — cloud sessions print persist → commit → push → cloud-check on stderr
- **Phase 2 decisions canon** — git-tracked append-only `openspec/changes/<name>/decisions.md`; `npx agent-orchestrator-kit handoff <name>` appends dated bullets from `handoff.md ## Decisions` (no duplicates; same topic + new text keeps history); Memory `Decision:*` mirrors the file (last topic wins, file → Memory only); `handoff --restore` prints from the git file or `decisions: none`
- **Skill inventory** — `skills.kit` / `skills.stack` / `skills.external` in `orchestrator.yaml` (template + all profiles); kit skill list for `init`/`update` is enumerated from `templates/.agents/skills/` (no hardcoded `KIT_SKILL_DIRS`); `status` prints warn-only Skill health (`ok` / `missing` / `stale`) plus Amp wrapper freshness; missing stack skills hint `npx <external> install --agent all --yes` without running an install
- **`agentic-factory-roadmap`** — planning (docs-only) capability: sequences factory phases 1–4 and records platform-level non-goals; implementation stays in later changes
- **Phase 1 factory gates & MCP** — opt-in pre-commit `gate-check --staged` via `hooks-setup` / `init --hooks` (husky-first, otherwise `core.hooksPath=.githooks`; never writes `.git/hooks/`)
- **`mcp-setup`** — GitHub / GitLab / browser stdio launchers (Figma pattern); VCS host from `git remote origin` (not `--ci`); `--vcs` override; `--no-browser`
- **MCP health** in `status` (`ok` / `not configured` / `skipped`) without printing token values
- Committed examples list `memory`, `figma`, `github`, `gitlab`, `browser`; gitignored `.agents/github.local.env` and `.agents/gitlab.local.env`

## [0.3.0] - 2026-08-18

### Added
- **`npx agent-orchestrator-kit archive <name>`** — deterministic archive CLI: gates (APPROVE, all tasks `[x]`, free target), delta-spec merge into main specs with `--sync` (ADDED append / MODIFIED replace / REMOVED delete), explicit refusal without a sync decision (`--sync` or `--no-sync --force`), snapshot + full rollback when `openspec validate --all --strict` fails, final `handoff.md` (`next_command: none`) + memory upsert
- **Task contract lint** — `gate-check --tasks <name>` enforces `Files:` / `Do:` / `Done-when:` per task, rejects vague phrasing and nonexistent `Files:` paths without `new file:`; controlled by `pipeline.task_contract: warn|strict|off` (default `warn`, mvp `off`)
- **Tiered review** — `gate-check --review <name> [--json]` is deterministic Tier 1 (strict validation, task-contract lint, proposal `Non-goals`/`Acceptance criteria`, non-empty delta sections); `spec-reviewer` runs only after Tier 1 passes and writes `apply-notes.md` (≤ 20 lines) on APPROVE

### Changed
- **Lean delegation model** — apply is parent-driven (implementer reads `tasks.md` + `apply-notes.md`, spawns subagents only for ≥ 2 independent tasks or on request, STOP escape valve instead of improvisation); archive is CLI-only with `spec-archiver` demoted to fallback; propose/review specialists remain mandatory
- **Parent-driven session handoff** — canonical Session Start/Exit protocol consolidated in `.agents/rules/session-handoff.mdc`; `/opsx:*` commands reference it instead of duplicating it; `session-handoff` subagent and Memory MCP mirror are fallbacks (`handoff.spawn_handoff_subagent: false` in all profiles); `opsx-archive.md` slimmed to a ≤ 1.5 KB CLI wrapper

## [0.2.0] - 2026-08-18

### Changed
- **Context budget** — thinned always-apply rules and `AGENTS.md` / `CLAUDE.md`; details stay in on-demand skills. `figma-token-setup.mdc` is no longer `alwaysApply`. Restore spawn of `session-handoff` is skipped when `handoff --restore` already printed a briefing.

## [0.1.14] - 2026-08-13

### Added
- **`session-handoff` subagent** — mandatory restore at session start and persist at session exit (Amp: isolated `subagent-session-handoff`)
- **`npx agent-orchestrator-kit handoff <name>`** — validates `handoff.md`, upserts `.cursor/memory.json` with an absolute path, prints an expanded self-contained next-thread prompt in `project.agent_language`
- **`npx agent-orchestrator-kit memory-setup`** — installs `scripts/memory-mcp-launcher.cjs` and rewrites Cursor/Amp Memory MCP away from relative `MEMORY_FILE_PATH`
- Always-apply rule `.agents/rules/session-handoff.mdc` with HARD STOP gates Amp cannot treat as optional

### Changed
- Next-session prompt is now a full operating brief (Done, Decisions, Blocked, attach, which subagent to spawn, Amp isolation, exit HARD STOP) so the next thread works even if Memory MCP is ignored
- Amp `subagent-*` wrappers require STOP if spawn is unavailable instead of running specialist work in the main thread
- Memory MCP examples and init/sync use the launcher instead of `npx` + relative path

## [0.1.13] - 2026-08-13

### Added
- **Pipeline subagent conductor** — every `/opsx:*` parent session now delegates through an exclusive phase/signal routing table, with five new stage specialists for explore, design, propose, spec review, and archive (`codebase-explorer`, `design-intake`, `spec-architect`, `spec-reviewer`, `spec-archiver`)
- **Durable session handoff** — sessions restore and persist `Change:*`, `Handoff:*`, and `Decision:*` Memory entities, mirror state in `openspec/changes/<name>/handoff.md`, and emit one next-session prompt in `project.agent_language` (no service banner, no duplicated summary)

### Changed
- Amp `subagent-*` wrappers now require isolated fresh-context execution and return only a structured specialist report
- OpenSpec commands, orchestration rules, skills, profiles, and documentation now enforce conductor-only task marking and phase separation

## [0.1.12] - 2026-07-21

### Added
- **`figma-fetch --depth <n>`** — limit Figma node tree depth for large frames (omit = full tree)

### Fixed
- **`figma-fetch` large payloads** — write API response text as-is instead of pretty-printing via `JSON.stringify` (avoids `Invalid string length` on huge trees)
- Clearer error when Figma API returns a non-JSON body

## [0.1.11] - 2026-07-21

### Added
- **Figma personal token setup** — local `.agents/figma.local.env` (gitignored) + committed `.agents/figma.local.env.example`
- **`scripts/figma-mcp-launcher.cjs`** — starts `figma-developer-mcp` with token from the env file (no secret in `.mcp.json`)
- **CLI** — `figma-setup`, `figma-status`, `figma-fetch` (REST file/nodes JSON via `X-Figma-Token`)
- Cursor/Amp MCP examples include optional `figma` server pointing at the launcher
- Agent rule `figma-token-setup.mdc`; setup-doctor + `/opsx:design` guidance (never ask for token in chat)
- `orchestrator.yaml` / profiles: `mcp.optional` includes `figma` + `figma.env_file` metadata

### Fixed
- **Amp / agent PATH** — templates now document and require `npx` / `npm run` for OpenSpec and `agent-orchestrator-kit` CLIs (bare binaries often exit 127 in Amp shells)
- Added always-apply rule `templates/.agents/rules/cli-via-npm.mdc`; updated openspec skills/commands, `AGENTS.md`, `CLAUDE.md`, `orchestrator.yaml` `cli.*` hints
- Never recommend `openspec validate --strict` without `<name>` / `--all`

## [0.1.10] - 2026-07-15

### Added
- **Custom subagents** — new `.agents/subagents/` asset category, synced to `.cursor/agents/` and `.claude/agents/` (like skills/rules, delete-stale semantics on `sync`)
- 6 default subagents: `openspec-guide` (pipeline navigator, read-only), `code-writer` (scoped task implementation), `code-reviewer` (spec-compliance + convention review), `test-writer` (test authoring), `setup-doctor` (orchestrator setup diagnosis/repair), `design-implementer` (pixel-accurate Figma/screenshot → code, honors design-brief priority)
- **Amp support via skill wrappers** — Amp has no file-based subagents, so `init`/`update`/`sync` auto-generate a committed `.agents/skills/subagent-<name>/SKILL.md` wrapper per subagent (Amp loads `.agents/skills/` natively); wrappers are excluded from `.cursor/`/`.claude/` skill sync and removed when the source subagent is deleted
- `update` and `sync --target cursor|claude|all` now manage `.agents/subagents/` alongside skills and rules
- `scripts/sync-local-agent-skills.sh` generates Amp wrappers and rsyncs `.agents/subagents/` → `.cursor/agents/` and `.claude/agents/`

### Fixed
- `update` no longer resurrects a CI workflow file the project deleted (e.g. `.github/workflows/agent-verify.yml` after switching to GitLab CI) — CI files are refreshed only when already present
- `update` keeps `scripts/sync-local-agent-skills.sh` executable

## [0.1.9] - 2026-07-12

### Added
- **Design intake** — optional `/opsx:design` phase: captures Figma / export / screenshot / photo into `design-brief.md` + `assets/` (writes only those paths)
- **Role `design_intake`** in templates and all profiles (`generic`, `vue3`, `node`, `mvp`) with `pipeline.require_design_brief: false` (opt-in)
- **`gate-check` design brief gate** — when `require_design_brief: true` and `src/` changed, requires `design-brief.md` or `Design: none` in `proposal.md`
- **`status`** shows `brief: yes/no` for every active change
- **Docs** — AGENTS.md / CLAUDE.md / rules / agent-orchestration skill / README section for design intake and manual enable after `update`

## [0.1.8] - 2026-07-07

### Changed
- **README** — Quickstart block (new vs existing project) and upgrade guide for `status` / `gate-check` / GitHub Spec Verifier adoption

## [0.1.7] - 2026-07-07

### Added
- **`agent-orchestrator status`** — dashboard for active OpenSpec changes: task progress (`N/M`), review verdict, `ready to archive` flag
- **`agent-orchestrator gate-check`** — deterministic review-gate check; exits non-zero when `src/` changed without an approved `review.md` (`require_spec_review: true`); warns (non-blocking) when active changes exceed `max_active_changes`; graceful no-op without `.agents/orchestrator.yaml`, when review isn't required, or when the diff can't be computed
- **GitHub AI Spec Verifier** — `init --ci github --spec-verify` installs `.github/workflows/spec-verify.yml` + `scripts/post-pr-verdict-github.sh` (via `gh pr comment`), reusing the existing stack-agnostic `scripts/verify-specs.sh`
- **OpenSpec specs** — `orchestrator-cli-controls`, `github-spec-verify`

### Changed
- **`sync`** (CLI) now removes stale skills/rules no longer present in `.agents/skills|rules` — matches `sync-local-agent-skills.sh` (`rsync --delete`); does not touch `memory.json`, `.mcp.json`, `CLAUDE.md`, `settings.json`
- **`agent-verify.yml`** (both GitHub and GitLab fragments) now run `gate-check` as part of verify
- **`--spec-verify`** — no longer GitLab-only; valid with `--ci gitlab` or `--ci github`
- **README / AGENTS.md / agent-orchestration skill** — document `status`, `gate-check`, and GitHub Spec Verifier parity

## [0.1.6] - 2026-07-02

### Added
- **`init --spec-verify`** — opt-in AI Spec Verifier for GitLab consumers: on MRs changing `src/`, an Amp agent verifies code against `openspec/specs/`, posts PASS/BLOCKED to the MR, and fails the pipeline on BLOCKED
- **Templates** — `.gitlab/spec-verify.yml` (blocking job, commented Phase 1 `allow_failure` fallback), `scripts/verify-specs.sh` (stack-agnostic prompt with project context from `openspec/config.yaml`, graceful skips, secret-safe), `scripts/post-mr-verdict.sh` (GitLab MR comment)
- **Orchestrator gate** — `spec-verify-blocking` auto-added to `roles.verifier.gates` (idempotent)
- **OpenSpec spec** — `spec-verify-consumer`

### Changed
- **`update`** refreshes spec-verify files via `KIT_OPTIN_PATHS` — only in projects that already installed them
- **README / AGENTS.md template** — AI Spec Verifier documented (install, CI variables, verdict schema, Phase 1 rollout)

## [0.1.5] - 2026-06-27

### Added
- **`init --ci gitlab|github|none`** — CI provider flag (default: `github`)
- **GitLab verify** — `.gitlab/agent-verify.yml` fragment with multi-PM detect (npm/yarn/pnpm)
- **PM-aware prebuild hook** — `verify:openspec` + `prebuild` injection on `--ci gitlab` (zero DevOps config via `npm run build`)
- **Starter example** — `templates/.gitlab-ci.starter.yml.example` for early push before DevOps owns root CI
- **OpenSpec specs** — `gitlab-consumer-verify`, `kit-ci-verify` synced to `openspec/specs/`

### Changed
- **`update`** refreshes `.gitlab/agent-verify.yml` via `KIT_MANAGED_PATHS`
- **README + AGENTS.md** — GitLab verifier path documented (prebuild hook, not GitHub Actions)
- **`printNextSteps`** — GitLab hints for `--ci gitlab` users

## [0.1.4] - 2026-06-27

### Added
- **Kit repo CI** — `.github/workflows/agent-verify.yml` (npm ci → OpenSpec validate → test)
- **OpenSpec devDependency** — `@fission-ai/openspec` for local and CI validation

## [0.1.3] - 2026-06-14

### Added
- **`mvp` profile** — demos/spikes: `require_spec_review: false`, up to 3 active changes
- **`/opsx:quick` command** — propose + apply in one session for MVP workflows
- **`openspec/config.yaml.example`** from vue3 and mvp profiles on init
- **Review gate enforcement** — `/opsx:review` writes `review.md`; `/opsx:apply` checks `require_spec_review`
- **Vue 3 review checklist** in `/opsx:review` (script setup, Pinia, Axios)
- **Package manager detection** (npm/yarn/pnpm) → updates verifier commands in `orchestrator.yaml`
- **CI workflow** auto-detects npm / yarn / pnpm
- **OpenSpec + frontend-agent-skills** hints in init next steps
- **Profile validation** with warning for unknown profiles

### Fixed
- Gitignore dedup uses exact line match (not substring) — `.cursor/memory.json` no longer blocks `.cursor`
- `.claude` added to gitignore on init
- `sync --target amp` — explicit Amp handling + `.amp/settings.json` bootstrap

## [0.1.2] - 2026-06-14

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

## [0.1.1] - 2026-06-14

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

### Removed
- Unused `prompts` dependency

## [0.1.0] - 2026-06-14

### Added
- Initial release: 5-role orchestration pipeline, `/opsx:*` commands, IDE sync

[0.13.0]: https://github.com/makshc2/agent-orchestrator-kit/compare/v0.12.0...v0.13.0
[0.12.0]: https://github.com/makshc2/agent-orchestrator-kit/compare/v0.11.0...v0.12.0
[0.11.0]: https://github.com/makshc2/agent-orchestrator-kit/compare/v0.10.0...v0.11.0
[0.10.0]: https://github.com/makshc2/agent-orchestrator-kit/compare/v0.9.0...v0.10.0
[0.9.0]: https://github.com/makshc2/agent-orchestrator-kit/compare/v0.8.0...v0.9.0
[0.8.0]: https://github.com/makshc2/agent-orchestrator-kit/compare/v0.7.0...v0.8.0
[0.7.0]: https://github.com/makshc2/agent-orchestrator-kit/compare/v0.6.0...v0.7.0
[0.6.0]: https://github.com/makshc2/agent-orchestrator-kit/compare/v0.5.0...v0.6.0
[0.5.0]: https://github.com/makshc2/agent-orchestrator-kit/compare/v0.4.0...v0.5.0
[0.4.0]: https://github.com/makshc2/agent-orchestrator-kit/compare/v0.3.0...v0.4.0
[0.3.0]: https://github.com/makshc2/agent-orchestrator-kit/compare/v0.2.0...v0.3.0
[0.2.0]: https://github.com/makshc2/agent-orchestrator-kit/compare/v0.1.14...v0.2.0
[0.1.14]: https://github.com/makshc2/agent-orchestrator-kit/compare/v0.1.13...v0.1.14
[0.1.13]: https://github.com/makshc2/agent-orchestrator-kit/compare/v0.1.12...v0.1.13
[0.1.12]: https://github.com/makshc2/agent-orchestrator-kit/compare/v0.1.11...v0.1.12
[0.1.11]: https://github.com/makshc2/agent-orchestrator-kit/compare/v0.1.10...v0.1.11
[0.1.10]: https://github.com/makshc2/agent-orchestrator-kit/compare/v0.1.9...v0.1.10
[0.1.9]: https://github.com/makshc2/agent-orchestrator-kit/compare/v0.1.8...v0.1.9
[0.1.8]: https://github.com/makshc2/agent-orchestrator-kit/compare/v0.1.7...v0.1.8
[0.1.7]: https://github.com/makshc2/agent-orchestrator-kit/compare/v0.1.6...v0.1.7
[0.1.6]: https://github.com/makshc2/agent-orchestrator-kit/compare/v0.1.5...v0.1.6
[0.1.5]: https://github.com/makshc2/agent-orchestrator-kit/compare/v0.1.4...v0.1.5
[0.1.4]: https://github.com/makshc2/agent-orchestrator-kit/compare/v0.1.3...v0.1.4
[0.1.3]: https://github.com/makshc2/agent-orchestrator-kit/compare/v0.1.2...v0.1.3
[0.1.2]: https://github.com/makshc2/agent-orchestrator-kit/compare/v0.1.1...v0.1.2
[0.1.1]: https://github.com/makshc2/agent-orchestrator-kit/compare/v0.1.0...v0.1.1
[0.1.0]: https://github.com/makshc2/agent-orchestrator-kit/releases/tag/v0.1.0
