gh-ci-pr Skill
This skill automates PR creation and CI visibility using gh.
When to use
- When you want Cursor to create a branch + PR with a proper task description.
- When CI runs are not visible in the editor and you want them fetched via
gh. - When CI fails and you want a "fix PR" that targets the same branch where the failure happened (NOT master/main).
Key rules / guarantees
- Never targets
master/mainunless the failure happened there. - A fix PR is created from the exact failing commit SHA and targets the same failing branch.
- Uses
gh run list/viewandgh apionly (no web scraping).
Inputs (ask user if missing)
- Repo (optional; defaults to current git remote)
- Base branch to scan (e.g.
release/v5.4,develop,feature/foo) - Optional: workflow name filter (if repo has many)
- Short task summary for PR body (ticket links, bullet points)
Workflow
- Scan CI runs for the chosen branch.
- If latest run is success: optionally create PR for current branch changes.
- If latest run is failure:
- Identify failing run + failing commit SHA
- Create fix branch from that SHA:
ci-fix/<branch>/<run_id> - Attempt local reproduction (run project tests/linters if known)
- Commit fixes
- Push fix branch
- Open PR: base = failing branch, head = fix branch
- PR body includes run link, failure summary, and what changed.
Scripts
scripts/ci_scan.sh <branch> [limit]scripts/fix_from_failure.sh <branch> [limit]scripts/pr_create.sh <base_branch> <head_branch> <title> <body_file>