用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/majiayu000/claude-skill-registry --skill agent-ops-github命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
| name | agent-ops-github |
| description | Bidirectional sync between agent-ops issues and GitHub Issues |
| category | extended |
| invokes | ["agent-ops-state","agent-ops-tasks"] |
| invoked_by | [] |
| state_files | {"read":["issues/*.md","focus.md"],"write":["issues/*.md","focus.md"]} |
Bidirectional sync between agent-ops issues and GitHub Issues. Push local issues to GitHub, pull from GitHub to local, and manage the connection.
Tier: 3 (Utility)
Works with or without aoc CLI installed
Before any GitHub API operation, you MUST:
owner/repo formatI will {push/pull/sync} issues {to/from} github.com/{owner}/{repo}:
- Operation: {describe what will happen}
- Issues affected: {count or list}
This will make API calls to GitHub. Continue? [Y/N]
GITHUB_TOKEN environment variable (required)repo scope (or public_repo for public repos)repo scope.env: GITHUB_TOKEN=ghp_xxxxxxxxxxxx# See sync overview between local and GitHub
aoc github sync status --repo owner/repo
# Push a single issue
aoc github sync push FEAT-0042 --repo owner/repo
# Push all todo issues
aoc github sync push-all --repo owner/repo --status todo
# Push all issues (dry run first)
aoc github sync push-all --repo owner/repo --dry-run
# Use visible metadata block (instead of hidden comment)
aoc github sync push FEAT-0042 --repo owner/repo --visible
# Pull a single GitHub issue (dry run by default)
aoc github sync pull 123 --repo owner/repo
# Actually import it
aoc github sync pull 123 --repo owner/repo --no-dry-run
# Pull all issues with agent-ops label
aoc github sync pull-all --repo owner/repo
# Pull all (actually import)
aoc github sync pull-all --repo owner/repo --no-dry-run
When pushing to GitHub:
type:feat, type:bug, etc.priority:high, priority:medium, etc.epic:{name}todo/in_progress → open, done → closed<details> block)When pulling from GitHub:
# All open issues
aoc github issues list --repo owner/repo --state open
# All issues including closed
aoc github issues list --repo owner/repo --state all
# Search issues
aoc github issues search "feature request" --repo owner/repo
# Issues by label
aoc github issues by-label bug --repo owner/repo
# Get issue #42 with all comments
aoc github issues get 42 --repo owner/repo --comments --json
# List PRs
aoc github pr list --repo owner/repo --state open
# PRs for a specific branch
aoc github pr list --repo owner/repo --branch feature/my-branch
# All comments for a PR
aoc github pr comments 123 --repo owner/repo --json
# Reviews for a PR
aoc github pr reviews 123 --repo owner/repo --json
# Everything for a PR (comments + reviews)
aoc github pr by-branch feature/my-branch --repo owner/repo --comments
import os
import requests
# Configuration
GITHUB_TOKEN = os.environ.get("GITHUB_TOKEN")
OWNER = "owner"
REPO = "repo"
BASE_URL = "https://api.github.com"
headers = {
"Authorization": f"Bearer {GITHUB_TOKEN}",
"Accept": "application/vnd.github+json",
"X-GitHub-Api-Version": "2022-11-28",
}
# List issues
def list_issues(state="open"):
url = f"{BASE_URL}/repos/{OWNER}/{REPO}/issues"
params = {"state": state, "per_page": 100}
all_issues = []
while url:
resp = requests.get(url, headers=headers, params=params)
resp.raise_for_status()
issues = resp.json()
# Filter out pull requests (they appear in issues endpoint)
all_issues.extend([i for i in issues if "pull_request" not in i])
# Check for next page
url = resp.links.get("next", {}).get("url")
params = None
return all_issues
# Create issue with metadata
def create_issue(title, body, labels):
url = f"{BASE_URL}/repos///issues"
data = {: title, : body, : labels}
resp = requests.post(url, headers=headers, json=data)
resp.raise_for_status()
resp.json()
When pushed to GitHub, the issue body contains:
{Description from local issue}
## Acceptance Criteria
- [ ] First criterion
- [ ] Second criterion
<!-- agent-ops-metadata
id: FEAT-0042@abc123
confidence: normal
epic: agent-ops-cli
acceptance_criteria:
- First criterion
- Second criterion
depends_on:
- FEAT-0040
-->
The metadata block is hidden in the rendered view but preserved for sync.
For visible metadata (useful for transparency), use --visible:
{Description}
<details>
<summary>Agent-Ops Metadata</summary>
yaml
id: FEAT-0042@abc123
...
</details>
| Local Field | GitHub Label |
|---|---|
| type: FEAT | type:feat |
| type: BUG | type:bug |
| type: CHORE | type:chore |
| priority: critical | priority:critical |
| priority: high | priority:high |
| priority: medium | priority:medium |
| priority: low | priority:low |
| epic: agent-ops-cli | epic:agent-ops-cli |
| (always added) | agent-ops |
GitHub API has rate limits:
If rate limited, wait and retry. The client handles this automatically with retries.
| Error | Cause | Solution |
|---|---|---|
| 401 Unauthorized | Invalid/expired token | Regenerate GITHUB_TOKEN |
| 403 Forbidden | Rate limit or no access | Wait or check permissions |
| 404 Not Found | Wrong repo or issue | Verify owner/repo/number |
1. Create working branch for issue
2. Work on the issue
3. Push issue to GitHub: aoc github sync push FEAT-0042 --repo owner/repo
4. Create PR referencing the GitHub issue
1. Complete work on feature
2. Push all done issues: aoc github sync push-all --repo owner/repo --status done
3. Create clean branch for PR
4. GitHub issue automatically closed when merged
# First, dry run to see what will happen
aoc github sync push FEAT-0042 --repo myorg/myrepo --dry-run
# Output: Would create GitHub issue #... from FEAT-0042
# Actually push
aoc github sync push FEAT-0042 --repo myorg/myrepo
# Output: Created FEAT-0042 → #156
# Push all in-progress issues
aoc github sync push-all --repo myorg/myrepo --status in_progress
# Output:
# Created: 2
# Updated: 1
# Skipped: 5
# See what would be imported
aoc github sync pull-all --repo myorg/myrepo
# Output shows issues with agent-ops label/metadata
# Actually import them
aoc github sync pull-all --repo myorg/myrepo --no-dry-run
基于 SOC 职业分类