You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(ship-skill): compare commit content not count, handle WIP before rebase, avoid fixed temp branch name
- Final verify now diffs actual commit subjects between git log and
the PR, not just a count — a corrupted branch's inflated count could
coincidentally match a later count check
- The pre-commit count in step 2 was being compared against the
post-commit PR in step 9, which would mismatch even on success; now
compares content at the point it's actually available
- Recovery flow stashes uncommitted work before rebasing so it isn't
blocked by a dirty tree, and checks for an existing tmp branch
before reusing the name
Copy file name to clipboardExpand all lines: .agents/skills/ship/SKILL.md
+12-2Lines changed: 12 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,12 @@ You help ship code by creating commits, pushing to the remote branch, and creati
12
12
When the user runs `/ship`:
13
13
14
14
1.**Check git status** - See what files have changed
15
-
2.**Sync check**: `git fetch origin staging && git log --oneline origin/staging..HEAD`. Must list only this session's commit(s) — a worktree/branch can silently be cut from a stale local `staging`, dragging in unrelated commits. If it shows extra commits, fix before pushing: `git rebase origin/staging`; if that hits conflicts on commits you don't recognize, `git rebase --abort` and instead `git checkout -b tmp origin/staging`, `git cherry-pick <your-sha(s)>`, resolve conflicts, then `git branch -f <branch> HEAD && git checkout <branch>` and `git push --force-with-lease`.
15
+
2.**Sync check**: `git fetch origin staging && git log --oneline origin/staging..HEAD`. Read the actual commit list, not just how many there are — it must show ONLY commits you can attribute to this session (recognizable subjects/SHAs). A worktree/branch can silently be cut from a stale local `staging`, dragging in unrelated commits; a corrupted branch's inflated commit *count* can coincidentally match a later check even when the *commits* are wrong, so always compare content, never just a number.
16
+
- If it shows commits you don't recognize, fix it now, **before** staging/committing any new work (step 7 hasn't run yet):
17
+
- If the working tree has uncommitted changes, stash them first — `git stash push -u -m ship-sync-fix` — so the rebase below isn't blocked by dirty state. Restore with `git stash pop` once the branch is fixed.
18
+
- Try `git rebase origin/staging` first.
19
+
- If that walks through unrelated history and conflicts on commits you don't recognize, `git rebase --abort` and rebuild instead: pick a temp branch name that isn't already in use (`git branch --list ship-sync-tmp`; if it exists, delete it or pick another name), `git checkout -b ship-sync-tmp origin/staging`, `git cherry-pick <your-sha(s)>`, resolve conflicts, then `git branch -f <original-branch> HEAD`, `git checkout <original-branch>`, and delete the temp branch.
20
+
- Re-verify with `git log --oneline origin/staging..HEAD` — it should list only commits you recognize.
16
21
3.**Generate a commit message** following this format: `type(scope): description`
17
22
- Types: `fix`, `feat`, `improvement`, `chore`
18
23
- Scope: short identifier (e.g., `undo-redo`, `api`, `ui`)
@@ -27,7 +32,12 @@ When the user runs `/ship`:
27
32
-`bun run check:api-validation:strict` to catch boundary contract failures before CI
28
33
7.**Stage and commit** the changes with the generated message
29
34
8.**Push to origin** using the current branch name
30
-
9.**Create a PR** to staging with a description in the user's voice, then confirm `gh pr view <n> --json commits -q '.commits | length'` matches the commit count from step 2 — otherwise redo the sync fix and force-push
35
+
9.**Create a PR** to staging with a description in the user's voice, then do a final content check — not a count check — comparing what actually landed:
These two lists must describe the same commits (same subjects, one of which is the commit from step 7). If they don't match, the branch still has a problem — redo step 2's fix and `git push --force-with-lease`.
Copy file name to clipboardExpand all lines: .cursor/commands/ship.md
+12-2Lines changed: 12 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,12 @@ You help ship code by creating commits, pushing to the remote branch, and creati
7
7
When the user runs `/ship`:
8
8
9
9
1.**Check git status** - See what files have changed
10
-
2.**Sync check**: `git fetch origin staging && git log --oneline origin/staging..HEAD`. Must list only this session's commit(s) — a worktree/branch can silently be cut from a stale local `staging`, dragging in unrelated commits. If it shows extra commits, fix before pushing: `git rebase origin/staging`; if that hits conflicts on commits you don't recognize, `git rebase --abort` and instead `git checkout -b tmp origin/staging`, `git cherry-pick <your-sha(s)>`, resolve conflicts, then `git branch -f <branch> HEAD && git checkout <branch>` and `git push --force-with-lease`.
10
+
2.**Sync check**: `git fetch origin staging && git log --oneline origin/staging..HEAD`. Read the actual commit list, not just how many there are — it must show ONLY commits you can attribute to this session (recognizable subjects/SHAs). A worktree/branch can silently be cut from a stale local `staging`, dragging in unrelated commits; a corrupted branch's inflated commit *count* can coincidentally match a later check even when the *commits* are wrong, so always compare content, never just a number.
11
+
- If it shows commits you don't recognize, fix it now, **before** staging/committing any new work (step 5 hasn't run yet):
12
+
- If the working tree has uncommitted changes, stash them first — `git stash push -u -m ship-sync-fix` — so the rebase below isn't blocked by dirty state. Restore with `git stash pop` once the branch is fixed.
13
+
- Try `git rebase origin/staging` first.
14
+
- If that walks through unrelated history and conflicts on commits you don't recognize, `git rebase --abort` and rebuild instead: pick a temp branch name that isn't already in use (`git branch --list ship-sync-tmp`; if it exists, delete it or pick another name), `git checkout -b ship-sync-tmp origin/staging`, `git cherry-pick <your-sha(s)>`, resolve conflicts, then `git branch -f <original-branch> HEAD`, `git checkout <original-branch>`, and delete the temp branch.
15
+
- Re-verify with `git log --oneline origin/staging..HEAD` — it should list only commits you recognize.
11
16
3.**Generate a commit message** following this format: `type(scope): description`
12
17
- Types: `fix`, `feat`, `improvement`, `chore`
13
18
- Scope: short identifier (e.g., `undo-redo`, `api`, `ui`)
@@ -21,7 +26,12 @@ When the user runs `/ship`:
21
26
22
27
6.**Push to origin** using the current branch name
23
28
24
-
7.**Create a PR** to staging with a description in the user's voice, then confirm `gh pr view <n> --json commits -q '.commits | length'` matches the commit count from step 2 — otherwise redo the sync fix and force-push
29
+
7.**Create a PR** to staging with a description in the user's voice, then do a final content check — not a count check — comparing what actually landed:
These two lists must describe the same commits (same subjects, one of which is the commit from step 5). If they don't match, the branch still has a problem — redo step 2's fix and `git push --force-with-lease`.
0 commit comments