pr-triage-gate
Skill8 starsChanged 6 months agoMITView on GitHub
Semantic redundancy gate -- before debugging CI or fixing any pull request, verify the PR's stated goals are not already on the target branch. Close obsolete PRs immediately rather than waste tokens on CI triage.
In this repository129 other files it gives its agents.
- AGENTS.mdAGENTS.md
- guidance/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- guidance/CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- blast-radius-checkSkill
- brainstormingSkill
- branch-flow-gateSkill
- branch-sync-gateSkill
- codebase-reconSkill
- codeowners-drift-auditSkill
- code-review-batterySkill
- cognitive-complexity-refactoringSkill
- debateSkill
- debug-conductorSkill
- dispatching-parallel-agentsSkill
- domain-buildSkill
- evidence-adjudicatorSkill
- executing-plansSkill
- external-cli-auditSkill
- feature-developmentSkill
- field-rename-verificationSkill
- finishing-a-development-branchSkill
- git-branch-conventionsSkill
- gitlab-cliSkill
- hotfix-charterSkill
- implementation-trackerSkill
- incident-revert-reviewSkill
- infra-config-investigatorSkill
- investigation-stateSkill
- kernel-splitSkill
- llm-behavior-investigatorSkill
- llm-skill-reviewSkill
- merge-authorization-gateSkill
- micro-harsh-reviewSkill
- output-verificationSkill
- pre-commit-gateSkill
- progressive-code-review-gateSkill
- progressive-harsh-reviewSkill
- providing-code-reviewSkill
- push-authorization-gateSkill
- receiving-code-reviewSkill
- reproduction-experiment-investigatorSkill
- requesting-code-reviewSkill
- requirements-validation-pmSkill
- requirements-validationSkill
- scope-tripwireSkill
- session-handoffSkill
- skills-hierarchy-tuningSkill
- sp-bughuntSkill
- state-consistency-investigatorSkill
- subagent-driven-developmentSkill
- systematic-debuggingSkill
- test-driven-developmentSkill
- timeline-trace-investigatorSkill
- token-estimationSkill
- unified-commit-gateSkill
- using-git-worktreesSkill
- using-superpowersSkill
- verification-before-completionSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 7 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 49
Before debugging CI failures on any MR or PR — verifies the work isn't already on the target branch
- Distinctive: line 50
When a PR appears stuck in CI and you're not sure if its changes are still needed
- Distinctive: line 51
Before spending time cherry-picking or rebasing an MR that may be obsolete
- Very specific: line 59
Every subsequent step compares HEAD against the target.
- Very specific: line 79
If your remote is GitLab, use glab instead.
- Distinctive: line 118
Do NOT open CI logs before completing Steps 1-3
- Distinctive: line 119
Do NOT retry pipelines before completing Steps 1-3
- Distinctive: line 120
Do NOT fix test failures before verifying the PR is still needed
- Distinctive: line 121
Do NOT rebase or squash before verifying the PR is still needed
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
PR Triage Gate
Purpose: Before touching CI logs or fixing test failures on any PR, answer: "Does the target branch already have this?"
Why this exists: A PR whose stated features are already on the target branch is a no-op; every minute spent debugging its CI is wasted. A two-command check at the start catches this before the debugging loop starts.
Announce at start: "I'm using the pr-triage-gate skill to verify this PR is still needed before debugging CI."
When to Use
- Before debugging CI failures on any MR or PR — verifies the work isn't already on the target branch
- When a PR appears stuck in CI and you're not sure if its changes are still needed
- Before spending time cherry-picking or rebasing an MR that may be obsolete
NOT when: you created the branch yourself in the current session and know it contains fresh work.
MANDATORY -- Run before any CI debug work
Step 0: Check out the PR branch so HEAD is the PR tip (10 seconds)
Every subsequent step compares HEAD against the target. If HEAD is on an unrelated branch, Step 2 silently produces a false verdict. Pin HEAD first:
# GitHub (substitute the PR number):
gh pr checkout "$PR_NUMBER"
# GitLab (substitute the MR internal ID):
glab mr checkout "$MR_IID"Step 1: Read the PR description (30 seconds)
Both branches emit the same JSON schema so downstream steps do not fork on remote type.
GitHub via gh:
gh pr view "$PR_NUMBER" --json title,baseRefName,body \
--jq '{title,target:.baseRefName,description:.body}'If your remote is GitLab, use glab instead. The project path must be URL-encoded even when it contains nested groups (group/subgroup/repo):
PROJECT="$(git remote get-url origin \
| sed -E 's#^(git@[^:]+:|https?://[^/]+/)##; s#\.git$##' \
| sed 's#/#%2F#g')"
glab api "projects/${PROJECT}/merge_requests/${MR_IID}" \
--jq '{title,target:.target_branch,description}'If the API call fails or returns an error, STOP and report -- do not guess at PR goals.
Extract the stated goals: what functions, flags, or behaviors does this PR claim to add or change?
Step 2: Check if the target branch already has each stated goal (60 seconds)
Fetch the target once, then run the single most relevant check per stated goal:
git fetch origin <target-branch>
# For each stated goal:
git show origin/<target-branch>:<file> | grep -n "<function-name>" # does the function exist on target?
git show origin/<target-branch>:<file> | grep -n "<flag-or-default>" # is the flag or default present?
git diff origin/<target-branch>..HEAD -- <file> | wc -l # how much does the file actually differ?If git show fails (file does not exist on the target), that stated goal is genuinely new -- note it and continue.
Step 3: Verdict
| Finding | Action |
| All stated goals already on target | Close the PR immediately. gh pr close <number> (or glab mr close <iid>) |
| Some goals already on target | Strip redundant commits, keep only novel changes |
| No goals on target | Proceed to CI debug -- move on to systematic-debugging and the review battery |
FORBIDDEN
- Do NOT open CI logs before completing Steps 1-3
- Do NOT retry pipelines before completing Steps 1-3
- Do NOT fix test failures before verifying the PR is still needed
- Do NOT rebase or squash before verifying the PR is still needed
Failure modes
| Failure | Symptom | Fix |
| Skipped Step 1 | Debugging starts with CI logs | Close current investigation, restart at Step 1 |
| Vague stated goals | PR body is empty or hand-wavey | Read the commit messages instead; if still vague, ask the author |
| False negative on Step 2 | grep misses a rename or refactor | Widen the search to a fuzzy identifier; if still ambiguous, compare with git log --oneline origin/<target-branch> -- <file> |
| Target branch has drifted | Local target is stale | git fetch origin <target-branch> before each check |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

