-
Identify current branch and confirm remote state through the bundled repo
helper for repo-core covered facts.
-
Run the repo-defined validation gate from the current repo root before
pushing.
-
Push branch to origin with upstream tracking if needed, using whatever
remote URL is already configured, then verify the published head matches the
local head.
-
If push is not clean/rejected:
- If the failure is a non-fast-forward or sync problem, run the
pull
skill to merge the repo's current base branch, resolve conflicts, and
rerun validation.
- Push again; use
--force-with-lease only when history was rewritten.
- If the failure is due to auth, permissions, or workflow restrictions on
the configured remote, stop and surface the exact error instead of
rewriting remotes or switching protocols as a workaround.
-
Ensure a PR exists for the branch:
- If no PR exists, create one.
- If a PR exists and is open, update it.
- If branch is tied to a closed/merged PR, create a new branch with the repo
helper when available, then create a replacement PR.
- Write a proper PR title that clearly describes the change outcome
- For branch updates, explicitly reconsider whether current PR title still
matches the latest scope; update it if it no longer does.
-
If repo.provider.options.required_pr_label is configured:
- Treat it as a GitHub-only workflow convention surfaced through the
repo-provider helper.
- Verify the PR has that label. Prefer
"$provider_cmd" pr-add-label "<label>" after the PR exists.
- Pass an explicit PR selector only when you are not on the PR branch.
-
When the target repo provides .github/pull_request_template.md, write/update
the PR body explicitly from that template:
- Fill every section with concrete content for this change.
- Replace all placeholder comments (
<!-- ... -->).
- Keep bullets/checkboxes where template expects them.
- If PR already exists, refresh body content so it reflects the total PR
scope (all intended work on the branch), not just the newest commits,
including newly added work, removed work, or changed approach.
- Do not reuse stale description text from earlier iterations.
-
If the target repo ships a local PR-body validator, run it and fix all
reported issues before handing off.
-
Reply with the PR URL from the bundled repo-provider helper.