auldsyababua/instructor-workflow/pr-backlog-cleaner
Claude Code and agent skill by auldsyababua/instructor-workflow
- community
Checking that the SKILL.md file is still in the repository.
Clean and normalize a large backlog of GitHub pull requests in messy repositories. This skill should be used when facing a repository with numerous stale, conflicted, or outdated PRs that need systematic review, conflict resolution, testing, and disposition (merge, close, or defer). Handles PR triage, automated rebasing, CI verification, risk assessment, and safe merging while maintaining default branch stability.
Install
npx vskill@latest install auldsyababua/instructor-workflow/pr-backlog-cleanerSKILL.md
PR Backlog Cleaner
Overview
Clean and normalize large backlogs of GitHub pull requests systematically while keeping the default branch stable and deployable. This skill provides a comprehensive workflow for triaging, reviewing, rebasing, testing, and dispositioning PRs at scale, ensuring every PR ends in one of three states: merged safely, closed with reason, or explicitly deferred.
NEW: Integrates pr-comment-analysis subskill to systematically extract, analyze, and prioritize existing PR review feedback. This helps avoid re-litigating issues reviewers already identified, catch hidden impacts through automated analysis, and make informed merge/close/defer decisions based on the complete feedback picture.
When to Use This Skill
Use this skill when:
- Facing a repository with numerous stale, outdated, or conflicted PRs
- Need to systematically clean up technical debt in pull request backlogs
- Want to safely merge or close PRs without destabilizing the default branch
- Managing a repository where PRs have accumulated without clear disposition
- Need to establish clear PR hygiene and backlog management practices
- PRs have existing review feedback that needs to be systematically analyzed and addressed (uses pr-comment-analysis subskill)
Global Safety Constraints
CRITICAL RULES - Never violate these:
- No blind merging: Do not modify or merge code without automated verification if any tests or CI are available
- No invention: Do not invent repository structure, commands, or tools—infer them only from existing files and configs
- Minimal scope: Do not modify unrelated files—restrict edits to files directly involved in the PR or minimally required for functionality
- Respect CI: Do not bypass failing CI without explicit instruction from user
- Prefer small changes: Prefer smaller, isolated changes over large refactors
- Prefer fresh PRs: Prefer creating new clean PRs over attempting to merge extremely outdated or conflicted ones
Core Workflow
Phase 1: Repository Initialization
Discover the environment before taking any action.
1.1 Identify Main Branch
Look for: main, master, or other protected branches
1.2 Identify Language and Tooling
Check for these files to determine tech stack:
- Node.js:
package.json,.nvmrc - Python:
requirements.txt,pyproject.toml,setup.py,Pipfile - Java:
pom.xml,build.gradle,build.gradle.kts - Go:
go.mod,go.sum - Rust:
Cargo.toml,Cargo.lock - Ruby:
Gemfile,Gemfile.lock
Check for CI/build configs:
.github/workflows/*Jenkinsfile.gitlab-ci.ymlazure-pipelines.yml.circleci/config.yml
1.3 Determine Test Commands
Extract test commands from:
- README.md or CONTRIBUTING.md - Look for "Running Tests" sections
- CI workflows - Parse
.github/workflows/*.ymlfor test steps - Package configs:
package.json:scripts.testpyproject.toml:[tool.pytest]or[tool.tox]pom.xml:<build><plugins>for surefire/failsafeCargo.toml: cargo test is standard
Common test commands by ecosystem:
1.4 Verify Tests Run Locally
Record:
- ✅ Pass/fail status
- ⏱️ Approximate runtime
- 🔍 Any flaky or known failing tests (from CI config or output)
If tests fail on default branch:
- Document the baseline failure state
- Future PR tests must not introduce additional failures beyond this baseline
Phase 2: Backlog Inventory
Create a comprehensive inventory of all open PRs.
2.1 Retrieve PR List
2.2 Extract PR Metadata
For each PR, document:
- PR number
- Title
- Author (username)
- Created date (ISO format)
- Last updated date (ISO format)
- CI status: SUCCESS, FAILURE, PENDING, or N/A
- Changed files count
- Additions/deletions (lines changed)
- Labels (if present)
See scripts/analyze_pr_backlog.py for automated inventory generation.
2.3 Classify PRs by Type
Based on title, description, and diff, classify as:
- `bugfix`: Fixes reported bugs or errors
- `feature`: Adds new functionality
- `refactor`: Restructures code without changing behavior
- `infra`: CI, build, tooling, deployment, configs
- `docs`: Documentation-only changes
- `mixed`: Contains multiple categories (upgrade risk)
2.4 Assign Risk Levels
Low Risk:
- Only docs changes
- Trivial or localized changes without external dependencies
- Logging-only or comment-only updates
Medium Risk:
- Localized behavior changes
- Small features with tests
- Non-critical infrastructure changes
High Risk:
- Large refactors (>500 lines or >10 files)
- Cross-cutting changes affecting multiple modules
- Database migrations or schema changes
- Public API changes
- Changes with no tests in critical areas
- Mixed PRs combining multiple change types
2.5 Create Structured Inventory
Store in pr_backlog_analysis.md:
Phase 3: Global Policies
Establish consistent rules for all PR processing.
3.1 Stale PR Policy
Stale threshold: 90 days with no commits or comments
For stale PRs:
- Mark as
stale-candidate - Review for obsolescence before closing
- Add comment with clear revival instructions
Stale closure template:
3.2 Merge Strategy
Default: Squash and merge
- Simplifies history
- Easier rollbacks
- Cleaner commit log
Use merge commits only if:
- Repository convention clearly demands it (check existing merge patterns)
- PR has carefully crafted commit history worth preserving
Rebase before merge:
- Always rebase on latest default branch first
- Resolve conflicts before final merge
3.3 Test Requirement Policy
If automated tests exist:
- ✅ Tests MUST pass before merging
- Align with default branch baseline (no new failures)
If tests are broken on default branch:
- Do not introduce additional failures
- Consider fixing baseline before merging PRs
If no tests exist:
- Restrict merging to:
- Low-risk changes (docs, comments, logging)
- Clearly localized fixes with verifiable behavior
- Avoid merging large refactors or cross-cutting changes
Phase 4: Triage Order
Process PRs in this priority order:
Priority 1: Low-hanging fruit
- Docs and low-risk infra changes
- Small bugfix PRs with clear intent
Priority 2: Value-add features
- Small to medium feature PRs (recent, low-to-medium risk)
Priority 3: Complex work
- Refactors and high-risk PRs
Priority 4: Problem cases
- Very old or heavily conflicted PRs
Within each category, prioritize:
- ✅ More recent activity over older
- 📦 Smaller diffs over larger
- 🟢 Passing CI over failing CI
Phase 5: Per-PR Standard Flow
Execute this workflow for each PR in triage order.
Step A: Relevance Check
Determine if still relevant:
- Is the problem/feature still needed?
- Has this been superseded by newer merged work?
- Is the approach still aligned with current architecture?
If clearly obsolete:
- Mark as
obsolete - Close with factual comment
- Move to next PR
Template for obsolete closure:
Step B: Metadata and Precheck
Check CI status:
If CI is green (✅):
- Proceed to Step C (rebase)
If CI is red (❌):
- Inspect logs to determine if failures are:
- Unrelated: Already failing on default branch (check baseline)
- PR-caused: Introduced by this PR
- If unclear, treat as PR-caused until proven otherwise
View CI logs:
Step C: Local Checkout and Rebase
Resolve conflicts:
Conflict resolution rules:
- Follow existing patterns from default branch
- Do not introduce new patterns during conflict resolution
- Do not modify files outside PR scope unless strictly required
- Prefer default branch's version for infrastructure files (CI, build configs)
After resolving conflicts:
Test scope:
- Full suite for small repos (<5 min runtime)
- Affected modules only for large repos
- At minimum, smoke tests for critical paths
Push rebased branch:
Step D: Structural Review and Comment Analysis
Identify blast radius:
- List affected modules/packages
``bash # View changed files gh pr diff <PR_NUMBER> --name-only ``
- Detect impact areas:
- Public APIs (exported functions, REST endpoints)
- Core domain logic (business rules, algorithms)
- Database schema (migrations, models)
- Shared utilities (used by multiple modules)
Detect change type:
- Mechanical: Renames, formatting, simple refactors (low risk if tests pass)
- Behavioral: Logic changes, new features (requires test validation)
- Mixed: Combines mechanical and behavioral (higher risk)
If PR mixes unrelated changes:
- Example: Formatting + behavior + infra in one PR
- Mark as
mixed - Consider splitting into focused follow-up PRs
- If not feasible, upgrade to high-risk classification
Extract and Analyze PR Comments (NEW - Subskill Integration):
Use the pr-comment-analysis subskill to systematically analyze existing PR feedback:
- Extract all PR comments:
```bash # Navigate to repository cd /path/to/repo
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/pr-backlog-cleaner/SKILL.md
Popularity
- Repository stars
- 6
- Repository forks
- 1
- 7-day trend score
- 10
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 26 Apr 2026, 7 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/auldsyababua/instructor-workflow/pr-backlog-cleaner)