git-ship-flow
Skill3 starsChanged 4 months agoMITView on GitHub
Safe git workflow for non-developers — init, branch, commit, push, open a PR, and undo mistakes without losing work. Use when the user says "commit this", "push my changes", "make a branch", "open a PR", "I messed up git", "undo my last commit", or is shipping code and doesn't know git well. Don't use for reviewing someone else's PR diff — use github-pr-review.
- Reads credentials
- Deletes or force-pushes
- Commits and pushes
In this repository74 other files it gives its agents.
- agent-eval-harnessSkill
- context-budget-managerSkill
- incident-rollbackSkill
- memory-hygieneSkill
- model-cost-optimizerSkill
- prompt-debuggerSkill
- skill-author-coachSkill
- third-party-skill-vetterSkill
- api-endpoint-testerSkill
- bug-triage-protocolSkill
- changelog-release-notesSkill
- docs-readme-writerSkill
- env-secrets-hygieneSkill
- github-pr-reviewSkill
- lovable-brief-writerSkill
- supabase-migration-writerSkill
- vercel-deploy-checkSkill
- cold-outreach-sequencerSkill
- competitor-pricing-scanSkill
- contract-redline-scanSkill
- customer-support-inboxSkill
- invoice-runnerSkill
- kpi-dashboard-weeklySkill
- lead-research-dossierSkill
- payment-reconciliationSkill
- pipeline-trackerSkill
- proposal-builderSkill
- stripe-payment-linkSkill
- testimonial-harvesterSkill
- weekly-revenue-reportSkill
- brand-voice-guardianSkill
- case-study-builderSkill
- content-repurposerSkill
- deep-research-briefSkill
- email-nurture-sequenceSkill
- landing-page-copywriterSkill
- linkedin-content-packSkill
- newsletter-assemblerSkill
- seo-blog-writerSkill
- social-listening-reportSkill
- x-thread-builderSkill
- youtube-script-writerSkill
- budget-guardrailsSkill
- ceo-operating-doctrineSkill
- delegation-protocolSkill
- editor-personaSkill
- heartbeat-standupSkill
- hiring-briefSkill
- ops-agent-personaSkill
- researcher-personaSkill
- sales-agent-personaSkill
- support-agent-personaSkill
- weekly-retroSkill
- writer-personaSkill
- calendar-conciergeSkill
- decision-journalSkill
- email-triageSkill
- file-organizerSkill
- habit-trackerSkill
- inbox-zero-sprintSkill
- The first 60 shown.
The file
Files
Git Ship Flow
The one safe path through git for people who build with AI and don't want to think about git internals: branch → commit → push → PR, plus the exact undo move for every common mistake. Core promise: with this flow you can always get your work back, and you can never destroy a teammate's.
When to Use
- User wants to save/ship their changes: "commit this", "push it", "get this on GitHub".
- User is starting a feature and should be on a branch, not
main. - Something went wrong: wrong commit message, committed to
mainby accident, need to undo. - Not for: reviewing a PR someone else opened — use
github-pr-review. Not for writing release notes from history — usechangelog-release-notes.
Quick Reference
| Action | Command / Call |
| See where you are | git status && git branch --show-current |
| Start a feature branch | git switch -c feat/short-name |
| Stage + commit | git add -A && git commit -m "feat: what changed and why" |
| Push branch (first time) | git push -u origin feat/short-name |
Open PR (needs gh) | gh pr create --fill (fallback: push, then open the URL git prints) |
| Safe undo of a pushed commit | git revert <sha> |
| Unstage without losing edits | git restore --staged <file> |
| Rescue "lost" work | git reflog (then git switch -c rescue <sha>) |
Procedure
- Precheck —
command -v git; thengit status. If not a repo:git initand confirm a.gitignoreexists (create one covering.env,node_modules/,.DS_Storebefore the first commit — seeenv-secrets-hygiene). Note the current branch. - Get off main — if the user is starting new work on
main/master, create a branch first:git switch -c feat/short-name. If they already edited files onmain, no problem —git switch -c feat/short-namecarries uncommitted changes with them. - Secret scan before staging —
git diff --statto see what's changing, and eyeball for.env, keys, or credentials. If anything secret is in the diff, stop and runenv-secrets-hygienefirst. - Commit —
git add -A && git commit -m "type: summary". Message formula: what changed + why, under ~70 chars, e.g.fix: stop signup form clearing on error. Success:git log --oneline -1shows it. - Push —
git push -u origin <branch>. Success: git prints the remote branch and usually a ready-made PR URL. - PR —
gh pr create --fillif the GitHub CLI is installed (command -v gh); otherwise use the URL from step 5. Title = the commit summary; body = what/why + how you tested. - Undo (only when asked) — pick from the table below, never guess:
| Situation | Safe move | Why |
| Wrong message, not pushed yet | git commit --amend -m "new msg" | Rewrites only your local last commit |
| Committed too early, not pushed | git reset --soft HEAD~1 | Uncommits but keeps every edit staged |
| Bad commit already pushed | git revert <sha> | Adds a new "opposite" commit; history stays intact |
| Committed to main by accident | git switch -c feat/x then on main git revert <sha> | Work lives on the branch; main is cleaned safely |
| Want one file back to last commit | git restore <file> | ⚠️ Destroys uncommitted edits to that file — confirm first |
- The never rule — never
git push --forceand nevergit reset --hardon anything pushed or shared. If the user asks for either, explain thatrevertdoes the job without rewriting shared history, and proceed with force only if they explicitly confirm they understand teammates' work can be lost (--force-with-leaseat minimum, on their own branch only).
Output Template
## Shipped ✅
Branch: feat/short-name (from main @ <sha>)
Commit: <sha> — "feat: what changed"
Pushed: yes → origin/feat/short-name
PR: <url> (or: "run `gh auth login` to open PRs from the terminal")
Undo, if needed: git revert <sha> (safe — does not rewrite history)Pitfalls
- Committed a secret (.env, API key) — the key is now in history; deleting the file in a new commit does NOT remove it. Recovery: rotate the key immediately, then follow
env-secrets-hygienefor history cleanup. Rotation first, always. - "detached HEAD" panic — user checked out a sha and thinks work is gone. Recovery:
git switch -c rescue-branchright there; everything is saved on the new branch. - Push rejected (non-fast-forward) — remote has commits you don't. Recovery:
git pull --rebase origin <branch>, resolve any conflicts, push again. Never "fix" this with--force. - Committed to main instead of a branch — recovery:
git branch feat/x(bookmarks the work), thengit reset --hard origin/mainONLY if main was not pushed since — otherwisegit revertthe commits on main and open a PR fromfeat/x. - Merge conflict mid-rebase — files full of
<<<<<<<markers. Recovery: open each file, keep the correct lines, delete all marker lines,git add <file>,git rebase --continue. If overwhelmed:git rebase --abortreturns to the pre-rebase state, nothing lost.
Verification
git statusis clean (nothing unintentionally uncommitted)- Work is on a feature branch, not main (unless user explicitly wanted main)
git log --oneline -3shows the expected commit(s) with clear messages- Branch visible on the remote (push output or
git ls-remote --heads origin <branch>) - No secrets in the diff (
git show --stat HEADreviewed) - No force-push or hard reset ran without the user's explicit confirmation
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.

