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.zipInstalls 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 correspondingKey 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
When to use push
- →Publish updates
- →Create pull request
- →Push local branch
About this skill
Push
Prerequisites
ghCLI is installed and available inPATH.gh auth statussucceeds for GitHub operations in this repo.
Goals
- Push current branch changes to
originsafely. - 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
- Identify the current branch and confirm the remote state.
- Run the required validation for the scope.
- Push the branch to
originwith upstream tracking if needed. - If push is rejected because the remote moved, run the
pullskill, rerun validation, and push again. - If push fails because of auth, permissions, or repo rules, stop and surface the exact error.
- 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.
- Write or update a clear PR title and body that match the current diff.
- 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-leaseonly when local history was intentionally rewritten. - Distinguish sync problems from auth or permission problems. Use the
pullskill 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
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.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| push (this skill) | 0 | 2mo | Review | Beginner |
| github-workflow-automation | 11 | 2mo | Review | Advanced |
| testing-workflow | 16 | 9mo | Review | Intermediate |
| github-actions-templates | 7 | 3mo | No flags | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by sushaantu
View all by sushaantu →You might also like
github-workflow-automation
ruvnet
Advanced GitHub Actions workflow automation with AI swarm coordination, intelligent CI/CD pipelines, and comprehensive repository management
testing-workflow
amo-tech-ai
Comprehensive testing workflow for E2E, integration, and unit tests. Use when testing applications layer-by-layer, validating user journeys, or running test suites.
github-actions-templates
wshobson
Create production-ready GitHub Actions workflows for automated testing, building, and deploying applications. Use when setting up CI/CD with GitHub Actions, automating development workflows, or creating reusable workflow templates.
glab
NikiforovAll
Expert guidance for using the GitLab CLI (glab) to manage GitLab issues, merge requests, CI/CD pipelines, repositories, and other GitLab operations from the command line. Use this skill when the user needs to interact with GitLab resources or perform GitLab workflows.
create-pr
n8n-io
Creates GitHub pull requests with properly formatted titles that pass the check-pr-title CI validation. Use when creating PRs, submitting changes for review, or when the user says /pr or asks to create a pull request.
gh-fix-ci
openai
Use when a user asks to debug or fix failing GitHub PR checks that run in GitHub Actions; use `gh` to inspect checks and logs, summarize failure context, draft a fix plan, and implement only after explicit approval. Treat external providers (for example Buildkite) as out of scope and report only the details URL.