Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问clear审计提醒

github-operationsGitHub operations 搜索

Agent Skill

用于围绕 GitHub 仓库、Issue、Pull Request、分支、提交和代码协作流程提供辅助能力。它适合让 Agent 查询项目状态、整理变更、辅助创建或检查协作事项,并把仓库中的信息转成可执行的下一步。使用时需要区分只读查询和写入操作;涉及创建 PR、修改 Issue、推送分支或访问私有仓库时,应确认 token 权限、目标仓库范围和用户授权。

总安装

3,026

周安装

130

GitHub Stars

161

下载量

1,061
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:github-operations(GitHub operations 搜索)
来源仓库:https://github.com/yonatangross/orchestkit
仓库路径:skills/github-operations
安装命令:
npx skills add https://github.com/yonatangross/orchestkit --skill github-operations
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/yonatangross/orchestkit --skill github-operations

简介

用于自动化 GitHub 仓库的日常运维任务。

  • 包括清理、归档、备份等例行工作。
  • 支持定时任务和事件触发执行。github-operations 属于研究检索类 Skill,可作为该场景下的辅助能力补充。
  • 减少人工维护负担和出错概率。适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。
  • 配置不当可能导致数据丢失,需谨慎使用。

SKILL.md

GitHub Operations

Comprehensive GitHub CLI (gh) operations for project management, from basic issue creation to advanced Projects v2 integration and milestone tracking via REST API.

Overview

  • Creating and managing GitHub issues and PRs
  • Working with GitHub Projects v2 custom fields
  • Managing milestones (sprints, releases) via REST API
  • Automating bulk operations with gh
  • Running GraphQL queries for complex operations

CRITICAL: Task Management is MANDATORY (CC 2.1.16)

BEFORE doing ANYTHING else, create tasks to track progress:

# 1. Create main task IMMEDIATELY
TaskCreate(
  subject="GitHub Operations: {target}",
  description="Managing GitHub issues, PRs, milestones, or Projects",
  activeForm="Managing GitHub resources"
)

# 2. Create subtasks matching the operation scope
TaskCreate(subject="Issue management", activeForm="Creating/updating issues")
TaskCreate(subject="PR management", activeForm="Managing pull requests")
TaskCreate(subject="Milestone tracking", activeForm="Updating milestones")

# 3. Set dependencies if operations are sequential
TaskUpdate(taskId="3", addBlockedBy=["2"])
TaskUpdate(taskId="4", addBlockedBy=["3"])

# 4. Before starting each task, verify it's unblocked
task = TaskGet(taskId="2")  # Verify blockedBy is empty

# 5. Update status as you progress
TaskUpdate(taskId="2", status="in_progress")  # When starting
TaskUpdate(taskId="2", status="completed")    # When done

Quick Reference

Issue Operations

# 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"

PR Operations

# 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 create are automatically linked to the PR. Use --from-pr to resume with full PR context.

Milestone Operations (REST API)

Footgun: gh issue edit --milestone takes a NAME (string), not a number. The REST API uses a NUMBER (integer). Never pass a number to --milestone. Load Read("${CLAUDE_SKILL_DIR}/references/cli-vs-api-identifiers.md").
# 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"

Projects v2 Operations

# 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="..."

JSON Output Patterns

# 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")]'

Key Concepts

Milestone vs Epic

MilestonesEpics
Time-based (sprints, releases)Topic-based (features)
Has due dateNo due date
Progress barTask list checkbox
Native REST APINeeds workarounds

Rule: Use milestones for "when", use parent issues for "what".

Projects v2 Custom Fields

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.


Rules Quick Reference

RuleImpactWhat It Covers
issue-tracking-automation (load ${CLAUDE_SKILL_DIR}/rules/issue-tracking-automation.md)HIGHAuto-progress from commits, sub-task completion, session summaries
issue-branch-linking (load ${CLAUDE_SKILL_DIR}/rules/issue-branch-linking.md)MEDIUMBranch naming, commit references, PR linking patterns

Batch Issue Creation

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).

Best Practices

  1. Always use --json for scripting - Parse with --jq for reliability
  2. Non-interactive mode for automation - Use --title, --body flags
  3. Check rate limits before bulk operations - gh api rate_limit. On CC ≥ 2.1.116, the Bash tool surfaces a rate-limit hint in the transcript when gh hits 403 — treat that hint as authoritative and back off, don't blind-retry. Before 2.1.116, agents had no signal and would burn all retry attempts in ~13 s.
  4. Use heredocs for multi-line content - --body "$(cat <<'EOF'...EOF)"
  5. Link issues in PRs - Closes #123, Fixes #456 — GitHub auto-closes on merge
  6. Use ISO 8601 dates - YYYY-MM-DDTHH:MM:SSZ for milestone due_on
  7. Close milestones, don't delete - Preserve history
  8. --milestone takes NAME, not number - Load Read("${CLAUDE_SKILL_DIR}/references/cli-vs-api-identifiers.md")
  9. Never gh issue close directly - Comment progress with gh issue comment; issues close only when their linked PR merges to the default branch

2026 CLI changes — what to know

gh-copilot extension is retired

GitHub retired the gh-copilot extension in October 2025. Copilot is now a standalone binary:

# OLD — no longer supported
gh extension install github/gh-copilot   # fails
gh copilot suggest "revert last commit"   # fails

# NEW — standalone `copilot` binary
copilot suggest "revert last commit"
copilot explain "git rebase -i HEAD~5"

Install from cli.github.com/copilot or via Homebrew (brew install github/gh/copilot). Authentication is shared with gh auth when both are installed.

gh agent-task (2026)

New subcommand for managing Copilot coding-agent tasks:

gh agent-task create --repo owner/repo --title "Fix flaky login test"
gh agent-task list --state open
gh agent-task view 42 --log          # stream agent log
gh agent-task watch 42                # live-follow until completion
gh agent-task cancel 42

Pairs with the REST endpoint POST /repos/{owner}/{repo}/agent-tasks for CI-driven task creation.

Sub-issues (native, 2026)

Sub-issues are now a native GitHub concept — no extension required:

# List sub-issues of parent #123
gh api repos/{owner}/{repo}/issues/123/sub_issues

# Add an existing issue #456 as sub-issue of #123
gh api -X POST repos/{owner}/{repo}/issues/123/sub_issues \
  -f sub_issue_id=$(gh api repos/{owner}/{repo}/issues/456 --jq .node_id)

# Remove a sub-issue relationship
gh api -X DELETE repos/{owner}/{repo}/issues/123/sub_issue \
  -F sub_issue_id=<id>

The old gh-sub-issue third-party extension still works but is superseded. GraphQL sub-issue mutations still require the issue node_id (see references/cli-vs-api-identifiers.md).


Related Skills

  • ork:create-pr - Create pull requests with proper formatting and review assignments
  • ork:review-pr - Comprehensive PR review with specialized agents
  • ork:release-management - GitHub release workflow with semantic versioning and changelogs
  • stacked-prs - Manage dependent PRs with rebase coordination
  • ork:issue-progress-tracking - Automatic issue progress updates from commits

Key Decisions

DecisionChoiceRationale
CLI vs APIgh CLI preferredSimpler auth, better UX, handles pagination automatically
Output format--json with --jqReliable parsing for automation, no regex parsing needed
Milestones vs EpicsMilestones for timeMilestones have due dates and progress bars, epics for topic grouping
Projects v2 fieldsGraphQL mutationsgh project commands limited, GraphQL required for custom fields
Milestone lifecycleClose, don't deletePreserves history and progress tracking

References

Load on demand with Read("${CLAUDE_SKILL_DIR}/references/<file>"):

FileContent
issue-management.mdBulk operations, templates, sub-issues
pr-workflows.mdReviews, merge strategies, auto-merge
milestone-api.mdREST API patterns for milestone CRUD
projects-v2.mdCustom fields, GraphQL mutations
graphql-api.mdComplex queries, pagination, bulk operations
cli-vs-api-identifiers.mdNAME vs NUMBER footguns, milestone/project ID mapping

Examples

Load: Read("${CLAUDE_SKILL_DIR}/examples/automation-scripts.md") - Ready-to-use scripts for bulk operations, PR automation, milestone management

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

31.02%
按下载量换算329

windsurf

25.13%
按下载量换算267

trae

16.99%
按下载量换算180

OpenCode

12.97%
按下载量换算138

Codex

7.68%
按下载量换算81

Antigravity

3.87%
按下载量换算41

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。

来源信息

继续浏览同类 Skills