| name | pre-merge-checklist |
| description | Comprehensive pre-merge validation checklist for Python/React pull requests. Use before approving or merging any PR. Covers code quality checks (linting, formatting, type checking), test coverage requirements, documentation updates, migration safety, API contract compatibility, accessibility compliance, bundle size impact, and deployment readiness. Provides a systematic checklist that ensures nothing is missed before merge. Does NOT cover security review depth (use code-review-security). |
| license | MIT |
| compatibility | Python 3.12+, React 18+, ruff, mypy, pytest, TypeScript |
| metadata | {"author":"platform-team","version":"1.0.0","sdlc-phase":"code-review"} |
| allowed-tools | Read Grep Glob Write Bash(pytest:*) Bash(npm:*) Bash(ruff:*) Bash(mypy:*) |
| context | fork |
Pre-Merge Checklist
When to Use
Activate this skill when:
- Reviewing a pull request before approving
- Preparing your own PR for merge
- Verifying that all automated checks pass before merging
- Auditing a PR that has been approved but not yet merged
- Running a final validation pass after addressing review feedback
Output: Write results to pre-merge-report.md with pass/fail status for each check and blocking issues.
Do NOT use this skill for:
- In-depth security review (use
code-review-security)
- Writing implementation code (use
python-backend-expert or react-frontend-expert)
- Architecture decisions (use
system-architecture)
- E2E test creation (use
e2e-testing)
Instructions
Automated Checks (Ordered)
Run automated checks in this order. Each check must pass before proceeding to the next. Use scripts/run-all-checks.sh to execute all checks at once.
1. Linting and Formatting
Python (ruff):
ruff check app/ tests/
ruff format --check app/ tests/
ruff check --fix app/ tests/
ruff format app/ tests/
TypeScript/React (eslint + prettier):
npx eslint 'src/**/*.{ts,tsx}' --max-warnings 0
npx prettier --check 'src/**/*.{ts,tsx}'
npx eslint 'src/**/*.{ts,tsx}' --fix
npx prettier --write 'src/**/*.{ts,tsx}'
Pass criteria:
- Zero lint errors (warnings are tolerated only with justification)
- All files formatted consistently
- No
# noqa or eslint-disable without a comment explaining why
2. Type Checking
Python (mypy):
mypy app/ --strict --no-error-summary
TypeScript:
npx tsc --noEmit
Use scripts/type-check.sh to run both in sequence with report output.
Pass criteria:
- Zero type errors in changed files
- No new
type: ignore or @ts-ignore without justification
- Generic types used correctly (no
Any leaks)
3. Tests
Python:
pytest tests/ -q --tb=short
React:
npm test -- --run --reporter=verbose
Pass criteria:
- All tests pass (zero failures)
- No skipped tests without a linked issue/ticket
- New code has corresponding tests
4. Coverage
Python:
pytest --cov=app --cov-report=term-missing --cov-fail-under=80
React:
npx vitest run --coverage --coverage.thresholds.lines=80
Pass criteria:
- Overall coverage >= 80%
- New code coverage >= 90%
- No critical paths left uncovered (auth, payment, data mutation)
5. Security Scan
pip-audit --requirement requirements.txt
npm audit --audit-level=high
python scripts/security-scan.py --path app/ --output-dir ./security-results
Pass criteria:
- No critical or high severity vulnerability in dependencies
- No critical findings in code scan
- All new endpoints have authentication checks
Manual Review Checklist
After automated checks pass, review the PR manually against these categories.
Code Quality
Testing
Type Safety
Error Handling
Backwards Compatibility
Documentation
Performance
Accessibility
Use scripts/accessibility-check.sh to run automated accessibility checks.
Failure Protocol
When a check fails, follow this escalation path:
Automated check failure:
- Fix the issue in the PR
- Push the fix and re-run checks
- Do not merge until all automated checks pass
Manual review finding:
- Add a review comment with the finding
- Request changes on the PR
- Re-review after the author addresses feedback
Severity-based response:
| Finding Type | Action | Can Override? |
|---|
| Lint/format error | Fix before merge | No |
| Type error | Fix before merge | No |
| Test failure | Fix before merge | No |
| Coverage below threshold | Add tests or justify | Yes, with tech lead approval |
| Security finding (critical/high) | Fix before merge | No |
| Security finding (medium/low) | Fix or create follow-up ticket | Yes, with ticket reference |
| Accessibility violation | Fix or create follow-up ticket | Yes, with justification |
| Performance concern | Discuss in PR, may defer | Yes, with tech lead approval |
Override Process
If a check must be overridden:
- Document the reason in a PR comment explaining why the override is acceptable
- Get explicit approval from a tech lead or senior engineer
- Create a follow-up ticket to resolve the underlying issue
- Add a code comment at the override point referencing the ticket
Overrides are never acceptable for:
- Critical security vulnerabilities
- Broken tests
- Type errors that mask bugs
Examples
Running All Checks
./scripts/run-all-checks.sh --output-dir ./check-results
./scripts/type-check.sh --output-dir ./check-results
./scripts/accessibility-check.sh --output-dir ./check-results
Quick PR Review Workflow
- Pull the branch locally
- Run
./scripts/run-all-checks.sh --output-dir ./pr-review
- Review the automated results file
- Walk through the manual checklist above
- Leave review comments or approve
Output File
Write results to pre-merge-report.md:
# Pre-Merge Report: [PR Title]
## Status: READY TO MERGE | BLOCKING ISSUES
## Automated Checks
| Check | Status | Details |
|-------|--------|---------|
| Linting (ruff) | PASS | No issues |
| Type check (mypy) | PASS | No errors |
| Tests (pytest) | PASS | 142 passed, 0 failed |
| Coverage | PASS | 85% (threshold: 80%) |
| Frontend lint | PASS | No issues |
| Frontend types | PASS | No errors |
## Manual Checks
- [x] Code follows project patterns
- [x] Tests cover new functionality
- [x] No breaking API changes
- [ ] Documentation updated (BLOCKING)
## Blocking Issues
1. README needs update for new CLI flag
## Recommendation
Address documentation before merge.