Automates branch publishing, PR creation, and validation gates before pushing code to origin.

Install

mkdir -p .claude/skills/push-sushaantu && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/15440" && unzip -o skill.zip -d .claude/skills/push-sushaantu && rm skill.zip

Installs to .claude/skills/push-sushaantu

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Push current branch changes to origin and create or update the corresponding
76 chars · catalog descriptionno explicit “when” trigger
Beginner

Key capabilities

  • Push current branch changes to `origin`.
  • Create a PR if none exists for the branch.
  • Update an existing open PR.
  • Run validation gates before pushing.
  • Keep branch history clean when remote has moved.

How it works

The skill pushes local changes to the remote, runs validation checks, and then creates or updates a pull request. It handles cases where the remote has moved by suggesting the `pull` skill.

Inputs & outputs

You give it
Local branch changes
You get back
Pushed changes to `origin` and an updated or new pull request

When to use push

  • Publish updates
  • Create pull request
  • Push local branch

About this skill

Push

Prerequisites

  • gh CLI is installed and available in PATH.
  • gh auth status succeeds for GitHub operations in this repo.

Goals

  • Push current branch changes to origin safely.
  • Create a PR if none exists for the branch, otherwise update the existing PR.
  • Keep branch history clean when remote has moved.

Related skills

  • pull: use this when push is rejected or the branch is stale.

Validation gate

Run the checks that match the repo's normal contribution flow before pushing:

bun run lint
bun run test

Run browser coverage too when the change is user-facing, routing-related, or otherwise browser-observable:

bun run test:e2e

If Playwright browsers are missing, install them first:

bunx playwright install --with-deps chromium

Steps

  1. Identify the current branch and confirm the remote state.
  2. Run the required validation for the scope.
  3. Push the branch to origin with upstream tracking if needed.
  4. If push is rejected because the remote moved, run the pull skill, rerun validation, and push again.
  5. If push fails because of auth, permissions, or repo rules, stop and surface the exact error.
  6. Ensure a PR exists for the branch:
    • If no PR exists, create one.
    • If a PR exists and is open, update it.
    • If the current branch is tied to a closed or merged PR, create a fresh branch and PR.
  7. Write or update a clear PR title and body that match the current diff.
  8. Reply with the PR URL from gh pr view.

Commands

branch=$(git branch --show-current)

git push -u origin HEAD

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

pr_title="<clear PR title written for this change>"
if [ -z "$pr_state" ]; then
  gh pr create --fill --title "$pr_title"
else
  gh pr edit --title "$pr_title"
fi

gh pr view --json url -q .url

Notes

  • Do not use --force; use --force-with-lease only when local history was intentionally rewritten.
  • Distinguish sync problems from auth or permission problems. Use the pull skill for the former and surface the latter directly.

When not to use it

  • When the current branch is tied to a closed or merged PR.
  • When push is rejected due to authentication or permissions issues.
  • When local history was intentionally rewritten and `--force-with-lease` is not desired.

Prerequisites

`gh` CLI is installed and available in `PATH`.`gh auth status` succeeds for GitHub operations in this repo.

Limitations

  • Does not use `--force` for pushing.
  • Requires manual intervention if push fails due to auth, permissions, or repo rules.
  • Cannot update a PR if the current branch is tied to a closed or merged PR.

How it compares

This skill integrates validation checks and PR management into the push workflow, providing a more structured approach than a simple `git push`.

Compared to similar skills

push side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
push (this skill)02moReviewBeginner
github-workflow-automation112moReviewAdvanced
testing-workflow169moReviewIntermediate
github-actions-templates73moNo flagsIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

Search skills

Search the agent skills registry