GitHub Helper
Overview
管理本地 GitHub 仓库目录,维护可检索知识库,并为仓库检索、克隆、Issue/PR 跟踪提供统一流程。
Local Repository Directory
Default path: INLINECODE0
This path is referenced in the knowledge base file: INLINECODE1
Core Workflows
1. Initialize or Update Knowledge Base
When first using this skill or when user requests an update:
- 1. Check if the github directory exists.
- If not found, ask user for the correct path.
- Scan the directory using
scripts/scan_repos.py. - Update CLAUDE.md using
scripts/update_kb.py.
Example:
CODEBLOCK0
2. Search for Repository
When user mentions a repository name:
- 1. Check local first: Read
@/Users/liuchen/Documents/github/CLAUDE.md. - If found locally: Use local path to analyze and answer.
- If not found: Search GitHub using
gh or GitHub MCP tools. - Offer to download: Ask user whether to clone.
3. Download Repository
When user requests to download/clone:
- 1. Clone to the github directory:
cd /Users/liuchen/Documents/github
git clone <repo-url>
- 2. After successful clone, update knowledge base:
- Run
scripts/scan_repos.py to get repo info.
- Run
scripts/update_kb.py to update CLAUDE.md.
4. GitHub Search Integration
Use gh CLI first, then fall back to GitHub MCP:
Search repositories
CODEBLOCK2
Search issues
CODEBLOCK3
Search PRs
CODEBLOCK4
Answering Repository Questions
- 1. Check whether repository exists in local knowledge base.
- If local, prioritize local code inspection.
- If information is insufficient, query GitHub issues/PRs/releases.
Directory Validation
If /Users/liuchen/Documents/github does not exist:
- 1. Ask user for the correct repository root path.
- Update this SKILL.md path if needed.
- Initialize knowledge base at the new location.
Scripts
- -
scan_repos.py: Scan local repositories and extract summaries. - INLINECODE11 : Update
CLAUDE.md with repository metadata.
GitHub Helper
概述
管理本地 GitHub 仓库目录,维护可检索知识库,并为仓库检索、克隆、Issue/PR 跟踪提供统一流程。
本地仓库目录
默认路径:/Users/liuchen/Documents/github
该路径在知识库文件 @/Users/liuchen/Documents/github/CLAUDE.md 中被引用。
核心工作流
1. 初始化或更新知识库
首次使用此技能或用户请求更新时:
- 1. 检查 github 目录是否存在。
- 如果未找到,询问用户正确的路径。
- 使用 scripts/scanrepos.py 扫描目录。
- 使用 scripts/updatekb.py 更新 CLAUDE.md。
示例:
bash
扫描仓库
python3 scripts/scan_repos.py /Users/liuchen/Documents/github
更新知识库(以 JSON 格式传递仓库信息)
python3 scripts/update_kb.py /Users/liuchen/Documents/github [{name:repo1,path:/path,summary:desc}]
2. 搜索仓库
当用户提到仓库名称时:
- 1. 首先检查本地:读取 @/Users/liuchen/Documents/github/CLAUDE.md。
- 如果在本地找到:使用本地路径进行分析和回答。
- 如果未找到:使用 gh 或 GitHub MCP 工具搜索 GitHub。
- 提供下载选项:询问用户是否要克隆。
3. 下载仓库
当用户请求下载/克隆时:
- 1. 克隆到 github 目录:
bash
cd /Users/liuchen/Documents/github
git clone <仓库-url>
- 2. 克隆成功后,更新知识库:
- 运行 scripts/scan_repos.py 获取仓库信息。
- 运行 scripts/update_kb.py 更新 CLAUDE.md。
4. GitHub 搜索集成
优先使用 gh CLI,然后回退到 GitHub MCP:
搜索仓库
bash
gh search repos <查询关键词> --limit 10
搜索 Issue
bash
gh issue list --repo <所有者/仓库> --state all --limit 20
搜索 PR
bash
gh pr list --repo <所有者/仓库> --state all --limit 20
回答仓库相关问题
- 1. 检查仓库是否存在于本地知识库中。
- 如果在本地,优先进行本地代码检查。
- 如果信息不足,查询 GitHub 的 Issue/PR/发布版本。
目录验证
如果 /Users/liuchen/Documents/github 不存在:
- 1. 询问用户正确的仓库根路径。
- 如有需要,更新此 SKILL.md 中的路径。
- 在新位置初始化知识库。
脚本
- - scanrepos.py:扫描本地仓库并提取摘要。
- updatekb.py:使用仓库元数据更新 CLAUDE.md。