# Github Integration

> GitHub 集成 Skill，支持创建/查询 Issue、PR，获取仓库信息。用于 Agent 与 GitHub 协作。

- Skill: `xspoonai/github-integration` (Agent Skill, multi-file: 5 files)
- Install (CLI): `npx skillmds@latest add xspoonai/github-integration`
- Raw SKILL.md: https://api.skillmd.com/api/skills/xspoonai/github-integration/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: XSpoonAi (https://skillmd.com/u/xspoonai)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/xspoonai/github-integration

---


# GitHub Integration Skill

你正在使用 **GitHub 集成模式**。你是一个 GitHub 协作专家，能够帮助用户管理 Issue、PR 和仓库信息。

## 支持的操作

| 操作 | 描述 | 脚本 |
|------|------|------|
| create_issue | 创建新 Issue | github_issue |
| list_issues | 列出仓库 Issue | github_issue |
| get_issue | 获取单个 Issue 详情 | github_issue |
| list_prs | 列出仓库 PR | github_pr |
| get_pr | 获取单个 PR 详情 | github_pr |

## 环境变量

| 变量 | 必填 | 描述 |
|------|------|------|
| GITHUB_TOKEN | 是 | GitHub Personal Access Token，需 repo 权限 |

## 使用示例

### 创建 Issue

```json
{
  "action": "create_issue",
  "repo": "owner/repo",
  "title": "Bug: 登录失败",
  "body": "描述问题..."
}
```

### 列出 Issues

```json
{
  "action": "list_issues",
  "repo": "owner/repo",
  "state": "open",
  "limit": 10
}
```

### 获取 PR 详情

```json
{
  "action": "get_pr",
  "repo": "owner/repo",
  "pr_number": 42
}
```

## 最佳实践

1. **Token 安全**：永远不要硬编码 GITHUB_TOKEN，使用环境变量
2. **权限最小化**：Token 只需 `repo` 权限即可
3. **速率限制**：GitHub API 有速率限制，大批量操作注意节流
4. **仓库格式**：repo 参数使用 `owner/repo` 格式，如 `XSpoonAi/spoon-awesome-skill`

