npx skills add ...
npx skills add rubenflamshepherd/ruben-agent-skills --skill checkout-commit-push-pr
Run the full git workflow end-to-end without prompting: create a dated branch off the default branch (if needed), stage and commit changes with a descriptive message, push to origin, open a PR (honoring any repo PR template), and monitor CI checks until they pass. Use when the user asks to commit and open a PR, ship a change, push and PR, or run the checkout-commit-push-pr flow.
npx skills add rubenflamshepherd/ruben-agent-skills --skill checkout-commit-push-pr
DO NOT ASK ME WHAT TO DO. Just follow the workflow below. The only exceptions: a questionable untracked file (per step 2) or a diverged local default branch (per step 1) — stop and flag those instead of guessing.
Check current branch and changes
Do that via
Examine ALL pending changes to inform our git commit/PR messages — plain git diff
only shows unstaged edits to tracked files, so also check what's already staged:
For untracked files you intend to commit, read their contents — a new file IS the change, and no diff command shows it.
Resolve the repo's default branch — do not assume it is main:
If already on a non-default branch, stay on it. Only create a new branch if
currently on the default branch — NEVER commit or push directly to the default
branch, whatever it's named (main, master, develop, ...).
If on the default branch, create and checkout a new branch using this naming convention:
DATA-24-). This lets later tooling discover the issue from the branch name and cross-link the PR.0712)Examples:
fix-sqlfluff-errors-1214 (December 14th)update-dbt-models-0103 (January 3rd)DATA-24-improve-dagster-debug-skill-0527 (issue-prefixed)Before branching, make sure the local default branch is up to date so the new
branch isn't based on stale code (a stale base causes unrelated diffs and avoidable
conflicts in the PR). Uncommitted local changes are fine — git pull --ff-only
won't touch them; if it fails because the local branch has diverged, stop and flag
it rather than rebasing or merging on your own.
Stage files deliberately and commit with a descriptive message:
Review what git status reported in step 1 before staging anything:
.env*,
credentials*, *.key, .DS_Store, editor swap files, large data dumps,
one-off debug scripts). If an untracked file is ambiguous, read it first.Check for PR template:
Before creating the PR, check if the repository has a PR template:
If a Linear issue is known at this point — either passed in by an orchestrator (e.g. wrap-up-session) or auto-detected from a LINEAR-IDENTIFIER-… branch prefix — include both a closing reference and a **Ticket:** line near the top of the PR body so the PR is born linked back to the issue:
Use the issue’s actual URL. Use Fixes only when the PR completes the issue; otherwise use Refs. Insert both lines directly under the first heading (e.g. right under ## Description & motivation when a template is in use). If no issue identifier is known, leave them out. When called by wrap-up-session, its subsequent linear-ticket-management step creates or updates the issue and cross-links it to the PR. A standalone invocation does not create an issue.
Push branch and create PR:
Monitor CI/CD Checks: After creating the PR, monitor the CI/CD pipeline to ensure all checks pass:
Important: gh pr checks returns "no checks reported" with exit 1 in two different cases: (a) the repo has no workflows, or (b) workflows exist but haven't registered yet (typical 10-30s after push). Do NOT conclude "no CI configured" from that output alone.
ls .github/workflows/ — if any files exist, CI is configured and you must wait.gh pr view <PR-NUMBER> --json statusCheckRollup which distinguishes "no workflows" from "pending."Goal: every required check green. Whatever checks the repo runs — linters, builds, tests, docs validation — treat each failing required check as yours to fix.
Handling Check Failures:
gh run view --log-failed) to find the actual error — don't guess from the check name.Acceptable Skipped Checks:
When All Checks Pass:
Co-Authored-By: Claude trailer (or any other generated-by attribution)*