Generate PR Description
Overview
This skill analyzes git changes between branches to generate professional, concise PR descriptions following a standardized format. It examines commits, diffs, and change patterns to automatically categorize changes into actionable tasks and important notes, with optional architectural diagrams.
When to Use This Skill
Invoke this skill when:
- Creating a pull request and need a description
- Want to document changes before creating PR
- Need to summarize branch work for review
- Generating release notes from changes
- Understanding what changed in a branch
Output Format
The skill generates markdown in this exact format:
## Tasks
- [Action verb] [high-level change description]
- [Action verb] [another top-level change]
- [Action verb] [change with sub-items if scope is large]
- [Sub-item describing specific aspect of parent change]
- [Another sub-item for the same parent change]
## Notes
- **[Topic Category]**: [One-sentence description of important context, gotcha, or consideration]
- **[Another Category]**: [Additional information developers need when integrating these changes]
## Diagram
[Optional Mermaid diagram showing architecture/flow/structure of PR changes - only include when 5+ files changed or architectural changes made]
Action verbs: Add, Update, Fix, Remove, Refactor, Migrate, Deprecate
Topic categories: Breaking Change, Migration Required, Configuration, Dependencies, Performance, Security, Testing, etc.
Workflow
Step 1: Branch Detection and Validation
- Identify current branch
- Detect base branch automatically:
- Check
origin/HEAD default branch
- Look for common branches (main, master, develop)
- Prompt user if ambiguous
- Validate both branches exist
Git Commands:
# Current branch
git branch --show-current
# Default base
git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's@^refs/remotes/origin/@@'
# Available branches
git branch -r | grep -E 'origin/(main|master|develop)'
Step 2: Gather Change Information
Collect comprehensive git information in parallel:
Commit History:
git log [base]..HEAD --format="%h %s%n%b%n---"
Change Statistics:
git diff [base]...HEAD --stat
git diff [base]...HEAD --name-status
Full Diff:
git diff [base]...HEAD
Step 3: Analyze Changes
Task Categorization:
- Group files by module/directory
- Identify functional areas (auth, api, ui, database, tests)
- Detect new features, updates, fixes, refactors
- Analyze commit messages for intent
- Create hierarchical task list
Note Extraction:
- Scan commits for keywords:
- "breaking", "deprecated", "migration"
- "security", "performance", "gotcha"
- "config", "environment", "setup"
- Identify breaking changes from:
- Removed functions/exports
- Changed function signatures
- API endpoint changes
- Detect dependencies:
- package.json changes
- New imports
- Spot configuration needs:
- .env changes
- Config file updates
Diagram Assessment:
- Count files changed
- Detect architectural patterns:
- New component interactions
- Data flow changes
- API additions/changes
- State management updates
- Decide diagram type and necessity
Step 4: Generate Markdown
Tasks Section:
- Use concise bullet points
- Group related changes
- Indent sub-items for large scopes
- Lead with verb (Add, Update, Fix, Remove, Refactor)
- Focus on WHAT changed
- Keep tasks at feature/module level - DO NOT enumerate details
- ❌ BAD: "Implement GammaApi client with 17 endpoints (status, teams, sports, tags, events, markets...)"
- ✅ GOOD: "Implement GammaApi client"
- Don't list specific functions, endpoints, components, or implementation details
- Tasks describe the change, not every aspect of it
Notes Section:
- Bold topic headings
- One-sentence descriptions
- Include only developer-impacting information:
- Breaking changes
- Migration steps required
- Configuration needs (env vars, config files)
- New dependencies
- Performance implications that affect usage
- Security considerations
- EXCLUDE implementation details visible in code:
- ❌ BAD: "Architecture: Uses result type pattern ({ ok: true, data } | { ok: false, error })"
- ❌ BAD: "Implementation: Uses factory pattern for service creation"
- ❌ BAD: "Code structure: Separates concerns into modules"
- These are visible in code review - don't waste note space on them
- Focus on information that requires developer action or awareness
Diagram Section:
- Use mermaid syntax
- Choose appropriate type:
flowchart TD for flows
sequenceDiagram for interactions
classDiagram for structure
stateDiagram-v2 for states
- Keep concise (< 15 nodes)
- Label clearly
- Show only PR changes, not entire system
Step 5: Present and Refine
- Output raw markdown wrapped in a markdown code fence (
markdown ... )
- This makes the output copy-pastable - user can select and copy the raw markdown syntax directly
- Do NOT output formatted/rendered markdown - output the raw text
- Verify accuracy with user
- Offer refinements if needed
- Ready to paste into GitHub PR
Examples
Example 1: Feature Addition
User request: "Generate PR description for my feature branch"
Process:
- Detect branches:
feature/user-auth → main
- Find commits: 8 commits about authentication
- Analyze files: auth/, api/auth.ts, components/LoginForm.tsx
- Generate:
- Tasks: Add user authentication, Add login form, Add auth middleware
- Notes: Requires AUTH_SECRET env var, Breaking: /login endpoint moved
- Diagram: Sequence diagram showing auth flow
Example 2: Bug Fix
User request: "/generate-pr-description"
Process:
- Detect branches:
fix/memory-leak → develop
- Find commits: 2 commits fixing memory issue
- Analyze files: utils/cache.ts, tests/cache.test.ts
- Generate:
- Tasks: Fix memory leak in cache, Add cache cleanup tests
- Notes: Performance: Memory usage reduced by 40% (Note: Only include notes with developer impact - omit if no breaking changes or config needed)
- Diagram: None (simple fix, < 5 files)
Example 3: Refactor
User request: "Generate description comparing to main"
Process:
- Detect branches:
refactor/api-layer → main
- Find commits: 15 commits restructuring API
- Analyze files: api/, services/, types/, tests/
- Generate:
- Tasks: Refactor API layer (service extraction, type updates, test updates)
- Notes: Breaking: Import paths changed, Migration: Update imports from api/* to services/*
- Diagram: Class diagram showing new service architecture
Best Practices
Analysis Quality
- Read ALL commits in range, not just latest
- Consider file locations for context
- Check for implicit breaking changes
- Verify test coverage changes
- Note dependency updates
Description Conciseness
- Target: 5-10 task items
- Target: 2-5 note items
- One sentence per item
- Technical audience (skip fluff)
- Action-oriented language
Diagram Guidelines
- Only when adding clarity
- Focus on new/changed parts
- Keep < 15 nodes
- Use standard mermaid syntax
- Label clearly
- Show relationships, not every detail
Token Efficiency
- Don't fetch full diff if > 10K lines
- Summarize large refactors
- Focus on public API changes
- Skip cosmetic changes in summary
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: generate-pr-description3description: Generate concise, technically-focused PR descriptions by analyzing git diff between base and current branch. Creates structured markdown with tasks, notes, and optional diagrams ready for GitHub. Use when this capability is needed.4---56# Generate PR Description78## Overview910This skill analyzes git changes between branches to generate professional, concise PR descriptions following a standardized format. It examines commits, diffs, and change patterns to automatically categorize changes into actionable tasks and important notes, with optional architectural diagrams.1112## When to Use This Skill1314Invoke this skill when:1516- Creating a pull request and need a description17- Want to document changes before creating PR18- Need to summarize branch work for review19- Generating release notes from changes20- Understanding what changed in a branch2122## Output Format2324The skill generates markdown in this exact format:2526```markdown27## Tasks28- [Action verb] [high-level change description]29- [Action verb] [another top-level change]30- [Action verb] [change with sub-items if scope is large]31 - [Sub-item describing specific aspect of parent change]32 - [Another sub-item for the same parent change]3334## Notes35- **[Topic Category]**: [One-sentence description of important context, gotcha, or consideration]36- **[Another Category]**: [Additional information developers need when integrating these changes]3738## Diagram39[Optional Mermaid diagram showing architecture/flow/structure of PR changes - only include when 5+ files changed or architectural changes made]40```4142**Action verbs**: Add, Update, Fix, Remove, Refactor, Migrate, Deprecate43**Topic categories**: Breaking Change, Migration Required, Configuration, Dependencies, Performance, Security, Testing, etc.4445## Workflow4647### Step 1: Branch Detection and Validation48491. Identify current branch502. Detect base branch automatically:51 - Check `origin/HEAD` default branch52 - Look for common branches (main, master, develop)53 - Prompt user if ambiguous543. Validate both branches exist5556**Git Commands:**57```bash58# Current branch59git branch --show-current6061# Default base62git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's@^refs/remotes/origin/@@'6364# Available branches65git branch -r | grep -E 'origin/(main|master|develop)'66```6768### Step 2: Gather Change Information6970Collect comprehensive git information in parallel:7172**Commit History:**73```bash74git log [base]..HEAD --format="%h %s%n%b%n---"75```7677**Change Statistics:**78```bash79git diff [base]...HEAD --stat80git diff [base]...HEAD --name-status81```8283**Full Diff:**84```bash85git diff [base]...HEAD86```8788### Step 3: Analyze Changes8990**Task Categorization:**91- Group files by module/directory92- Identify functional areas (auth, api, ui, database, tests)93- Detect new features, updates, fixes, refactors94- Analyze commit messages for intent95- Create hierarchical task list9697**Note Extraction:**98- Scan commits for keywords:99 - "breaking", "deprecated", "migration"100 - "security", "performance", "gotcha"101 - "config", "environment", "setup"102- Identify breaking changes from:103 - Removed functions/exports104 - Changed function signatures105 - API endpoint changes106- Detect dependencies:107 - package.json changes108 - New imports109- Spot configuration needs:110 - .env changes111 - Config file updates112113**Diagram Assessment:**114- Count files changed115- Detect architectural patterns:116 - New component interactions117 - Data flow changes118 - API additions/changes119 - State management updates120- Decide diagram type and necessity121122### Step 4: Generate Markdown123124**Tasks Section:**125- Use concise bullet points126- Group related changes127- Indent sub-items for large scopes128- Lead with verb (Add, Update, Fix, Remove, Refactor)129- Focus on WHAT changed130- **Keep tasks at feature/module level - DO NOT enumerate details**131 - ❌ BAD: "Implement GammaApi client with 17 endpoints (status, teams, sports, tags, events, markets...)"132 - ✅ GOOD: "Implement GammaApi client"133 - Don't list specific functions, endpoints, components, or implementation details134 - Tasks describe the change, not every aspect of it135136**Notes Section:**137- Bold topic headings138- One-sentence descriptions139- **Include only developer-impacting information:**140 - Breaking changes141 - Migration steps required142 - Configuration needs (env vars, config files)143 - New dependencies144 - Performance implications that affect usage145 - Security considerations146- **EXCLUDE implementation details visible in code:**147 - ❌ BAD: "Architecture: Uses result type pattern ({ ok: true, data } | { ok: false, error })"148 - ❌ BAD: "Implementation: Uses factory pattern for service creation"149 - ❌ BAD: "Code structure: Separates concerns into modules"150 - These are visible in code review - don't waste note space on them151- Focus on information that requires developer action or awareness152153**Diagram Section:**154- Use mermaid syntax155- Choose appropriate type:156 - `flowchart TD` for flows157 - `sequenceDiagram` for interactions158 - `classDiagram` for structure159 - `stateDiagram-v2` for states160- Keep concise (< 15 nodes)161- Label clearly162- Show only PR changes, not entire system163164### Step 5: Present and Refine165166- **Output raw markdown wrapped in a markdown code fence** (```markdown ... ```)167- This makes the output copy-pastable - user can select and copy the raw markdown syntax directly168- Do NOT output formatted/rendered markdown - output the raw text169- Verify accuracy with user170- Offer refinements if needed171- Ready to paste into GitHub PR172173## Examples174175### Example 1: Feature Addition176177**User request:** "Generate PR description for my feature branch"178179**Process:**1801. Detect branches: `feature/user-auth` → `main`1812. Find commits: 8 commits about authentication1823. Analyze files: auth/, api/auth.ts, components/LoginForm.tsx1834. Generate:184 - Tasks: Add user authentication, Add login form, Add auth middleware185 - Notes: Requires AUTH_SECRET env var, Breaking: /login endpoint moved186 - Diagram: Sequence diagram showing auth flow187188### Example 2: Bug Fix189190**User request:** "/generate-pr-description"191192**Process:**1931. Detect branches: `fix/memory-leak` → `develop`1942. Find commits: 2 commits fixing memory issue1953. Analyze files: utils/cache.ts, tests/cache.test.ts1964. Generate:197 - Tasks: Fix memory leak in cache, Add cache cleanup tests198 - Notes: Performance: Memory usage reduced by 40% (Note: Only include notes with developer impact - omit if no breaking changes or config needed)199 - Diagram: None (simple fix, < 5 files)200201### Example 3: Refactor202203**User request:** "Generate description comparing to main"204205**Process:**2061. Detect branches: `refactor/api-layer` → `main`2072. Find commits: 15 commits restructuring API2083. Analyze files: api/*, services/*, types/*, tests/*2094. Generate:210 - Tasks: Refactor API layer (service extraction, type updates, test updates)211 - Notes: Breaking: Import paths changed, Migration: Update imports from api/* to services/*212 - Diagram: Class diagram showing new service architecture213214## Best Practices215216### Analysis Quality217218- Read ALL commits in range, not just latest219- Consider file locations for context220- Check for implicit breaking changes221- Verify test coverage changes222- Note dependency updates223224### Description Conciseness225226- Target: 5-10 task items227- Target: 2-5 note items228- One sentence per item229- Technical audience (skip fluff)230- Action-oriented language231232### Diagram Guidelines233234- Only when adding clarity235- Focus on new/changed parts236- Keep < 15 nodes237- Use standard mermaid syntax238- Label clearly239- Show relationships, not every detail240241### Token Efficiency242243- Don't fetch full diff if > 10K lines244- Summarize large refactors245- Focus on public API changes246- Skip cosmetic changes in summary247248---249> Converted and distributed by [TomeVault](https://tomevault.io/claim/yulolimum) — claim your Tome and manage your conversions.250<!-- tomevault:4.0:skill_md:2026-04-11 -->