skill-exporter

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Skill Exporter

Skill Exporter

Generate
npx skills add
commands from current installation.
从当前安装环境生成
npx skills add
命令。

Workflow

工作流程

Copy this checklist and track progress:
Export Skills:
- [ ] Step 1: Collect installation data
- [ ] Step 2: Parse and map agent names
- [ ] Step 3: Group by source and agent-set
- [ ] Step 4: Generate commands
复制此检查清单并跟踪进度:
Export Skills:
- [ ] Step 1: Collect installation data
- [ ] Step 2: Parse and map agent names
- [ ] Step 3: Group by source and agent-set
- [ ] Step 4: Generate commands

Step 1: Collect Installation Data

步骤1:收集安装数据

Run these commands:
bash
npx skills ls -g
cat ~/.agents/.skill-lock.json
运行以下命令:
bash
npx skills ls -g
cat ~/.agents/.skill-lock.json

Step 2: Parse and Map Agent Names

步骤2:解析并映射Agent名称

Parse
npx skills ls -g
output:
<skill-name> <path>
  Agents: <Agent1>, <Agent2>, ...
Extract skill name (first word of non-indented line) and agents (comma-separated after "Agents:").
Map display names to CLI values: See references/agents.md
解析
npx skills ls -g
的输出:
<skill-name> <path>
  Agents: <Agent1>, <Agent2>, ...
提取技能名称(非缩进行的第一个单词)和Agent(“Agents:”后逗号分隔的内容)。
将显示名称映射为CLI值: 参考references/agents.md

Step 3: Group by Source and Agent-Set

步骤3:按来源和Agent集合分组

Lock file path:
~/.agents/.skill-lock.json
json
{ "<skill-name>": { "source": "<owner/repo>", ... } }
Group skills sharing same source repo AND same agent set into one command.
锁定文件路径:
~/.agents/.skill-lock.json
json
{ "<skill-name>": { "source": "<owner/repo>", ... } }
将共享同一来源仓库且Agent集合相同的技能分组到一条命令中。

Step 4: Generate Commands

步骤4:生成命令

Command format:
bash
npx skills add <source> -g -y -s <skill1> -s <skill2> -a <agent1> -a <agent2>
命令格式:
bash
npx skills add <source> -g -y -s <skill1> -s <skill2> -a <agent1> -a <agent2>

Error Handling

错误处理

  • Lock file missing: Use
    npx skills ls -g
    only; source repo info will be unavailable
  • Skill not in lock file: Skip or prompt user for source repo
  • 锁定文件缺失:仅使用
    npx skills ls -g
    ;此时将无法获取来源仓库信息
  • 技能不在锁定文件中:跳过或提示用户输入来源仓库

Example

示例

Input:
docx ~/.agents/skills/docx
  Agents: Antigravity, Claude Code
pdf ~/.agents/skills/pdf
  Agents: Antigravity, Claude Code
Lock:
docx
and
pdf
both have
"source": "anthropics/skills"
Output:
bash
npx skills add anthropics/skills -g -y -s docx -s pdf -a antigravity -a claude-code
输入:
docx ~/.agents/skills/docx
  Agents: Antigravity, Claude Code
pdf ~/.agents/skills/pdf
  Agents: Antigravity, Claude Code
锁定文件:
docx
pdf
"source"
均为
"anthropics/skills"
输出:
bash
npx skills add anthropics/skills -g -y -s docx -s pdf -a antigravity -a claude-code