GitHub pull requests, review threads, failing Actions checks and stacked pull requests, through GitHub's MCP server and the gh CLI. Use when opening, reviewing or updating a pull request, fixing a failed check, or splitting a change into a stack.
75
94%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Low
Low-risk findings worth noting
Branch, commit and pull request conventions: the git-workflow skill. Docs: https://docs.github.com/en/pull-requests
GitHub's own remote server, https://api.githubcopilot.com/mcp/. VS Code signs in with OAuth. Every other assistant sends GITHUB_PERSONAL_ACCESS_TOKEN, so the server acts as that token's user — call get_me first to know whose name every comment will carry. Tool names change between releases: read the tool list the server offers instead of assuming a name.
context, repos, issues, pull_requests, users. An X-MCP-Toolsets header on the server entry turns on more (actions for CI logs), and X-MCP-Readonly: true drops every write tool.gh covers the rest: review threads, job logs and stacks, below. It signs in on its own (gh auth status).gh pr view 42 --json mergeStateStatus. BEHIND needs a rebase onto its base, DIRTY has conflicts, BLOCKED lacks a required review or check, UNSTABLE has a non-required check failing.gh offer a merge.gh pr create --draft) and mark it ready when it is done (gh pr ready 42). Closes #123 in the body closes the issue only when the PR merges into the default branch.```suggestion block replaces the commented lines when the author applies it. Use it for any fix that fits those lines.repo: and is:open rather than paging.The REST API returns review comments without saying which are resolved. GraphQL says.
List the threads:
gh api graphql -F owner='{owner}' -F repo='{repo}' -F pr=42 -f query='
query($owner: String!, $repo: String!, $pr: Int!) {
repository(owner: $owner, name: $repo) { pullRequest(number: $pr) {
reviewThreads(first: 100) { nodes { id isResolved isOutdated path line
comments(first: 20) { nodes { databaseId author { login } body } } } } } } }'Fix what each unresolved thread asks, then commit and push. An isOutdated thread sits on code that has since changed: check that its point still applies.
Reply in the thread with what changed: gh api repos/{owner}/{repo}/pulls/42/comments/<databaseId>/replies -f body='Fixed in <sha>: …'
Resolve it: gh api graphql -F id=<thread id> -f query='mutation($id: ID!) { resolveReviewThread(input: {threadId: $id}) { thread { isResolved } } }'
Done when step 1 shows every thread you fixed as resolved. A point you disagree with gets a reply and stays open for the reviewer.
gh pr checks 42 lists every check on the head commit. --watch --fail-fast waits, and stops at the first failure.gh run view <run-id> --log-failed, which prints only the failed steps (the run ID is in the check's link). Start at the first error, not the last line.gh pr checks 42 passes on the new head commit.gh run rerun <run-id> --failed once. A second failure is real.Causes no log names:
GITHUB_TOKEN inside a workflow starts no other workflow, so a bot's commit gets no checks. Push with a GitHub App token or a personal token when it needs them.paths filter never reports, and the PR waits for it forever. Run the job and exit early instead.pull_request workflows with a read-only token and no secrets. pull_request_target has both and runs the base branch's workflow, so checking out the PR's code there runs it with your secrets.permissions: on each workflow rather than inheriting the repository default, which is read and write on older repositories.A change too big for one review becomes a stack: a chain of layers, each its own PR on the branch below, with the bottom one on trunk (the default branch). Dependencies point down: shared types and schema at the bottom, the code that uses them above. Each PR is held to trunk's required reviews and checks, so every layer builds and passes CI on its own. With agents, one task per layer.
The gh stack extension does the bookkeeping: gh extension install github/gh-stack. Name every branch on the command line, because a bare command opens a prompt.
gh stack init feat/search-01-schema, then commit the first layer.gh stack add feat/search-02-api, then commit.gh stack push, then gh stack submit --auto. This opens one draft PR per branch, each based on the one below, linked as a stack. Give each its title and body with gh pr edit <n> --title "…" --body-file <file>. Done when gh stack view --json lists every branch with its PR.gh stack checkout feat/search-01-schema, commit, then gh stack rebase --upstack, gh stack push and gh stack top.gh stack sync --prune rebases what remains onto trunk, pushes, and deletes the merged branches.gh stack push, which uses --force-with-lease per branch.git add, then gh stack rebase --continue, or --abort to restore every branch.gh pr create --draft --base <branch below>. After a layer is squash-merged, rebase the next one with git rebase --onto origin/main <merged branch> <next branch> so the squashed commits are not replayed.monkilabs/opencastle
3942f46
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.