GitHub CLI operations for issues, PRs, milestones, and Projects v2. Covers gh commands, REST API patterns, and automation scripts. Use when managing GitHub issues, PRs, milestones, or Projects with gh.
Manages GitHub issues, PRs, milestones, and Projects v2 using CLI commands and REST API patterns.
/plugin marketplace add yonatangross/orchestkit/plugin install orkl@orchestkitThis skill inherits all available tools. When active, it can use any tool Claude has access to.
examples/automation-scripts.mdreferences/cli-vs-api-identifiers.mdreferences/graphql-api.mdreferences/issue-management.mdreferences/milestone-api.mdreferences/pr-workflows.mdreferences/projects-v2.mdrules/_sections.mdrules/_template.mdrules/issue-branch-linking.mdrules/issue-tracking-automation.mdComprehensive GitHub CLI (gh) operations for project management, from basic issue creation to advanced Projects v2 integration and milestone tracking via REST API.
gh# Create issue with labels and milestone
gh issue create --title "Bug: API returns 500" --body "..." --label "bug" --milestone "Sprint 5"
# List and filter issues
gh issue list --state open --label "backend" --assignee @me
# Edit issue metadata
gh issue edit 123 --add-label "high" --milestone "v2.0"
# Create PR with reviewers
gh pr create --title "feat: Add search" --body "..." --base dev --reviewer @teammate
# Watch CI status and auto-merge
gh pr checks 456 --watch
gh pr merge 456 --auto --squash --delete-branch
# Resume a session linked to a PR (CC 2.1.27)
claude --from-pr 456 # Resume session with PR context (diff, comments, review status)
claude --from-pr https://github.com/org/repo/pull/456
Tip (CC 2.1.27): Sessions created via
gh pr createare automatically linked to the PR. Use--from-prto resume with full PR context.
Footgun:
gh issue edit --milestonetakes a NAME (string), not a number. The REST API uses a NUMBER (integer). Never pass a number to--milestone. See CLI-vs-API Identifiers.
# List milestones with progress
gh api repos/:owner/:repo/milestones --jq '.[] | "\(.title): \(.closed_issues)/\(.open_issues + .closed_issues)"'
# Create milestone with due date
gh api -X POST repos/:owner/:repo/milestones \
-f title="Sprint 8" -f due_on="2026-02-15T00:00:00Z"
# Close milestone (API uses number, not name)
MILESTONE_NUM=$(gh api repos/:owner/:repo/milestones --jq '.[] | select(.title=="Sprint 8") | .number')
gh api -X PATCH repos/:owner/:repo/milestones/$MILESTONE_NUM -f state=closed
# Assign issues to milestone (CLI uses name, not number)
gh issue edit 123 124 125 --milestone "Sprint 8"
# Add issue to project
gh project item-add 1 --owner @me --url https://github.com/org/repo/issues/123
# Set custom field (requires GraphQL)
gh api graphql -f query='mutation {...}' -f projectId="..." -f itemId="..."
# Get issue numbers matching criteria
gh issue list --json number,labels --jq '[.[] | select(.labels[].name == "bug")] | .[].number'
# PR summary with author
gh pr list --json number,title,author --jq '.[] | "\(.number): \(.title) by \(.author.login)"'
# Find ready-to-merge PRs
gh pr list --json number,reviewDecision,statusCheckRollupState \
--jq '[.[] | select(.reviewDecision == "APPROVED" and .statusCheckRollupState == "SUCCESS")]'
| Milestones | Epics |
|---|---|
| Time-based (sprints, releases) | Topic-based (features) |
| Has due date | No due date |
| Progress bar | Task list checkbox |
| Native REST API | Needs workarounds |
Rule: Use milestones for "when", use parent issues for "what".
Projects v2 uses GraphQL for setting custom fields (Status, Priority, Domain). Basic gh project commands work for listing and adding items, but field updates require GraphQL mutations.
| Rule | Impact | What It Covers |
|---|---|---|
| issue-tracking-automation | HIGH | Auto-progress from commits, sub-task completion, session summaries |
| issue-branch-linking | MEDIUM | Branch naming, commit references, PR linking patterns |
When creating multiple issues at once (e.g., seeding a sprint), use an array-driven loop:
# Define issues as an array of "title|labels|milestone" entries
SPRINT="Sprint 9"
ISSUES=(
"feat: Add user auth|enhancement,backend|$SPRINT"
"fix: Login redirect loop|bug,high|$SPRINT"
"chore: Update dependencies|maintenance|$SPRINT"
)
for entry in "${ISSUES[@]}"; do
IFS='|' read -r title labels milestone <<< "$entry"
NUM=$(gh issue create \
--title "$title" \
--label "$labels" \
--milestone "$milestone" \
--body "" \
--json number --jq '.number')
echo "Created #$NUM: $title"
done
Tip: Capture the created issue number with
--json number --jq '.number'so you can reference it immediately (e.g., add to Projects v2, link in PRs).
--json for scripting - Parse with --jq for reliability--title, --body flagsgh api rate_limit--body "$(cat <<'EOF'...EOF)"Closes #123, Fixes #456 — GitHub auto-closes on mergeYYYY-MM-DDTHH:MM:SSZ for milestone due_on--milestone takes NAME, not number - See CLI-vs-API Identifiersgh issue close directly - Comment progress with gh issue comment; issues close only when their linked PR merges to the default branchork:create-pr - Create pull requests with proper formatting and review assignmentsork:review-pr - Comprehensive PR review with specialized agentsork:release-management - GitHub release workflow with semantic versioning and changelogsstacked-prs - Manage dependent PRs with rebase coordinationork:issue-progress-tracking - Automatic issue progress updates from commits| Decision | Choice | Rationale |
|---|---|---|
| CLI vs API | gh CLI preferred | Simpler auth, better UX, handles pagination automatically |
| Output format | --json with --jq | Reliable parsing for automation, no regex parsing needed |
| Milestones vs Epics | Milestones for time | Milestones have due dates and progress bars, epics for topic grouping |
| Projects v2 fields | GraphQL mutations | gh project commands limited, GraphQL required for custom fields |
| Milestone lifecycle | Close, don't delete | Preserves history and progress tracking |
Activates when the user asks about AI prompts, needs prompt templates, wants to search for prompts, or mentions prompts.chat. Use for discovering, retrieving, and improving prompts.
Search, retrieve, and install Agent Skills from the prompts.chat registry using MCP tools. Use when the user asks to find skills, browse skill catalogs, install a skill for Claude, or extend Claude's capabilities with reusable AI agent components.
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems. Create original algorithmic art rather than copying existing artists' work to avoid copyright violations.