with one click
push
// Push current branch changes to origin and create or update the corresponding pull request; use when asked to push, publish updates, or create pull request.
// Push current branch changes to origin and create or update the corresponding pull request; use when asked to push, publish updates, or create pull request.
Land a PR by monitoring conflicts, resolving them, waiting for checks, and squash-merging when green; use when asked to land, merge, or shepherd a PR to completion.
Pull latest origin/main into the current local branch and resolve merge conflicts (aka update-branch). Use when Codex needs to sync a feature branch with origin, perform a merge-based update (not rebase), and guide conflict resolution best practices.
Live Borg debugging by exec-ing into the borg-web-ui Docker container. Use when debugging borg commands, writing tests against real borg output, developing borg 2.0 features, or verifying borg behavior before writing code.
| name | push |
| description | Push current branch changes to origin and create or update the corresponding pull request; use when asked to push, publish updates, or create pull request. |
gh CLI is installed and available in PATH.gh auth status succeeds for GitHub operations in this repo.origin safely.pull: use this when push is rejected or sync is not clean (non-fast-forward,
merge conflict risk, or stale branch).Identify current branch and confirm remote state.
Run Borg UI validation appropriate to the changed files before pushing.
Push branch to origin with upstream tracking if needed, using whatever
remote URL is already configured.
If push is not clean/rejected:
pull
skill to merge origin/main, resolve conflicts, and rerun validation.--force-with-lease only when history was rewritten.Ensure a PR exists for the branch:
Write/update PR body explicitly using .github/PULL_REQUEST_TEMPLATE.md:
<!-- ... -->).Validate the PR body has no template comments or unresolved placeholders.
Reply with the PR URL from gh pr view.
# Identify branch
branch=$(git branch --show-current)
# Minimal validation gate for Borg UI setup and docs changes.
git diff --check
# Backend validation for backend changes.
if git diff --name-only origin/main...HEAD | rg -q '^(app|tests|requirements.txt|pytest.ini|ruff.toml)(/|$)'; then
ruff check app tests
ruff format --check app tests
pytest tests/unit -v
fi
# Frontend validation for frontend changes.
if git diff --name-only origin/main...HEAD | rg -q '^frontend/'; then
(cd frontend && npm run check:locales && npm run typecheck && npm run lint && npm run build)
fi
# Initial push: respect the current origin remote.
git push -u origin HEAD
# If that failed because the remote moved, use the pull skill. After
# pull-skill resolution and re-validation, retry the normal push:
git push -u origin HEAD
# If the configured remote rejects the push for auth, permissions, or workflow
# restrictions, stop and surface the exact error.
# Only if history was rewritten locally:
git push --force-with-lease origin HEAD
# Ensure a PR exists (create only if missing)
pr_state=$(gh pr view --json state -q .state 2>/dev/null || true)
if [ "$pr_state" = "MERGED" ] || [ "$pr_state" = "CLOSED" ]; then
echo "Current branch is tied to a closed PR; create a new branch + PR." >&2
exit 1
fi
# Write a clear, human-friendly title that summarizes the shipped change.
pr_title="<clear PR title written for this change>"
if [ -z "$pr_state" ]; then
gh pr create --title "$pr_title"
else
# Reconsider title on every branch update; edit if scope shifted.
gh pr edit --title "$pr_title"
fi
# Write/edit PR body to match .github/PULL_REQUEST_TEMPLATE.md before validation.
# Example workflow:
# 1) open the template and draft body content for this PR
# 2) gh pr edit --body-file /tmp/pr_body.md
# 3) for branch updates, re-check that title/body still match current diff
tmp_pr_body=$(mktemp)
gh pr view --json body -q .body > "$tmp_pr_body"
if rg -n '<!--|Fixes #$|TODO|TBD' "$tmp_pr_body"; then
echo "PR body still contains template comments or unresolved placeholders." >&2
exit 1
fi
rm -f "$tmp_pr_body"
# Show PR URL for the reply
gh pr view --json url -q .url
--force; only use --force-with-lease as the last resort.pull skill for non-fast-forward or stale-branch issues.