push-pr
Skill31 starsChanged 6 months agoMITView on GitHub
Commits changes, pushes to remote, and creates or updates a pull request for the current branch. Use when the user says "push pr", "create pr", "push and create pr", or invokes "codagent:push-pr".
- Reads credentials
- Commits and pushes
We split this skill into the rules it gives an agent
14 rules. About 0 are common, 11 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈11
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 10
Commit all changes, push to the remote, and create or update the pull request for the current branch.
- Distinctive: line 22
If there are changes, create a commit:
- Distinctive: line 23
Run git diff --staged and git diff to see what's changed
- Very specific: line 26
Commit with: git commit -m "message".
- Distinctive: line 27
If there are no changes, proceed to push check
- Distinctive: line 32
If push fails, show the error and stop
- Distinctive: line 36
If the command fails for auth, network, API, or another error, report stderr and stop
- Distinctive: line 37
If the output is invalid JSON or contains more than one open PR, report the unexpected state and stop
- Distinctive: line 38
If exactly one open PR exists, use it.
- Very specific: line 40
Check if there are new commits by comparing current HEAD with PR's headRefOid
- Distinctive: line 41
If new commits exist:
- Very specific: line 45
Update the PR: gh pr edit <pr-number> --body "updated description"
- Distinctive: line 47
If no new commits: print "PR already exists: <url>"
- Distinctive: line 65
Always include the PR URL in the final output
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
codagent:push-pr
Commit all changes, push to the remote, and create or update the pull request for the current branch.
Steps
- Run validator detection
- Run
agent-validator detect 2>&1 - Exit 0 → gates would run, invoke
agent-validator:validator-runskill and wait for it to pass before proceeding - Exit 2 → no gates would run (no changes or no applicable gates), skip to Step 2
- Exit 1 → error, report the error to the user and stop
- Any other exit code → treat as error, report output to the user, and stop
- Run
- Check for uncommitted changes using
git status --porcelain- If there are changes, create a commit:
- Run
git diff --stagedandgit diffto see what's changed - Generate a concise, descriptive commit message based on the changes
- Stage changed files by name (avoid staging sensitive files like
.envor credentials) - Commit with:
git commit -m "message"; add-m "Co-Authored-By: <Name> <email>"only when the co-author identity is explicitly configured or provided by the user
- Run
- If there are no changes, proceed to push check
- If there are changes, create a commit:
- Push to remote
- Get current branch:
git branch --show-current - Push with upstream tracking:
git push -u origin <branch> - If push fails, show the error and stop
- Get current branch:
- Check if PR exists
- Query the current branch explicitly:
gh pr list --head <branch> --state open --json url,title,state,number,headRefOid --limit 2 - If the command fails for auth, network, API, or another error, report stderr and stop
- If the output is invalid JSON or contains more than one open PR, report the unexpected state and stop
- If exactly one open PR exists, use it; do not let a prior closed or merged PR substitute for it
- If PR exists and is OPEN:
- Check if there are new commits by comparing current HEAD with PR's
headRefOid - If new commits exist:
- Get default branch:
gh repo view --json defaultBranchRef --jq .defaultBranchRef.name - Get all commits for the description:
git log <default-branch>..HEAD --oneline - Regenerate the PR description based on all commits (including the new ones)
- Update the PR:
gh pr edit <pr-number> --body "updated description" - Print: "PR updated with new commits:
<url>"
- Get default branch:
- If no new commits: print "PR already exists:
<url>"
- Check if there are new commits by comparing current HEAD with PR's
- If no open PR exists:
- Optionally query
gh pr list --head <branch> --state allfor context. TreatCLOSEDandMERGEDas terminal history, not as the current PR. - Print that no open PR exists and create a new PR using the steps below.
- Get default branch:
gh repo view --json defaultBranchRef --jq .defaultBranchRef.name - Get commit history for PR description:
git log <default-branch>..HEAD --oneline - Generate a clear PR title and description based on the commits and change context
- Create PR:
gh pr create --base <default-branch> --title "title" --body "description" - Print the PR URL
- Optionally query
- Query the current branch explicitly:
- Print the PR URL at the end so it's easy to find
Notes
- Operates on the current branch — does NOT create or switch branches
- Uses descriptive commit messages that explain the "why" not just the "what"
- PR descriptions should summarize the changes and their purpose
- Always include the PR URL in the final output
- Can be invoked standalone at any point without prior workflow state
- A merged or closed PR for the current branch never prevents creating a new open PR
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- kaeawc/auto-mobile★ 54same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository30 other files it gives its agents.
- AGENTS.mdAGENTS.md
- docs/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- releaseSkill
- releaseSkill
- ask-questionsSkill
- call-agentSkill
- designSkill
- finalize-prSkill
- fix-prSkill
- handoffSkill
- implement-changeSkill
- initSkill
- orchestrate-changeSkill
- plan-tasksSkill
- prepare-acceptanceSkill
- proposal-reviewSkill
- proposeSkill
- review-approachSkill
- review-assumptionsSkill
- review-specSkill
- review-tasksSkill
- session-reportSkill
- simple-planSkill
- specSkill
- task-complianceSkill
- test-flowsSkill
- test-planSkill
- verify-behaviorSkill
- wait-ciSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

