Generate PR Description
You are tasked with generating a comprehensive pull request description following the repository's standard template.
Steps to follow:
-
Read the PR description template:
- Read the repository's PR template at
pull_request_template.md
- If it doesn't exist, inform the user that the repository is missing a PR template
- Read the template carefully to understand all sections and requirements
-
Identify the current branch and changes:
- Get current branch:
git branch --show-current
- If on develop/main branch, inform user they should be on a feature branch
- Determine base branch (usually develop, sometimes main):
git merge-base develop HEAD
- Identify all changes:
git diff develop...HEAD
-
Check for existing description:
- Check if
thoughts/shared/prs/{branch_name}_description.md already exists
- If it exists, read it and inform the user you'll be updating it
- Consider what has changed since the last description was written
-
Gather comprehensive change information:
- Get the full diff:
git diff develop...HEAD
- Get list of changed files:
git diff --name-only develop...HEAD
- Get commit history:
git log develop..HEAD --oneline
- Get commit details if needed:
git log develop..HEAD --format="%h %s %an"
- Identify base branch:
git merge-base develop HEAD (fallback to main if develop doesn't exist)
-
Analyze the changes thoroughly: (ultrathink about the code changes, their architectural implications, and potential impacts)
- Read through the entire diff carefully
- For context, read any files that are referenced but not shown in the diff
- Understand the purpose and impact of each change
- Identify user-facing changes vs internal implementation details
- Look for breaking changes or migration requirements
-
Generate the PR title and description:
- Generate a concise PR title:
- Format:
type(scope): brief description (e.g., feat(auth): add OAuth2 support)
- Use conventional commit prefixes:
feat, fix, refactor, docs, test, chore, perf
- Keep under 72 characters
- Be specific but concise about the main change
- Fill out each section from the template thoroughly:
- Answer each question/section based on your analysis
- Be specific about problems solved and changes made
- Focus on user impact where relevant
- Include technical details in appropriate sections
- Write a concise changelog entry
- Ensure all checklist items are addressed (checked or explained)
- IMPORTANT: Keep within character limits if your platform has them
- Check character count:
wc -c {file_path}
- If over limit, condense sections while keeping essential information
-
Save the title and description:
- Write the completed description to
thoughts/shared/prs/{branch_name}_description.md
- Include the PR title at the top of the file as:
# PR Title: {title}
- Show the user both the generated PR title and description
-
Provide instructions:
- Show the user the file location:
thoughts/shared/prs/{branch_name}_description.md
- Display the PR title prominently so it can be easily copied
- Instruct them to copy the title and description when creating their PR
- If any verification steps remain unchecked, remind the user to complete them before creating the PR
Important notes:
- This skill generates descriptions for current branch changes (before PR creation)
- Always read the local
pull_request_template.md template
- Be thorough but scannable - prioritize essential information
- Focus on the "why" as much as the "what"
- Include any breaking changes or migration notes prominently
- If the changes touch multiple components, organize the description accordingly
- Always attempt to run verification commands when possible
- Clearly communicate which verification steps need manual testing
- User will copy the generated description to their PR platform when creating the PR
Command Execution Guidelines:
- Handle command failures gracefully: If a command fails, document the failure and continue