github

Execute GitHub operations (PRs, issues, labels, comments, merges) using PowerShell scripts with structured output and error handling. Use when working with pull requests, issues, review comments, or CI checks instead of raw gh commands.

model: claude-opus-4-5

$ Installieren

git clone https://github.com/rjmurillo/ai-agents /tmp/ai-agents && cp -r /tmp/ai-agents/.claude/skills/github ~/.claude/skills/ai-agents

// tip: Run this command in your terminal to install the skill


name: github version: 3.0.0 description: Execute GitHub operations (PRs, issues, labels, comments, merges) using PowerShell scripts with structured output and error handling. Use when working with pull requests, issues, review comments, or CI checks instead of raw gh commands. license: MIT model: claude-opus-4-5 metadata: domains:

  • github
  • pr
  • issue
  • labels
  • milestones
  • comments
  • reactions type: integration complexity: intermediate generator: keep_headings:
    • Decision Tree
    • Script Reference
    • Output Format
    • See Also

GitHub Skill

Use these scripts instead of raw gh commands for consistent error handling and structured output.


Triggers

PhraseOperation
get PR context for #123Get-PRContext.ps1
respond to review commentsPost-PRCommentReply.ps1
add label to issue #456Set-IssueLabels.ps1
merge this PRMerge-PR.ps1

Decision Tree

Need GitHub data?
├─ List PRs (filtered) → Get-PullRequests.ps1
├─ PR info/diff → Get-PRContext.ps1
├─ CI check status → Get-PRChecks.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
└─ 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 milestone → Set-IssueMilestone.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/)

ScriptPurposeKey Parameters
Get-PullRequests.ps1List PRs with filters-State, -Label, -Author, -Base, -Head, -Limit
Get-PRContext.ps1PR metadata, diff, files-PullRequest, -IncludeChangedFiles, -IncludeDiff
Get-PRChecks.ps1CI check status, polling-PullRequest, -Wait, -TimeoutSeconds, -RequiredOnly
Get-PRReviewComments.ps1Paginated review comments-PullRequest, -IncludeIssueComments
Get-PRReviewThreads.ps1Thread-level review data-PullRequest, -UnresolvedOnly
Get-PRReviewers.ps1Enumerate unique reviewers-PullRequest, -ExcludeBots
Get-UnaddressedComments.ps1Bot comments needing attention-PullRequest
Get-UnresolvedReviewThreads.ps1Unresolved thread IDs-PullRequest
Test-PRMerged.ps1Check if PR is merged-PullRequest
Detect-CopilotFollowUpPR.ps1Detect Copilot follow-up PRs-PRNumber, -Owner, -Repo
Post-PRCommentReply.ps1Thread-preserving replies-PullRequest, -CommentId, -Body
Add-PRReviewThreadReply.ps1Reply to thread by ID (GraphQL)-ThreadId, -Body, -Resolve
Resolve-PRReviewThread.ps1Mark threads resolved-ThreadId or -PullRequest -All
Unresolve-PRReviewThread.ps1Mark threads unresolved-ThreadId or -PullRequest -All
Get-ThreadById.ps1Get single thread by ID-ThreadId
Get-ThreadConversationHistory.ps1Full thread comment history-ThreadId, -IncludeMinimized
Test-PRMergeReady.ps1Check merge readiness-PullRequest, -IgnoreCI, -IgnoreThreads
Set-PRAutoMerge.ps1Enable/disable auto-merge-PullRequest, -Enable/-Disable, -MergeMethod
Invoke-PRCommentProcessing.ps1Process AI triage output-PRNumber, -Verdict, -FindingsJson
New-PR.ps1Create PR with validation-Title, -Body, -Base
Close-PR.ps1Close PR with comment-PullRequest, -Comment
Merge-PR.ps1Merge with strategy-PullRequest, -Strategy, -DeleteBranch, -Auto

Issue Operations (scripts/issue/)

ScriptPurposeKey Parameters
Get-IssueContext.ps1Issue metadata-Issue
New-Issue.ps1Create new issue-Title, -Body, -Labels
Set-IssueLabels.ps1Apply labels (auto-create)-Issue, -Labels, -Priority
Set-IssueMilestone.ps1Assign milestone-Issue, -Milestone
Post-IssueComment.ps1Comments with idempotency-Issue, -Body, -Marker
Invoke-CopilotAssignment.ps1Synthesize context for Copilot-IssueNumber, -WhatIf

Reactions (scripts/reactions/)

ScriptPurposeKey Parameters
Add-CommentReaction.ps1Add 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) { ... }

Anti-Patterns

AvoidWhyInstead
Raw gh pr view commandsNo structured outputUse Get-PRContext.ps1
Raw gh api for commentsDoesn't preserve threadingUse Post-PRCommentReply.ps1
Inline issue creationMissing validationUse New-Issue.ps1
Multiple individual reactions88% slowerUse batch mode in Add-CommentReaction.ps1
Hardcoding owner/repoBreaks in forksLet scripts infer from git remote
Ignoring exit codesMissing error handlingCheck $LASTEXITCODE
Skipping idempotency markersDuplicate commentsUse -Marker parameter

See Also

DocumentContent
examples.mdComplete script examples
patterns.mdReusable workflow patterns
copilot-prompts.mdCreating @copilot directives
copilot-synthesis-guide.mdCopilot context synthesis
api-reference.mdExit codes, API endpoints, troubleshooting
modules/GitHubCore.psm1Shared 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: true in response
  • State change verified (for mutating operations)