| name | wild-pr |
| description | Open a PR for the current branch using summary-writer for the title/body, then run babysit up to three times (stop early on clean). Use when the user says /wild-pr, "create a PR and babysit", "open a PR and babysit", or wants create-then-tend in one shot. |
| user-invocable | true |
| disable-model-invocation | true |
| argument-hint | [optional base branch or extra gh pr create flags] |
/wild-pr — create PR, then babysit ×3
Open a PR for the current branch, write its description with summary-writer, then tend it with babysit up to three times (stop early if a pass exits clean).
Dependencies (must be available this session):
summary-writer (this plugin) — description + title
babysit (this plugin) — CI + review tending
If either skill is missing, stop and tell the user what to install. Do not invent a substitute description format or a hand-rolled babysit loop.
Arguments: $ARGUMENTS — optional base branch name, or extra flags to pass through to gh pr create (e.g. --draft). Only pass values that are valid gh pr create flags or a base branch name — do not dump free-form prose into the create command.
Composing other skills
For each dependency skill or command:
- Locate its installed
SKILL.md or commands/*.md (plugin cache, marketplace checkout, or session skill list).
- Read that file with the Read tool — do not rely on memory or a paraphrase.
- Execute it fully, then return here to the next phase.
Don't paraphrase either dependency from memory. Don't skip the Read step even if you have used it before in this conversation.
When invoking babysit, treat the captured PR URL (or number) as the command's argument text — as if the user had run /wild-pr:babysit <url>. That feeds its Setup parser so it targets the right PR.
Phase 1 — Preflight
Run in parallel:
git status --short
git branch --show-current
git status --short --branch
gh repo view --json defaultBranchRef --jq .defaultBranchRef.name
git rev-parse --abbrev-ref HEAD@{upstream} 2>/dev/null
gh pr view --json number,url,state 2>/dev/null
Resolve the repo's actual default branch from gh repo view (fallback: git symbolic-ref refs/remotes/origin/HEAD). Do not hard-code main / master.
Stop and report if:
- Not on a git repo, or on the repository's default branch with no feature branch.
- An open PR already exists for this branch — print its URL and ask whether to (a) skip create and only run the babysit loop on it, or (b) abort. Do not open a duplicate.
- If (a): capture that PR's URL/number, run Commit uncommitted work (if dirty) below, then the push step if needed, skip Phases 2–3 entirely, and jump to Phase 4 with that URL as the babysit target.
- If (b): stop. Do not continue.
Commit uncommitted work (if dirty)
If git status --short shows changes, commit them before push/create so nothing is left out of the PR.
Run in parallel:
git status
git diff
git diff --cached
git log --oneline -5
Stop and ask the user only if staged or unstaged changes look like secrets (.env, credentials, tokens, private keys). Do not commit those files.
Otherwise:
- Stage the relevant changes (
git add for modified/untracked files that belong in the PR — not secrets or local-only scratch).
- Draft a concise commit message from the diff and recent
git log style (1–2 sentences, focus on why).
- Commit with a heredoc so quotes and metacharacters stay literal:
git commit -m "$(cat <<'EOF'
<commit message>
EOF
)"
- If the commit fails (e.g. pre-commit hook rejected the commit), fix the issue and create a new commit — do not amend unless you created the prior commit in this same
/wild-pr run and it has not been pushed.
- After every successful commit, re-check
git status --short. For remaining dirty files:
- Re-run the secret check from above; stop and ask the user if any path looks like secrets.
- Stage any remaining dirty files that belong in the PR (same criteria as step 1 — not secrets or local-only scratch), whether hook-touched or not.
- If any dirty files remain that are unrelated to this run (disjoint paths, pre-existing work the user had before
/wild-pr started), stop and report instead of continuing to push.
- Otherwise commit the follow-up changes and repeat this status check until the tree is clean.
Then continue to the push step below.
Push when the branch has no upstream, or when local HEAD is ahead of its upstream (use git status --short --branch or git rev-list --left-right --count @{upstream}...HEAD). An upstream existing is not enough — unpushed local commits must land before create and before a babysit-only jump to Phase 4 (option (a)):
git push -u origin HEAD
Phase 2 — Description via summary-writer
- Compose summary-writer per Composing other skills above.
- That skill produces a title and body. Because no PR exists yet, take the title and body it hands off — do not offer an edit confirmation loop here;
/wild-pr means create now.
- Respect repo conventions summary-writer already covers (conventional titles when the repo uses them, no "Generated with Claude" footers, no Co-Authored-By trailers).
Phase 3 — Create the PR
Build the create invocation shell-safely — do not interpolate the title into an unquoted string, and do not expand $ARGUMENTS unquoted. Don't assign the title with TITLE='…' — a single quote inside the title (common in conventional commits) terminates the string early.
TITLE=$(cat <<'TITLE_EOF'
<title from summary-writer>
TITLE_EOF
)
CREATE_ARGS=()
gh pr create --title "$TITLE" "${CREATE_ARGS[@]}" --body-file - <<'EOF'
<body>
EOF
Notes:
--body-file - with a single-quoted heredoc keeps $, backticks, and quotes in the body literal.
- Quote
"$TITLE" at the gh call so spaces and metacharacters do not word-split.
- Capture the PR URL from
gh pr create output (or gh pr view --json url -q .url right after).
Print the PR URL, then continue — do not wait for the user.
Phase 4 — Babysit up to 3 times
/wild-pr owns the outer babysit loop. Run babysit on the PR from Phase 3 (or the existing PR URL from preflight option (a)), up to three sequential passes.
babysit's own Loop control may say "tell the user to re-run" or "wrap with /loop" on a progressing exit. Ignore that advice while inside /wild-pr — continue to the next pass yourself until you hit 3 passes or an early-exit condition below.
For each pass N in 1..3:
- Compose babysit per Composing other skills, with the captured PR URL as its argument.
- After the pass finishes, note its stop condition (
clean / progressing / stuck).
- Early exit (clean): if the pass exits clean, stop the loop. Do not run remaining passes.
- Stuck — soft vs hard:
- Soft stuck (CI still pending after watch timeout, or similar "re-run could help"): count the pass, then continue to the next pass immediately.
- Hard stuck (auth/infra/external check/diagnosis-only with nothing actionable): stop the loop and report. Do not burn remaining passes.
- Progressing: count the pass and start the next one immediately. CI wait lives inside babysit's own
gh pr checks --watch, not between passes.
After the loop (3 passes or early clean/hard-stuck stop), summarize:
- PR URL
- How many babysit passes ran, and each pass's stop condition
- Commits / replies made across passes (URLs if any)
- Anything still open (failing CI, deferred follow-ups, stuck reason)
Rules
Do:
- Commit uncommitted work during preflight when the tree is dirty (except suspected secrets) —
/wild-pr should not stop with local changes still on disk.
- Use summary-writer for every title/body — never a changelog-style stub.
- Use babysit for tending — never a hand-rolled "check CI and reply" shortcut.
- Push when the branch has no upstream, or when local
HEAD is ahead of its upstream — before create and before a babysit-only jump to Phase 4 (same rule as Phase 1).
- Return the PR URL in the final summary.
- Own the outer babysit loop: on
progressing or soft stuck, run the next pass yourself.
Don't:
- Don't open a second PR when one already exists for the branch.
- Don't commit files that look like secrets — stop and ask the user instead.
- Don't run more than three babysit passes in this skill, even if the PR is still progressing.
- Don't stop after a
progressing exit to wait for the user or suggest /loop — continue to the next pass until 3 or early exit.
- Don't paraphrase summary-writer or babysit from memory — Read each skill's SKILL.md (or babysit's command file) before executing it.
- Don't append "Generated with Claude" footers or Co-Authored-By trailers.