GitHub 源码解读助手 设计模式 本 skill 主要采用: - Pipeline :按“定位仓库 → 建目录 → 阅读分析 → 生成两份文档 → 交付 → 如有需要再复查”的顺序执行 - Generator :稳定产出源码解读与快速上手两份文档 - Inversion(轻度) :开始前先确认分析范围,复查前再次征求用户同意 Gotchas - 不要把“只想克隆仓库”误判成“源码解读” - 不要假装已经全读完大型仓库;必须说明本次聚焦模块 - 不要默认安排复查;是否复查必须先征求用户确认 - 不要凭空编造运行命令、依赖关系、架构细节 - 如果当前渠道支持发文件,应优先发文件,不要只丢路径 适用边界 使用本 skill: - 用户提供 GitHub 仓库链接,并明确要“解读源码 / 分析架构 / 理解原理 / 生成学习报告 / 快速上手” - 用户想把一个开源项目梳理成可读的中文文档 不要使用本 skill: - 用户只想克隆仓库 - 用户只想要一句简介或推荐语 - 用户要解读论文或普通技术文章 核心交付 在合适的 子目录下创建项目分析目录,并产出两份文档: - - 可额外产出: - - 报告结构参考 。 工作流 0. 先确认分析范围(必须先做) 开始前先向用户确认或声明本次分析范围,至少覆盖: - 是否只做架构解读,还是同时生成快速上手文档 - 是否聚焦某个模块,还是做整体源…

, # https://github.com/user/repo\n r'github\\.com/([^/]+)/([^/]+?)

GitHub 源码解读助手 设计模式 本 skill 主要采用: - Pipeline :按“定位仓库 → 建目录 → 阅读分析 → 生成两份文档 → 交付 → 如有需要再复查”的顺序执行 - Generator :稳定产出源码解读与快速上手两份文档 - Inversion(轻度) :开始前先确认分析范围,复查前再次征求用户同意 Gotchas - 不要把“只想克隆仓库”误判成“源码解读” - 不要假装已经全读完大型仓库;必须说明本次聚焦模块 - 不要默认安排复查;是否复查必须先征求用户确认 - 不要凭空编造运行命令、依赖关系、架构细节 - 如果当前渠道支持发文件,应优先发文件,不要只丢路径 适用边界 使用本 skill: - 用户提供 GitHub 仓库链接,并明确要“解读源码 / 分析架构 / 理解原理 / 生成学习报告 / 快速上手” - 用户想把一个开源项目梳理成可读的中文文档 不要使用本 skill: - 用户只想克隆仓库 - 用户只想要一句简介或推荐语 - 用户要解读论文或普通技术文章 核心交付 在合适的 子目录下创建项目分析目录,并产出两份文档: - - 可额外产出: - - 报告结构参考 。 工作流 0. 先确认分析范围(必须先做) 开始前先向用户确认或声明本次分析范围,至少覆盖: - 是否只做架构解读,还是同时生成快速上手文档 - 是否聚焦某个模块,还是做整体源…

, # https://github.com/user/repo\n ]\n\n for pattern in patterns:\n match = re.search(pattern, url)\n if match:\n groups = match.groups()\n # 处理可能包含 .git 的情况\n owner = groups[0]\n repo = groups[1].replace('.git', '') if len(groups) > 1 else ''\n return owner, repo\n\n raise ValueError(f\"无法解析 GitHub URL: {url}\")\n\n\ndef check_repo_exists(github_dir, owner, repo):\n \"\"\"检查仓库是否已在本地\"\"\"\n repo_path = Path(github_dir) / repo\n if repo_path.exists():\n # 检查是否是 git 仓库\n git_dir = repo_path / '.git'\n if git_dir.exists():\n return True, str(repo_path)\n\n return False, None\n\n\ndef get_repo_info(repo_path):\n \"\"\"获取仓库基本信息\"\"\"\n info = {\n 'name': Path(repo_path).name,\n 'path': str(repo_path),\n 'last_commit': None,\n 'branch': None,\n 'file_stats': {}\n }\n\n try:\n # 获取当前分支\n result = subprocess.run(\n ['git', 'rev-parse', '--abbrev-ref', 'HEAD'],\n cwd=repo_path,\n capture_output=True,\n text=True,\n timeout=10\n )\n if result.returncode == 0:\n info['branch'] = result.stdout.strip()\n\n # 获取最后提交时间\n result = subprocess.run(\n ['git', 'log', '-1', '--format=%ci'],\n cwd=repo_path,\n capture_output=True,\n text=True,\n timeout=10\n )\n if result.returncode == 0:\n info['last_commit'] = result.stdout.strip()\n\n except Exception as e:\n info['error'] = str(e)\n\n return info\n\n\ndef generate_structure_file(repo_path, output_path, max_depth=3):\n \"\"\"生成仓库结构文件\"\"\"\n try:\n # 排除的目录\n exclude_dirs = {\n 'node_modules', 'target', '__pycache__', 'dist', 'build',\n '.git', '.vscode', '.idea', 'vendor', 'venv', 'env'\n }\n\n result = subprocess.run(\n ['tree', '-L', str(max_depth), '-I',\n ','.join(exclude_dirs), '-a'],\n cwd=repo_path,\n capture_output=True,\n text=True,\n timeout=30\n )\n\n if result.returncode == 0:\n with open(output_path, 'w', encoding='utf-8') as f:\n f.write(result.stdout)\n return True\n else:\n # 如果 tree 命令不可用,使用 find 替代\n result = subprocess.run(\n ['find', '.', '-type', 'd', '-maxdepth', str(max_depth),\n '-not', '-path', '*/.*'],\n cwd=repo_path,\n capture_output=True,\n text=True,\n timeout=30\n )\n with open(output_path, 'w', encoding='utf-8') as f:\n f.write(\"# Directory Structure\\n\\n\")\n f.write(result.stdout)\n return True\n\n except Exception as e:\n print(f\"生成结构文件失败: {e}\")\n return False\n\n\ndef count_lines_of_code(repo_path):\n \"\"\"统计代码行数(简单统计)\"\"\"\n extensions = {\n '.ts': 'TypeScript',\n '.tsx': 'TypeScript',\n '.js': 'JavaScript',\n '.jsx': 'JavaScript',\n '.py': 'Python',\n '.go': 'Go',\n '.rs': 'Rust',\n '.java': 'Java',\n '.c': 'C',\n '.cpp': 'C++',\n '.h': 'C/C++ Header',\n '.cs': 'C#',\n '.rb': 'Ruby',\n '.php': 'PHP',\n }\n\n stats = {}\n\n try:\n for ext, lang in extensions.items():\n result = subprocess.run(\n ['find', '.', '-name', f'*{ext}', '-type', 'f'],\n cwd=repo_path,\n capture_output=True,\n text=True,\n timeout=30\n )\n\n if result.returncode == 0:\n files = [f for f in result.stdout.strip().split('\\n') if f]\n total_lines = 0\n\n for file in files:\n try:\n result = subprocess.run(\n ['wc', '-l', file],\n cwd=repo_path,\n capture_output=True,\n text=True,\n timeout=5\n )\n if result.returncode == 0:\n lines = int(result.stdout.split()[0])\n total_lines += lines\n except:\n pass\n\n if total_lines > 0:\n stats[lang] = {\n 'files': len(files),\n 'lines': total_lines\n }\n except Exception as e:\n print(f\"统计代码行数失败: {e}\")\n\n return stats\n\n\ndef main():\n import sys\n\n if len(sys.argv) \u003c 3:\n print(\"用法: python bootstrap_github_analysis.py \u003cgithub_url> \u003cworking_dir>\")\n print(\"示例: python bootstrap_github_analysis.py https://github.com/user/repo ~/Documents/working\")\n sys.exit(1)\n\n github_url = sys.argv[1]\n working_dir = sys.argv[2]\n\n try:\n # 解析 GitHub URL\n owner, repo = parse_github_url(github_url)\n print(f\"✓ 解析 GitHub 仓库: {owner}/{repo}\")\n\n # GitHub 目录\n github_dir = os.path.expanduser('~/Documents/coding/github')\n\n # 检查仓库是否存在\n exists, repo_path = check_repo_exists(github_dir, owner, repo)\n\n if exists:\n print(f\"✓ 仓库已在本地: {repo_path}\")\n else:\n print(f\"✗ 仓库不在本地\")\n print(f\" 请先克隆: git clone https://github.com/{owner}/{repo}.git\")\n print(f\" 目标目录: {github_dir}/{repo}\")\n sys.exit(1)\n\n # 获取仓库信息\n repo_info = get_repo_info(repo_path)\n print(f\"✓ 当前分支: {repo_info.get('branch', 'unknown')}\")\n\n # 创建分析目录\n analysis_dir = Path(working_dir) / 'github-analysis' / repo\n analysis_dir.mkdir(parents=True, exist_ok=True)\n print(f\"✓ 创建分析目录: {analysis_dir}\")\n\n # 生成结构文件\n structure_file = analysis_dir / 'structure.txt'\n if generate_structure_file(repo_path, structure_file):\n print(f\"✓ 生成结构文件: {structure_file}\")\n\n # 统计代码行数\n loc_stats = count_lines_of_code(repo_path)\n\n # 生成 metadata.json\n metadata = {\n 'github_url': github_url,\n 'owner': owner,\n 'repo': repo,\n 'repo_path': repo_path,\n 'analysis_dir': str(analysis_dir),\n 'branch': repo_info.get('branch'),\n 'last_commit': repo_info.get('last_commit'),\n 'analysis_date': datetime.now().isoformat(),\n 'loc_stats': loc_stats\n }\n\n metadata_file = analysis_dir / 'metadata.json'\n with open(metadata_file, 'w', encoding='utf-8') as f:\n json.dump(metadata, f, indent=2, ensure_ascii=False)\n\n print(f\"✓ 生成元数据文件: {metadata_file}\")\n print(f\"\\n分析目录已创建: {analysis_dir}\")\n print(f\"开始解读吧!\")\n\n # 输出关键路径(供 AI 读取)\n print(f\"\\n# OUTPUT_START\")\n print(f\"repo_dir={repo_path}\")\n print(f\"analysis_dir={analysis_dir}\")\n print(f\"metadata_path={metadata_file}\")\n print(f\"structure_path={structure_file}\")\n print(f\"report_outline={Path(__file__).parent.parent / 'references' / 'report-outline.md'}\")\n print(f\"# OUTPUT_END\")\n\n except ValueError as e:\n print(f\"✗ 错误: {e}\")\n sys.exit(1)\n except Exception as e:\n print(f\"✗ 未知错误: {e}\")\n import traceback\n traceback.print_exc()\n sys.exit(1)\n\n\nif __name__ == '__main__':\n main()\n","content_type":"text/x-python; charset=utf-8","language":"python","size":8475,"content_sha256":"512fd6826145accbc3edc170b9d7a918817b6fcbf81770bb79eb519788569eb7"},{"filename":"scripts/review.sh","content":"#!/bin/bash\n# GitHub 源码解读 - 复查脚本\n# 用于 1 小时后复查和完善文档\n\nset -e\n\n# 从命令行参数获取分析目录\nANALYSIS_DIR=\"$1\"\n\nif [ -z \"$ANALYSIS_DIR\" ]; then\n echo \"用法: $0 \u003canalysis_dir>\"\n echo \"示例: $0 ~/Documents/working/github-analysis/some-repo\"\n exit 1\nfi\n\nif [ ! -d \"$ANALYSIS_DIR\" ]; then\n echo \"错误: 分析目录不存在: $ANALYSIS_DIR\"\n exit 1\nfi\n\necho \"================================================\"\necho \"GitHub 源码解读 - 复查任务\"\necho \"================================================\"\necho \"分析目录: $ANALYSIS_DIR\"\necho \"时间: $(date '+%Y-%m-%d %H:%M:%S')\"\necho \"\"\n\n# 检查 metadata.json\nMETADATA_FILE=\"$ANALYSIS_DIR/metadata.json\"\nif [ -f \"$METADATA_FILE\" ]; then\n echo \"✓ 找到元数据文件: $METADATA_FILE\"\n\n # 提取仓库路径\n REPO_PATH=$(grep -o '\"repo_path\":[[:space:]]*\"[^\"]*\"' \"$METADATA_FILE\" | cut -d'\"' -f4)\n if [ -n \"$REPO_PATH\" ] && [ -d \"$REPO_PATH\" ]; then\n echo \"✓ 仓库路径: $REPO_PATH\"\n\n # 检查是否有更新\n echo \"\"\n echo \"检查仓库更新...\"\n cd \"$REPO_PATH\"\n git fetch origin > /dev/null 2>&1\n\n LOCAL_COMMIT=$(git rev-parse HEAD)\n REMOTE_COMMIT=$(git rev-parse @{u} 2>/dev/null || echo \"none\")\n\n if [ \"$LOCAL_COMMIT\" != \"$REMOTE_COMMIT\" ] && [ \"$REMOTE_COMMIT\" != \"none\" ]; then\n echo \"⚠ 仓库有更新,建议拉取最新代码\"\n echo \" 本地: $LOCAL_COMMIT\"\n echo \" 远程: $REMOTE_COMMIT\"\n else\n echo \"✓ 仓库已是最新\"\n fi\n fi\nfi\n\n# 检查文档文件\necho \"\"\necho \"检查文档文件...\"\n\nREPORT_FILE=$(find \"$ANALYSIS_DIR\" -maxdepth 1 -name \"*_源码解读.md\" | head -1)\nQUICKSTART_FILE=$(find \"$ANALYSIS_DIR\" -maxdepth 1 -name \"*_快速上手.md\" | head -1)\n\nif [ -n \"$REPORT_FILE\" ]; then\n echo \"✓ 找到解读报告: $REPORT_FILE\"\n LINES=$(wc -l \u003c \"$REPORT_FILE\")\n echo \" 当前行数: $LINES\"\nelse\n echo \"⚠ 未找到解读报告(*_源码解读.md)\"\nfi\n\nif [ -n \"$QUICKSTART_FILE\" ]; then\n echo \"✓ 找到快速上手文档: $QUICKSTART_FILE\"\n LINES=$(wc -l \u003c \"$QUICKSTART_FILE\")\n echo \" 当前行数: $LINES\"\nelse\n echo \"⚠ 未找到快速上手文档(*_快速上手.md)\"\nfi\n\necho \"\"\necho \"================================================\"\necho \"复查任务清单\"\necho \"================================================\"\necho \"\"\necho \"请按以下顺序进行复查:\"\necho \"\"\necho \"1. 读取当前的解读报告和快速上手文档\"\necho \"2. 重新审视仓库结构(structure.txt)\"\necho \"3. 补充遗漏的内容:\"\necho \" - 调用 mermaid skill 生成架构图或流程图\"\necho \" - 关键模块的详细说明\"\necho \" - 使用场景的补充\"\necho \" - 设计思想的深入分析\"\necho \" - 对悟鸣的启发(结合岗位和研究)\"\necho \"4. 检查快速上手文档的准确性\"\necho \"5. 在文档末尾添加/更新复查记录\"\necho \"\"\necho \"复查记录格式:\"\necho '### YYYY-MM-DD 复查 N'\necho '- 补充了 xxx'\necho '- 修正了 xxx'\necho '- 优化了 xxx'\necho \"\"\necho \"================================================\"\necho \"复查准备完成,可以开始完善文档了!\"\necho \"================================================\"\n","content_type":"application/x-sh; charset=utf-8","language":"bash","size":3307,"content_sha256":"28e4a06055129973e6f0e712bfdb215814a47c7309402b73ce1a59b1a83dac60"}],"content_json":{"type":"doc","content":[{"type":"heading","attrs":{"level":1},"content":[{"text":"GitHub 源码解读助手","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"设计模式","type":"text"}]},{"type":"paragraph","content":[{"text":"本 skill 主要采用:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Pipeline","type":"text","marks":[{"type":"strong"}]},{"text":":按“定位仓库 → 建目录 → 阅读分析 → 生成两份文档 → 交付 → 如有需要再复查”的顺序执行","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Generator","type":"text","marks":[{"type":"strong"}]},{"text":":稳定产出源码解读与快速上手两份文档","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Inversion(轻度)","type":"text","marks":[{"type":"strong"}]},{"text":":开始前先确认分析范围,复查前再次征求用户同意","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Gotchas","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"不要把“只想克隆仓库”误判成“源码解读”","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"不要假装已经全读完大型仓库;必须说明本次聚焦模块","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"不要默认安排复查;是否复查必须先征求用户确认","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"不要凭空编造运行命令、依赖关系、架构细节","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"如果当前渠道支持发文件,应优先发文件,不要只丢路径","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"适用边界","type":"text"}]},{"type":"paragraph","content":[{"text":"使用本 skill:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"用户提供 GitHub 仓库链接,并明确要“解读源码 / 分析架构 / 理解原理 / 生成学习报告 / 快速上手”","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"用户想把一个开源项目梳理成可读的中文文档","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"不要使用本 skill:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"用户只想克隆仓库","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"用户只想要一句简介或推荐语","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"用户要解读论文或普通技术文章","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"核心交付","type":"text"}]},{"type":"paragraph","content":[{"text":"在合适的 ","type":"text"},{"text":"~/Documents/working","type":"text","marks":[{"type":"code_inline"}]},{"text":" 子目录下创建项目分析目录,并产出两份文档:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"\u003crepo_name>_源码解读.md","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"\u003crepo_name>_快速上手.md","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"paragraph","content":[{"text":"可额外产出:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"structure.txt","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"metadata.json","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"paragraph","content":[{"text":"报告结构参考 ","type":"text"},{"text":"references/report-outline.md","type":"text","marks":[{"type":"code_inline"}]},{"text":"。","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"工作流","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"0. 先确认分析范围(必须先做)","type":"text"}]},{"type":"paragraph","content":[{"text":"开始前先向用户确认或声明本次分析范围,至少覆盖:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"是否只做架构解读,还是同时生成快速上手文档","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"是否聚焦某个模块,还是做整体源码导读","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"最终交付以本地文档为主,而不是在对话中直接长篇展开","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"如果用户已经明确说了“解读源码/分析架构/生成报告”,可直接进入执行,并在回复里顺手说明本次范围。","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"1. 确定工作目录","type":"text"}]},{"type":"paragraph","content":[{"text":"按以下优先级选择输出目录:","type":"text"}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"用户明确指定的目录","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"当前上下文里已存在且明显合适的 ","type":"text"},{"text":"~/Documents/working","type":"text","marks":[{"type":"code_inline"}]},{"text":" 子目录","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"默认使用 ","type":"text"},{"text":"~/Documents/working/github-analysis/\u003crepo_name>","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"paragraph","content":[{"text":"不要跳出 ","type":"text"},{"text":"~/Documents/working","type":"text","marks":[{"type":"code_inline"}]},{"text":" 体系。","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"2. 定位仓库","type":"text"}]},{"type":"paragraph","content":[{"text":"优先在 ","type":"text"},{"text":"~/Documents/coding/github","type":"text","marks":[{"type":"code_inline"}]},{"text":" 中查找目标仓库。","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"已存在:直接使用","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"不存在:克隆到 ","type":"text"},{"text":"~/Documents/coding/github/\u003crepo_name>","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"3. 初始化分析目录","type":"text"}]},{"type":"paragraph","content":[{"text":"需要快速完成仓库定位、结构导出、元数据生成时,运行:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"python3 scripts/bootstrap_github_analysis.py \u003cgithub_url> ~/Documents/working","type":"text"}]},{"type":"paragraph","content":[{"text":"如果脚本不可用,就手动完成以下事情:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"创建分析目录","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"导出目录结构","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"记录仓库路径、分支、最后提交时间等基础信息","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"4. 阅读与分析","type":"text"}]},{"type":"paragraph","content":[{"text":"至少覆盖这些内容:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"README.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" 和核心文档","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"依赖或构建文件,如 ","type":"text"},{"text":"package.json","type":"text","marks":[{"type":"code_inline"}]},{"text":"、","type":"text"},{"text":"pyproject.toml","type":"text","marks":[{"type":"code_inline"}]},{"text":"、","type":"text"},{"text":"Cargo.toml","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"主要源码目录","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"测试、示例、文档目录","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"大型仓库不要假装“全读完了”。要明确说明本次聚焦的模块或子系统。","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"5. 生成两份文档","type":"text"}]},{"type":"heading","attrs":{"level":4},"content":[{"text":"源码解读文档","type":"text"}]},{"type":"paragraph","content":[{"text":"至少包括:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"项目是做什么的","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"适用场景","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"优点与局限","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"整体架构与关键模块","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"核心原理 / 关键数据流 / 关键算法","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"设计思想与值得借鉴的点","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"必要术语解释","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"按需调用 ","type":"text"},{"text":"mermaid","type":"text","marks":[{"type":"link","attrs":{"href":"../mermaid/SKILL.md","title":null}},{"type":"code_inline"}]},{"text":" skill 生成图","type":"text"}]}]}]},{"type":"heading","attrs":{"level":4},"content":[{"text":"快速上手文档","type":"text"}]},{"type":"paragraph","content":[{"text":"至少包括:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"环境要求","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"安装步骤","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"配置说明","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"最小可运行示例","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"常见问题","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"下一步建议先读哪些源码","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"6. 交付要求","type":"text"}]},{"type":"paragraph","content":[{"text":"完成初稿后,先把两份文档路径明确告诉用户,再补充:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"仓库本地路径","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"输出目录路径","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"本次分析范围","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"还没验证的部分","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"如果当前渠道支持发文件,就直接发送文件;如果不支持,就至少给出可点击路径。","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"7. 复查原则","type":"text"}]},{"type":"paragraph","content":[{"text":"默认不自动复查。","type":"text"}]},{"type":"paragraph","content":[{"text":"如果你判断这份分析值得继续完善,只能先问用户要不要复查;用户明确同意后,才可以安排约 1 小时后的复查。 如果当前环境不方便安排,就不要假装已经安排成功,直接告诉用户即可。","type":"text"}]},{"type":"paragraph","content":[{"text":"复查时遵循增量更新:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"先读现有两份文档","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"再看仓库是否有更新","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"补充遗漏架构细节、使用场景、设计思想","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"必要时验证快速上手文档","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"在文档末尾追加复查记录","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"输出要求","type":"text"}]},{"type":"paragraph","content":[{"text":"汇报时至少包含:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"仓库名与本地路径","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"输出目录","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"两份文档路径","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"本次聚焦模块","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"是否建议复查,以及如需复查必须先征求用户确认","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"注意事项","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"大型仓库优先聚焦核心模块,不要泛泛而谈","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"先看文档,再读源码,避免误解设计意图","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"快速上手文档尽量基于真实命令,不要凭空猜","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"不要把“当前渠道的文件发送格式”写死成某个平台专用语法","type":"text"}]}]}]},{"type":"hr","attrs":{"markup":"---"}}]},"metadata":{"date":"2026-06-05","name":"github-code-interpreter","author":"@skillopedia","source":{"stars":620,"repo_name":"skills","origin_url":"https://github.com/chujianyun/skills/blob/HEAD/skills/github-code-interpreter/SKILL.md","repo_owner":"chujianyun","body_sha256":"6f881a9987f5d4aea518d1bfbd36e087c02e6aee15eb0cd22f5cfc7a14bbc248","cluster_key":"864f074919127a0b96454233fdd14d32759a47777ff5f98d1311d91a03444a0b","clean_bundle":{"format":"clean-skill-bundle-v1","source":"chujianyun/skills/skills/github-code-interpreter/SKILL.md","attachments":[{"id":"e7419b1f-aad9-5072-9eca-2d3c7fc23906","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/e7419b1f-aad9-5072-9eca-2d3c7fc23906/attachment.md","path":"references/report-outline.md","size":5877,"sha256":"c583cbda7fa8596d3feec75563786224e568b47ea60e6bc7ff63e1033e98d2f4","contentType":"text/markdown; charset=utf-8"},{"id":"d768a456-4599-59bd-ab4e-df68c6a3a73c","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/d768a456-4599-59bd-ab4e-df68c6a3a73c/attachment.py","path":"scripts/bootstrap_github_analysis.py","size":8475,"sha256":"512fd6826145accbc3edc170b9d7a918817b6fcbf81770bb79eb519788569eb7","contentType":"text/x-python; charset=utf-8"},{"id":"0e7c4c72-c7f4-5a91-ad54-02be0ae782eb","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/0e7c4c72-c7f4-5a91-ad54-02be0ae782eb/attachment.sh","path":"scripts/review.sh","size":3307,"sha256":"28e4a06055129973e6f0e712bfdb215814a47c7309402b73ce1a59b1a83dac60","contentType":"application/x-sh; charset=utf-8"}],"bundle_sha256":"4174110eca2158f6fa9fbbc73ad2b6ee004b077d85e2299b727601fd238c4f9f","attachment_count":3,"text_attachments":3,"attachment_storage":"skillopedia-attachments-v1","binary_attachments":0,"excluded_attachments":[]},"cluster_size":1,"skill_md_path":"skills/github-code-interpreter/SKILL.md","import_metadata":{"date":"2026-06-05","author":"@skillopedia","version":"v1","category":"integrations-apis","category_label":"Integrations"},"exact_dupes_collapsed_into_this":0},"version":"v1","category":"integrations-apis","import_tag":"clean-skills-v1","visibility":"public","description":"GitHub 源码解读助手。适用于用户提供 GitHub 仓库链接,并希望解读源码、理解原理、分析架构、生成学习报告或快速上手文档时使用。会在 working 目录下生成源码解读和快速上手两份文档。默认先交付初稿,不自动复查;如果用户明确同意,再安排后续复查。不适用于仅克隆仓库或只要一句简介的场景。"}},"renderedAt":1782979242148}

GitHub 源码解读助手 设计模式 本 skill 主要采用: - Pipeline :按“定位仓库 → 建目录 → 阅读分析 → 生成两份文档 → 交付 → 如有需要再复查”的顺序执行 - Generator :稳定产出源码解读与快速上手两份文档 - Inversion(轻度) :开始前先确认分析范围,复查前再次征求用户同意 Gotchas - 不要把“只想克隆仓库”误判成“源码解读” - 不要假装已经全读完大型仓库;必须说明本次聚焦模块 - 不要默认安排复查;是否复查必须先征求用户确认 - 不要凭空编造运行命令、依赖关系、架构细节 - 如果当前渠道支持发文件,应优先发文件,不要只丢路径 适用边界 使用本 skill: - 用户提供 GitHub 仓库链接,并明确要“解读源码 / 分析架构 / 理解原理 / 生成学习报告 / 快速上手” - 用户想把一个开源项目梳理成可读的中文文档 不要使用本 skill: - 用户只想克隆仓库 - 用户只想要一句简介或推荐语 - 用户要解读论文或普通技术文章 核心交付 在合适的 子目录下创建项目分析目录,并产出两份文档: - - 可额外产出: - - 报告结构参考 。 工作流 0. 先确认分析范围(必须先做) 开始前先向用户确认或声明本次分析范围,至少覆盖: - 是否只做架构解读,还是同时生成快速上手文档 - 是否聚焦某个模块,还是做整体源…