Automates closing failing PRs and reverting linked issues.
Install
mkdir -p .claude/skills/close-human-intervention-and-failing-ci-prs && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/16235" && unzip -o skill.zip -d .claude/skills/close-human-intervention-and-failing-ci-prs && rm skill.zipInstalls to .claude/skills/close-human-intervention-and-failing-ci-prs
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Close batches of graalvm-reachability-metadata pull requests that either have the `human-intervention` label or failing CI, and revert their linked issues by clearing assignees and moving project status to `Todo`.Key capabilities
- →Fetch open PRs with `human-intervention` label
- →Fetch open PRs with failing CI status
- →Revert linked issues by clearing assignees
- →Move linked project status to `Todo`
- →Close target PRs with a factual comment
- →Verify changes after every mutation
How it works
The skill builds an inventory of target PRs, re-reads their live state, resolves linked issues, reverts the issues by clearing assignees and setting project status to 'Todo', and then closes the PRs.
Inputs & outputs
When to use close-human-intervention-and-failing-ci-prs
- →Cleaning up stale PRs
- →Reverting issues from failing builds
- →Managing PR queues
About this skill
Close Human-Intervention and Failing-CI PRs
Use this skill when asked to clean up open pull requests that need human
intervention or have failing CI. In this skill, "revert" means only issue
rollback: the linked issue must have no assignees and its project Status must
be Todo. This is not a git revert workflow.
Scope
Target open PRs in oracle/graalvm-reachability-metadata when either condition
is true:
- The PR has the
human-interventionlabel. - The PR's CI rollup is failed (
FAILUREorERROR), or an individual completed check has a failing conclusion such asFAILURE,CANCELLED,TIMED_OUT, orACTION_REQUIRED.
Deduplicate PRs that match both conditions. Do not delete branches unless the user explicitly asks.
Workflow
-
Build an inventory before making changes.
- Fetch open human-intervention PRs:
gh pr list -R oracle/graalvm-reachability-metadata --state open --label human-intervention --limit 200 --json number,title,url,labels,statusCheckRollup - Fetch open PRs broadly enough to find failing CI:
gh pr list -R oracle/graalvm-reachability-metadata --state open --limit 500 --json number,title,url,labels,statusCheckRollup - If the repository has more open PRs than the limit, rerun with a higher limit or use GraphQL pagination.
- Treat
PENDING,EXPECTED, missing, or empty checks as not yet failing. Do not close those PRs for CI failure alone.
- Fetch open human-intervention PRs:
-
For each target PR, re-read live state immediately before acting.
gh pr view PR_NUMBER -R oracle/graalvm-reachability-metadata --json number,title,state,merged,labels,statusCheckRollup,url,body- Skip merged PRs and report them separately. A merged PR needs a real code revert decision, which is outside this skill.
- If a PR is already closed, still try the issue rollback when the linked issue is unambiguous.
-
Resolve the linked issue without guessing.
- Prefer GraphQL
closingIssuesReferences:gh api graphql -f query=' query { repository(owner: "oracle", name: "graalvm-reachability-metadata") { pullRequest(number: PR_NUMBER) { closingIssuesReferences(first: 10) { nodes { number title state } } } } }' - If no linked issue is returned, inspect the PR body for an unambiguous
Fixes #...,Closes #..., orResolves #...reference. - If there are zero or multiple possible linked issues, close the PR only if it is clearly in the target set, but do not revert any issue. Report the missing or ambiguous issue mapping.
- Prefer GraphQL
-
Revert the linked issue.
- Read assignees and project items:
gh issue view ISSUE_NUMBER -R oracle/graalvm-reachability-metadata --json assignees,projectItems,state,title,url - Remove every assignee:
gh issue edit ISSUE_NUMBER -R oracle/graalvm-reachability-metadata --remove-assignee login1,login2 - If the assignees remain after
gh issue edit, clear them through the REST API:gh api repos/oracle/graalvm-reachability-metadata/issues/ISSUE_NUMBER -X PATCH -f assignees[]= - Set every linked project item that has a
Statusfield toTodo. Query item IDs and current status:gh api graphql -f query=' query { repository(owner: "oracle", name: "graalvm-reachability-metadata") { issue(number: ISSUE_NUMBER) { projectItems(first: 20) { nodes { id project { id number title owner { __typename ... on Organization { login } ... on User { login } } } fieldValues(first: 20) { nodes { __typename ... on ProjectV2ItemFieldSingleSelectValue { field { ... on ProjectV2SingleSelectField { id name } } name optionId } } } } } } } }' - Resolve the
Statusfield ID andTodooption ID from the owning project. Cache this per project:gh project field-list PROJECT_NUMBER --owner PROJECT_OWNER --format json - Update each project item:
gh project item-edit \ --id ITEM_ID \ --project-id PROJECT_ID \ --field-id STATUS_FIELD_ID \ --single-select-option-id TODO_OPTION_ID
- Read assignees and project items:
-
Close the PR.
- Use a short factual comment matching the reason:
gh pr close PR_NUMBER -R oracle/graalvm-reachability-metadata --comment "Closing this PR because CI is failing and returning the linked issue to Todo."gh pr close PR_NUMBER -R oracle/graalvm-reachability-metadata --comment "Closing this human-intervention PR and returning the linked issue to Todo." - If the PR was already closed, do not reopen it.
- Use a short factual comment matching the reason:
-
Verify after every mutation.
- Re-read the issue and PR:
gh issue view ISSUE_NUMBER -R oracle/graalvm-reachability-metadata --json assignees,projectItems,state,url gh pr view PR_NUMBER -R oracle/graalvm-reachability-metadata --json state,url - Confirm the PR is closed, assignees are empty, and each reverted project
item status is
Todo.
- Re-read the issue and PR:
Decision Rules
- Closing PRs and reverting issues are related but separate actions. Never guess an issue number just to complete rollback.
- For this skill,
Doneis not a protected status: if the target PR has one unambiguous linked issue and rollback is requested, set linked project statuses toTodo. - Do not close a PR only because checks are pending, missing, or inconclusive.
- If
gh project ...fails with a missing scope or authorization error, run:
Then retry the project status update.gh auth refresh -s project - If a target list is unexpectedly large, print the inventory and pause for confirmation before mutating.
Output Style
Report a compact batch summary:
- PRs closed for
human-intervention - PRs closed for failing CI
- linked issues reverted to unassigned +
Todo - PRs skipped because they were merged, had pending CI, or had ambiguous issue mapping
- any verification failures that still need manual follow-up
When not to use it
- →When the user asks to delete code branches
- →When a merged PR needs a real code revert decision
- →When there are zero or multiple possible linked issues for a PR
Limitations
- →Does not delete branches unless explicitly asked.
- →Does not perform `git revert` for merged PRs.
- →Cannot revert an issue if there are zero or multiple possible linked issues.
How it compares
This skill automates the batch closing of specific PRs and the rollback of their linked issues, providing a structured cleanup process that is more efficient than manual intervention.
Compared to similar skills
close-human-intervention-and-failing-ci-prs side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| close-human-intervention-and-failing-ci-prs (this skill) | 0 | 3mo | Review | Intermediate |
| glab | 6 | 3mo | Review | Intermediate |
| azure-devops-cli | 4 | 5mo | Review | Beginner |
| gitlab-ci-patterns | 10 | 4mo | No flags | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
You might also like
glab
NikiforovAll
Expert guidance for using the GitLab CLI (glab) to manage GitLab issues, merge requests, CI/CD pipelines, repositories, and other GitLab operations from the command line. Use this skill when the user needs to interact with GitLab resources or perform GitLab workflows.
azure-devops-cli
github
Manage Azure DevOps resources via CLI including projects, repos, pipelines, builds, pull requests, work items, artifacts, and service endpoints. Use when working with Azure DevOps, az commands, devops automation, CI/CD, or when user mentions Azure DevOps CLI.
gitlab-ci-patterns
wshobson
Build GitLab CI/CD pipelines with multi-stage workflows, caching, and distributed runners for scalable automation. Use when implementing GitLab CI/CD, optimizing pipeline performance, or setting up automated testing and deployment.
update-go-version
grafana
Update Go version across the Tempo codebase (go.mod, tools/go.mod, Dockerfile, CI workflows, tools image tag)
repository-module-architecture
TencentBlueKing
Repository 代码库管理模块架构指南,涵盖 Git/SVN 代码库接入、Webhook 配置、代码库授权、触发器管理。当用户开发代码库功能、配置 Webhook、处理代码库授权或实现触发器逻辑时使用。
agent-ops-cicd-github
ruvnet
Agent skill for ops-cicd-github - invoke with $agent-ops-cicd-github