github
GitHub CLI operations for PRs, Issues, Labels, Milestones, Comments, and Reactions.Unified skill with shared helpers for DRY code.Use when Claude needs to: (1) Get PR context, diff, or changed files, (2) Reply toPR review comments preserving threads, (3) Post idempotent issue comments, (4) Applyor create labels, (5) Assign milestones, (6) Add reactions to comments, (7) Close ormerge PRs, (8) Resolve review threads, (9) Synthesize context for Copilot assignment,(10) Create new issues or PRs with validation.Do NOT use for: raw git operations, GitHub Actions workflow editing, repository settings.
When & Why to Use This Skill
This Claude skill provides a comprehensive suite of PowerShell-based tools for advanced GitHub repository management. It enables AI agents to perform structured operations on Pull Requests, Issues, labels, and milestones, ensuring consistent error handling and data-rich responses for complex development workflows. By replacing raw CLI commands with structured JSON outputs, it facilitates seamless automation of code reviews, project tracking, and CI/CD monitoring.
Use Cases
- Automated Code Review: Retrieve PR context, diffs, and file changes to analyze code quality and respond to specific review threads while preserving conversation history.
- CI/CD Pipeline Troubleshooting: Monitor CI check statuses in real-time and fetch detailed failure logs to diagnose and report integration issues automatically.
- Issue & Project Triage: Streamline repository maintenance by automatically creating issues, applying labels, assigning milestones, and managing assignees based on project needs.
- Intelligent PR Lifecycle Management: Verify merge readiness, manage auto-merge settings, and perform idempotent commenting to ensure efficient and clean pull request workflows.
| name | github |
|---|---|
| version | 3.1.0 |
| model | claude-opus-4-5 |
| description | Execute GitHub operations (PRs, issues, milestones, labels, comments, merges) |
| license | MIT |
| type | integration |
| complexity | intermediate |
GitHub Skill
Use these scripts instead of raw gh commands for consistent error handling and structured output.
Triggers
| Phrase | Operation |
|---|---|
get PR context for #123 |
Get-PRContext.ps1 |
respond to review comments |
Post-PRCommentReply.ps1 |
check CI status |
Get-PRChecks.ps1 |
add label to issue |
Set-IssueLabels.ps1 |
assign milestone |
Set-ItemMilestone.ps1 |
Decision Tree
Need GitHub data?
├─ List PRs (filtered) → Get-PullRequests.ps1
├─ PR info/diff → Get-PRContext.ps1
├─ CI check status → Get-PRChecks.ps1
├─ CI failure logs → Get-PRCheckLogs.ps1
├─ Review comments → Get-PRReviewComments.ps1
├─ Review threads → Get-PRReviewThreads.ps1
├─ Unique reviewers → Get-PRReviewers.ps1
├─ Unaddressed bot comments → Get-UnaddressedComments.ps1
├─ PR merged check → Test-PRMerged.ps1
├─ Copilot follow-up PRs → Detect-CopilotFollowUpPR.ps1
├─ Issue info → Get-IssueContext.ps1
├─ Merge readiness check → Test-PRMergeReady.ps1
├─ Latest milestone → Get-LatestSemanticMilestone.ps1
└─ Need to take action?
├─ Create issue → New-Issue.ps1
├─ Create PR → New-PR.ps1
├─ Reply to review → Post-PRCommentReply.ps1
├─ Reply to thread (GraphQL) → Add-PRReviewThreadReply.ps1
├─ Comment on issue → Post-IssueComment.ps1
├─ Add reaction → Add-CommentReaction.ps1
├─ Apply labels → Set-IssueLabels.ps1
├─ Set issue milestone → Set-IssueMilestone.ps1
├─ Set PR/issue milestone (auto-detect) → Set-ItemMilestone.ps1
├─ Assign issue → Set-IssueAssignee.ps1
├─ Resolve threads → Resolve-PRReviewThread.ps1
├─ Process AI triage → Invoke-PRCommentProcessing.ps1
├─ Assign Copilot → Invoke-CopilotAssignment.ps1
├─ Enable/disable auto-merge → Set-PRAutoMerge.ps1
├─ Close PR → Close-PR.ps1
└─ Merge PR → Merge-PR.ps1
Script Reference
PR Operations (scripts/pr/)
| Script | Purpose | Key Parameters |
|---|---|---|
Get-PullRequests.ps1 |
List PRs with filters | -State, -Label, -Author, -Base, -Head, -Limit |
Get-PRContext.ps1 |
PR metadata, diff, files | -PullRequest, -IncludeChangedFiles, -IncludeDiff |
Get-PRChecks.ps1 |
CI check status, polling | -PullRequest, -Wait, -TimeoutSeconds, -RequiredOnly |
Get-PRCheckLogs.ps1 |
Fetch logs from failing CI checks | -PullRequest, -MaxLines, -ContextLines |
Get-PRReviewComments.ps1 |
Paginated review comments | -PullRequest, -IncludeIssueComments |
Get-PRReviewThreads.ps1 |
Thread-level review data | -PullRequest, -UnresolvedOnly |
Get-PRReviewers.ps1 |
Enumerate unique reviewers | -PullRequest, -ExcludeBots |
Get-UnaddressedComments.ps1 |
Bot comments needing attention | -PullRequest |
Get-UnresolvedReviewThreads.ps1 |
Unresolved thread IDs | -PullRequest |
Test-PRMerged.ps1 |
Check if PR is merged | -PullRequest |
Detect-CopilotFollowUpPR.ps1 |
Detect Copilot follow-up PRs | -PRNumber, -Owner, -Repo |
Post-PRCommentReply.ps1 |
Thread-preserving replies | -PullRequest, -CommentId, -Body |
Add-PRReviewThreadReply.ps1 |
Reply to thread by ID (GraphQL) | -ThreadId, -Body, -Resolve |
Resolve-PRReviewThread.ps1 |
Mark threads resolved | -ThreadId or -PullRequest -All |
Unresolve-PRReviewThread.ps1 |
Mark threads unresolved | -ThreadId or -PullRequest -All |
Get-ThreadById.ps1 |
Get single thread by ID | -ThreadId |
Get-ThreadConversationHistory.ps1 |
Full thread comment history | -ThreadId, -IncludeMinimized |
Test-PRMergeReady.ps1 |
Check merge readiness | -PullRequest, -IgnoreCI, -IgnoreThreads |
Set-PRAutoMerge.ps1 |
Enable/disable auto-merge | -PullRequest, -Enable/-Disable, -MergeMethod |
Invoke-PRCommentProcessing.ps1 |
Process AI triage output | -PRNumber, -Verdict, -FindingsJson |
New-PR.ps1 |
Create PR with validation | -Title, -Body, -Base |
Close-PR.ps1 |
Close PR with comment | -PullRequest, -Comment |
Merge-PR.ps1 |
Merge with strategy | -PullRequest, -Strategy, -DeleteBranch, -Auto |
Issue Operations (scripts/issue/)
| Script | Purpose | Key Parameters |
|---|---|---|
Get-IssueContext.ps1 |
Issue metadata | -Issue |
New-Issue.ps1 |
Create new issue | -Title, -Body, -Labels |
Set-IssueLabels.ps1 |
Apply labels (auto-create) | -Issue, -Labels, -Priority |
Set-IssueMilestone.ps1 |
Assign milestone | -Issue, -Milestone |
Post-IssueComment.ps1 |
Comments with idempotency | -Issue, -Body, -Marker |
Invoke-CopilotAssignment.ps1 |
Synthesize context for Copilot | -IssueNumber, -WhatIf |
Set-IssueAssignee.ps1 |
Assign users to issues | -Issue, -Assignees |
Milestone Operations (scripts/milestone/)
| Script | Purpose | Key Parameters |
|---|---|---|
Get-LatestSemanticMilestone.ps1 |
Detect latest semantic version milestone | -Owner, -Repo |
Set-ItemMilestone.ps1 |
Assign milestone to PR/issue (auto-detect) | -ItemType, -ItemNumber, -MilestoneTitle |
Reactions (scripts/reactions/)
| Script | Purpose | Key Parameters |
|---|---|---|
Add-CommentReaction.ps1 |
Add emoji reactions (batch support) | -CommentId[], -Reaction, -CommentType |
Output Format
All scripts output structured JSON with Success boolean:
$result = pwsh -NoProfile scripts/pr/Get-PRContext.ps1 -PullRequest 50 | ConvertFrom-Json
if ($result.Success) { ... }
Process
This skill provides a toolkit of PowerShell scripts for GitHub operations. Use scripts directly or compose them into workflows.
Basic Usage:
- Identify the operation needed using the Decision Tree
- Find the corresponding script in the Script Reference
- Call the script with required parameters
- Parse the JSON output and check
Successfield
Example Flow:
# Get PR context
$pr = pwsh scripts/pr/Get-PRContext.ps1 -PullRequest 123 | ConvertFrom-Json
# Check CI status
$checks = pwsh scripts/pr/Get-PRChecks.ps1 -PullRequest 123 | ConvertFrom-Json
# Add comment if needed
if ($checks.FailedCount -gt 0) {
pwsh scripts/pr/Post-PRCommentReply.ps1 -PullRequest 123 -Body "CI failures detected"
}
Anti-Patterns
| Avoid | Why | Instead |
|---|---|---|
Raw gh pr view commands |
No structured output | Use Get-PRContext.ps1 |
Raw gh api for comments |
Doesn't preserve threading | Use Post-PRCommentReply.ps1 |
| Replying to thread expecting auto-resolve | Replies DON'T auto-resolve threads | Use Resolve-PRReviewThread.ps1 after reply |
| Inline issue creation | Missing validation | Use New-Issue.ps1 |
| Multiple individual reactions | 88% slower | Use batch mode in Add-CommentReaction.ps1 |
| Hardcoding owner/repo | Breaks in forks | Let scripts infer from git remote |
| Ignoring exit codes | Missing error handling | Check $LASTEXITCODE |
| Skipping idempotency markers | Duplicate comments | Use -Marker parameter |
See Also
| Document | Content |
|---|---|
| examples.md | Complete script examples |
| patterns.md | Reusable workflow patterns |
| copilot-prompts.md | Creating @copilot directives |
| copilot-synthesis-guide.md | Copilot context synthesis |
| api-reference.md | Exit codes, API endpoints, troubleshooting |
modules/GitHubCore.psm1 |
Shared helper functions |
Verification
Before completing a GitHub operation:
- Correct script selected from Decision Tree
- Required parameters provided (PR/issue number)
- Response JSON parsed successfully
-
Success: truein response - State change verified (for mutating operations)