github-to-skills

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

GitHub to Skills Factory

GitHub 转 AI 技能工厂

This skill automates the conversion of GitHub repositories into fully functional AI skills.
此技能可自动将GitHub仓库转换为功能完整的AI技能。

Core Functionality

核心功能

  1. Analysis: Fetches repository metadata (Description, README, Latest Commit Hash).
  2. Scaffolding: Creates a standardized skill directory structure.
  3. Metadata Injection: Generates
    SKILL.md
    with extended frontmatter (tracking source, version, hash) for future automated management.
  4. Wrapper Generation: Creates a
    scripts/wrapper.py
    (or similar) to interface with the tool.
  1. 分析:获取仓库元数据(描述、README、最新提交哈希值)。
  2. 脚手架搭建:创建标准化的技能目录结构。
  3. 元数据注入:生成带有扩展前置内容的
    SKILL.md
    (跟踪来源、版本、哈希值),用于未来的自动化管理。
  4. 封装器生成:创建
    scripts/wrapper.py
    (或类似文件)以与工具交互。

Usage

使用方法

Trigger:
/GitHub-to-skills <github_url>
or "Package this repo into a skill: <url>"
触发方式
/GitHub-to-skills <github_url>
或 "将此仓库打包成技能:<url>"

Required Metadata Schema

必填元数据 Schema

Every skill created by this factory MUST include the following extended YAML frontmatter in its
SKILL.md
. This is critical for the
skill-manager
to function later.
yaml
---
name: <kebab-case-repo-name>
description: <concise-description-for-agent-triggering>
此工厂创建的每个技能必须在其
SKILL.md
中包含以下扩展YAML前置内容。这对后续
skill-manager
的正常运行至关重要。
yaml
---
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"]

undefined

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"]

undefined

Workflow

工作流程

  1. Fetch Info: The agent first runs
    scripts/fetch_github_info.py
    to get the raw data from the repo.
  2. Plan: The agent analyzes the README to understand how to invoke the tool (CLI args, Python API, etc.).
  3. Generate: The agent uses the
    skill-creator
    patterns to write the
    SKILL.md
    and wrapper scripts, ensuring the extended metadata is present.
  4. Verify: Checks if the commit hash was correctly captured.
  1. 获取信息:Agent 首先运行
    scripts/fetch_github_info.py
    以从仓库获取原始数据。
  2. 规划:Agent 分析 README 以了解如何调用工具(CLI 参数、Python API 等)。
  3. 生成:Agent 使用
    skill-creator
    模式编写
    SKILL.md
    和封装器脚本,确保包含扩展元数据
  4. 验证:检查提交哈希值是否已正确捕获。

Resources

资源

  • scripts/fetch_github_info.py
    : Utility to scrape/API fetch repo details (README, Hash, Tags).
  • scripts/create_github_skill.py
    : Orchestrator to scaffold the folder and write the initial files.
  • scripts/fetch_github_info.py
    :用于抓取/通过API获取仓库详情(README、哈希值、标签)的工具。
  • 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
    /
    pip
    ) if possible, or clearly state them.
  • 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
    github_hash
    field allows the future
    skill-manager
    to check
    if remote_hash != local_hash
    to trigger updates.
  • 隔离:生成的技能应尽可能安装自身依赖(例如在venv中或通过
    uv
    /
    pip
    ),或明确列出依赖项。
  • 渐进式披露:不要将整个仓库内容导入技能中。仅包含必要的封装器代码,并引用原始仓库以进行深入了解。
  • 幂等性
    github_hash
    字段允许未来的
    skill-manager
    检查
    if remote_hash != local_hash
    以触发更新。