better-skill-creator

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Skill Creator

技能创建器

Language

语言

Match user's language: Respond in the same language the user uses.
匹配用户语言:使用与用户相同的语言进行响应。

Overview

概述

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

对话流程

Progress:
  • Step 1: Skill name
  • Step 2: Skill level
  • Step 3: Environment strategy (L1 only)
  • Step 4: Output directory
  • Generate and report
Follow these steps in order. Use AskUserQuestion for steps 1–4.
进度:
  • 步骤1:技能名称
  • 步骤2:技能等级
  • 步骤3:环境策略(仅L1适用)
  • 步骤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。

Completion Report

完成报告

After successful generation, present:
[Skill Creator] Complete!

Skill: <name> (Level: <level>[, Env: <env>])
Output: <directory>

Files created:
• <list from JSON "created" field>

Next Steps:
→ Edit SKILL.md — replace TODO markers, write description with trigger phrases
→ Customize scripts/ (L0+/L1)
→ Test preflight (L0+/L1)
→ Publish with skill-publish when ready
Then provide detailed guidance:
  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? — If the
    better-skill-publish
    skill is installed, use it to wrap this into a complete GitHub repo with README, LICENSE, plugin.json, and marketplace.json. If not installed:
    npx skills add psylch/better-skills@better-skill-publish -g -y
生成成功后,展示:
[技能创建器] 完成!

技能:<name>(等级:<level>[, 环境:<env>])
输出:<directory>

已创建文件:
• <来自JSON "created"字段的列表>

后续步骤:
→ 编辑SKILL.md — 替换TODO标记,编写包含触发短语的描述
→ 自定义scripts/目录(L0+/L1)
→ 预检查测试(L0+/L1)
→ 准备就绪后使用skill-publish发布
然后提供详细指导:
  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. 准备发布? — 如果已安装
    better-skill-publish
    技能,使用它将技能打包成包含README、LICENSE、plugin.json和marketplace.json的完整GitHub仓库。 如果未安装:
    npx skills add psylch/better-skills@better-skill-publish -g -y

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 better-skill-review), read
references/validation_rules.md
.
有关技能设计规范——输出格式、错误处理、环境策略、预检查规范——请阅读
references/best_practices.md
有关常见质量问题及避免方法,请阅读
references/improvement_patterns.md
有关(由better-skill-review执行的)自动验证检查内容,请阅读
references/validation_rules.md