← 提示词库 Meta/muse-code/skills/create-skill/SKILL.md 原文 md
🌐 中英双语对照

name: create-skill
description: Create and validate a new Muse skill — project-local in the current workspace by default, or a personal skill staged for muse skills install into the managed personal root. Use ONLY when the user explicitly asks to create a Muse skill or invokes the create-skill skill. Do NOT use for ordinary skill usage, code changes, benchmark tasks, or third-party skill/plugin systems.

Create Skill / 创建技能

Create one new Muse skill. Use this skill only for explicit Muse skill creation
requests, not for ordinary skill usage, code changes, benchmark tasks, or
third-party skill/plugin systems.

创建一个新的 Muse 技能。此技能仅用于明确的 Muse 技能创建请求,不用于普通技能使用、代码修改、基准测试任务或第三方技能/插件系统。

Two scopes exist (ADR 8975):

存在两种作用域(ADR 8975):

Never write to a foreign harness root (~/.codex/skills, ~/.claude/skills)
or to $HOME/.agents/skills — those are import-only sources, never write
targets. Never write directly into $CONFIG_DIR/skills either: the store owns
that write, through the install command below.

绝不要写入外部 harness 根目录(~/.codex/skills、~/.claude/skills)或 $HOME/.agents/skills——它们只是仅限导入的来源,绝不是写入目标。也绝不要直接写入 $CONFIG_DIR/skills:该写入由存储库通过下面的安装命令独占完成。

【评论】"仅限导入、绝不写入"的约束用于避免与其他 AI 工具的技能目录发生写入冲突,属于跨工具共存的边界设计。

Scope / 作用域

Inputs / 输入

Before writing files, identify:

写文件之前,先确定:

Ask a short clarification question if the user did not provide enough information
to choose a safe skill-id and useful behavior.

如果用户提供的信息不足以选择一个安全的 skill-id 和有用的行为,则提出一个简短的澄清问题。

Safety Checks / 安全检查

Reject the request before writing when:

出现以下情况时,在写入之前拒绝请求:

Creation Steps / 创建步骤

Use normal file and shell tools with the current workspace as the base. <dir>
below is .agents/skills/<skill-id> (project scope) or
.agents/skill-drafts/<skill-id> (personal scope).

使用普通文件和 shell 工具,以当前工作区为基准。下文的 <dir> 指 .agents/skills/<skill-id>(项目作用域)或 .agents/skill-drafts/<skill-id>(个人作用域)。

  1. Check that <dir> does not exist.
    检查 <dir> 不存在。

  2. Create its parent (.agents/skills or .agents/skill-drafts) if needed.
    按需创建其父目录(.agents/skills 或 .agents/skill-drafts)。

  3. Reserve the leaf directory with a no-replace operation. If another process wins
    the race, stop and report incomplete.
    用不可替换操作预留叶子目录。如果另一进程赢得竞争,停止并报告未完成。

  4. Recheck that the reserved directory resolves inside the current workspace and is
    not a symlink.
    复查预留目录解析后位于当前工作区内且不是符号链接。

  5. Write <dir>/SKILL.md.
    写入 <dir>/SKILL.md。

  6. Run:
    运行:

    muse skills validate <dir> --json
    
  7. Treat the draft as complete only when the validator succeeds, returns
    valid: true, and reports zero diagnostics or warnings.
    仅当校验器成功、返回 valid: true 且报告零诊断或警告时,才视为草稿完成。

  8. If validation fails, correct the same draft and revalidate. Stop after three
    correction rounds and report the remaining validator output as incomplete.
    如果校验失败,修正同一草稿并重新校验。三轮修正后停止,并将剩余的校验器输出报告为未完成。

Generated SKILL.md / 生成的 SKILL.md

Use this shape:

使用以下形态:

---
name: <skill-id>
description: <one sentence>
---

# <Readable Skill Name>

<Instructions for when and how to use the skill.>

Keep the generated instructions direct and self-contained. Include only behavior the
user asked for or that is necessary for the skill to work.

保持生成的指令直接且自包含。只包含用户要求的行为或技能正常工作所必需的行为。

Completion Report / 完成报告

On success, report:

成功时,报告:

On failure, report:

失败时,报告: