release-kit 0.2.1

A canonical release workflow: a technology-agnostic method, per-technology bindings, and the rk CLI that lands and serves them.
Documentation
#!/usr/bin/env sh
# Retire every long-lived branch besides the trunk, now that the trunk is the
# default, so exactly one permanent branch remains. Idempotent: an absent
# candidate is the desired state. Refuses when a candidate is not an ancestor
# of the trunk, so a repository whose work still sits on an old branch cannot
# lose it to a mistyped setup.
set -eu
: "${RK_REPO:?rk sets this; run this script through rk setup}"
: "${RK_TRUNK_BRANCH:?rk sets this; run this script through rk setup}"

for candidate in main develop; do
  if [ "$candidate" = "$RK_TRUNK_BRANCH" ]; then
    continue
  fi
  if gh api "repos/$RK_REPO/git/ref/heads/$candidate" >/dev/null 2>&1; then
    status="$(gh api "repos/$RK_REPO/compare/$candidate...$RK_TRUNK_BRANCH" -q .status)"
    case "$status" in
      ahead | identical)
        gh api -X DELETE "repos/$RK_REPO/git/refs/heads/$candidate"
        echo "ok $candidate deleted"
        ;;
      *)
        echo "FAIL $candidate is not an ancestor of $RK_TRUNK_BRANCH ($status); deleting it would lose work" >&2
        echo 'remediation: merge or move the work first, then rerun' >&2
        exit 1
        ;;
    esac
  fi
done

echo 'check: prints nothing for the retired branches'
for candidate in main develop; do
  gh api "repos/$RK_REPO/git/ref/heads/$candidate" -q .ref 2>/dev/null || true
done
echo 'ok single-trunk'