github-ops
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGitHub Ops Skill
GitHub 操作技能
Provides structured guidance for repository reconnaissance using and .
gh apigh search提供使用和进行仓库侦察的结构化指导。
gh apigh searchOverview
概述
Repository reconnaissance often fails when agents guess file paths or attempt to fetch large files blindly. This skill enforces a structured sequence using the GitHub CLI to minimize token waste and improve reliability.
Map -> Identify -> Fetch当Agent盲目猜测文件路径或尝试拉取大文件时,仓库侦察往往会失败。本技能通过GitHub CLI强制执行的结构化流程,以减少Token浪费并提升可靠性。
映射 -> 识别 -> 拉取⚡ Essential Reconnaissance Commands
⚡ 核心侦察命令
Use these commands to understand a repository structure before fetching content.
在拉取内容之前,使用这些命令了解仓库结构。
1. List Repository Root
1. 列出仓库根目录
bash
gh api repos/{owner}/{repo}/contents --jq '.[].name'bash
gh api repos/{owner}/{repo}/contents --jq '.[].name'2. List Specific Directory
2. 列出指定目录
bash
gh api repos/{owner}/{repo}/contents/{path} --jq '.[].name'bash
gh api repos/{owner}/{repo}/contents/{path} --jq '.[].name'3. Fetch File Content (Base64 Decoded)
3. 拉取文件内容(Base64解码)
bash
gh api repos/{owner}/{repo}/contents/{path} --jq '.content' | base64 -dbash
gh api repos/{owner}/{repo}/contents/{path} --jq '.content' | base64 -d4. Search for Pattern in Repository
4. 在仓库中搜索模式
bash
gh search code "{pattern}" --repo {owner}/{repo}bash
gh search code "{pattern}" --repo {owner}/{repo}5. Get Repository Metadata
5. 获取仓库元数据
bash
gh repo view {owner}/{repo} --json description,stargazerCount,updatedAtbash
gh repo view {owner}/{repo} --json description,stargazerCount,updatedAt🔄 Token-Efficient Workflow
🔄 高效使用Token的工作流
- Map Tree: List the root and core directories (,
commands,src).docs - Identify Entrypoints: Look for ,
README.md,gemini-extension.json, orpackage.json.SKILL.md - Targeted Fetch: Download only the entrypoints first.
- Deep Dive: Use to find logic patterns rather than reading every file.
gh search code
- 映射目录树:列出根目录和核心目录(、
commands、src)。docs - 识别入口点:查找、
README.md、gemini-extension.json或package.json。SKILL.md - 定向拉取:先仅下载入口点文件。
- 深度探索:使用查找逻辑模式,而非读取每个文件。
gh search code
🛡️ Platform Safety (Windows)
🛡️ 平台安全(Windows)
- When using , ensure the output is redirected to a file using the
base64 -dtool if it's large.Write - Avoid Linux-style patterns in complex pipes.
/dev/stdin - Use native paths for any local storage.
- 使用时,如果输出内容较大,请确保使用Write工具将其重定向到文件。
base64 -d - 在复杂管道中避免使用Linux风格的模式。
/dev/stdin - 任何本地存储都使用原生路径。
Assigned Agents
分配的Agent
- artifact-integrator: Lead agent for repository onboarding.
- developer: PR management and exploration.
- artifact-integrator:仓库接入的主导Agent。
- developer:PR管理与探索。
Memory Protocol (MANDATORY)
内存协议(强制要求)
Before starting:
Read
.claude/context/memory/learnings.mdAfter completing:
- New pattern ->
.claude/context/memory/learnings.md - Issue found ->
.claude/context/memory/issues.md - Decision made ->
.claude/context/memory/decisions.md
ASSUME INTERRUPTION: If it's not in memory, it didn't happen.
开始前:
读取
.claude/context/memory/learnings.md完成后:
- 新发现的模式 ->
.claude/context/memory/learnings.md - 发现的问题 ->
.claude/context/memory/issues.md - 做出的决策 ->
.claude/context/memory/decisions.md
假设会被中断:如果未记录到内存中,就视为未发生。