github-to-skills
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGitHub to Skills Factory
GitHub 转 AI 技能工厂
This skill automates the conversion of GitHub repositories into fully functional AI skills.
此技能可自动将GitHub仓库转换为功能完整的AI技能。
Core Functionality
核心功能
- Analysis: Fetches repository metadata (Description, README, Latest Commit Hash).
- Scaffolding: Creates a standardized skill directory structure.
- Metadata Injection: Generates with extended frontmatter (tracking source, version, hash) for future automated management.
SKILL.md - Wrapper Generation: Creates a (or similar) to interface with the tool.
scripts/wrapper.py
- 分析:获取仓库元数据(描述、README、最新提交哈希值)。
- 脚手架搭建:创建标准化的技能目录结构。
- 元数据注入:生成带有扩展前置内容的(跟踪来源、版本、哈希值),用于未来的自动化管理。
SKILL.md - 封装器生成:创建(或类似文件)以与工具交互。
scripts/wrapper.py
Usage
使用方法
Trigger: or "Package this repo into a skill: <url>"
/GitHub-to-skills <github_url>触发方式: 或 "将此仓库打包成技能:<url>"
/GitHub-to-skills <github_url>Required Metadata Schema
必填元数据 Schema
Every skill created by this factory MUST include the following extended YAML frontmatter in its . This is critical for the to function later.
SKILL.mdskill-manageryaml
---
name: <kebab-case-repo-name>
description: <concise-description-for-agent-triggering>此工厂创建的每个技能必须在其中包含以下扩展YAML前置内容。这对后续的正常运行至关重要。
SKILL.mdskill-manageryaml
---
name: <kebab-case-repo-name>
description: <concise-description-for-agent-triggering>EXTENDED METADATA (MANDATORY)
EXTENDED METADATA (MANDATORY)
github_url: <original-repo-url> github_hash: <latest-commit-hash-at-time-of-creation> version: <tag-or-0.1.0> created_at: <ISO-8601-date> entry_point: scripts/wrapper.py # or main script dependencies: # List main dependencies if known, e.g., ["yt-dlp", "ffmpeg"]
undefinedgithub_url: <original-repo-url> github_hash: <latest-commit-hash-at-time-of-creation> version: <tag-or-0.1.0> created_at: <ISO-8601-date> entry_point: scripts/wrapper.py # or main script dependencies: # List main dependencies if known, e.g., ["yt-dlp", "ffmpeg"]
undefinedWorkflow
工作流程
- Fetch Info: The agent first runs to get the raw data from the repo.
scripts/fetch_github_info.py - Plan: The agent analyzes the README to understand how to invoke the tool (CLI args, Python API, etc.).
- Generate: The agent uses the patterns to write the
skill-creatorand wrapper scripts, ensuring the extended metadata is present.SKILL.md - Verify: Checks if the commit hash was correctly captured.
- 获取信息:Agent 首先运行以从仓库获取原始数据。
scripts/fetch_github_info.py - 规划:Agent 分析 README 以了解如何调用工具(CLI 参数、Python API 等)。
- 生成:Agent 使用模式编写
skill-creator和封装器脚本,确保包含扩展元数据。SKILL.md - 验证:检查提交哈希值是否已正确捕获。
Resources
资源
- : Utility to scrape/API fetch repo details (README, Hash, Tags).
scripts/fetch_github_info.py - : Orchestrator to scaffold the folder and write the initial files.
scripts/create_github_skill.py
- :用于抓取/通过API获取仓库详情(README、哈希值、标签)的工具。
scripts/fetch_github_info.py - :用于搭建文件夹并写入初始文件的编排器。
scripts/create_github_skill.py
Best Practices for Generated Skills
生成技能的最佳实践
- Isolation: The generated skill should install its own dependencies (e.g., in a venv or via /
uv) if possible, or clearly state them.pip - Progressive Disclosure: Do not dump the entire repo into the skill. Only include the necessary wrapper code and reference the original repo for deep dives.
- Idempotency: The field allows the future
github_hashto checkskill-managerto trigger updates.if remote_hash != local_hash
- 隔离:生成的技能应尽可能安装自身依赖(例如在venv中或通过/
uv),或明确列出依赖项。pip - 渐进式披露:不要将整个仓库内容导入技能中。仅包含必要的封装器代码,并引用原始仓库以进行深入了解。
- 幂等性:字段允许未来的
github_hash检查skill-manager以触发更新。if remote_hash != local_hash