pr-creator
Creates a pull request from current changes, monitors GitHub CI, and debugs any failures until CI passes. Use this when the user says "create pr", "make a pr", "open pull request", "submit pr", or "pr for these changes". Does NOT merge - stops when CI passes and provides the PR link.
When & Why to Use This Skill
The PR Creator skill automates the end-to-end workflow of submitting code changes, from branch management and commits to monitoring GitHub CI pipelines. It proactively identifies and debugs CI failures, ensuring your pull requests are green and ready for review without manual intervention, significantly accelerating the development lifecycle.
Use Cases
- Automating the repetitive process of creating feature branches, staging changes, and opening pull requests after completing a task.
- Continuous monitoring of GitHub Actions workflows to automatically catch and resolve linting, typing, or test errors as they occur in the pipeline.
- Ensuring all pull requests meet organizational standards for commit messages and PR descriptions before they reach human reviewers.
- Streamlining the 'fix-and-retry' loop for CI failures by analyzing logs and pushing corrective commits until all checks pass.
| name | pr-creator |
|---|---|
| description | Creates a pull request from current changes, monitors GitHub CI, and debugs any failures until CI passes. Use this when the user says "create pr", "make a pr", "open pull request", "submit pr", or "pr for these changes". Does NOT merge - stops when CI passes and provides the PR link. |
PR Creator Skill
You are a developer preparing changes for review. Your job is to commit changes, create a PR, monitor CI, fix any failures, and notify the user when the PR is ready for merge.
Process
Step 1: Check Git Status
Run these commands to understand the current state:
git status
git diff --stat
git log --oneline -5
Verify before proceeding:
- There are changes to commit (staged or unstaged)
- You're on a feature branch (not main/master) OR need to create one
- The branch is not already ahead with unpushed commits that have a PR
If no changes exist:
- Inform the user: "No changes detected. Nothing to commit."
- Stop here.
Step 2: Create Branch (if needed)
If currently on main/master:
git checkout -b <descriptive-branch-name>
Branch naming convention:
feat/short-descriptionfor featuresfix/short-descriptionfor bug fixesrefactor/short-descriptionfor refactoringdocs/short-descriptionfor documentation
Step 3: Stage and Commit Changes
# Stage all changes
git add -A
# Review what's staged
git diff --cached --stat
# Create commit with descriptive message
git commit -m "$(cat <<'EOF'
<type>: <short summary>
<optional longer description>
EOF
)"
Commit message guidelines:
- Use conventional commits:
feat:,fix:,refactor:,docs:,test:,chore: - First line: 50 chars max, imperative mood
- Body: wrap at 72 chars, explain what and why
Step 4: Push Branch
git push -u origin <branch-name>
Step 5: Create Pull Request
gh pr create --title "<title>" --body "$(cat <<'EOF'
## Summary
<1-3 bullet points describing what this PR does>
## Changes
<list of key changes>
## Test Plan
<how to verify this works>
EOF
)"
Capture the PR URL from the output - you'll need it later.
Step 6: Monitor CI
Wait for CI to start, then monitor:
# List workflow runs for this PR
gh run list --branch <branch-name> --limit 5
# Watch a specific run (blocking)
gh run watch <run-id>
# Or check status without blocking
gh run view <run-id>
Poll every 30-60 seconds until CI completes.
Step 7: Handle CI Results
If CI Passes:
- STOP HERE - do not merge
- Report to user:
✅ PR is ready for review! **PR:** <url> **Branch:** <branch-name> **CI Status:** All checks passed The PR is ready to be reviewed and merged.
If CI Fails:
Get failure details:
gh run view <run-id> --log-failedAnalyze the failure:
- Identify which job/step failed
- Read the error message
- Determine the fix
Fix the issue:
- Make necessary code changes
- Stage and commit the fix:
git add -A git commit -m "fix: <what was fixed>" git push
Return to Step 6 - monitor the new CI run
Repeat until CI passes.
Step 8: Final Report
When CI passes, provide a summary:
## PR Ready for Review
**PR:** [#<number> <title>](<url>)
**Branch:** `<branch-name>` → `main`
**Commits:** <count>
**CI Status:** ✅ All checks passed
### Changes Included
- <change 1>
- <change 2>
### CI Runs
- Run #1: ❌ Failed (lint errors)
- Run #2: ❌ Failed (test failures)
- Run #3: ✅ Passed
### Next Steps
1. Request review from team
2. Address any review feedback
3. Merge when approved
**Note:** This PR has NOT been merged. Please review and merge manually.
Important Rules
- NEVER merge the PR - only create it and ensure CI passes
- NEVER force push unless explicitly asked
- NEVER push to main/master directly
- Continue fixing until CI passes - don't give up after one failure
- Preserve commit history - don't squash unless asked
Error Handling
Authentication issues:
gh auth status
If not authenticated, inform user to run gh auth login.
Branch conflicts:
git fetch origin main
git rebase origin/main
# or
git merge origin/main
Resolve conflicts if any, then continue.
PR already exists:
gh pr view --web
Inform user a PR already exists for this branch.
CI Debugging Tips
Common failures and fixes:
| Failure | Likely Cause | Fix |
|---|---|---|
| Lint errors | Code style violations | Run npm run lint -- --fix or equivalent |
| Type errors | TypeScript issues | Fix type annotations |
| Test failures | Broken tests | Fix tests or update snapshots |
| Build failures | Compilation errors | Fix syntax/import errors |
| Timeout | Slow tests | Optimize or increase timeout |
Read the logs carefully - the error message usually tells you exactly what's wrong.