Loading...
Loading...
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.
npx skill4agent add neonwatty/claude-skills pr-creator[Main Task] "Create PR: [branch-name]"
└── [CI Task] "CI Run #1" (status: failed, reason: lint errors)
└── [Fix Task] "Fix: lint errors"
└── [CI Task] "CI Run #2" (status: failed, reason: test failures)
└── [Fix Task] "Fix: test failures"
└── [CI Task] "CI Run #3" (status: passed)1. Call TaskList to check for existing PR tasks
2. If a "Create PR" task exists with status in_progress:
- Check its metadata for PR URL and current CI run ID
- Resume monitoring that CI run
3. If CI tasks exist, check their status to understand current state
4. If no tasks exist, proceed with fresh executionTaskCreate:
- subject: "Create PR: [branch-name or 'pending']"
- description: |
Create pull request from current changes.
Starting: git status check
- activeForm: "Checking git status"
TaskUpdate:
- taskId: [pr task ID]
- status: "in_progress"git status
git diff --stat
git log --oneline -5TaskUpdate:
- taskId: [pr task ID]
- subject: "Create PR: [actual-branch-name]"
- metadata: {"branch": "[branch-name]", "changesDetected": true}git checkout -b <descriptive-branch-name>feat/short-descriptionfix/short-descriptionrefactor/short-descriptiondocs/short-description# 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
)"feat:fix:refactor:docs:test:chore:git push -u origin <branch-name>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
)"TaskUpdate:
- taskId: [pr task ID]
- metadata: {
"prUrl": "https://github.com/owner/repo/pull/123",
"prNumber": 123,
"prTitle": "[title]",
"commits": [count]
}TaskCreate:
- subject: "CI Run #[N]: monitoring"
- description: |
Monitoring CI run for PR #[number]
Run ID: [run-id]
Started: [timestamp]
- activeForm: "Monitoring CI Run #[N]"
TaskUpdate:
- taskId: [ci task ID]
- addBlockedBy: [pr task ID] # Links CI run to main PR task
- status: "in_progress"# 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>TaskUpdate:
- taskId: [ci task ID]
- metadata: {"runId": "[run-id]", "status": "running"}TaskUpdate:
- taskId: [ci task ID]
- subject: "CI Run #[N]: passed ✅"
- status: "completed"
- metadata: {"runId": "[run-id]", "status": "passed", "completedAt": "[timestamp]"}TaskUpdate:
- taskId: [pr task ID]
- metadata: {"ciStatus": "passed", "ciRunCount": [N]}✅ PR is ready for review!
**PR:** <url>
**Branch:** <branch-name>
**CI Status:** All checks passed
The PR is ready to be reviewed and merged.TaskUpdate:
- taskId: [ci task ID]
- subject: "CI Run #[N]: failed ❌"
- status: "completed"
- metadata: {"runId": "[run-id]", "status": "failed", "failureReason": "[brief reason]"}gh run view <run-id> --log-failedTaskCreate:
- subject: "Fix: [failure reason]"
- description: |
Fixing CI failure from Run #[N]
Failure: [detailed error]
Files to modify: [list if known]
- activeForm: "Fixing [failure reason]"
TaskUpdate:
- taskId: [fix task ID]
- addBlockedBy: [ci task ID] # Links fix to the failed CI run
- status: "in_progress"git add -A
git commit -m "fix: <what was fixed>"
git pushTaskUpdate:
- taskId: [fix task ID]
- status: "completed"
- metadata: {"filesModified": ["file1.ts", "file2.ts"], "commitHash": "[hash]"}TaskUpdate:
- taskId: [pr task ID]
- status: "completed"
- metadata: {
"prUrl": "[url]",
"prNumber": [number],
"branch": "[branch-name]",
"ciStatus": "passed",
"ciRunCount": [N],
"merged": false
}TaskList## 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
[Generated from CI run tasks:]
- Run #1: ❌ Failed (lint errors) → Fixed in commit [hash]
- Run #2: ❌ Failed (test failures) → Fixed in commit [hash]
- Run #3: ✅ Passed
### Fixes Applied
[Generated from fix tasks:]
- Fix: lint errors - modified [files]
- Fix: test failures - modified [files]
### 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.TaskList shows:
├── PR task in_progress, no CI tasks
│ └── PR was created, start monitoring CI (Step 6)
├── PR task in_progress, CI task in_progress
│ └── Resume monitoring CI run from task metadata runId
├── PR task in_progress, CI task failed, no fix task
│ └── Analyze failure and create fix task (Step 7)
├── PR task in_progress, fix task in_progress
│ └── Continue fixing, then push and monitor new CI run
├── PR task completed
│ └── PR is done, show final report
└── No tasks exist
└── Fresh start (Step 1)1. Get runId from latest CI task metadata
2. Check if run is still active: gh run view <runId>
3. If still running, continue monitoring
4. If completed, process result (Step 7)
5. If new run started, create new CI task and monitor thatResuming PR creation session:
- PR: [url from task metadata]
- Branch: [branch from task metadata]
- CI Runs: [count] attempts
- Current state: [in_progress task description]
- Resuming: [next action]gh auth statusgh auth logingit fetch origin main
git rebase origin/main
# or
git merge origin/maingh pr view --web| Failure | Likely Cause | Fix |
|---|---|---|
| Lint errors | Code style violations | Run |
| 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 |