Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

flow-finalize

БесплатноБез исполняемых скриптовНе проверен

Finalize a merged issue — archive its OpenSpec change (sync delta specs into openspec/specs/), remove the worktree + branch, and close the issue with a…

pmcfadinот pmcfadin★ 22 звезды на GitHub

Об этом скилле

flow-finalize — archive, clean up, close

You are the CQLite delivery lead. The PR for issue #N is merged. Close the loop.

Steps

FIRST — is this a COMPLETED delivery or a SLICE? (issue #3550) A slice is a merged PR that shipped part of an issue which deliberately stays OPEN (the shape the lead ruled correct on #3393). This skill's default path ends by archiving the change, setting the board to Done, and CLOSING the issue — every one of which is WRONG for a slice, and closing the issue is the named FORBIDDEN workaround #3550 exists to prevent. Do not run steps 3, 5 and 7 unmodified for a slice; see "Slice deliveries" below, which says exactly what to do instead. Deciding is mechanical, not a judgement call: if the merged PR declared Closes #<N> it is a completed delivery; if it deliberately did not, it is a slice. Compare by URL, never by number — an issue NUMBER is repository-scoped, so a PR closing other-repo#<N> would read as closing THIS repo's #<N> and you would close a deliberately-open issue. delivery-telemetry.py makes the same comparison the same way (issue #3550).

# gh's built-in --jq takes NO --arg, so the issue url is passed through the ENVIRONMENT
# and read with jq's env.U. (`gh pr view --jq --arg u "$u" '<expr>'` is a usage error:
# --jq consumes "--arg" and the rest become surplus positionals.)
export U=$(gh issue view <N> --json url --jq .url)
gh pr view <pr> --json closingIssuesReferences \
  --jq 'if [.closingIssuesReferences[].url] | index(env.U) then "COMPLETED" else "SLICE" end'
# COMPLETED -> run every step as written
# SLICE     -> follow "Slice deliveries" below
  1. Confirm the merge + capture the merged branch. state MUST be MERGED; the cleanup in step 6 keys off the merged PR's headRefName (NOT a issue-<N>-* glob — see the #1162 guardrails below):
    gh pr view <pr> --json state,mergeCommit,headRefName
    # state MUST be MERGED; record headRefName as <merged-branch> for step 6.
    
    If not merged, stop — finalize only runs post-merge.
  2. Update the root checkout's main — but FIRST guard against a commandeered root. A Codex/other session may have switched the shared root checkout onto its own branch. Do NOT git switch main / git reset it back (that yanks it from whoever owns it), and NEVER commit to it while it is off-main:
    repo_root=~/projects/cqlite
    root_branch=$(git -C "$repo_root" rev-parse --abbrev-ref HEAD)
    git -C "$repo_root" fetch origin main -q
    if [ "$root_branch" = "main" ]; then
      git -C "$repo_root" merge --ff-only origin/main
    else
      echo "⚠️ root checkout is on $root_branch, not main — will stamp main-only artifacts via a throwaway worktree (step 4), NOT the root."
    fi
    
    (Archiving + cleanup below run from the worktree; they don't require local main.)
  3. Archive the OpenSpec change (design-driven) — NOT for a SLICE delivery (see the gate above: the change is unfinished and archiving strands the remaining slices): openspec archive <slug> --yes (use --skip-specs only for a doc/infra change with no capability delta). This moves the change to openspec/changes/archive/ and syncs its delta spec into openspec/specs/<capability>/spec.md. Commit the archive (and push / open a small PR per the repo's merge norms).
  4. (Retired) Telemetry stamping. Delivery telemetry was retired on 2026-11-02 (#4406): do not run scripts/delivery-telemetry.py record and do not open a ledger PR. docs/reports/delivery-telemetry.jsonl stays in the tree as history only. Step numbers are kept so existing references still resolve.
  5. Set the board to Done + release the claim. — NOT Done for a SLICE delivery (see the gate above: use Ready/In Progress; Done hides an unfinished issue from dispatch). The PR-merged / issue-closed server-side automation should already have moved the Project item to Status=Done (it fires even when you merge from the phone/web — no flow-* run needed); if it hasn't, set it yourself:
    # Run the flow-board detection snippet first (it switches to the project-capable account — the EMU
    # flip otherwise makes this write fail silently), then set the board Status only.
    # `--field` is NOT a gh flag (verified gh 2.87.3 offers only --field-id); all four IDs are required:
    gh project item-edit --id <item-id> --project-id <project-id> \
      --field-id <status-field-id> --single-select-option-id <Done-option-id>   # when have_project=1
    
    Do NOT write any status:* label here. Done → no board-derived label (board→label mirror #2855: Backlog/Done carry none), and the mirror only reconciles OPEN issues, so a leftover label on the now-closed issue is irrelevant to discovery (--state open) and to the detector; a reopen fires the mirror's issues: reopened trigger and re-derives from board Status
Полный SKILL.md на GitHub

Установить flow-finalize в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл flow-finalize?

Finalize a merged issue — archive its OpenSpec change (sync delta specs into openspec/specs/), remove the worktree + branch, and close the issue with a traceable comment. Fifth stage of the CQLite delivery pipeline. Runs after the PR is merged — workers merge autonomously on green (gate PASS + C PASS + roborev clean), so finalize normally follows the worker's own merge. Use right after a merge (or when the owner says "finalize

Как установить скилл flow-finalize?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл flow-finalize запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить flow-finalize с