AgentSkillsCN

github

为仓库、问题、PR、工作流和安全进行全面GitHub集成。在使用GitHub时使用:(1) 仓库操作——获取/创建文件、分支、搜索代码,(2) 问题管理——列出、创建、更新、评论问题,(3) 拉取请求——创建、审查、合并PR,检查CI状态,(4) GitHub Actions——列出工作流、查看运行、下载日志、触发工作流,(5) 代码安全——Dependabot警报、代码扫描、秘密扫描。需要具有适当范围的GITHUB_TOKEN环境变量。

SKILL.md
--- frontmatter
name: github
description: >-
  Complete GitHub integration for repositories, issues, PRs, workflows, and security.
  Use when working with GitHub: (1) Repository operations - get/create files, branches, search code,
  (2) Issue management - list, create, update, comment on issues,
  (3) Pull requests - create, review, merge PRs, check CI status,
  (4) GitHub Actions - list workflows, view runs, download logs, trigger workflows,
  (5) Code security - Dependabot alerts, code scanning, secret scanning.
  Requires GITHUB_TOKEN environment variable with appropriate scopes.
allowed-tools:
  - Bash
  - Read

GitHub Integration

Complete GitHub API integration for Claude Code. All operations require the GITHUB_TOKEN environment variable.

Quick Start

Verify authentication:

bash
python scripts/github_client.py --check-auth

Check rate limits:

bash
python scripts/github_client.py --rate-limit

Operation Reference

Choose your operation and load the appropriate reference file for detailed usage.

TaskReference FileCommon Operations
Repository/Filesrepos.mdGet files, create/update files, branches, fork
Issuesissues.mdList, create, update, comment, labels
Pull Requestspull-requests.mdCreate, review, merge, check status
GitHub Actionsactions.mdList runs, view logs, rerun, trigger
Securitycode-security.mdDependabot, code scanning, secrets
Searchsearch.mdSearch repos, code, issues, users
Troubleshootingapi-patterns.mdError handling, rate limits, patterns

Decision Tree

code
What do you need to do?
│
├── Work with files or code?
│   └── Read references/repos.md
│       - Get file contents
│       - Create/update files
│       - Create branches
│       - Fork repositories
│
├── Manage issues?
│   └── Read references/issues.md
│       - List/filter issues
│       - Create issues
│       - Update status/labels
│       - Add comments
│
├── Work with pull requests?
│   └── Read references/pull-requests.md
│       - Create PRs
│       - Review/approve
│       - Check CI status
│       - Merge PRs
│
├── GitHub Actions / CI?
│   └── Read references/actions.md
│       - List workflow runs
│       - View/download logs
│       - Rerun failed jobs
│       - Trigger workflows
│
├── Security alerts?
│   └── Read references/code-security.md
│       - Dependabot alerts
│       - Code scanning
│       - Secret scanning
│
└── Search GitHub?
    └── Read references/search.md
        - Search repositories
        - Search code
        - Search issues/PRs
        - Search users

All Scripts Support --help

Run any script with --help to see full usage:

bash
python scripts/repos.py --help
python scripts/issues.py --help
python scripts/pull_requests.py --help
python scripts/search.py --help
python scripts/actions.py --help
python scripts/code_security.py --help

Output Formats

All scripts support --format:

  • json (default) - Full JSON output
  • markdown - Human-readable format
  • minimal - Compact JSON

Required Token Scopes

OperationRequired Scopes
Repositories (public)public_repo
Repositories (private)repo
Issues & PRsrepo
GitHub Actionsworkflow
Code Securitysecurity_events
Search CodeAuthentication required