Stage, commit, create PR, and merge to main. Use for the standard commit-PR-merge cycle.
Verify the gates, then commit. A commit is not a pull request, and a pull request is not a merge.
This skill stops after the commit. It pushes and opens a pull request only with --pr or when the
user asks, and it never merges โ a merge happens only when the user explicitly says to merge
that pull request (see "Merging" below). Reviewers such as Codex and Copilot comment after a pull
request opens; merging before they report skips their review.
Run before branching. For every changed .qmd, .tex, or .R file that has quality rubrics, run:
python3 scripts/quality_score.py <changed-file-paths>
./scripts/install-hooks.sh has been run, .githooks/pre-commit re-runs the same โฅ80 gate on the staged .qmd/.tex/.R files, so carry an approved override into Step 4 as SKIP_QUALITY_GATE=1 git commit ... and record the override reason in the commit message. That variable skips only the quality score; the backtest still runs. Never fall back to git commit --no-verify.Spawn the verifier agent (via the Agent tool with subagent_type=verifier) to run compilation/render checks on the changed files. Report pass/fail before committing.
Runs unconditionally. The full backtest suite โ all ten gates (surface-sync count claims like "18 agents, 61 skills, 37 rules, 11 hooks" and marked tables, skill integrity, model currency, links, spec conformance, staleness, repo hygiene, derived counts, ledger coverage, hook battery):
./scripts/backtest.sh
If the diff touches a manuscript (.tex/.qmd) that has a passport in quality_reports/passports/, any source_file a passport lists, or any file a claim declares as a display (its location:, or an appears_in path:), read that passport: a load-bearing claim with status: FAIL or STALE is a must-fix โ halt, name the claim, and point at /audit-reproducibility (or the stale script) before committing. A touched display triggers the check for the same reason a touched script does: editing one artifact's copy of a number desynchronizes it from that number's other displays โ the supplement or deck holding the same value was not necessarily updated in the same commit. Skip silently when no passport exists.
git status
git diff --stat
git log --oneline -5
Never commit directly to main. If the current branch is main, create one; if you are already on
a feature branch, commit there.
git checkout -b <short-descriptive-branch-name>
Add specific files (never use git add -A):
git add <file1> <file2> ...
Do NOT stage .claude/settings.local.json or any files containing secrets.
If $ARGUMENTS is provided, use it as the commit message. Otherwise, analyze the staged changes and write a message that explains why, not just what.
The subject line states what is TRUE AFTER the commit โ a plain sentence about behavior that a reader could go and test. "Fixed review feedback" and "Updated the checker" narrate your afternoon and tell a reader nothing; "The parity gate refuses a fixture whose hash is unregistered" is a claim they can check against the code. Process narration โ which review round it came from, who asked, how many attempts it took โ belongs in the body if it belongs anywhere. The body still carries the why; the subject carries the claim.
git commit -m "$(cat <<'EOF'
<commit message here>
EOF
)"
--pr or when the user asksWithout --pr, and without the user asking for a pull request, skip this step: the commit stays
local and the report says so.
git push -u origin <branch-name>
gh pr create --title "<short title>" --body "$(cat <<'EOF'
## Summary
<1-3 bullet points>
## Changed defaults
<"None", or each default a forker will notice changing: a setting, a threshold, a hook that now fires, a path that moved>
## Test plan
<checklist>
๐ค Generated with [Claude Code](https://claude.com/claude-code)
EOF
)"
Report the commit (hash and subject), the branch, and โ if a pull request was opened โ its URL. Say plainly that nothing was merged.
A merge is never a step of this skill. Merge only when the user explicitly asks to merge a specific pull request ("merge #155"); "ship it", "done" or "commit" are not a merge instruction. Before merging, check that the pull request's CI is green and that its reviews (human, Codex, Copilot) have been read and answered.
gh pr merge <pr-number> --merge --delete-branch
git checkout main
git status --porcelain # must print nothing before the next line runs
git pull
Expect the tree to be dirty here โ that is what Step 3 is for. Staging specific files means
everything the session touched but did not stage, plus every untracked artifact, is still in the
tree when you arrive at this step. The git-guardrails hook this template ships denies
git pull (and merge, and rebase) whenever git status --porcelain is non-empty, because a
pull that resolves on top of uncommitted work cannot be reviewed afterwards โ you can no longer
tell which hunk came from the remote. Chaining a stash into the same command line does not help:
the hook reads the tree, it does not predict what the line will do to it.
Clear the tree deliberately, then pull:
git stash push -u -m "post-merge: unstaged leftovers" # -u, or untracked files stay behind
git pull
git stash pop
git pull --autostash is the one-command alternative, but only on a tree whose dirt is entirely
tracked. git stash does not stash untracked files, so an autostash over a ?? entry starts
the pull on the same dirty tree the check exists to refuse โ the hook therefore reads porcelain
and denies --autostash whenever any ?? entry is present. At this step that is the usual
state, so the explicit -u stash above is the default route and --autostash is the shortcut for
the case where git status --porcelain shows no ?? lines at all. Git agrees independently: if
the incoming commits add a file at a path you are holding untracked, it aborts the merge
("untracked working tree files would be overwritten") after the autostash has already been
taken. Either route must be its own command โ chaining the stash and the pull onto one line is
denied outright, because an identified history op reaches the tree reading only as a standalone
simple command.
ALLOW_DIRTY_MERGE=1 is the hatch for a dirty state you have looked at and can justify out loud.
It is not the routine remedy, and reaching for it because the block is inconvenient is the
behavior the check exists to prevent.
main. If the user insists on skipping, record their override reason in the commit message.main; branch off it first.settings.local.json and sensitive files from staging.--merge (not --squash or --rebase) unless they say otherwise.$ARGUMENTS is provided, use it exactly.| Flag | Effect |
|---|---|
--pr |
After the commit, push the branch and open a pull request (Step 5). Never merges. |