| name | pr-preparer |
| description | Analyzes git branch diffs (added, modified, deleted files) against the default or target branch, and generates a conventional commit title, PR title, and formatted markdown PR description for copy-pasting to GitHub. Use when the user asks to prepare a PR, generate a PR description, generate a commit message, summarize branch changes, or create a PR template. |
PR Preparer Skill
This skill guides the AI assistant in comparing the current branch against the base/default branch (develop, main, master), analyzing all added, modified, and deleted files, and generating a conventional commit title, PR title, and a comprehensive, GitHub-ready markdown PR description.
Workflow Steps
Step 1: Determine the Base Branch & Diff Scope
- Identify the current branch and default target branch:
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
BASE_BRANCH=$(gh pr view --json baseRefName --jq '.baseRefName' 2>/dev/null || git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's@refs/remotes/origin/@@' || echo "develop")
- Empty Diff & Branch Validation Check:
-
Run a diff check against $BASE_BRANCH and working directory:
BRANCH_DIFF=$(git diff --name-only "$BASE_BRANCH"...HEAD)
WORKING_DIFF=$(git status -s)
-
Case A: Zero changes anywhere (branch is identical to base & working tree is clean):