skills/gh-ship/SKILL.md
--- name: gh-ship description: Ship a feature branch through GitHub — open PR, watch PR checks, confirm merge, then monitor main-branch CI and verify auto-deploy. Use when a feature is ready to go from branch to production via GitHub. Sibling to /ro:cf-ship (that one runs the local pre-flight; this one drives the GitHub side). category: development argument-hint: [--title "<title>"] [--base main] [--squash|--merge|--rebase] [--no-merge] allowed-tools: Bash(git *) Bash(gh *) Bash(curl *) Read ---
npx skillsauth add RonanCodes/ronan-skills skills/gh-shipInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Drive a feature from branch to production through GitHub. The PR gets opened, CI gets watched, merge gets confirmed, post-merge pipeline gets watched, and auto-deploy gets verified. If there's no auto-deploy wired up, offer to set it up.
/ro:gh-ship # open PR from current branch, full flow
/ro:gh-ship --title "✨ feat: add search" # explicit title, skip the derive-from-commits step
/ro:gh-ship --base release/1.2 # base branch other than main
/ro:gh-ship --squash # squash-merge (default)
/ro:gh-ship --merge # merge commit
/ro:gh-ship --rebase # rebase-merge
/ro:gh-ship --no-merge # open + watch PR, stop before asking to merge
main / master / the base branch — fail fast with "checkout a feature branch first"git status --porcelain empty) — if not, bail and tell the user to commit first (do NOT auto-stash)git rev-parse @{u} succeeds) — if not, git push -u origin <branch>gh auth status is logged inUnless --title given, derive from commits on this branch:
git log --format="%s" "${BASE}..HEAD"
Use the repo's existing PR template if .github/pull_request_template.md exists.
gh pr create --base "$BASE" --head "$BRANCH" \
--title "$TITLE" --body "$BODY"
Capture the PR number for the rest of the flow.
First, check the per-repo CI config. Some repos run with wait_for_remote: false in .ronan-skills.json (e.g., when GitHub Actions is billing-blocked or when the team has decided local pre-push validation is sufficient). If so, skip this step entirely and jump to step 5.
if [ -f .ronan-skills.json ]; then
wait_for_remote=$(jq -r '.ci.wait_for_remote // true' .ronan-skills.json)
if [ "$wait_for_remote" = "false" ]; then
echo "skip: .ronan-skills.json has ci.wait_for_remote=false — trusting local pre-push quality"
# Continue to step 5 (or step 6 if auto_merge_on_local_pass=true)
fi
fi
If wait_for_remote is true (or the config file is missing), kick off a Monitor watching the PR's check run:
until s=$(gh run list --branch "$BRANCH" --limit 1 --json status,conclusion \
-q '.[0] | "\(.status) \(.conclusion)"'); [[ "$s" == completed* ]]; do
echo "pr-ci: $s"
sleep 20
done
echo "pr-ci: $s"
Report status updates as they change (in_progress → completed).
On completion:
gh run view <id> --log-failed | tail -50), show the user the first clear error, stop. Offer to fix.If the PR has required status checks and they haven't all reported yet, wait for them too — gh pr checks <num> is the source of truth (not just workflow runs).
--no-merge)Check .ronan-skills.json ci.auto_merge_on_local_pass first. When true (and the local pre-push hook already validated format + lint + typecheck + test + build), skip the AskUserQuestion and proceed straight to step 6:
auto_merge=$(jq -r '.ci.auto_merge_on_local_pass // false' .ronan-skills.json 2>/dev/null || echo false)
if [ "$auto_merge" = "true" ]; then
echo "auto-merge: .ronan-skills.json has ci.auto_merge_on_local_pass=true — merging without prompt"
# Skip the question, go to step 6.
fi
Otherwise, via AskUserQuestion:
PR #N passed checks. Merge to
$BASEnow? (Options: squash / merge / rebase / not yet)
Default option matches the --squash|--merge|--rebase flag (squash if none given). On "not yet", print the PR URL and exit cleanly.
Read merge_method from .ronan-skills.json (defaults to squash) and use --admin to bypass branch protection when remote CI hasn't reported (because we're trusting local pre-push):
merge_method=$(jq -r '.ci.merge_method // "squash"' .ronan-skills.json 2>/dev/null || echo squash)
admin_flag=""
if [ "$(jq -r '.ci.wait_for_remote // true' .ronan-skills.json 2>/dev/null)" = "false" ]; then
admin_flag="--admin" # bypass "checks required" branch protection
fi
gh pr merge "$NUM" --"$merge_method" --delete-branch $admin_flag
If gh pr merge fails with "Not possible to fast-forward" after the merge itself succeeded, that's gh trying to update local main — fix with git fetch origin && git reset --hard origin/main (safe here because local main hasn't diverged intentionally).
Verify via gh pr view <num> --json state → expect MERGED.
Immediately start monitoring CI on the base branch:
until s=$(gh run list --branch "$BASE" --limit 1 --json status,conclusion \
-q '.[0] | "\(.status) \(.conclusion)"'); [[ "$s" == completed* ]]; do
echo "deploy: $s"
sleep 25
done
echo "deploy: $s"
Report status updates. Don't just watch the workflow as a whole — if the workflow has a deploy job specifically, name it in the report ("deploy: in_progress", "deploy: skipped", "deploy: failure", "deploy: success").
Three possible outcomes after the base-branch workflow finishes:
Report the deployed URL if derivable (from the workflow log, or from the wrangler.jsonc / fly.toml / vercel.json). Done.
Fetch the logs, surface the specific error. Common failures:
| Symptom | Cause | Fix |
|---|---|---|
| CLOUDFLARE_API_TOKEN empty | Secret not in production environment (if workflow uses environment: production) | Set via gh secret set ... --env production |
| gh secret set returns 401 | Current gh token lacks the right scope | gh auth refresh -h github.com -s admin:repo_hook (or set secrets manually) |
| Not possible to fast-forward (post-merge) | Local main diverged from origin | git fetch && git reset --hard origin/<base> |
| Migration wrangler d1 ... --remote fails | CLOUDFLARE_ACCOUNT_ID missing | Same as above |
Offer to fix. Don't silently retry.
Detect by checking .github/workflows/*.yml for any job with wrangler deploy, fly deploy, vercel deploy, etc. If none, tell the user:
Merged to
$BASE, but I don't see any auto-deploy wired up in.github/workflows/.Would you like me to add a push-to-
$BASEdeploy job? I'd need to know the deploy target (Cloudflare Workers / Fly / Vercel / other).
If they say yes, delegate to the appropriate scaffold step:
deploy job that does pnpm wrangler deploy, gated on the existing test job, under environment: production, reading CLOUDFLARE_API_TOKEN + CLOUDFLARE_ACCOUNT_ID from env secrets. Template below.flyctl deploy --remote-only with FLY_API_TOKENvercel deploy --prod with VERCEL_TOKEN (though /ro:cf-ship would already have migrated away from this)If the deploy succeeded and either docs/infrastructure/ is absent (first deploy) or this deploy changed bindings/resources, run /ro:infra-docs to generate or refresh the living architecture docs (live resource inventory, C4 + sequence diagrams, security model, provisioning runbook). Standing up a new app should leave it documented; the skill is idempotent, so re-run after notable deploys.
Summarise:
Drop this into .github/workflows/ci.yml after the existing test job:
deploy:
name: Deploy to Cloudflare Workers
needs: test
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
runs-on: ubuntu-latest
environment: production
concurrency:
group: deploy-production
cancel-in-progress: false
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with: { version: 9 }
- uses: actions/setup-node@v4
with: { node-version: 22, cache: pnpm }
- run: pnpm install --frozen-lockfile
- run: pnpm build
- name: Apply D1 migrations
run: pnpm wrangler d1 migrations apply <db-name> --remote
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
- name: Deploy worker
run: pnpm wrangler deploy
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
Then set secrets on the production environment (not repo-level, so non-main branches can't read them):
set -a && source "$(ro context env)" && set +a
unset GITHUB_TOKEN GH_TOKEN # see gotcha below
REPO=<owner>/<repo>
gh secret set CLOUDFLARE_API_TOKEN --env production --repo $REPO --body "$CLOUDFLARE_API_TOKEN"
gh secret set CLOUDFLARE_ACCOUNT_ID --env production --repo $REPO --body "$CLOUDFLARE_ACCOUNT_ID"
HTTP 401: Bad credentials on gh secret setTwo causes, in this order of likelihood:
GITHUB_TOKEN from ~/.claude/.env is shadowing the gh keychain. Sourcing ~/.claude/.env to pull CLOUDFLARE_API_TOKEN also loads GITHUB_TOKEN, and gh prefers env-var auth over the keychain. If that env token has narrower scopes, you get HTTP 401: Bad credentials on the public-key fetch — even though gh api on the same endpoint works. Fix: unset GITHUB_TOKEN GH_TOKEN right after sourcing, before any gh call.gh auth refresh -h github.com -s admin:repo_hook.Always pass --repo <owner>/<name> explicitly when calling from a subshell or a directory where the remote isn't obvious — gh's repo auto-detection is flaky.
--delete-branch after merge)/ro:cf-ship — local pre-flight deploy gate (lint/test/build/migrations/smoke) — run before opening the PR/ro:commit — emoji conventional commit format (used for commits before shipping)/ro:cloudflare-dns — if the deploy job succeeds but you also need to point a custom domain/ro:git-guardrails — destructive-command hook that complements this skill's safety rulestesting
--- name: linear-pipeline description: The Fable orchestrator for a single dispatched Linear ticket. Holds almost no context itself; it receives `--issue <ID> --detached`, decides the stage sequence, and fans out a sub-agent per stage, passing forward only each stage's artifact (never re-derived, never inlined into its own context). Step zero, before any planning or stage routing, is a boundary triage against `canon/security-boundary.md` (#199): a match tags Ronan Connolly and stops the run, no
development
--- name: in-your-face description: Capture a chat-only answer into a durable artifact (markdown + HTML, PDF when cheap) and launch it automatically so the user cannot miss it. Use when user says "in your face", "don't let me lose this", "save that answer", "make that durable", or right after answering a substantive side question (a recipe, comparison, how-to, or generated prompt) that would otherwise die with the context. category: workflow argument-hint: [--no-open] [--vault <short>] [hint of
tools
One-shot headless OpenAI Codex CLI calls for background/admin AI tasks — summaries, classification, extraction, admin glue. The default engine for anything that runs AI constantly in the background (daemon-driven, per-event), because it bills the flat ChatGPT subscription instead of Claude usage or per-token API spend, and it keeps working while Claude is rate-limited. NEVER for coding — coding stays Claude. Use when a skill or daemon needs a cheap always-on AI call, when the user says "use codex", "ask codex", "codex as backup", or when building a background summarizer/classifier into a listener or loop. Reads auth from ~/.codex/auth.json (ChatGPT account, no API key).
research
Turn a warranty rejection, repair quote, or RMA email into a cited decision brief — legal read (NL/EU consumer law), is the part user-serviceable, live part and new-unit prices, repair-vs-DIY-vs-new economics, before-you-send-it checklist, deadlines. Use when the user pastes or screenshots a repair quote, warranty rejection, "not covered" email, onderzoekskosten fee, or asks "should I repair or replace this".