gh-pr
Skill4 starsChanged 6 months agoMITView on GitHub
GitHub CLI (`gh pr`) operations for pull requests, reviews, PR checks, and PR branches. You MUST load this skill when working with the `gh pr` command.
- Deletes or force-pushes
- Commits and pushes
4 other projects use a version of this.
Adopted by
Most recently taken up by
- longmajs/claude-skillstheir own version, first seen Oct 15, 2026
- mir-am/skills-agents-ai-codingtheir own version, first seen Oct 1, 2026
- mehdi-dbx/claude-skillstheir own version, first seen Jun 2, 2026
- puku0x/agent-skills-testtheir own version, first seen Apr 19, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 4
- mir-am/skills-agents-ai-coding★ 2same name
- puku0x/agent-skills-test★ 1same name
- longmajs/claude-skills★ 0same name
- mehdi-dbx/claude-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository124 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .github/AGENTS.mdAGENTS.md
- .github/workflows/AGENTS.mdAGENTS.md
- .vscode/AGENTS.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
- agent-log-analysisSkill
- agent-mdSkill
- agent-md-writerSkill
- agent-skill-md-writerSkill
- agentskillsSkill
- agents-md-writerSkill
- ai-prompt-writerSkill
- ansibleSkill
- apache-airflow-apiSkill
- apache-airflow-dagsSkill
- astro-cliSkill
- astronomer-docsSkill
- awesome-copilotSkill
- brainstorm-agent-runsSkill
- brainstorm-github-prSkill
- brainstormSkill
- catSkill
- chrome-devtoolsSkill
- claude-docsSkill
- codeqlSkill
- code-reviewSkill
- code-tourSkill
- coding-standard-writerSkill
- context-aware-opsSkill
- copilot-cliSkill
- copilot-docsSkill
- critical-thinkingSkill
- datadog-agentSkill
- datadog-apiSkill
- datadog-mcpSkill
- datadog-monitorsSkill
- datadog-pulumiSkill
- devcontainerSkill
- dictationSkill
- direnvSkill
- dockerfileSkill
- dockerSkill
- docs-reviewSkill
- docs-writerSkill
- dot-claudeSkill
- dotfilesSkill
- dot-githubSkill
- editorconfigSkill
- fact-writerSkill
- gdpr-compliantSkill
- gh-agent-taskSkill
- gh-apiSkill
- gh-aw-compileSkill
- gh-aw-firewall-debugSkill
- gh-aw-firewallSkill
- gh-aw-newSkill
- gh-awSkill
- gh-aw-troubleshootingSkill
- gh-codespaceSkill
- gh-issueSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
24 rules. 0 are common, 14 are distinctive, and 10 are very specific to this project.
0
Common
Most of the 4 edited versions we read keep these.
14
Distinctive
This author's own choices. Worth a look.
10
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 11
Use gh pr to natively interact with GitHub Pull Requests.
- Distinctive: line 67
Always prefer non-interactive creation in automated environments:
- Very specific: line 80
If checks fail, use gh-run skill to diagnose specific workflow failures.
- Very specific: line 118
When you need to visualize the results of gh pr checks, you can generate an architectural flowchart (using Mermaid) that categorizes checks …
- Distinctive: line 199
Dynamic PR Targeting: ALWAYS target the explicitly provided Base Branch when creating/updating PRs.
- Distinctive: line 203
When executing autonomously within a GitHub Actions environment, adhere strictly to these interaction constraints:
- Distinctive: line 211
Dynamic PR Targeting: ALWAYS target this explicitly provided Base Branch when creating/updating PRs.
- Very specific: line 213
Response Detection & Routing: Check github.event_name and payload to identify trigger source:
- Distinctive: line 226
Symmetric Routing: ALWAYS reply via the exact originating channel.
- Distinctive: line 231
When the prompt asks to "pull" or "sync with base" in GitHub Actions runtime, the agent MUST integrate remote changes with a merge commit …
- Distinctive: line 234
MUST NOT: run any rebase-based update command during runtime.
- Distinctive: line 237
MUST: use pull-with-merge semantics: git pull --no-rebase.
- Distinctive: line 244
Ensure work is on the PR head branch (not detached HEAD).
- Very specific: line 246
If base changes must be integrated into head, merge base explicitly: git fetch origin <base-branch> && git merge --no-ff …
- Distinctive: line 260
Before finishing your session, you MUST ensure the workspace is in a valid state.
- Distinctive: line 264
If the runtime did not involve intended modification of files:
- Distinctive: line 266
Verify: Run git status to confirm the workspace is clean.
- Distinctive: line 267
Clean: If untracked or modified files exist (e.g., temporary analysis artifacts), run git clean -fd and git checkout -- ..
- Distinctive: line 269
Assert: Ensure no PR or commit is triggered for purely informational tasks.
- Very specific: line 273
"Draft PRs cannot be merged": Use gh pr ready <number> first.
- Very specific: line 274
"Permission denied": Check gh auth status. You may need to request additional scopes.
- Very specific: line 275
"PR already exists": If creating a PR fails because one exists for the branch, use gh pr list --head <branch> to find it and gh pr edit if …
- Very specific: line 280
Avoid using git push then gh pr create separately if you can use gh pr create --fill or --head to do it in one flow.
- Very specific: line 282
Do not use gh api for PR operations that have native gh pr subcommands unless you need raw JSON fields not exposed by --json.
“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
gh-pr Skill
Use gh pr to natively interact with GitHub Pull Requests. Prefer native
fields and explicit routing over brittle shell post-processing.
When to Use
- User asks to manage, review, or inspect a pull request using the GitHub CLI (
gh pr). - Task involves querying PR CI/CD checks (
gh pr checks), logs, mergeability, or PR metadata. - Need to perform branch synchronizations, merges, or PR updates inside a GitHub Actions runtime.
- Extracting PR context, reviewing diffs, or commenting on specific PR threads.
Mindmap of Commands
mindmap
root((gh-pr))
checkout
Check out a PR in git
checks
Show CI status for a PR
close
Close a PR
comment
Add a comment to a PR
create
Create a pull request
diff
View changes in a PR
edit
Edit a PR (title, body, labels, etc.)
list
List pull requests in a repository
lock
Lock PR conversation
merge
Merge a PR
ready
Mark a draft PR as ready for review
reopen
Reopen a closed PR
revert
Revert a merged PR
review
Add a review to a PR (approve, request changes, or comment)
status
Show status of relevant PRs
unlock
Unlock PR conversation
update-branch
Update a PR branch with latest from base
view
View PR details, description, and commentsAdvanced PR Workflows
PR Creation with Metadata: Always prefer non-interactive creation in automated environments:
gh pr create --title "feature: add new component" --body-file /tmp/description.md --label "enhancement" --assignee "@me"Inspecting PR Checks and Logs: To see exactly why a PR is failing:
gh pr checks <number> --watchIf checks fail, use
gh-runskill to diagnose specific workflow failures.Listing Failed Checks: To quickly identify only the failing jobs for a specific PR:
gh pr checks <number> --repo <owner>/<repo> | grep failReviewing Changes: For quick review of changes without leaving the terminal:
gh pr diff <number> --color always | less -RMerging Strategies: Be explicit about the merge method:
gh pr merge <number> --merge # Create a merge commit gh pr merge <number> --squash # Squash and merge gh pr merge <number> --rebase # Rebase and merge
Pull Request Diagnostics & Checks
- Checking Runs for a Pull Request:
gh pr checks <number> --repo <owner>/<repo>is the quickest way to map checks directly to the PR's HEAD commit. This outputs standard CI/CD checks (successes, failures, skips) and provides direct URLs to the workflow jobs.- Limitation:
gh pr checksonly evaluates the HEAD commit. It completely misses manually triggered (workflow_dispatch) or comment-triggered (issue_comment) agent runs. - Workaround: To comprehensively fetch all workflow runs associated with
a PR (including custom actions and agentic runs),
refer to the
gh-apiskill for instructions on usinggh apito query by branch and display title.
Visualizing PR Checks
When you need to visualize the results of gh pr checks, you can
generate an architectural flowchart (using Mermaid) that categorizes
checks logically (e.g., CI Formatting vs Tests vs Molecule).
Example:
%% This flowchart visualizes the topology and statuses of CI/CD checks for a PR.
%% Data for this diagram can be retrieved natively using:
%% gh pr checks <number> --repo <owner>/<repo>
flowchart LR
pr(["PR {number}: {title}"])
subgraph Checks ["CI Format & Linting"]
direction TB
c3["actionlint<br>{job_id}"]:::pass
c1["link-checker<br>{job_id}"]:::pass
c2["pre-commit<br>{job_id}"]:::pass
end
subgraph Tests ["Tests"]
direction TB
t1["test-on-debian-latest<br>{job_id}"]:::pass
end
subgraph Molecule ["Scenarios"]
direction TB
m1["default / ubuntu-latest<br>{job_id}"]:::fail
m2["default / ubuntu-noble<br>{job_id}"]:::fail
end
pr --> Checks
pr --> Tests
pr --> Molecule
pr --> cr["CodeRabbit"]:::pass
classDef pass fill:#d4edda,stroke:#28a745,color:#155724,stroke-width:2px;
classDef fail fill:#f8d7da,stroke:#dc3545,color:#721c24,stroke-width:2px;Structured Query Patterns
- Extract PR commit history for Mermaid
gitGraph:- With Git (
git):git log origin/main..HEAD --reverse --format='commit id: "%s"' - For more context, load relevant skill files when working with this type of diagrams.
- With GitHub API (
gh api):gh api repos/<owner>/<repo>/pulls/<number>/commits \--jq '.[] | "commit id: \"[\(.sha[0:7])] \(.commit.message | split("\n")[0] | gsub("\""; "'\''"))\""' - With GitHub CLI (
gh):gh pr view <number> --json headRefName,baseRefName,commits
- With Git (
- Detailed JSON Retrieval (Comments & Reviews):
gh pr view <number> --repo <owner>/<repo> --json commentsgh pr view <number> --repo <owner>/<repo> --json reviews
- Lightweight PR context:
gh pr view <number> --json number,title,state,reviewDecision,url Listing PRs for a Specific Author:
gh pr list --author "@me" --state openChecking Mergeability:
gh pr view <number> --json mergeable,mergeStateStatus
Interaction & Comments
- For PR thread interactions, use
gh pr commentorgh api. For long comments, avoid heredocs as they can cause shell hangs if truncated. Write the comment to a temporary file first, then use
--body-file:# Use your file-writing tools to write the comment to /tmp/comment.md, then: gh pr comment <number> --body-file /tmp/comment.md- Note:
gh pr reviewis often restricted in automated environments (e.g., OpenCode); prefergh pr comment. - Dynamic PR Targeting: ALWAYS target the explicitly provided Base Branch when creating/updating PRs.
GitHub Actions Runtime
When executing autonomously within a GitHub Actions environment, adhere strictly to these interaction constraints:
OpenCode PR Context & Response Routing
Context & Targeting Invariants:
- Extract Context: Parse the
## Pull Request Contextblock containing**Base Branch:**dynamically. - Dynamic PR Targeting: ALWAYS target this explicitly provided Base Branch when creating/updating PRs.
Response Detection & Routing: Check github.event_name and payload to identify trigger source:
- General PR comment (
issue_comment):- Condition:
if: ${{ github.event.issue.pull_request }} - Reply Method:
gh pr comment
- Condition:
- Issue comment (
issue_comment):- Condition:
if: ${{ !github.event.issue.pull_request }} - Reply Method:
gh issue comment
- Condition:
- Inline code review (
pull_request_review_comment):- Reply Method:
gh api repos/<owner>/<repo>/pulls/<pr>/comments/<comment_id>/replies -f body="..."
- Reply Method:
Routing Invariants:
- Symmetric Routing: ALWAYS reply via the exact originating channel. NEVER cross threads.
- Parse
github.event.comment.idandin_reply_to_idto maintain thread continuity.
Branch Sync Policy (No Rebase During Runtime)
When the prompt asks to "pull" or "sync with base" in GitHub Actions runtime, the agent MUST integrate remote changes with a merge commit workflow.
- MUST NOT run any rebase-based update command during runtime.
- FORBIDDEN:
gh pr update-branch --rebase,git pull --rebase,git rebase, or any history rewrite that changes commit SHAs. - MUST use pull-with-merge semantics:
git pull --no-rebase. - MUST preserve remote branch compatibility for post-run auto PR/push logic.
Execution Steps (strict order):
- Determine PR base/head from context (
## Pull Request Context,gh pr view). - Ensure work is on the PR head branch (not detached HEAD).
- Sync head branch from remote with merge semantics:
git pull --no-rebase origin <head-branch>. - If base changes must be integrated into head, merge base explicitly:
git fetch origin <base-branch> && git merge --no-ff origin/<base-branch>. - Resolve conflicts, commit merge if required, then push normally (no force).
Verification Gate (required before push):
- Confirm no rebase command was executed in this run.
- Confirm
git log --oneline --graph -n 10shows merge topology (no rewritten linearized history from rebase). - Proceed with normal
git pushonly after these checks pass.
For high-level pull request routing guidance, refer to the github-pr skill.
Pre-Completion
Before finishing your session, you MUST ensure the workspace is in a valid state.
Workspace Cleanliness (Non-Modifying Tasks)
If the runtime did not involve intended modification of files:
- Verify: Run
git statusto confirm the workspace is clean. - Clean: If untracked or modified files exist (e.g., temporary analysis artifacts), run
git clean -fdandgit checkout -- .. - Assert: Ensure no PR or commit is triggered for purely informational tasks.
Failure Signatures
- "Draft PRs cannot be merged": Use
gh pr ready <number>first. - "Permission denied": Check
gh auth status. You may need to request additional scopes. - "PR already exists": If creating a PR fails because one exists for the branch, use
gh pr list --head <branch>to find it andgh pr editif updates are needed.
What to Avoid
- Avoid using
git pushthengh pr createseparately if you can usegh pr create --fillor--headto do it in one flow. - Do not use
gh apifor PR operations that have nativegh prsubcommands unless you need raw JSON fields not exposed by--json.
Related Skills
- gh-run:
You MUST load this skill when working with the
gh runand thegh workflowcommands. - git: You MUST load this skill when performing standard git operations.
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.

