Deft directive release

From deftai/directive · View interactive version

Deft directive release is an AI agent skill from the GitHub repository deftai/directive. Cut a v0.X.Y release of the deft framework safely. Use when the user says "release", "cut release", "v0.X.Y", or "publish release" -- to walk an 8-phase workflow that pre-flights, runs an end-to-end rehearsal against a temp repo, lands a draft GitHub release (npm ships irrevocably at tag push), opti

How to use this skill

Skill file

<!-- AUTO-GENERATED by task packs:render -- DO NOT EDIT MANUALLY -->

<!-- Purpose: rendered skill -->

<!-- Source of truth: packs/skills/skills-pack-0.1.json -->

<!-- Regenerate with: task packs:render -->

<!-- Edit the source, not this file. Slice instead of loading every SKILL.md: task packs:slice skills by-trigger --trigger <kw> (or list) -->

Deft Directive Release

Structured 8-phase workflow for cutting a v0.X.Y release of the deft framework. Operationalizes the task release / task release:publish / task release:rollback / task release:e2e / task release:wait-npm / task release:local-update surface introduced in #716 (safety hardening of #74; Phase 7 wait #4267; maintainer checkout closeout #5953).

Legend (from RFC2119): !=MUST, ~=SHOULD, ≉=SHOULD NOT, ⊗=MUST NOT, ?=MAY.

See also: deft-directive-swarm Phase 6 Step 5 (Slack announcement template re-used by Phase 8 below) | deft-directive-review-cycle (user-gate pattern) | deft-directive-refinement (conversational phased flow).

Platform Requirements

! GitHub as the SCM platform; the GitHub CLI (gh) must be installed and authenticated. The full pipeline plus the rehearsal target (task release:e2e) all dispatch through gh.

Primary occupancy — trusted producer (#4266)

! Mutation session:start on a contended primary MUST pass --primary-claim-exception=release-cut before any state-changing preflight command (task policy:allow-direct-commits -- --confirm, reconcile, cache refresh). Occupancy already implements that exception; session:start CLI argv is the trusted producer.

deft session:start --primary-claim-exception=release-cut

or task session:start -- --primary-claim-exception=release-cut. Sibling values: policy-restore, operator-default-branch. Unknown values fail closed (exit 2). --read-only never claims.

⊗ Invent a process-wide env producer for the exception.

⊗ Name the exception in spawn JSON.

⊗ Run task policy:allow-direct-commits (or any other mutation) before mutation session:start --primary-claim-exception=release-cut on a contended primary.

Release cut-context — keep published pin (#5910)

! At release entry (Phase 1 after the version is confirmed, before Phase 4 / task release mutations that reach version bump/tag), write the cut-context marker via the named producer:

task materialize:cut-context

or node tasks/materialize.cjs --write-cut-context <checkout-root>. That writes .deft-scratch/release-cut-context.json. While the marker is present, task materialize:runtime refuses before it moves or replaces node_modules/@deftai/directive-runtime, so tip 0.0.0 cannot displace the published pin mid-cut.

! Keep cut-context active from release entry through version bump/tag. Clear after the bump/tag lands:

task materialize:clear-cut-context

! Tip dogfood materialize:runtime stays outside the cut path (#5805 keep-out). Do not remint pin-exclusive ordinary invoke.

⊗ Run task materialize:runtime on the cut worktree while cut-context is active.

⊗ Treat schedule-graph-only "never materialize" docs as a substitute for the cut-context refuse-before-replace guard.

! If a materialize overlay (.deft-scratch/materialize-runtime-overlay.json) is already present, cheapInSync fail-closes even when version strings match. Recovery is operator-terminal outside the blocked hook: pnpm install --frozen-lockfile (or equivalent exact restore), then retire the overlay before identity may pass.

Release through a PR (#6296)

! The release grant is the only human act a cut needs. Branch protection stays on, no policy switch, no direct push to the base branch, no override variables, and no hotfix label on the next PR. A stable cut runs these steps as deft release:run, which mints the grant up front (§ Stable cut runbook); the steps below are what it does and the manual path. Depth: CODE2 § Release through a PR (#6296).

  1. ! Make the release branch from the fetched tip: git fetch origin master && git switch -c release/v<version> origin/master. Step 2 accepts only release/v<version> at the fetched base tip; it refuses the base branch (naming the release branch) and a release branch left by an earlier attempt or already on origin (naming the recovery).
  2. ! task release -- <version> runs Steps 1 to 9 on that branch, then pushes release/v<version> and opens the release PR (generated body: the version and the documentation-impact block; no closing keyword, no release notes). It stops and prints the finish command.
  3. ! Merge the release PR through the merge queue like any PR: task pr:wait-mergeable-and-merge -- <N> --wait.
  4. ! Mint the grant, then task release -- --finish <version>. The finish step resolves the merged PR's merge commit M and refuses before any tag unless M is on the fetched base, has one parent, changes only CHANGELOG.md, ROADMAP.md and deleted changelog.d/ fragments, holds the ## [<version>] heading and the release line, holds no other [Unreleased] entry and no fragment, and the named merge gate is green on M. Then it checks the grant, tags M by SHA, pushes only the tag, and creates the draft GitHub release from CHANGELOG.md at M.

! Release line. The release writes - [release-line] v<version> under the fresh [Unreleased], so master's merge gate stays green after a cut and the pin-bump PR merges with no hotfix label. verify:changelog-unreleased judges a change set that adds a release line by the release rule only (release files only, matching heading, the line alone, no fragment, no note lost line by line).

! Merge-queue skip. verify:changelog-unreleased skips itself on merge_group with the change-set skip notice (#7147): on a group commit the change set holds every PR queued ahead, so the check runs on the PR head instead. What is given up: on a merge-queue commit nothing re-checks the changelog; the entry requirement and the release rule were judged on the PR at its last CI run.

! Changes that land ahead. A note that merges to the base before the release PR's check fails the release rule: close the release PR, delete the release branch, run the cut again from a fresh branch. A note queued ahead that lands first is seen by no check; the finish step refuses and names it.

! Recovery by state. PR open: close the PR and delete the release branch, or run the cut again. Merged and not tagged: run the finish step; when it refuses, abandoning the release is break-glass (a direct revert on the base branch by an operator with ruleset bypass) until #6485 ships. Tagged: task release:rollback, unchanged, still pushes the base branch directly and needs ruleset bypass, so it is break-glass.

Stable cut runbook

A stable cut is one command, one approval and the post-run pin steps (#6845). Depth: CODE0 § Release run (#6845). Key:

  1. [agent] Quiescence: report open PRs, armed auto-merge and running workers. Each agent releases its own lease on the primary (occupancy:release or session:end) and clears story bindings for merged work. The operator decides on any finding.
  2. [operator] On a clean primary on the default branch: deft release:run <version> --expires <ISO>, plus --promote-latest to also mint the latest grant and --summary "<text>" if collected. Readiness runs before any write (Phase 1 checks, Phase 2 dry run, free tag, version files, CI rule) and says whether Step 5 will reuse CI or run the full local check and about how long. Then setup (release branch from the fetched tip B, session:start --primary-claim-exception=release-cut, cut context) and the local cut (Steps 1 to 9, no push).
  3. [operator] Approve: the run shows the version, B, the release tree T and the promoted CHANGELOG section, then mints one release-publish grant for <version>@<T> (and the release-promote-latest grant with --promote-latest). Type mint at the TTY. Without a TTY it prints the mint commands and stops: mint them from your own terminal, then deft release:run <version> --resume. No later phase prompts.
  4. [run] Push and open the release PR; wait with pr:watch until CLEAN; pr:wait-mergeable-and-merge --wait, enqueueing only while the origin tip is still B and the merge queue is empty. A failed required check is re-run once per run; a second failure or a review finding stops.
  5. [run] Finish: refuses unless the sole parent of the merge commit M is B; tags M, pushes only the tag, creates the draft GitHub release with the notes and banner read from M, clears the cut context.
  6. [run] Publish watch: waits on the tag-triggered npm-publish.yml run at M. npm is done only when it and its post-publish fixture concluded success and both packages carry the version on maintainer. A failed run stops; the run never dispatches the manual republish workflow. Until #6966 lands, a fixture that deferred Pass 2 still reads success: read the fixture log before promoting.
  7. [run] Draft flip: a published release is done; a draft is flipped with the run's grant.
  8. [run] Promote, only with the up-front grant: an existing promote-latest run is waited on or judged (success with both packages on latest: done; failed or partial: stop); with none it dispatches once. Without the grant latest stays.
  9. [operator] Post-run pin + local-update paths (the run prints them; #7331): run task release:pin-pr -- <version> (tip worktree + chore/pin-directive-<version>; bumps pin + minimumReleaseAgeExclude; ensures changelog.d/ exists before the fragment write; lockfile regenerated with pnpm update -w @deftai/directive-runtime@<version> then pnpm install --frozen-lockfile must pass; opens the PR with Documentation impact change_class: none). The agent commit gate refuses a dogfood pin commit, so the operator commits the pin from their own terminal until #5771 lands; the pin PR carries the host-file deposit the new version writes. Merge it through the queue. Then switch the primary to the default branch, task release:local-update -- <version> --checkout <primary> (remediates untracked tip-tracked .deft/approved-scope/** twins per-path: tip-identical → remove; divergent → OS temp move-aside; never git clean -fd the whole tree), then npm i -g @deftai/directive@<version>.
  10. [agent] Phase 7 closeout: issue auto-close checks, roadmap render, umbrella reopen sweep.

Stops and --resume. A stop names the phase and the run record (.deft-scratch/release-run/<version>.json). Fix the cause, then deft release:run <version> --resume. Each phase decides from what GitHub and npm show: a done step is never redone, anything it cannot place stops, and nothing is overwritten. An expired or spent grant that a phase still needs stops the run and names the mint command; a newer grant minted for the same target is used on resume. A PR that lands ahead stops the run before the tag (break-glass recovery until #6485). Recovery by state: CODE3 § Release run recovery.

Publish target. A stable publish goes to the maintainer dist-tag and never moves latest. Only the promote phase, with its own up-front release-promote-latest grant, moves latest.

Branch-Protection Policy Guard

! Break-glass only (#6296). The normal path (§ Release through a PR) needs none of this section. It applies to task release -- <version> --break-glass (the old base-branch run with the atomic push; it writes the release line too), used only when the merge queue itself is broken, and to the direct revert above. It needs an operator with ruleset bypass. Before any break-glass state mutation, run the skill-level branch-policy guard documented in task policy:show / dual-invoke deft verify:branch (#746 / #747); the break-glass run is on the configured base branch (default master), so the operator MUST be on the explicit-opt-in side of the policy before the pipeline starts writing files.

Preferred path — typed direct-commit policy opt-out (#1553). For a release session on the default branch, prefer the audited typed flag over the emergency env-var bypass:

task policy:allow-direct-commits -- --confirm

This writes plan.policy.allowDirectCommitsToMaster = true on xbrief/PROJECT-DEFINITION.xbrief.json with a capability-cost disclosure. After the release completes (or if the session aborts), restore enforcement and commit the restore in the same closeout (#2623):

task policy:enforce-branches
# enforce flips the typed flag to false locally — the commit that lands that
# flip cannot use the typed opt-in anymore. Scope the emergency env bypasses to
# ONLY this closeout commit+push (do NOT export them for the whole session):
DEFT_ALLOW_DEFAULT_BRANCH_COMMIT=1 DEFT_ALLOW_DESTRUCTIVE_GH_VERBS=1 git add xbrief/PROJECT-DEFINITION.xbrief.json meta/policy-changes.log
DEFT_ALLOW_DEFAULT_BRANCH_COMMIT=1 DEFT_ALLOW_DESTRUCTIVE_GH_VERBS=1 git commit -m "chore(policy): restore branch protection after vX.Y.Z"
DEFT_ALLOW_DEFAULT_BRANCH_COMMIT=1 DEFT_ALLOW_DESTRUCTIVE_GH_VERBS=1 git push origin HEAD

⊗ Leave allowDirectCommitsToMaster=true on origin after publish. ⊗ Run policy:enforce-branches and leave the dirty restore under protection ON without committing (forces a follow-up PR — the v0.79.0 / #2619 failure mode).

Branch-guard probe (either path). Regardless of which opt-out path you chose, confirm the guard passes before Phase 1 mutates state:

deft verify:branch

or task deft:verify:branch when the consumer Taskfile include is present. Do not add a consumer verify:branch task. This is the canonical surface that surfaces the policy state to the operator before the pipeline starts writing files. The release pipeline's other safety surfaces (the dirty-tree guard, base-branch check, task check gate) remain independent of this check. (task ci:local is historical and removed.)

Emergency env-var bypass — narrow scope only (#1553). DEFT_ALLOW_DEFAULT_BRANCH_COMMIT=1 is process-wide: every child process, nested test, and temporary repository spawned from the same shell inherits it. During the v0.43.0 release attempt, wrapping the entire task release invocation in this env var let the bypass leak into the Step 5 task ci:local preflight, which caused TestWriteConsumerGitHooks_VendoredCommitBlocked_RealGit to fail because the vendored test repo allowed a direct master commit the test expected the hook to block.

The release pipeline's Step 9/10/11 git mutations carry the bypass in subprocess env= only (the release pipeline subprocess env, #867) so the parent shell stays clean. Operator-side env-var exports defeat that isolation.

Deterministic Questions Contract

! Every numbered-menu prompt rendered in this skill (Phase 1 version-bump magnitude check, Phase 2 dry-run review yes/back/quit, Phase 5 optional defer/rollback/Discuss (happy path auto-publishes after draft QA)) MUST follow CODE6: the final two numbered options MUST be Discuss and Back, in that order. Existing back/quit options remain valid; this contract simply adds Discuss as a peer alongside Back. The Discuss-pause semantic is documented verbatim in the contract -- implicit resumption is forbidden.

When to Use

Phase 1 — Pre-flight

! Validate the local + remote state before any irreversible action.

Parallel prep — #1880 Gap D (#2692)

! Phase 1 long steps (task reconcile:issues -- --apply-lifecycle-fixes, cache refresh when ritual-stale) and Phase 3 task release:e2e MUST be backgrounded or subagent-dispatched when the host supports it (Cursor: Task tool run_in_background: true), with progress surfaced via DONE/heartbeat — same ownership as review-cycle / merge-ready workers (#1880 Gap D). The operator conversation MUST stay interactive for version magnitude confirmation, --summary, and the Phase 2 dry-run yes/back/quit gate while prep runs. (task ci:local is historical and removed.)

! Checklist: Phase 1 prep parallelized — long prep started in background before (or while) collecting version magnitude / summary / npm irrevocability disclosure.

! On Windows PowerShell, do NOT wrap long task output in Select-Object -Last (it buffers until the process exits); stream to the terminal or log to a file and read incrementally. See scm/github.md § #2646 / Windows encoding guidance for related PS pitfalls.

⊗ Foreground-block the operator chat on reconcile / release:e2e when background dispatch is available (#1880 Gap D / #2692).

Orientation-dirty / check-class stale-by-drift (#4399 / #7326)

! When orientation prints [deft orientation] cache_fresh: dirty because the github-issue triage cache is in bootstrap-missing state (missing .deft-cache/github-issue/ source dir or missing candidates log), treat that as advisory for Phase 1 — warn and point at deft triage:bootstrap / triage-queue recovery. Do not hard-require deft cache fetch-all --source github-issue before task release for that missing-bootstrap class alone. No release step owns the github-issue triage cache for issue-state truth (live REST). Distinct from ritual-stale (gated ritual age / compact stale); the parallel-prep ritual-stale cache refresh does not cover this class.

! When a present github-issue cache reports check-class verify:cache-fresh stale-by-drift, that remains a hard Phase 1 preflight. Run deft cache fetch-all --source github-issue --repo <owner>/<repo> before task release. Skip-drift gated-verify green is not cache-ready for that present-cache class.

⊗ Proceed to task release when check-class verify:cache-fresh (no --skip-drift-probe) reports stale-by-drift on a present cache.

⊗ Silence orientation missing-bootstrap cache_fresh: dirty without the advisory triage:bootstrap / triage-queue pointer.

Fixable check failure — file-and-merge before resume (#2859)

! When pipeline Step 5 fails on a fixable product or test defect (hang, failing test, validation bug — not operator env misconfiguration), the release cut MUST pause and route the blocker through normal issue → xBRIEF → feature branch → PR → merge before resuming Phase 1.

? Step 5 branch-coverage threshold misses during task release (Vitest branch coverage below 85% with no other failure mode) are carved out to § Step 5 branch-coverage threshold — open-issue ledger hatch (#2866) below — not this file-and-merge path.

Required path:

  1. File a GitHub issue with root cause, recurrence signature, and acceptance criteria.
  2. Ingest / promote / activate scope xBRIEF; implement on a feature branch with drive-to: merge-ready.
  3. Merge; confirm pipeline Step 5 is green for the failure mode.
  4. Resume the release cut from Phase 1 (re-run pipeline Step 5).

⊗ Lead with an inline-only hotfix on the release branch / default branch without a tracked issue and merged PR.

⊗ Suggest untracked --skip-ci or --allow-skip-ci without a tracked issue number as the first recovery when the failure is a clear, shippable bug.

⊗ Continue the cut with "raise timeouts," "fix it here," or other shortcut theater before file-and-merge completes.

? --skip-ci / --allow-skip-ci=#N remains valid only under explicit operator incident review with a tracked issue cited on the flag (Phase 4 contract). It is NOT a substitute for filing and merging a fixable defect discovered in Phase 1.

AGENTS.md bulk rejected (#2859): Expanding AGENTS.md / content/templates/agents-entry.md with an always-on pin for this release-phase reminder was considered and rejected. This rule lives in the release skill (and optional lesson); do NOT add AGENTS.md / agents-entry bulk for it.

See CODE0 § Fixable check failure during release for the operator runbook and the existing --allow-skip-ci=#N incident contract.

Step 5 branch-coverage threshold — open-issue ledger hatch (#2866 / #3187)

! When task release Step 5 fails on Vitest coverage below the 85% goal, apply this hatch only when branches is the sole metric below 85% (hairline branch miss — lines, functions, and statements all ≥ 85%). Confirm via the Step 5 failure output or task coverage:hotspots before hatching. Do not treat coverage/coverage-final.json as live until #4244. If any other metric is also below 85%, or the failure is a hang / failing test / non-coverage defect, STOP — use § Fixable check failure — file-and-merge before resume (#2859) instead.

Runtime disclosure (#2573): --allow-coverage-debt=#N sets vitest coverage thresholds to zero for the release Step 5 run (vitest.config.ts). The hatch is justified only for branch-only hairlines; the filed debt issue MUST require restoring all four metrics (lines, functions, branches, statements) to ≥ 85% before close.

Auto-hatch in task release Step 5 (#3187): the pipeline classifies a non-zero Step 5 as REAL_FAILURE | BRANCH_HAIRLINE | OTHER_COVERAGE | UNKNOWN after one suite run.

  1. REAL_FAILURE | OTHER_COVERAGE | UNKNOWN → fail closed (no auto-issue). Route product defects via #2859.
  2. BRANCH_HAIRLINE + any open coverage-debt ledger entry → fail closed ("restore coverage; close #N first") — consecutive soft-pass ban (#2866).
  3. BRANCH_HAIRLINE + empty open debt ledger → auto-file #N with markers coverage-debt and --allow-coverage-debt, measured metrics, cut version, and acceptance (all four metrics ≥ 85%); mark Step 5 PASS_WITH_DEBT(#N); continue the cut without re-running vitest. Loud stderr banner + cite #N in CHANGELOG / release notes.

! File before continue — never soft-pass without a durable issue number.

? Operators MAY still pass --allow-coverage-debt=#N manually (PowerShell-safe: --allow-coverage-debt=N or --allow-coverage-debt="#N" — #2621) when re-running after a pre-filed debt issue.

SHA suite stamp (#3187, coordinates with #3188 check ordering): after suite green or PASS_WITH_DEBT, write a local SHA-bound stamp under .deft/release-suite-stamp.json (gitignored). Re-entry at the same clean HEAD skips the suite; dirty tree or different HEAD invalidates the stamp. ⊗ CI never trusts the stamp (GHA has no committed stamp; CI/GITHUB_ACTIONS force miss).

Open-issue ledger (release-scoped only):

  1. Check for an open coverage-debt tracking issue (unpaid hatch from a prior cut) — union all three probes and dedupe by issue number:

```

gh issue list --repo <owner>/<repo> --state open --search "coverage-debt in:title,body" --limit 20

gh issue list --repo <owner>/<repo> --state open --search "allow-coverage-debt in:body" --limit 20

```

  1. If no open coverage-debt issue exists → auto-hatch files #N (or operator files manually) with title prefix coverage-debt: and body containing both markers. The open #N remains WIP until coverage is restored and the issue is closed.
  2. If an open coverage-debt issue from a prior hatch still exists → ⊗ soft-pass again; restore real coverage (all four metrics ≥ 85%) and close the debt issue before the cut proceeds.

Framework-release-first (#3187): auto-hatch applies to framework task release Step 5 (e.g. deftai/directive). Consumer expansion of auto-hatch via plan.policy.coverageDebt is reserved; consumer expansion is not implemented (#3314). Refuse when unset or off. Live hatch is --allow-coverage-debt=#N (#2866). Do not auto-file debt on the framework repo from consumer trees; consumer ledger is always the consumer repo.

⊗ Auto-pass on a near-miss band without #N (#2573).

⊗ Silent soft-pass with no tracked issue.

⊗ File a debt issue without coverage-debt / allow-coverage-debt markers in title or body — the ledger query will miss it and permit a consecutive soft-pass (#2866).

⊗ Use this carve-out when lines, functions, or statements are also below 85%, or for hangs, failing tests, or non-coverage Step 5 failures — those stay under #2859 file-and-merge.

⊗ Treat file-debt-then-hatch as the default for ordinary PR / task check work outside a release cut — this hatch is release-scoped only.

⊗ Trust a laptop suite stamp in CI or after HEAD/tree drift (#3187).

See CODE0 § Coverage debt hatch during release.

Routine vs hard cut for Step 5 (#2953)

! Treat hard cut as the default: Step 5 with no --skip-ci. It runs in full (task check + host coverage) unless the CI reuse rule below holds.

~ Treat routine cut as the same Step 5, sped up by default-excluding .deft-scratch/ (and legacy swarm-worktrees/) from content/link/path/build-dist walks, plus pre-cut hygiene (green required checks on the tip SHA; prune stale .deft-scratch/worktrees).

! Let Step 5 decide on CI reuse (#6791): when the clean Step 5 input tree equals a fetched tip whose latest required checks succeeded, and both nightly lanes are reusable on that tree (#6849), Step 5 reuses CI on its own and runs only the host smoke check (no host coverage); otherwise it runs in full. There is no routine-cut skip path, and deft release:run asks for no choice.

! Know where coverage and Windows testing run (#6849): .github/workflows/nightly.yml runs once a day on the master tip, never on pull requests or merge_group. Nightly coverage (Linux) runs the suite with --coverage and the vitest.config.ts floor; Nightly full suite (Windows) runs the full suite without coverage. Neither is a required check.

⊗ Invent a silent lighter Step 5 that skips or soft-passes coverage without an explicit hatch (--allow-coverage-debt=#N for branch-only hairlines, or --skip-ci + --allow-skip-ci=#N for incidents). Silent soft-pass is forbidden in every mode.

~ Prefer pruning abandoned worktrees / cutting from a clean clone over re-scanning scratch noise.

See CODE0 § Routine vs hard cut for Step 5 (#2953).

~ Go installer retired (AC10.10 / #1912 lineage / #6863): cmd/deft-install/ is absent and master has no Go build or release workflow. Do not rebuild Go installer binaries; npm/directive is the only channel. The frozen bridge binaries stay on the v0.58.0 release — see CODE2 § Frozen Go-installer bridge — retired from master.

  1. ! Verify the operator is on the configured base branch (default master) and the working tree is clean
  2. ! Confirm the next version number (X.Y.Z) with the user. Major / minor / patch decision flows from the [Unreleased] content, including changelog.d/ fragments (breaking change → major; new feature → minor; fix-only → patch)

! After the version is confirmed, name the mint CLI for that version. The operator runs it immediately before Phase 4 (not now): deft authz:grant -- --template release-publish --target <version> --confirm plus typed mint on a real TTY. Do not wait for a live grant before Phase 3 — a grant for the cut version cannot satisfy rehearsal target=0.0.1 in a clone with no .deft/authz, and a Phase-1 mint can expire (1h) during long e2e before production Step 10. ⊗ task authz:grant (not a Taskfile target). ⊗ Treat a live grant as a Phase 3 precondition.

  1. ! Inspect [Unreleased] content (with changelog.d/ fragments) vs the proposed version bump. If a breaking change appears in ### Changed / ### Removed but only a patch is proposed, surface the mismatch and ask the user to choose
  2. ! Verify GitHub is usable: gh api rate_limit must exit 0
  3. ! Verify identity: task verify:gh-auth -- --repo <owner>/<repo> --expected-login <maintainer>, or compare gh api user --jq .login to the expected login
  4. ! Run task reconcile:issues -- --apply-lifecycle-fixes to clear any closed-issue / non-completed-folder xBRIEFs before invoking task release (#734). The release pipeline carries the deterministic gate at Step 3 (task reconcile:issues -- --apply-lifecycle-fixes, refuses with EXIT_VIOLATION on any Section (c) mismatch), but Phase 1 is the operator's first-line defence -- running the apply-mode flag here is the canonical clean path; --allow-vbrief-drift on the pipeline exists only as the explicit-acknowledgment escape hatch (analogous to --allow-dirty). The recurrence record is the v0.21.0 cut, which surfaced 13 stranded xBRIEFs (8 cycle-relevant + 5 historical residue) post-publish; the gate now blocks that drift before any irreversible action
  5. ! Verify the proposed v<version> tag is not already in use locally, on origin, or as a published GitHub release (#784). The release pipeline carries the deterministic gate at Step 4 (the release tag-availability gate, refuses with EXIT_VIOLATION before any state mutation -- prepare/write artifacts, build, commit), but Phase 1 is the operator's first-line defence. Quickly probe with git tag -l v<version> (local), git ls-remote --tags origin refs/tags/v<version> (remote), and gh release view v<version> --repo <owner>/<repo> (release-only, where gh release view exits 0 only when the release exists). The recurrence record is the v0.22.0 → v0.23.0 release attempt on 2026-05-01: the operator typed 0.22.0 (the prior release from 12 hours earlier) and the legacy pipeline ran 8 steps before failing at git tag -- leaving a wrong-version local commit + dist/deft-0.22.0.zip orphan + manual git reset --hard recovery. The new pre-flight gate blocks that mode before any irreversible action
  6. ! Verify the npm credential path is configured before cutting the tag (#1910, #1909). A v* tag now auto-triggers .github/workflows/npm-publish.yml, which publishes the two OVPR packages (@deftai/directive + @deftai/directive-runtime) with npm publish --provenance. Confirm the publish path can authenticate: either the NPM_TOKEN repo secret is present (gh secret list --repo <owner>/<repo> shows NPM_TOKEN) OR an npm OIDC trusted publisher is configured for the @deftai/directive* packages. If neither is in place, WARN loudly that the tag will fire a publish job that fails (red X on the tag, no packages) -- the operator may still proceed for a GitHub-only release, but the npm channel will not land until #1909's credential is provisioned. Cross-reference #1909.
  7. ! Disclose npm irrevocability before any tag push (#1972, #2002, #3527). A v<version> tag push is the real npm publish gate -- NOT Phase 5 or task release:publish. Tag push fires .github/workflows/npm-publish.yml in a separate workflow that is NOT draft-gated; npm packages ship immediately and cannot be retracted (npm unpublish is forbidden). Recovery is forward-only: deprecate, dist-tag, or ship a patch. The last human gates before npm goes live are: (a) Phase 2 dry-run yes, (b) a human-origin closed-verb grant (deft authz:grant -- --template release-publish --target <version> --confirm or DEFT_ALLOW_RELEASE_PUBLISH=1). task release -- --finish <version> fails closed before the tag push without that grant (Step 10–11 on a break-glass run). Phase 5 only controls GitHub release visibility (draft → public); it does NOT gate npm. The draft-flip release:publish closed-verb check remains (#1095).
  8. ~ Ask the operator for an optional one-line release summary (recommended 80-160 chars; can be skipped). The summary is the canonical narrative for THIS release across three audiences: (a) injected as a Markdown blockquote at the top of the promoted CHANGELOG.md [<version>] section, (b) auto-flowed into the GitHub release body via the existing _section_for_version pickup, and (c) populated VERBATIM into the Phase 8 Slack *Summary*: slot. Capture the wording once here; do NOT regenerate per-audience downstream
  1. ! Separate missing-bootstrap advisory from present-cache stale-by-drift (#4399 / #7326). Distinct from ritual-stale. If orientation cache_fresh: dirty is only bootstrap-missing github-issue triage cache (missing source dir or candidates log), treat as advisory with deft triage:bootstrap / triage-queue pointer — do not hard-require cache fetch-all before task release. If a present cache reports deft verify:cache-fresh (no --skip-drift-probe) stale-by-drift, that stays a hard preflight: run deft cache fetch-all --source github-issue --repo <owner>/<repo> before invoking task release. Do not treat skip-drift verify:session-ritual green as cache-ready for present-cache drift.

⊗ Skip the version-bump magnitude check -- a patch release that ships breaking changes is the kind of regression that Repair Authority [AXIOM] (#709) is designed to prevent.

⊗ Skip the xBRIEF-lifecycle-sync check (#734); the gate exists because operators consistently forget the manual task scope:complete move step. The v0.21.0 cut surfaced 13 stranded xBRIEFs (8 cycle-relevant + 5 historical residue) post-publish as the recurrence record this gate prevents. If task release reports [3/13] Pre-flight xBRIEF lifecycle sync... FAIL (<count> mismatches; run task reconcile:issues -- --apply-lifecycle-fixes to fix), the canonical recovery is the apply-mode invocation -- --allow-vbrief-drift is reserved for cases where the operator has explicitly reviewed the drift and chosen to defer the lifecycle reconcile to the next refinement pass (e.g. an emergency hot-fix release).

⊗ Skip the tag-availability check (#784); the gate exists because the legacy 12-step pipeline only invoked git tag at Step 9, after Steps 1-8 had already mutated state (CHANGELOG promoted, ROADMAP refreshed, dist built, release commit made locally). A duplicate-tag failure at Step 9 stranded the operator with an unpushed wrong-version commit + orphaned dist/deft-<wrong>.zip artifact + manual git reset --hard recovery (forbidden by AGENTS.md SCM rules without explicit permission). The recurrence record is the v0.22.0 → v0.23.0 release attempt on 2026-05-01. If task release reports [4/13] Pre-flight tag availability... FAIL (<surface> tag v<version> already exists ...), the canonical recovery is to choose a different version (the most likely cause is operator typo of a prior release).

⊗ Hand-write a different one-line narrative for each of the three downstream surfaces (CHANGELOG / GitHub release / Slack) -- that drift is exactly the gap the --summary flag is designed to close. If the operator insists on per-audience tone, populate the canonical --summary ONCE here and document the deviation in the Phase 8 anti-pattern.

Phase 2 — Dry-run review

! Invoke task release -- <version> --dry-run --skip-tag --skip-release and present the plan to the user. If Phase 1 collected an operator summary, also pass --summary "<text>" so the dry-run preview reflects the canonical narrative the operator just authored.

task release -- <version> --dry-run --skip-tag --skip-release --summary "<text>"

The dry-run prints [N/13] <step>... DRYRUN (would <action>) for every pipeline step (Step 13 is the post-create verify-isDraft gate added by #724; Step 4 is the tag-availability pre-flight gate added by #784). Step 6 (Prepare release artifacts) surfaces whether a summary was supplied (truncated to ~60 chars in the preview) so the operator can validate the wording before any file is written. Capture the output and present it to the user, then wait for explicit confirmation before continuing.

! Wait for explicit user confirmation: yes / back / quit. Remind the operator that Phase 4's tag push will irrevocably publish npm (#1972) and requires a release-publish grant (or DEFT_ALLOW_RELEASE_PUBLISH=1) -- this yes is the last safe abort before that channel opens (#3527).

⊗ Skip the dry-run preview. The dry-run is the operator's last opportunity to catch a bad version number, malformed CHANGELOG, or wrong base branch before the pipeline starts writing files.

Phase 3 — E2E sanity

! Invoke task release:e2e against an auto-created temp repo to verify the full pipeline shape works end-to-end before touching the real repo.

! #1880 Gap D (#2692): task release:e2e is a long-running step — MUST background / subagent-dispatch it when the host supports it so Phase 2 confirmation and other human gates stay interactive. Do not wrap its output in PowerShell Select-Object -Last.

task release:e2e

The harness provisions deftai/deftai-release-test-<ts>-<uuid6>, runs the smoke-test rehearsal, and by default keeps the temp repo (#2572). Stderr always includes the full owner/slug and a copy-pasteable manual-cleanup command (gh repo delete <owner>/<slug> --yes). Privileged environments (CI or an operator with delete_repo) MAY pass task release:e2e -- --destroy-repo to attempt auto-delete; destroy failure emits a WARN and does not block Phase 4 when the rehearsal succeeded.

! After Phase 3, the agent MUST NOT retry or escalate temp-repo deletion. Include any leftover temp repo(s) in the phase summary for the operator to clean up manually.

! Treat a non-zero exit from task release:e2e as a hard refusal to proceed to Phase 4. Surface the diagnostic and ask whether to retry (return to Phase 1) or stop (quit).

! Rehearsal uses sentinel version 0.0.1 on a throwaway repo. The landed rehearsal exemption lets task release:e2e reach npm dry-run without a release-publish grant. ⊗ Ask the operator to mint 0.0.1. ⊗ Wait for a live grant before Phase 3. Mint remains immediately before Phase 4.

? Skip allowed when the operator has just run task release:e2e successfully against the same branch in the past 30 minutes. Note the prior run timestamp in the user-facing summary.

! task release:e2e now also rehearses the npm publish (#1910). Unless --skip-npm is passed (or npm is absent from PATH, which soft-skips), the rehearsal runs npm publish --dry-run --access public for both @deftai/directive and @deftai/directive-runtime against the throwaway clone in dependency order (runtime -> launcher (cli)), after pnpm install + pnpm -w run build and a version-alignment pass. This catches a broken files allowlist, a version-drift bug, or a dependency-order error BEFORE the real v* tag fires the publish workflow -- without touching the real registry. The install+build exceeds the <90s fast budget, so pass task release:e2e -- --skip-npm when you only need the GitHub-pipeline shape check.

! Tag -> npm coupling + irrevocability (#1910, #1972, #2002). A v<version> tag is a TWO-channel action: the GitHub release (this skill's pipeline) AND .github/workflows/npm-publish.yml, which runs in a SEPARATE workflow that does NOT block the GitHub release and is NOT draft-gated. The npm workflow derives the published version from the tag (${GITHUB_REF_NAME#v}); this skill owns the version chosen in Phase 1. These MUST stay consistent -- the tag you cut IS the npm version that ships; there is no separate npm version bump. npm publish is irrevocable (#1972): once the tag fires, packages are live on npm and cannot be unpulled; task release:rollback does NOT retract npm (forward-only recovery). A red npm job on a green GitHub release means the npm channel did not ship (verify in Phase 5/7).

Phase 4 — Production draft

! Last human gate before npm (#1972, #2002, #3527). Immediately before invoking task release, re-state that the tag push in this step will irrevocably publish both @deftai/directive and @deftai/directive-runtime to npm via .github/workflows/npm-publish.yml. There is no undo on npm; only forward recovery (deprecate / dist-tag / patch). Proceed only when the operator explicitly confirms and a human-origin grant covers release-publish for this version (deft authz:grant -- --template release-publish --target <version> --confirm or DEFT_ALLOW_RELEASE_PUBLISH=1). The finish step (task release -- --finish <version>) fails closed before the tag without that grant -- that is the npm-distributing boundary (Step 10–11 on a break-glass run). ⊗ Rely on Phase 5 release:publish as the npm gate; it only flips the GitHub draft. ⊗ Delete the draft-flip check as a substitute for the tag-push gate.

! On a fresh release/v<version> branch (§ Release through a PR), invoke task release -- <version> (NO --dry-run, NO --skip-tag, NO --skip-release, NO --skip-ci except the incident path in the runbook). If Phase 1 collected an operator summary, pass --summary "<text>" so the production cut writes the same blockquote the dry-run previewed. The cut opens the release PR; merge it through the queue, then run task release -- --finish <version> with the grant minted. The finish step is the tag push.

⊗ Use --skip-ci on a production cut except under explicit operator incident review — it skips Step 5 vitest coverage and ships untested npm builds (#2652). When unavoidable, pass --allow-skip-ci=#N citing the tracked issue; Step 5 emits a loud WARN. See CODE2 § Vitest coverage hang recovery. The next patch after the hang fix must cut without --skip-ci.

! Release Step 5 hang detector is 60 minutes (RELEASE_CHECK_TIMEOUT_MS / RELEASE_CHECK_TIMEOUT_MINUTES). Hang detection, not a success SLA. Do not raise casually -- further increases are a deliberate gate change via issue/PR + intent-constraint mint (suite growth raised 20→30 under #5022, then 30→45 under #5024, then 45→60 under #5091). For ordinary exit 124, cheapen the Windows Step 5 suite first; numeric raise is not the default recovery. Do not equate Ubuntu CI timeout-minutes: 20 with this Windows release Step 5 wall.

task release -- <version> --summary "<text>"

Per #716 default-draft hardening, this lands the release as a --draft on the real repo. No binaries upload (master has no Go release workflow, #6863), and the draft is NOT yet visible to consumers. The operator-authored summary becomes part of the promoted CHANGELOG.md [<version>] section AND the GitHub release body (auto-pickup via _section_for_version). The same wording is the canonical source for the Phase 8 Slack *Summary*: slot.

! Maintainer-mode release notes auto-lead with an "Upgrading from an older version?" banner (#1413). When the cut targets the canonical framework repo (deftai/directive), task release Step 12 prepends the banner from the editable template at .github/release-notes/upgrade-banner.md to the notes passed to gh release create (via _prepend_upgrade_banner). The banner points consumers at the OVPR npm path (npm i -g @deftai/directive@latest then directive upgrade / doctor) — not deleted deft-install (AC10.10). This is GitHub-release-body-only -- it is NEVER injected into CHANGELOG.md, so the CHANGELOG section and the release body intentionally differ by this leading block. To change the wording, edit the template file; do not hand-edit the published release body. Consumer-mode releases (any non-deftai/directive repo) are unaffected -- a downstream project that vendors the release pipeline never inherits deft's upgrade guidance. A missing/unreadable template degrades gracefully (notes ship without the banner; the cut is never blocked).

! Verify isDraft within 5 seconds; flip immediately if not (#724). Immediately after gh release create --draft returns success, task release Step 11 polls gh release view v<version> --json isDraft up to 5 times at 1-second intervals. If the release exists with isDraft=false, the pipeline auto-flips it via gh release edit v<version> --draft=true and emits a WARNING: release landed as public; flipping to draft (defense-in-depth, see #724) line. This closes the ~90-second public-exposure window observed during the v0.21.0 cut where a manual recovery created a public release before the operator noticed and flipped it. The verify gate is defense in depth even when --draft was passed correctly: it catches the case where gh release create partially succeeded (release record written, error returned) AND the operator-error variant where an alternate code path sent the release without --draft. A release-not-found-within-budget result emits a WARN and does NOT fail the pipeline (release.yml CI may still be processing).

! Wait for task release to exit 0 before continuing. A non-zero exit means the pipeline halted partway through; consult Phase 7's task release:rollback recovery before retrying.

! Changelog fragments (#6315). Step 6 captures the changelog.d/ fragments and assembles the promoted section in memory (subsection order, then file name). It refuses an invalid or symlinked fragment, an entry line held by two fragments, and a CHANGELOG.md that already holds the version heading. Step 7 writes CHANGELOG.md, then deletes exactly the captured fragments; Step 9 stages those deletions in the release commit, and refuses while a captured fragment is still on disk. A dry run writes and deletes nothing.

! Failure between the write and the commit (#6315). Restore CHANGELOG.md, ROADMAP.md and changelog.d/ to HEAD (git restore --source=HEAD --staged --worktree -- CHANGELOG.md ROADMAP.md changelog.d/), then rerun. After the release commit exists, recovery is task release:rollback; its revert restores the fragments.

⊗ Rerun a failed cut with --allow-dirty -- it skips the dirty-tree guard and is not a recovery path (#6315).

⊗ Pass --no-draft here unless the operator has explicitly opted into direct-publish (e.g. automated security patch). The default-draft contract is the foundation of the safety hardening surface.

⊗ Skip the post-create verify-isDraft gate -- the gate is the only reliable safety net against "create call exited 0 but the release somehow landed as public" variants (#724). If task release is invoked manually outside the canonical task release flow, the operator MUST run gh release view v<version> --json isDraft followed by gh release edit --draft=true on isDraft=false BEFORE handing off to Phase 5.

Phase 5 — GitHub draft QA (optional; NOT the npm authority gate)

! After task release exits 0, QA the GitHub draft release only. npm packages typically already shipped when the tag push in Phase 4 fired .github/workflows/npm-publish.yml (#1972, #2002). Phase 5 is NOT a "user-only authority before going live" gate for the release as a whole -- it is optional draft QA for GitHub assets, notes, and binaries.

  1. ! Verify npm publish status FIRST (in parallel with draft inspection). Run gh run list --workflow=npm-publish.yml --repo <owner>/<repo> --limit 5 and confirm the tag run for v<version> is completed/success. If npm failed, surface immediately -- the GitHub draft QA is secondary to a red npm channel.
  2. ! Run gh release view v<version> --json url,name,body,assets,isDraft --repo <owner>/<repo> and present the output to the user
  3. ! Surface the asset list (size + filename) so the user can verify binaries uploaded correctly
  4. ! Surface the auto-generated release notes (or the CHANGELOG section that was promoted into the release body)

Happy path (default when npm succeeded and draft assets look correct)

! When the npm workflow succeeded AND draft assets/notes pass inspection, auto-proceed to Phase 6 Publish branch -- run task release:publish -- <version> without a redundant human publish prompt (#2002). npm already shipped at tag push; waiting for a separate publish confirmation does not protect the npm channel.

? Operator override: if the operator wants to hold the GitHub release in draft (e.g. embargo, last-minute notes edit), they MAY say defer before auto-publish runs.

Exception paths (operator-initiated)

⊗ Treat Phase 5 as the npm publish-authority gate -- npm ships at tag push (Phase 4), not at task release:publish. A human publish prompt here is redundant when npm already succeeded and only delays flipping the GitHub draft to public.

⊗ Skip npm workflow verification in Phase 5 and defer it entirely to post-publish Phase 7 -- npm status MUST be checked before or in parallel with the GitHub publish flip.

Phase 6 — Publish or rollback

! Branch on the Phase 5 outcome. The happy path auto-enters the Publish branch when npm succeeded and draft QA passed (#2002).

Publish branch (happy path auto-run, or resumed after `defer`)

task release:publish -- <version>

The companion script flips --draft=false, then re-reads the release to verify isDraft == false actually flipped. State machine:

! Wait for task release:publish to exit 0 before continuing. On the happy path this runs immediately after Phase 5 draft QA without a separate human publish prompt.

Rollback branch (user said `rollback`)

task release:rollback -- <version>

The state-aware unwind detects the post-release state and applies the matching tiered recovery. Time-windowed download-count guard:

Three escape hatches (escalating warnings):

Race-condition mitigation: download_count is double-read with a 5s sleep between reads; rollback only proceeds if both reads agree below threshold.

! When the guard refuses, surface the recommendation to the user: rollback is risky on a released artifact with non-zero downloads. Prefer the hot-fix path (cut the next patch with a withdrawal note in [Unreleased]/Changed rather than deleting the broken release).

! task release:rollback does NOT retract npm (#1972, #2002). Rollback unwinds GitHub release state (draft/public, tag, assets) only. npm packages published at tag push remain on the registry irrevocably. Recovery is forward-only: deprecate the bad version, move a dist-tag, or ship a patch release.

Phase 7 — Post-publish verification

! Only enter Phase 7 if Phase 6 took the Publish branch (rollback branch ends here with the unwind log).

! Stable cut: decide npm latest explicitly (#5852). A stable X.Y.Z publishes to the maintainer dist-tag and a prerelease to its id (beta, rc, ...); the publish never moves latest and the GitHub release is not marked Latest. For a stable cut, ask the operator: promote now or record an explicit decline. Promote is the separate release-promote-latest closed verb (mint deft authz:grant -- --template release-promote-latest --target <version> --confirm or set DEFT_ALLOW_RELEASE_PROMOTE_LATEST=1; a release-publish grant does not cover it). Run the gated command deft release-publish --promote-latest <version> (optional --dry-run); it evaluates the closed-verb gate and only then dispatches gh workflow run npm-publish.yml --ref master -f action=promote-latest -f tag=v<version>. That job (environment npm, concurrency npm-promote-latest) preflights both packages then moves latest for both and marks the GitHub release Latest. A decline is recorded in the release notes or record as "latest stays at <prior version>". Non-latest announcements give npm i -g @deftai/directive@<dist-tag>, not @latest.

! Do not move latest with a bare shell npm dist-tag add or a bare gh workflow run for promote; use deft release-publish --promote-latest.

  1. ! Wait until both public packages list the cut version (#4267, #1910, #3753). Run task release:wait-npm -- <version>. That caller polls npm view <pkg> versions (prefer-online, doctor temp-cwd isolation) until both @deftai/directive and @deftai/directive-runtime list <version>, or 10 minutes. Partial visibility is still-propagating (wait before npm i -g); none visible after the wait is publish-incomplete. Report-only: must not fail the GitHub release. Confirm provenance on the npm page after the wait. ⊗ Treat a green npm-publish.yml job plus one visible sibling as registry truth. ⊗ Run npm i -g. task release Step 13 stays a single probe (timeout 0).
  2. ! Report local-vs-released CLI drift (#3753). task release:wait-npm already prints the local global CLI version, the released version, whether they match, and the exact remediation npm i -g @deftai/directive@<version> --prefer-online. Compare versions with checkActiveCliAgainstTarget (not bare deft --version) so a PATH-shadowed install cannot report success (#3233). The report must not fail the release.
  3. ! Verify GitHub auto-closed the discrete-task issue(s) referenced via Closes #N in the release notes (mirrors skills/deft-directive-swarm/SKILL.md Phase 6 Step 2)
  4. ! Run gh issue view <N> --json state --jq .state for each closed issue. If any didn't auto-close, manually close with gh issue close <N> --comment "Closed by release v<version> (squash auto-close did not trigger)" (Layer 1, #167)
  5. ! Verify ROADMAP.md correctness via task roadmap:render (the release pipeline already invoked this; Phase 7 is the second-pass sanity check)
  6. ! Verify binaries are downloadable from the public release URL: gh release view v<version> --json assets --jq '.assets[].url' and curl one to confirm 200 OK
  7. ! For any umbrella / staying-OPEN issue (Refs #N) referenced in the release notes, run the Layer 3 reopen sweep from skills/deft-directive-swarm/SKILL.md Phase 6 Step 1: any protected issue that auto-closed MUST be reopened with a comment citing #701
  1. ! Update the maintainer's local checkout (#5953 / #6613 / #7331). Required for every release; required especially for maintainer (non-latest) cuts where npm latest will not advance the checkout by accident.

First open and merge the pin-bump PR via the runnable setup:

task release:pin-pr -- <version>

That creates a tip worktree + chore/pin-directive-<version>, bumps the package.json pin and the minimumReleaseAgeExclude row, ensures changelog.d/ exists (tip after release fold often lacks it), writes the pin fragment, runs pnpm update -w @deftai/directive-runtime@<version> + frozen-lockfile verify, and prints the operator commit / gh pr create lines (Documentation impact change_class: none). Operator commits the pin until #5771. Then run:

task release:local-update -- <version> --checkout <maintainer-primary-occupancy-root>

The task never resets, force-pushes, commits, or runs npm i -g. It does five things:

  1. Checkout checks: --checkout <path> must name the maintainer primary occupancy root (not the release worktree alone), and the checkout must not hold a live foreign occupancy lease.
  2. Clash remediation (#7331): before ff-only, for untracked tip-tracked .deft/approved-scope/** (same-class mint paths): tip-byte-identical → remove untracked; else → move aside to OS temp; print one-step remediation; never git clean -fd the whole tree.
  3. Pull: on the default branch, git pull --ff-only (never reset).
  4. Install: pnpm install --frozen-lockfile.
  5. Confirm installed = pin: the installed node_modules/@deftai/directive-runtime version equals <version> and the package.json pin.

It does not check hook files. Hook files refresh on the next hook run (AC8.6). A post-release directive upgrade that changes hook files is normal. Commit it in an ordinary PR when you choose. It is not part of the release.

Report the local-update result (checkout path, installed version) beside the existing global CLI drift report in Skill Completion.

⊗ Skip the post-publish verification. The closing-keyword false-positive (Layer 1 / Layer 2 / Layer 3) and the incremental-renderer-drift (#641, #614) are exactly the kind of issues that surface only AFTER a release is public.

Phase 8 — Slack announcement

! Generate the canonical Slack release announcement and present it to the user for copy-paste, re-using the template from skills/deft-directive-swarm/SKILL.md Phase 6 Step 5.

The announcement block MUST include:

:rocket: *deft v<version>* -- <release title>

*Summary*: <one-sentence description of the release scope>

*Key Changes*:
- <bullet per significant change, 3-5 items max>

*Stats*: 1 release | ~<duration> elapsed | <N> commits since v<previous>
*Release*: <GitHub release URL>

! Populate version from the freshly-published gh release view v<version> output. Populate release title from the CHANGELOG section heading (or the GitHub release title). Summarize key changes from the promoted [Unreleased] -> [<version>] CHANGELOG section (NOT raw commit messages). Populate stats from git log v<previous>..v<version> --oneline | wc -l.

! Populate the *Summary*: slot VERBATIM from the operator-authored blockquote at the top of the CHANGELOG [<version>] section (the line beginning with > immediately after the ## [<version>] - <date> heading). The Phase 1 prompt + Phase 4 --summary flag exist precisely so this populate step is mechanical -- one canonical narrative authored once at Phase 1, propagated through Phase 4 promotion, and copy-pasted here without re-authoring. If the CHANGELOG section has no blockquote (operator skipped the Phase 1 prompt), generate a one-sentence summary from the ### Added / ### Changed bullets and surface to the operator that this is a regenerated narrative (NOT canonical) so they can decide whether to amend the CHANGELOG before publishing.

! Present the block as a code-fenced snippet the user can copy directly. Do NOT post to Slack from inside this skill -- the user owns the actual broadcast.

Skill Completion

! When Phase 8 completes (or when Phase 5 took the defer / quit path, or when Phase 6 completed the rollback branch), explicitly confirm skill exit:

deft-directive-release complete -- exiting skill.
Next: <one-line guidance>

Where <one-line guidance> is one of:

! On the Publish/live path, Skill Completion MUST also print the Phase 7 local-update result beside the global CLI drift report: checkout path and installed runtime version. When the global launcher is behind <version>, print the exact command npm i -g @deftai/directive@<version> for the operator to run (#6358); the pipeline never runs it. ⊗ Claim Phase 7 local update complete while release:local-update exited non-zero or was skipped on a maintainer non-latest cut (#5953).

! After finish+promote, the exit / post-run card MUST name both runnable paths (#7331): task release:pin-pr -- <version> (ensures changelog.d/) and task release:local-update -- <version> --checkout <primary> (approved-scope clash remediation before ff-only).

⊗ Exit silently without confirming completion or providing next-step guidance.

Anti-Patterns

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.