Git ship flow
Skill megandmartin/agent-skills-repo/skills/builder-dev/git-ship-flow
75 production-grade agent skills for Hermes Agent + Paperclip — research, write, organize, earn, and run an AI workforce. Every skill passes a QA gate with hard safety rails. Built by Gen AI Hub.
npx -y skills add megandmartin/agent-skills-repo --skill git-ship-flowAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- 15 days oldThe repository was created 15 days ago. New is not bad, but a brand new repository carrying a familiar-sounding name is the shape a typosquat arrives in, and there has been no time for anyone else to find a problem with it.
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
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.
The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.
SKILL.md
6.1 KB, ~1.4k tokens by cl100k_base, as published. Nobody here has run it
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
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.