Push pr

From sapiencexyz/sapience · View interactive version

Push pr is an AI agent skill from the GitHub repository sapiencexyz/sapience. Push current branch and create a GitHub PR if one doesn't exist

How to use this skill

Skill file

Push and Create PR

Steps

  1. Parse the target branch (the branch to open a PR against) from the arguments. Pull latest for that branch before doing anything. Always create a new branch from the target branch — do not continue on the current branch.
  2. If there are uncommited files, commit them, adding an appropriate commit message of a short to medium length.
  3. Lint and build the affected packages. API build might fail because of Sentry misconfiguration - ignore that. Otherwise, try to lint and build everything.
  4. Run the tests. If those fail - stop the execution of the following steps and propose steps to resolve the issue.
  5. Get the current branch name with git rev-parse --abbrev-ref HEAD
  6. Push the branch: git push -u origin "$BRANCH"
  7. Check if a PR already exists: gh pr list --head "$BRANCH" --json number,url --jq '.[0]'
  8. If no PR exists:
  1. If a PR already exists:

PR format

Use this format for gh pr create:

gh pr create --title "short title under 70 chars" --body "$(cat <<'EOF'
## Summary
<detailed summary of what changed, why, tradeoffs if needed>

## Test plan
- [ ] relevant test checklist items
EOF
)"

Rules

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.