create-skill-from-repo
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCreate Skills from Repo
从仓库创建Skills
Use this workflow to quickly ingest a framework or project's logic and documentation into the local environment. This is triggered when a user provides a and a for which no local skill yet exists.
<repo-url><skills-name>使用此工作流可快速将框架或项目的逻辑与文档导入本地环境。当用户提供一个和一个本地尚未存在的时,将触发此工作流。
<repo-url><skills-name>🎯 Objectives
🎯 目标
- Source Persistence: Keep the original repo in for traceability and future updates.
sources/ - Knowledge Distillation: Convert dense documentation into agent-optimized (focusing on Usage and Why over Installation).
references/*.md - Automatic Registration: Ensure the new skill is immediately discoverable via .
AGENTS.md
- 源代码持久化:将原始仓库保存在目录中,以便追溯和后续更新。
sources/ - 知识提炼:将冗长的文档转换为适配Agent的文件(重点关注使用方法和设计初衷,而非安装步骤)。
references/*.md - 自动注册:确保新技能可通过立即被发现。
AGENTS.md
🛠 Prerequisites
🛠 前置条件
- Validation: Ensure is valid and
<repo-url>uses kebab-case.<skills-name> - Environment: Verify access and identify the project root.
git
- 验证:确保有效,且
<repo-url>使用kebab-case命名格式。<skills-name> - 环境:验证访问权限,并确定项目根目录。
git
🔄 Workflow
🔄 工作流
Step 1: Source Synchronization
步骤1:源代码同步
- Define the destination: .
sources/<submodule> - Sync Logic:
- Primary:
git submodule add <repo-url> sources/<submodule> - Fallback: If the workspace is not a git repo, use
git clone --depth 1 <repo-url> sources/<submodule> - Maintenance: If the directory exists but is empty, run .
git submodule update --init
- 定义目标路径:。
sources/<submodule> - 同步逻辑:
- 主要方式:
git submodule add <repo-url> sources/<submodule> - 备选方式:如果工作区不是git仓库,使用
git clone --depth 1 <repo-url> sources/<submodule> - 维护操作:如果目录已存在但为空,执行。
git submodule update --init
Step 2: Identify Knowledge Base
步骤2:识别知识库
- Locate Source Root: Scan for
sources/<submodule>/,docs/,wiki/, orREADME.md.packages/*/docs/ - Filtering Strategy:
- ✅ Include: API references, core concepts, design patterns, best practices.
- ❌ Exclude: Installation guides (irrelevant to the Agent), contributing logs, sponsorship info, or marketing fluff.
- 定位源代码根目录:扫描目录,查找
sources/<submodule>/、docs/、wiki/或README.md。packages/*/docs/ - 筛选策略:
- ✅ 包含:API参考、核心概念、设计模式、最佳实践。
- ❌ 排除:安装指南(与Agent无关)、贡献日志、赞助信息或营销内容。
Step 3: Modular Skill Generation
步骤3:生成模块化技能
Target Structure:skills/<skills-name>/[SKILL.md, GENERATION.md, references/]
- Guidelines:
references/*.md
- Atomicity: One concept per file.
- Naming: (e.g.,
{category}-{concept}.md).core-reactivity.md - Content: Must include a , a brief description, high-quality Code Snippets, and source URLs.
Frontmatter
- Indexing:
SKILL.md
- Create a central entry point with tables categorizing references into ,
Core, andFeatures.Advanced
- Metadata:
GENERATION.md
- Record the Git SHA, source path, and generation date for future diffing.
目标结构:skills/<skills-name>/[SKILL.md, GENERATION.md, references/]
- 编写规范:
references/*.md
- 原子性:每个文件对应一个概念。
- 命名:(例如:
{category}-{concept}.md)。core-reactivity.md - 内容:必须包含、简短描述、高质量代码片段和源代码URL。
Frontmatter
- 索引:
SKILL.md
- 创建一个中心入口文件,通过表格将参考文档分为、
核心和功能三类。进阶
- 元数据:
GENERATION.md
- 记录Git SHA、源代码路径和生成日期,以便后续对比差异。
Step 4: The Coverage Loop
步骤4:覆盖循环
- Review: Compare the navigation tree against the generated
Source Root.references/ - Supplement: If major modules (e.g., Middleware, Auth, Error Handling) are missing, repeat Step 3 for those specific modules.
- Exit Condition: Stop once the primary API surface and architectural pillars are covered. Do not get bogged down in edge cases.
- 审查:将的导航树与生成的
源代码根目录目录进行对比。references/ - 补充:如果缺失主要模块(如中间件、认证、错误处理),针对这些特定模块重复执行步骤3。
- 退出条件:当覆盖了主要API表面和架构支柱后停止。无需纠结于边缘情况。
Step 5: Integration & Handover
步骤5:集成与交付
- **Update : Locate
AGENTS.md**in the project root (create it if missing).AGENTS.md - Inject Skill Entry:
markdown
undefined- 更新:在项目根目录中找到
AGENTS.md(如果不存在则创建)。AGENTS.md - 注入技能条目:
markdown
undefined<skills-name>
<skills-name>
- Location:
skills/<skills-name>/ - Description: [Short description from SKILL.md]
3. **Completion Report**: Summarize the output for the user (e.g., "Generated 15 reference files covering Core and Advanced modules").
---- 位置:
skills/<skills-name>/ - 描述:[来自SKILL.md的简短描述]
3. **完成报告**:向用户总结输出内容(例如:“已生成15份参考文件,覆盖核心和进阶模块”)。
---💡 Key Principles
💡 核心原则
- Agent-Centric Writing: Write for an AI audience. Prioritize technical accuracy and code examples over prose.
- Kebab-Case: Strictly use for all directory and filenames.
kebab-case - Path Formatting: Always use forward slashes () for cross-platform compatibility.
/ - Incremental Readiness: The clone should remain so that
sources/can be used later to spot documentation changes.git diff
- 以Agent为中心的写作:为AI受众编写内容。优先保证技术准确性和代码示例,而非冗长的文字描述。
- Kebab-Case命名:所有目录和文件名严格使用格式。
kebab-case - 路径格式:始终使用正斜杠()以保证跨平台兼容性。
/ - 增量就绪:目录下的克隆仓库应保持原样,以便后续使用
sources/发现文档变更。git diff
📚 References
📚 参考资料
| Topic | Description | Reference |
|---|---|---|
| Coverage Criteria | Definitions of "major modules" and stop conditions | coverage-loop |
| Style Guide | Detailed writing style for reference files | style-guide |
Would you like me to simulate a run of this skill using a specific repository URL to show you the expected output?
| 主题 | 描述 | 参考链接 |
|---|---|---|
| 覆盖标准 | “主要模块”和停止条件的定义 | coverage-loop |
| 风格指南 | 参考文件的详细写作风格规范 | style-guide |
是否需要我使用特定的仓库URL模拟运行此技能,以展示预期输出?