Pull Request Workflow
Create GitHub pull requests with semantic change analysis, intelligent defaults, and minimal friction.
Validate Prerequisites
See context.md > Auth Validation for GitHub authentication. The repository context read below is the auth check.
Collect repo context once (also confirms the repo and remote exist):
<skill-dir>/scripts/yeet-context.sh repoResolve <skill-dir> to the absolute directory containing the owning SKILL.md. Before pushing or creating the PR,
load posting.md > External-disclosure Review and review the exact title, body, reviewers, labels, and branch contents
that will be published.
Use repository.defaultBranchRef.name as the default base branch unless args specify a base.
Parse Arguments Naturally
- "draft" or "--draft" → draft mode
- "test-plan" or "--test-plan" → include test plan section
- "to X" or "base=X" → target branch X (default: repo default branch)
- If no base was passed, use
repository.defaultBranchRef.namefrom repo context - "review=X" or "reviewers=X" → add reviewer(s)
- Quoted text → custom title
- Everything else → additional context for description
Fetch Base And Check Commits
Fetch the selected base branch only:
git fetch origin "+refs/heads/$base_branch:refs/remotes/origin/$base_branch"- Commits ahead:
git rev-list --count origin/$base_branch..HEAD 2>/dev/null - IF 0 commits: ERROR "No commits to create PR from"
Semantic Change Analysis
Follow the process in writing.md > Semantic Change Analysis. Write the title and body in the voice from
writing.md > Informal Tone.
Test Plan (only if --test-plan flag): Add a "## Test Plan" section with testing/validation approach, manual steps,
or checklist.
Identify reviewers:
- Check for CODEOWNERS file:
git ls-files | rg CODEOWNERS - If exists, extract owners for changed files
- Otherwise use git blame for frequent contributors
- Combine with reviewers from arguments
Use an admonition only for a material warning that would otherwise be missed.
Issue linking: If an issue number was referenced in the conversation (e.g., "fixes #42", "for issue #100"), append
Closes #NUMBER to the PR body so the issue auto-closes on merge.
Check for Existing PR
BRANCH=$(git branch --show-current)
gh pr list --state all --head "$BRANCH" --json number,url --jq '.[0]' 2>/dev/nullIF existing PR found: ERROR "PR already exists for this branch: $URL". Do not create or update.
Create New PR
Push branch:
git push -u origin "$BRANCH"Create PR:
gh pr create \
--title "$generated_title" \
--body "$generated_body" \
--base "$base_branch" \
$(test "$draft_mode" = "true" && echo "--draft") \
$(test -n "$reviewers" && echo "--reviewer $reviewers")Display the verified URL with the ### 🚀 PR created receipt from SKILL.md.
On failure: check the specific error (auth, branch protection, validation) and follow posting.md > Error Handling and Idempotency — run the idempotency check before any retry.