Squash-merge a verified non-main branch into main, push, and clean up the merged branch
Canonical source: docs/codex/usage-prompts/07B-squash-merge.md
Precondition: run in a local environment with git, remote access, and the working repo checked out.
Merge / finalization task for the current repository.
Run this with a local-capable agent only.
Goal:
Safely finalize verified work by squash-merging the current non-main branch into main, pushing main, and deleting the merged branch when safe.
Workflow mode:
Detect from docs/codex/REPO_OVERVIEW.md → ## Workflow Mode. If absent, default to solo-direct-push.
solo-direct-push: squash merge the current branch into main locally, push main, delete the merged branch.
main.protected/team: this prompt does not apply. Squash merge is performed via PR in the remote.
Workflow mode is protected/team — squash merge via PR only. This prompt does not apply.Precondition:
mainsolo-direct-push (if protected/team, stop immediately)Hard rules:
protected/team.docs/agent-workflow/* if presentdocs/codex/*Inspect first:
git status --porcelain=v1 -bgit branch --show-currentgit fetch origingit diff --name-status origin/main...HEADgit diff --stat origin/main...HEADgit log --oneline origin/main..HEADdocs/agent-workflow/* if presentdocs/codex/PLAN.mddocs/codex/STATUS.mddocs/codex/RUNBOOK.mddocs/codex/DOC_SYNC_MATRIX.mdRequired procedure:
docs/codex/REPO_OVERVIEW.md. If protected/team, stop and report.main.origin/main.main.main safely from origin/main:
git pull --ff-only origin mainmain.<area/scope>: <imperative summary>main to origin.Merge decision rules:
protected/team, stop and report immediately.origin/main contains unrelated files, stop and report the blocker.main, do not run this prompt; report that 07A should have ended the workflow.Output: A) Target
main)B) Scope check
C) Merge result
mainD) Push result
origin/main was updated successfullyE) Branch cleanup
F) Leftovers
G) Next suggested prompt
No next prompt needed.09-tag&release.md