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 rulesdevelopment
Close the loop on a Linear ticket when its work ships - move the status and post a deploy comment with the PR link, what shipped, and a try-it link, mentioning the collaborator. Used as the tail of /ro:linear-nightshift for every merged mirror, or manually after an ad-hoc build. Triggers on "linear update", "update the linear ticket", "mark NUT-x done", "tell eoin it shipped", "/ro:linear-update".
devops
Run a night-shift against a collaborator's Linear board. Pulls the team's Grilled tickets (/ro:linear-grill moves a ticket to Grilled once its questions are answered), VERIFIES the questions were actually answered (unanswered → bounce the ticket to the "Question for <name>" state), mirrors verified tickets to ephemeral GitHub issues with ready-for-agent, then runs the standard /ro:night-shift machinery on GitHub. Tail-calls /ro:linear-update for everything that merged + deployed. Triggers on "linear nightshift", "nightshift linear", "drain the linear board", "run the shift off linear", "/ro:linear-nightshift".
development
Grill a collaborator's Linear tickets and move every processed ticket to where it belongs. Resolves the board from the repo's .ro-linear.json, reads the collaborator's Backlog / Ready-for-agent issues, then per ticket either posts 3-5 decision-extracting questions (state moves to "Question for <name>") or confirms it build-ready (state moves to "Grilled", the gate /ro:linear-nightshift consumes); shipped-and-confirmed tickets close as Done. The async-collaborator counterpart of /ro:day-shift for people who never touch GitHub. Triggers on "grill linear", "grill eoin's tickets", "linear grill", "add questions to the linear tickets", "/ro:linear-grill".
development
--- name: about-page description: Add a standard About page to any web app, what it is, the tech stack, and an FAQ, wired into a footer link with a sticky footer. Built with Spartan + Tailwind (the canonical component layer) and falls back to semantic HTML so it ships reliably. Use whenever building, polishing, or shipping an app, every app should have one. Triggers on "add an about page", "about page", "footer about link", or as a standard step in app build/polish. category: frontend argument-h