skill-creator

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Skill Creator

Skill Creator

Create new agent skills by guiding the user through a series of choices, then generating a ready-to-edit project structure with best practices baked in.
通过引导用户完成一系列选择来创建新的Agent技能,随后生成内置最佳实践的可编辑项目结构。

How It Works

工作原理

  1. Collect requirements through dialogue (AskUserQuestion)
  2. Call
    scaffold.py
    with the collected parameters (non-interactive)
  3. Report what was generated and guide next steps
  1. 通过对话收集需求(AskUserQuestion)
  2. 传入收集到的参数调用
    scaffold.py
    (非交互式)
  3. 报告生成内容并指导后续步骤

Dialogue Flow

对话流程

Follow these steps in order. Use AskUserQuestion for steps 1–4.
按以下顺序执行步骤。步骤1–4使用AskUserQuestion。

Step 1: Skill Name

步骤1:技能名称

Ask the user for a skill name. Validate it meets these rules:
  • Lowercase letters, digits, and hyphens only
  • Must start with a letter, end with a letter or digit
  • No consecutive hyphens
  • Maximum 64 characters
If invalid, explain the constraint and ask again.
询问用户技能名称,并验证其符合以下规则:
  • 仅包含小写字母、数字和连字符
  • 必须以字母开头,以字母或数字结尾
  • 无连续连字符
  • 最大长度64个字符
如果不符合规则,说明限制条件并重新询问。

Step 2: Skill Level

步骤2:技能级别

Ask the user to choose a skill level:
L0 — Pure Prompt: Only a SKILL.md file. All capabilities come from Claude's built-in tools, MCP servers, or general knowledge. Best for workflow guides, domain knowledge, configuration wizards. No scripts needed.
L0+ — Prompt + Helper Scripts: SKILL.md plus lightweight helper scripts for environment detection, status caching, or other auxiliary tasks. Core logic stays in the prompt. Best when Claude needs a preflight check or a small utility but handles business logic itself.
L1 — Prompt + Business Scripts: SKILL.md orchestrates CLI scripts that handle core business logic. Scripts accept parameters, return structured JSON, and follow MCP tool design principles. Best for skills that interact with APIs, process data, or perform operations that benefit from deterministic code.
请用户选择技能级别:
L0 — 纯提示词:仅包含SKILL.md文件。所有能力均来自Claude的内置工具、MCP服务器或通用知识。最适合工作流指南、领域知识、配置向导。无需脚本。
L0+ — 提示词+辅助脚本:包含SKILL.md和用于环境检测、状态缓存或其他辅助任务的轻量辅助脚本。核心逻辑仍在提示词中。当Claude需要预检查或小型工具,但自身处理业务逻辑时,选择此级别。
L1 — 提示词+业务脚本:SKILL.md编排处理核心业务逻辑的CLI脚本。脚本接受参数,返回结构化JSON,并遵循MCP工具设计原则。最适合与API交互、处理数据或执行可从确定性代码中获益的操作的技能。

Step 3: Environment Strategy (L1 only)

步骤3:环境策略(仅L1级别)

If the user chose L1, ask which environment strategy to use:
stdlib — Python standard library only. Zero dependencies, zero environment issues. Choose this when
urllib
,
json
,
argparse
,
pathlib
are sufficient. This is the recommended default.
uv — Dependencies declared inline via PEP 723, executed with
uv run
. No persistent venv, global cache, version-isolated. Choose this when external packages are needed but a full venv is overkill.
venv — Traditional per-skill virtual environment with
run.sh
wrapper. Choose this only when dependencies require C extensions, or the skill runs long-lived processes.
如果用户选择L1级别,询问其要使用的环境策略:
stdlib — 仅使用Python标准库。零依赖,无环境问题。当
urllib
json
argparse
pathlib
足够时选择此策略。这是推荐的默认选项。
uv — 通过PEP 723内联声明依赖,使用
uv run
执行。无持久化venv,全局缓存,版本隔离。当需要外部包但完整venv过于冗余时选择此策略。
venv — 传统的单技能虚拟环境,带有
run.sh
包装器。仅当依赖需要C扩展,或技能需要运行长期进程时选择此策略。

Step 4: Output Directory

步骤4:输出目录

Ask where to generate the skill. Default: current working directory. The script creates
skills/<name>/
under this directory.
询问用户技能生成位置。默认值:当前工作目录。脚本会在此目录下创建
skills/<name>/
文件夹。

Generate

生成项目

After collecting all parameters, run:
bash
python3 {SKILL_DIR}/scripts/scaffold.py scaffold \
    --name <name> \
    --level <level> \
    [--env <strategy>] \
    --output <dir>
Where
{SKILL_DIR}
is the directory containing this SKILL.md file. Resolve it at runtime.
The script outputs JSON to stdout:
json
{
  "status": "ok",
  "level": "l1",
  "env": "uv",
  "created": ["skills/my-skill/SKILL.md", "skills/my-skill/scripts/main.py", ...],
  "hint": "..."
}
If it fails, stderr contains JSON with
error
,
hint
, and
recoverable
fields.
收集所有参数后,运行:
bash
python3 {SKILL_DIR}/scripts/scaffold.py scaffold \
    --name <name> \
    --level <level> \
    [--env <strategy>] \
    --output <dir>
其中
{SKILL_DIR}
是包含本SKILL.md文件的目录。在运行时解析该路径。
脚本会向标准输出打印JSON:
json
{
  "status": "ok",
  "level": "l1",
  "env": "uv",
  "created": ["skills/my-skill/SKILL.md", "skills/my-skill/scripts/main.py", ...],
  "hint": "..."
}
如果执行失败,标准错误输出会包含带有
error
hint
recoverable
字段的JSON。

Post-Generation Guidance

生成后指导

After successful generation, tell the user:
  1. Edit SKILL.md — Replace all placeholder markers. The
    description
    field in frontmatter is critical — it determines when Claude activates the skill. Be specific and include trigger phrases.
  2. Customize scripts/ (L0+/L1) — The generated scripts are functional frameworks with placeholder markers. Add your business logic.
  3. Test preflight (L0+/L1) — Run the preflight command to verify the JSON output structure works:
    • L0+:
      bash scripts/helper.sh preflight
    • L1 stdlib:
      python3 scripts/main.py preflight
    • L1 uv:
      uv run scripts/main.py preflight
    • L1 venv:
      bash scripts/run.sh preflight
      (after setup)
  4. Add references/ — Put detailed reference documents here and reference them from SKILL.md with file read instructions. Keep SKILL.md lean.
  5. Ready to publish? — Use the
    skill-publish
    skill (if installed) to wrap this into a complete GitHub repo with README, LICENSE, plugin.json, and marketplace.json.
生成成功后,告知用户:
  1. 编辑SKILL.md — 替换所有占位符标记。前置元数据中的
    description
    字段至关重要,它决定了Claude何时激活该技能。请描述具体,并包含触发短语。
  2. 自定义scripts/目录(L0+/L1) — 生成的脚本是带有占位符标记的功能框架。请添加您的业务逻辑。
  3. 预检查测试(L0+/L1) — 运行预检查命令以验证JSON输出结构是否可用:
    • L0+:
      bash scripts/helper.sh preflight
    • L1 stdlib:
      python3 scripts/main.py preflight
    • L1 uv:
      uv run scripts/main.py preflight
    • L1 venv:
      bash scripts/run.sh preflight
      (设置完成后)
  4. 添加references/目录 — 将详细的参考文档放在此处,并在SKILL.md中通过文件读取指令引用它们。保持SKILL.md简洁。
  5. 准备发布? — 使用
    skill-publish
    技能(若已安装)将其打包为完整的GitHub仓库,包含README、LICENSE、plugin.json和marketplace.json。

References

参考资料

For skill design conventions — output formats, error handling, environment strategies, preflight conventions — read
references/best_practices.md
.
For common quality issues and how to avoid them, read
references/improvement_patterns.md
.
For what automated validation checks will be run (by skill-review), read
references/validation_rules.md
.
关于技能设计规范——输出格式、错误处理、环境策略、预检查规范——请阅读
references/best_practices.md
关于常见质量问题及避免方法,请阅读
references/improvement_patterns.md
关于(由skill-review执行的)自动化验证检查内容,请阅读
references/validation_rules.md