pushing-safely
Skill0 starsChanged 3 months agoMITView on GitHub
Use before pushing, force-pushing, or marking a change ready for review; when a push needs history rewritten; when CI reports no checks at all for a pushed commit; or when deciding whether a merge actually landed. DO NOT invoke to select which checks to run first — route that to ledger:refusing-busywork.
- Deletes or force-pushes
- Commits and pushes
In this repository23 other files it gives its agents.
- AGENTS.mdAGENTS.md
- adapting-to-a-projectSkill
- curating-decision-recordsSkill
- designing-concurrent-testsSkill
- diagnosing-flakesSkill
- fact-checking-by-executionSkill
- metabolizing-knowledgeSkill
- planning-the-workSkill
- proving-code-is-deadSkill
- proving-the-regressionSkill
- qualifying-a-requestSkill
- receiptsSkill
- recording-ui-evidenceSkill
- refusing-busyworkSkill
- reviewing-as-cis-complementSkill
- running-a-bounded-loopSkill
- scoping-a-changeSkill
- specifying-acceptanceSkill
- trimming-session-vantageSkill
- using-ledgerSkill
- validating-real-scenariosSkill
- what-counts-as-evidenceSkill
- writing-complete-propositionsSkill
The file
We split this skill into the rules it gives an agent
10 rules. About 0 are common, 8 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 12
Read hooks, ci, and default_branch from .ledger.yml.
- Distinctive: line 18
Before a rewrite: fetch the current remote branch and record its exact object id.
- Distinctive: line 32
Run the selected relevant checks once.
- Distinctive: line 33
Commit, then inspect any files a commit hook modified before continuing.
- Very specific: line 35
Verify the remote ref matches local HEAD:
- Distinctive: line 63
If a relevant check fails before a push, stop and fix the blocker or explain it.
- Distinctive: line 65
If a failure looks environment-specific, prove it rather than asserting it:
- Distinctive: line 69
prefer fixing cross-platform nondeterminism when the check is required.
- Distinctive: line 74
A queued merge is not a landing: Wait for the terminal merged state before saying it landed, and report a queued request as queued.
- Distinctive: line 75
Before deleting a branch, confirm nothing still depends on it — check for open change requests targeting it and require the count to be …
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Pushing safely
Publishing is where a local mistake becomes everyone's. Three things go wrong here, and each has a specific protocol: a rewrite that eats someone else's commit, a claim that something landed when it did not, and a missing signal misread as infrastructure trouble.
This skill owns the mechanics of publishing and of establishing that something landed. It does not select what to run beforehand.
Read hooks, ci, and default_branch from .ledger.yml.
Protect a history rewrite with a lease
Rebasing a feature branch is fine, including after review. Force-pushing without a lease is not.
Before a rewrite: fetch the current remote branch and record its exact object id. Then publish against that specific id, so a concurrent update aborts your push instead of silently discarding it:
git fetch origin <branch>
git rev-parse origin/<branch> # record this
git push --force-with-lease=<branch>:<observed-oid>Raw --force is never acceptable. --force-with-lease without an explicit object id is weaker than it looks — it leases against your local remote-tracking ref, which a background fetch can have already advanced. Name the id you actually observed.
After any rewritten push, re-audit. Fetch the live heads again and re-check unresolved review threads, approvals, mergeability, and checks. Commit hashes and inline-comment anchors recorded before the rewrite are not current evidence — they point at commits that no longer exist.
Push procedure
- Run the selected relevant checks once.
- Commit, then inspect any files a commit hook modified before continuing. A hook that reformats your work has changed what you are about to publish.
- Push — normally, or with the exact lease for an authorized rewrite.
- Verify the remote ref matches local
HEAD:
git rev-parse HEAD "origin/$(git branch --show-current)"That last step is not ceremony. A push can partially succeed, hit a hook rejection, or land on a different ref than you expect, and every downstream claim assumes it worked.
When CI reports no checks at all
This is the diagnosis worth knowing, because the obvious readings are all wrong.
Your change request says "no checks reported", and querying workflow runs for the head commit returns a count of zero. The instinct is a dropped event, a broken workflow file, or a bad push. Before any of that, read mergeability:
gh pr view <number> --json mergeable,mergeStateStatusA platform creates no change-request workflow runs while the request is conflicting. So the absent signal is the conflict — not infrastructure, not a dropped webhook, not your push.
Resolving the conflict is the only fix. Empty commits, allow-empty pushes, draft/ready toggles, and revert-and-restore bounces all leave the count at zero and add junk history to a branch someone still has to review. When the branch cannot be merged locally yet, confirm the conflicting paths without touching your working tree:
git merge-tree --write-tree HEAD origin/<base>Handle failures honestly
If a relevant check fails before a push, stop and fix the blocker or explain it. Do not push and hope CI differs.
If a failure looks environment-specific, prove it rather than asserting it:
- record the exact command, the failing case, and the platform-specific mismatch;
- confirm the relevant non-platform evidence still passes;
- prefer fixing cross-platform nondeterminism when the check is required;
- bypass an automated hook only when the user explicitly asks or agrees, and then report exactly what failed and why CI is expected to differ.
Landing is not the same as being accepted
- A queued merge is not a landing. Wait for the terminal merged state before saying it landed, and report a queued request as queued.
- Before deleting a branch, confirm nothing still depends on it — check for open change requests targeting it and require the count to be zero. A branch deleted under a dependent request breaks it in a way that is tedious to recover.
- Report pending checks as pending. Inspect a failure before attributing it to the branch or the environment.
For what a green check does and does not prove, see ledger:what-counts-as-evidence.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

