skills/mine.create-pr/SKILL.md
Use when the user says: "create PR" or "open pull request". Reviews branch changes and creates a PR on GitHub or Azure DevOps.
npx skillsauth add NodeJSmith/Claudefiles mine.create-prInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
git branch --show-currentgit-default-branchgit remote get-url origin 2>/dev/nullgit-branch-loggit-branch-diff-statBased on the above changes:
git-platform. If output is unknown, inform the user the platform is unsupported and stop. If github, use gh CLI. If ado, use az CLI.git status to ensure no "Your branch is ahead" or "not yet pushed" messages)gh pr list --head <branch-name>az repos pr list --source-branch <branch-name> --status activegit loggit diff [base-branch]...HEAD to see all code changesrules/common/git-workflow.md (Task File Cleanup). If anything archives, commit it (chore: archive completed tasks) and push before creating the PR. If spec-helper archive --all exits non-zero, stop and report the error — do not proceed to create the PR.### H3 header followed by bullet points. Order sections from most to least impactful. Bullets should explain why a change was made, not just what changed — include motivation, tradeoffs, or decisions worth preserving for future readers. Exception: if the PR includes changes to ./design/ (ADRs, design docs, decision records), don't re-explain that reasoning in the PR body — just reference the document (e.g., "see design/adr-012-auth-approach.md"). Duplicating it risks going stale or conflicting. Collect small, standalone changes (one-liners that don't warrant their own section) into one or two ungrouped sections:
### Notable Changes (top) — small but important changes worth seeing first### Housekeeping (bottom) — minor cleanup, dependency bumps, typo fixes, etc.### Notable Changes
- Important small change and why it matters
### Feature name or area
- What changed and why this approach was chosen over alternatives
- Any tradeoff or decision future readers should know about
### Another significant area
- Change detail with motivation
### Housekeeping
- Bump dependency X to v2
- Fix typo in README
N):
N-description (e.g., 123-fix-null)issue-N or issue/Nfix/N-description, feat/N-description, chore/N-description, etc.git log output for GitHub closing keywords followed by an issue number (e.g., Fixes #123, Closes #123, Resolves #123). Do NOT match generic references like refs #123 — those do not close issues.Closes #N
Closes #N line per issue.get-skill-tmpdir mine-pr to create a temp directory, then write the PR body to <dir>/body.md and use that path in subsequent commandsgh-pr-create --draft --title "..." --body-file <tmpfile>
az repos pr create --draft true --title "..." --description "<body content>" --source-branch <branch> --target-branch <default-branch>
Do NOT use --description "$(cat <tmpfile>)" — command substitution is broken in the Bash tool eval wrapper.CHANGELOG.md using the ancestor-walk algorithm: walk upward from the current working directory one level at a time toward the repo root, checking each directory for CHANGELOG.md — the first one found is the nearest. If none found by walking up, run git ls-files '*CHANGELOG.md' and pick the result with the shortest relative path from CWD. If no CHANGELOG.md exists anywhere, suggest the user add one. Once located:
# (e.g., (#123)) — links to the PR(!123)) — links to the PR (# would link to a work item instead)gh pr view --json baseRefName --jq '.baseRefName'ado-api pr show --json | jq -r '.targetRefName' | sed 's|refs/heads/||'git diff origin/<base>...HEAD -- <changelog-path> to identify lines added in this branch- ) that does not already contain a PR reference ((#...) or (!...)), append (#<PR_NUMBER>) for GitHub or (!<PR_NUMBER>) for Azure DevOps to the end of the linechangelog: add PR #<NUMBER> for GitHub or changelog: add PR !<NUMBER> for Azure DevOpsCHANGELOG.md exists, suggest to the user that they add one to track notable changes per releasegh pr readyaz repos pr update --id <PR_ID> --draft falseYou have the capability to call multiple tools in a single response. Gather context first (steps 1-6), complete WP archival if needed (step 7), draft the PR body (step 8), then create the PR (step 9). Do not create multiple PRs.
Important:
--body-file (GitHub) to avoid command substitutionAzure DevOps notes:
https://dev.azure.com/{org}/{project}/_git/{repo})--auto-complete or --delete-source-branch flags — just create the PRaz repos pr create command returns JSON; extract the PR URL from the responsedevelopment
Use when the user says: "document how X works", "write up how this works", "durable explanation", "explain this for the docs", "document this subsystem". Writes a durable, architectural-altitude explanation that survives code churn.
development
Use when picking up a fresh session after /clear, a stop, or an unanswered AskUserQuestion. Reconstructs the prior session's intent from its transcript tail and surfaces any unresolved decision; user-invoked only — for a hand-written end-of-day handoff use /mine-good-morning instead.
development
Use when the user says: "what did we discuss", "continue where we left off", "remember when", "as I mentioned", "you suggested", "we decided", "search my conversations", "find the conversation where", "what did we work on", or uses implicit signals like past-tense references, possessives without context, or assumptive questions. Direct search over past Claude Code sessions via cass.
tools
Use when the user says: "what context do I have", "relevant history for this task", "what have we done related to this". Also usable proactively when starting work that likely has prior history. Assembles a structured context brief from past session history via cass, scoped to the current task and workspace.