Release Os

OpenSafari release workflow — triage, review, fix own PRs, merge, and optionally publish

shaun0927 10 updated 1mo ago
Claude CodeGeneric
View source ↗
---
name: release-os
description: OpenSafari release workflow — triage, review, fix own PRs, merge, and optionally publish
---

# OpenSafari Release Workflow

$ARGUMENTS

---

## STEP 1: Status Check

Run all of these and report results:

```bash
git status
git stash list
git branch -a
gh pr list --state open --json number,title,headRefName,baseRefName,additions,deletions,author,files
npm run build
npm run lint
npm test

Gate: If build, lint, or tests fail, fix errors first. Do NOT proceed with any failures.

STEP 2: Classify Open PRs

For each open PR, determine ownership:

Type How to Identify Action
MY PR author.login matches repo owner Review → Fix P0/P1 → Merge
OTHER's PR Different author Review → Post comment → Do NOT merge

List all PRs in a table (include mergeable status):

# Get mergeable status for all open PRs
gh pr list --state open --json number,mergeable,mergeStateStatus \
  --jq '.[] | "\(.number) | \(.mergeable) | \(.mergeStateStatus)"'
| PR # | Title | Author | Type | Files Changed | Mergeable |
|------|-------|--------|------|---------------|-----------|

STEP 3: Triage Local Changes

Check for uncommitted local work:

git status
git stash list
git diff --stat

For each local change, classify:

Change Type Action
Source code (.ts) changes Create PR by category (feat/fix/refactor/chore). All PR titles, descriptions, and commit messages MUST be in English.
.claude/ agents/commands Validate YAML frontmatter, bundle into chore PR
Temp/experiment files Delete if not needed
Stashed changes Pop, resolve conflicts, commit or drop

Gate: All local changes committed or discarded. git status shows clean working tree.

STEP 4: Review Each PR

For EACH open PR (both mine and others'), in order:

4a. Run /pr-review-os <N>

This produces a P0/P1/P2 issue list and verdict.

4b. Take action based on ownership + verdict

MY PR with P0s:

  1. git checkout <branch>
  2. Fix ALL P0 issues
  3. npm run build — must pass
  4. Commit and push fixes
  5. Re-run /pr-review-os <N> — must have P0 = 0
  6. If P1s remain, fix those too
  7. Repeat until P0 = 0 and P1 = 0

MY PR, P0 = 0 and P1 = 0:

  1. Post review to GitHub (use --comment for self-PRs)

OTHER's PR with P0 or P1:

  1. Post review to GitHub: gh pr review <N> --request-changes --body "<review>"
  2. Do NOT fix their code. Do NOT merge. Leave for the author.

OTHER's PR, clean:

  1. Post review to GitHub: gh pr review <N> --approve --body "<review>"
  2. Still do NOT merge unless user explicitly says to.

Gate: Every PR has a posted GitHub review comment before proceeding.

STEP 5: Pre-merge Checks

Before merging ANY PR, verify ALL of these:

npm ci                                                 # must pass (lockfile in sync)
npm run build                                          # must pass
npm run lint                                           # must pass (no errors)
npm test                                               # must pass (ALL test suites green)
git diff --name-only HEAD | wc -l                      # must be 0 (clean tree)

Also grep for known anti-patterns:

# Protocol safety
grep -r "console\.log(" src/ --include="*.ts"          # must be 0 — MCP stdio breaks
grep -r "puppeteer\|CDPClient\|CDPSession" src/ --include="*.ts" | grep -v "//"  # must be 0 — no Chrome deps
grep -r "Network\.setCookie\|Network\.getAllCookies\|Network\.clearBrowserCookies" src/ --include="*.ts"  # must be 0 — use Page domain
grep -r "captureScreenshot" src/ --include="*.ts"      # must be 0 — use Page.snapshotRect
grep -r "new Touch(" src/ --include="*.ts"             # must be 0 — use document.createTouch
grep -r "simctl snapshot save\|simctl snapshot restore" src/ --include="*.ts"  # must be 0 — does not exist

MCP Protocol Conformance

Verify the MCP server produces spec-compliant responses:

# 1. Initialize response must contain ONLY: protocolVersion, capabilities, serverInfo
INIT_RESPONSE=$(echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"conformance-test","version":"1.0.0"}}}' | timeout 10 node dist/cli/index.js serve 2>/dev/null | head -1)
INIT_KEYS=$(echo "$INIT_RESPONSE" | jq -r '.result | keys | sort | join(",")')
echo "Initialize result keys: $INIT_KEYS"

# 2. serverInfo.version matches package.json version
SERVER_VERSION=$(echo "$INIT_RESPONSE" | jq -r '.result.serverInfo.version')
PACKAGE_VERSION=$(node -p "require('./package.json').version")
echo "Server version: $SERVER_VERSION, Package version: $PACKAGE_VERSION"

Gate: All checks must pass. If any fail, fix before merging.

STEP 6: Merge Readiness & Conflict Resolution

Before merging, ensure every MY PR is mergeable. Process ALL my PRs in this step before moving to STEP 7.

6a. Determine merge order

# Check mergeable status for all MY PRs
for N in <list of MY PR numbers>; do
  gh pr view $N --json number,title,headRefName,baseRefName,mergeable,mergeStateStatus \
    --jq '"\(.number) | \(.title) | \(.mergeable) | \(.mergeStateStatus) | \(.baseRefName)"'
done

Sort PRs for merge order:

  1. MERGEABLE PRs first (no conflicts — merge immediately)
  2. CONFLICTING PRs next (need rebase before merge)
  3. Within each group, smaller PRs (fewer changed files) first — reduces cascading conflicts

6b. For each PR: check and resolve conflicts

For EACH MY PR in the determined order:

# 1. Check current mergeable status (may change after prior merges)
MERGE_STATUS=$(gh pr view <N> --json mergeable --jq '.mergeable')
echo "PR #<N> mergeable: $MERGE_STATUS"

If MERGEABLE: skip to 6c.

If CONFLICTING: resolve via rebase:

# 2. Fetch latest and checkout the PR branch
git fetch origin
BASE_BRANCH=$(gh pr vie

Maintain Release Os?

Let people know it's listed here — add the badge (live metrics, light/dark aware) or a plain link to your README or docs.

[Release Os on getagentictools](https://getagentictools.com/loops/shaun0927-opensafari-release-workflow?ref=badge)