Issues & PRs
PR Template

PR Description Template

Copy-Paste Ready

These templates are battle-tested across hundreds of successful PRs. Customize them for your needs.

Universal Template

Use this for most PRs:

## Problem
<!-- Clear explanation of what this PR addresses -->
 
Fixes #ISSUE_NUMBER
 
## Solution
<!-- How you solved the problem. Key technical decisions. -->
 
## Changes
<!-- Bullet list of what changed -->
- 
- 
- 
 
## Testing
<!-- How you verified this works -->
- [ ] Unit tests pass
- [ ] Integration tests pass
- [ ] Manual testing completed
 
**Manual test scenarios:**
- 
- 
 
## Breaking Changes
<!-- YES or NO. If YES, explain migration path -->
 
## Checklist
- [ ] Code follows project style guide
- [ ] Tests added/updated
- [ ] Documentation updated
- [ ] CI passing
- [ ] Self-reviewed code

Bug Fix Template

fix(scope): brief description of bug
 
## Problem
**Bug:** [Clear description of the bug]
 
**Impact:** [Who/what is affected]
 
**Root Cause:** [Why the bug exists]
 
Fixes #ISSUE_NUMBER
 
## Solution
[Explanation of how you fixed it]
 
## Changes
- Fixed X by doing Y
- Added validation for Z
- Updated error handling in W
 
## Testing
**Before this fix:**
- Scenario A resulted in error ❌
- Scenario B crashed the app ❌
 
**After this fix:**
- Scenario A works correctly ✅
- Scenario B handles gracefully ✅
 
**Test coverage:**
- [ ] Unit tests for bug scenario
- [ ] Regression test added
- [ ] Edge cases covered
 
**Manual testing:**
```bash
# Steps to reproduce original bug:
1. 
2. 
3. 
 
# Verified fix:
[x] Bug no longer occurs
[x] No new issues introduced

Affected Users

[Low / Medium / High impact]

Breaking Changes

NO

Checklist

  • Bug fix verified
  • Tests prevent regression
  • No unintended side effects

---

## Feature Template

```markdown
feat(scope): brief description of feature

## Problem
**User need:** [What problem does this solve for users?]

**Current limitation:** [What can't users do now?]

Closes #ISSUE_NUMBER

## Solution
[High-level overview of your implementation]

**Key features:**
- Feature A allows users to...
- Feature B provides...
- Feature C enables...

## Changes
**Added:**
- New component: `ComponentName`
- New utility: `utilityFunction()`
- New API endpoint: `POST /api/resource`

**Modified:**
- Updated `ExistingComponent` to handle new feature
- Enhanced `existingFunction()` with parameter X

**Database changes:**
- Added table: `table_name`
- New columns: `column_a`, `column_b`
- Migration: `YYYYMMDD_migration_name.sql`

## Technical Design
[Brief architecture explanation or link to design doc]

**Implementation approach:**
1. 
2. 
3. 

**Alternatives considered:**
- Approach A: Rejected because...
- Approach B: Too complex for...

## Testing
**Unit tests:**
- [x] `ComponentName` tests (100% coverage)
- [x] `utilityFunction()` tests
- [x] API endpoint tests

**Integration tests:**
- [x] End-to-end user flow
- [x] Error handling scenarios

**Manual testing:**
- [x] Feature works as expected
- [x] Edge cases handled:
  - Empty state ✅
  - Max capacity ✅
  - Invalid input ✅
- [x] Cross-browser testing (Chrome, Firefox, Safari)
- [x] Mobile responsive ✅

## Screenshots
### Before
![Before](url)

### After
![After](url)

### Different States
- Empty: ![Empty](url)
- Loading: ![Loading](url)
- Error: ![Error](url)
- Success: ![Success](url)

## Performance Impact
- Bundle size: +15KB (minified + gzipped)
- API response time: < 100ms
- Database queries: +1 query, < 50ms

## Breaking Changes
NO
<!-- If YES: explain migration path and deprecation timeline -->

## Documentation
- [ ] README updated
- [ ] API docs updated
- [ ] Code comments added
- [ ] Examples provided

## Checklist
- [ ] Feature complete and working
- [ ] Tests comprehensive
- [ ] Documentation complete
- [ ] No breaking changes
- [ ] Performance acceptable
- [ ] Accessibility considered
- [ ] Security reviewed

Documentation Template

docs(scope): brief description
 
## Problem
**Documentation gap:** [What was missing or unclear?]
 
**User impact:** [How does this help users?]
 
Closes #ISSUE_NUMBER
 
## Changes
- Added section: "Title"
- Clarified explanation of X
- Fixed typos in Y
- Updated outdated examples in Z
 
## Improvements
**Before:**
- Users were confused about...
- Common questions about...
 
**After:**
- Clear explanation with examples
- Step-by-step guide
- Visual diagrams
 
## Validation
- [ ] Technically accurate
- [ ] Links work
- [ ] Code examples tested
- [ ] Spelling/grammar checked
 
## Preview
[Link to preview or screenshots if applicable]
 
## Checklist
- [ ] All links tested
- [ ] Code examples work
- [ ] No broken formatting
- [ ] Consistent with existing docs style

Refactoring Template

refactor(scope): brief description
 
## Problem
**Code smell:** [What needed improvement?]
 
**Motivation:** [Why refactor now?]
 
Related to #ISSUE_NUMBER
 
## Solution
[What you refactored and how]
 
## Changes
**Refactored:**
- Extracted `newFunction()` from `oldFunction()`
- Renamed `confusingName` to `clearName`
- Simplified logic in `module`
- Removed duplication between X and Y
 
**Benefits:**
- Improved readability
- Reduced complexity (cyclomatic complexity: 12 → 6)
- Better testability
- Eliminated code duplication
 
## Testing
**No behavior changes:**
- [x] All existing tests pass
- [x] No new tests needed (pure refactor)
- [x] Manual smoke testing completed
 
**Before/After metrics:**

Lines of code: 450 → 320 (-29%) Duplication: 15% → 3% Complexity: 12 → 6


## Breaking Changes
NO - Internal refactor only, no API changes

## Checklist
- [ ] Behavior unchanged
- [ ] Tests still pass
- [ ] No performance regression
- [ ] Improved code quality

Test Addition Template

test(scope): add tests for X
 
## Problem
**Coverage gap:** [What wasn't tested?]
 
**Risk:** [Why does this matter?]
 
Related to #ISSUE_NUMBER
 
## Solution
Added comprehensive test coverage for:
- Happy path scenarios
- Edge cases
- Error conditions
 
## Changes
**Added tests:**
- Unit tests for `functionName()`
- Integration tests for X workflow
- Edge case tests for Y scenario
 
**Coverage improvement:**

Before: 65% After: 92%


## Test Cases
1. ✅ Normal input handling
2. ✅ Empty/null input
3. ✅ Invalid input rejection
4. ✅ Boundary conditions
5. ✅ Error scenarios
6. ✅ Race conditions
7. ✅ Async behavior

## Testing
- [x] All new tests pass
- [x] No flaky tests
- [x] Fast execution (< 1s per test)

## Checklist
- [ ] Tests are readable
- [ ] Tests are maintainable
- [ ] No redundant tests
- [ ] Good coverage of edge cases

Performance Improvement Template

perf(scope): optimize X to improve Y
 
## Problem
**Performance issue:** [What was slow?]
 
**Impact:** [How did this affect users?]
 
Fixes #ISSUE_NUMBER
 
## Solution
[How you optimized it]
 
## Changes
- Optimized database query by adding index
- Implemented caching for expensive operation
- Reduced memory allocations in hot path
 
## Performance Impact
**Before:**

Response time: 1200ms Memory usage: 150MB Database queries: 15


**After:**

Response time: 180ms (-85%) Memory usage: 45MB (-70%) Database queries: 2 (-87%)


**Benchmarks:**
```bash
# Before
10,000 requests: 120s
Throughput: 83 req/s

# After
10,000 requests: 15s
Throughput: 666 req/s (+700%)

Testing

  • Load testing performed
  • No functionality changes
  • All tests pass
  • Memory profiling shows improvement

Trade-offs

[Any compromises made, if applicable]

Breaking Changes

NO

Checklist

  • Performance improvement verified
  • No breaking changes
  • Tests pass
  • Monitoring added for key metrics

---

## Security Fix Template

```markdown
fix(security): address vulnerability in X

## Problem
**Vulnerability:** [Brief description]

**Severity:** [Critical / High / Medium / Low]

**Attack vector:** [How could this be exploited?]

Fixes #ISSUE_NUMBER

## Solution
[How you fixed the vulnerability]

## Changes
- Updated dependency X to version Y
- Added input validation for Z
- Implemented sanitization in W

## Security Impact
**Before:** 
- Vulnerable to [attack type]
- Potential for [impact]

**After:**
- Vulnerability patched
- Input sanitized
- Tests verify security

## Testing
- [x] Security test added
- [x] Attempted exploit scenarios (all blocked)
- [x] No regressions

**Verified:**
- [x] SQL injection attempts blocked
- [x] XSS attempts sanitized
- [x] CSRF protection working

## Breaking Changes
NO

## Disclosure
[If coordinated disclosure, mention timeline]

## Checklist
- [ ] Vulnerability fixed
- [ ] Security tests added
- [ ] No information leak in PR
- [ ] Backports considered

Dependency Update Template

chore(deps): update X from v1.0 to v2.0
 
## Changes
**Updated dependencies:**
- `package-name`: v1.0.0 → v2.0.0
 
## Motivation
- Security patch included
- Performance improvements
- New features available
- Bug fixes
 
## Breaking Changes
[Check if dependency has breaking changes affecting this project]
 
**Migration notes:**
- [If applicable]
 
## Testing
- [x] All tests pass
- [x] No regressions observed
- [x] Compatibility verified
 
## Changelog Review
[Link to dependency's changelog]
 
Key changes:
- 
- 
 
## Checklist
- [ ] Lock file updated
- [ ] Tests pass
- [ ] No breaking changes (or handled)
- [ ] Bundle size acceptable

Multi-PR Template (Part of Series)

feat(scope): add feature X [Part 1/3]
 
## Context
This is part 1 of a 3-part feature addition:
- **Part 1 (this PR):** Core data models and database schema
- Part 2: API endpoints and business logic
- Part 3: UI components and integration
 
Related to #ISSUE_NUMBER
 
## Problem
[Overall problem being solved]
 
## This PR's Scope
[What specifically this PR does]
 
**Out of scope:**
- API implementation (Part 2)
- UI components (Part 3)
 
## Changes
[Changes in this PR only]
 
## Testing
[Tests for this PR's scope]
 
## Next Steps
After merge:
1. Part 2 PR will add API endpoints
2. Part 3 PR will add UI
 
## Checklist
- [ ] Focused on defined scope
- [ ] Ready for Part 2 to build on
- [ ] Tests complete for this part

Quick Reference

┌─────────────────────────────────────────────────────────────────────────────┐
│                         PR TYPE SELECTOR                                    │
├─────────────────────────────────────────────────────────────────────────────┤
│                                                                             │
│  Your Change           Template to Use                                      │
│  ═══════════           ══════════════                                       │
│                                                                             │
│  Fixing a bug          → Bug Fix Template                                   │
│  Adding feature        → Feature Template                                   │
│  Improving docs        → Documentation Template                             │
│  Refactoring code      → Refactoring Template                               │
│  Adding tests          → Test Addition Template                             │
│  Making faster         → Performance Template                               │
│  Security issue        → Security Fix Template                              │
│  Updating deps         → Dependency Update Template                         │
│  Series of PRs         → Multi-PR Template                                  │
│  Not sure / Mixed      → Universal Template                                 │
│                                                                             │
└─────────────────────────────────────────────────────────────────────────────┘
💡

Customize the Template

These templates are starting points. Adapt them to your project's conventions and the specific PR context.


Next Steps