📋

Claude Code 官方技能文档生成器

Create Skills · v0.1.2
入口已确认,内容待校验 文件树里有 SKILL.md,但正文还没采回,frontmatter 未核对。
专业技能 安全 S+ 级 作者 ryanallen 公开目录收录
3.6k 下载 1 安装 9.4k 收藏 131 浏览

简介

Anthropic 官方 Skill 文档编写工具,提供标准化 SKILL.md 模板与结构规范,支持自动化技能创建与更新流程。

原始描述

Write or update a skill (SKILL.md and supporting files) to match host structure and best practices. Use when user says create skill, write skill, update SKIL...

通过你的 Agent 添加

安装目录:create-skills/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。

点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。

或者手动安装

Claude Code~/.claude/skills/create-skills/
Codex CLI~/.codex/skills/create-skills/
DeepSeek Harness~/.agents/skills/create-skills/

包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可; 目录名不用换,也不要把包直接解压到 skills 根目录。 技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。

中文使用说明 来自收录源

核心用法

document-skills 是 Claude Code 生态中的文档生成技能,专用于将用户草稿、指令或笔记转化为符合官方规范的 SKILL.md 文件。其核心工作流程包括:解析目标路径与输入源、应用标准化模板(Frontmatter + Inputs/Output/Process/Examples/Troubleshooting/Reference 六段式结构)、执行完整性检查清单(checklist),最终生成可直接投入使用的技能文档。

该技能严格遵循 Anthropic 官方定义的结构规范:文件夹必须为 kebab-case,Frontmatter 必须包含 name(匹配文件夹名)和 description(采用「功能+触发时机+核心能力」三段式,限1024字符,禁用 XML 尖括号),任务类技能需设置 disable-model-invocation: true 防止自动加载。内容组织采用渐进式披露策略——YAML 元数据常驻内存、SKILL.md 主体按需加载、references/ 和 assets/ 目录内容仅在需要时访问。

显著优点

标准化程度极高:完全对齐官方技能参考文档(code.claude.com/docs/en/skills.md)和《Complete Guide to Building Skills》PDF 指南,确保产出物与 Claude Code 宿主系统零摩擦集成。

安全性经过六维验证:静态分析、动态行为、依赖审计、网络分析、隐私合规、威胁情报六项检测全部满分通过,无任何敏感信息泄露、恶意代码模式或外部数据外泄风险。外部链接全部指向 Anthropic 官方域名,属于可信来源。

工程实践完备:内置 Checklist 机制覆盖 12 项关键验证点,从文件夹命名、Frontmatter 格式到参数替换变量($ARGUMENTS、${CLAUDE_SKILL_DIR})均有明确指引,大幅降低人工出错概率。

潜在缺点与局限性

无自动化执行能力:该技能本身为纯 Markdown 文档,不产生可执行代码,需依赖 Claude Code 宿主或其他代理完成实际的文件写入操作。用户无法直接「运行」document-skills 获得结果,必须通过对话交互触发。

版本生态依赖:高度绑定 Anthropic 官方技能规范,若官方更新结构标准(如新增 Frontmatter 字段或调整章节顺序),需同步更新 skill 内容。当前版本 0.1.2 尚未建立公开的版本发布流程和社区仓库。

T3 来源可信度:作为个人开发者(ryanallen)贡献的社区项目,缺乏官方背书和企业级维护承诺,建议关键环境进行二次审查。

适合人群

  • Claude Code 技能开发者:需要快速创建符合规范的新技能
  • DevOps/平台工程师:维护内部技能库,统一文档标准
  • 技术写作者:将非结构化需求转化为结构化技能文档
  • 开源贡献者:向 Claude Code 生态提交技能PR前的格式自检

常规风险

低——无代码执行风险:纯文档属性消除了传统软件供应链攻击向量(如依赖混淆、恶意脚本注入)。

中——规范漂移风险:若用户未同步更新 coordinator-flows.md 和引用该 skill 的其他 agent,可能导致技能触发逻辑与实际文档描述不一致。技能明确建议「After writing」阶段执行 coordinator 同步,但依赖人工操作。

低——许可证不明:当前标记为 unknown,建议补充 MIT 等明确开源协议以降低企业采纳顾虑。

技能正文


name: document-skills description: Write or update a skill (SKILL.md and supporting files) to match host structure and best practices. Use when user says create skill, write skill, update SKILL.md, /document-skills. disable-model-invocation: true argument-hint: "[skill-path] [source]" context: fork agent: general-purpose

Document Skills

Write or update a skill to fit the host's expected structure. Use the structure and checklist below.

Inputs

  1. Target skill – Path to the skill folder (e.g. the project skills directory skills/example/) or the skill name.
  2. Source – Draft, user instructions, or notes to turn into the skill or merge in.

If you don't give either: Use the current or given context (e.g. the skill or path already under discussion).

Output

SKILL.md updated (and supporting files if needed).

Process

1. Skill layout

  • One folder per skill. The main file is always SKILL.md (exact name, case-sensitive).
  • Folder name: Must be kebab-case (lowercase, hyphens; no spaces, underscores, or capitals). The frontmatter name must match the folder name.
  • Where skills live: In a project, typically a dedicated skills directory (e.g. skills/<name>/). The host discovers skills from this location even when it's nested (e.g. inside a package).
  • Optional subfolders only: Use scripts/ (executable code), references/ (documentation loaded as needed), and assets/ (templates, icons, etc.). Do not put README.md inside the skill folder; all documentation goes in SKILL.md or references/. Long reference material goes in references/ and is linked from SKILL.md (progressive disclosure).
  • Length: Keep SKILL.md under ~5,000 words. Long reference in references/, linked from SKILL.md.
  • Progressive disclosure: Skills use three levels — (1) YAML frontmatter is always loaded so the assistant knows when to use the skill; (2) SKILL.md body is loaded when the skill is relevant; (3) files in references/ or assets/ are opened only as needed. This keeps token use down while keeping expertise available.
  • Composability: Skills can load together. Write the skill so it works alongside others; don't assume it's the only one active.

2. SKILL.md format

Frontmatter (the YAML block between the first --- lines)

Frontmatter configures when and how the skill runs. The table below follows the official skills reference.

name and description are required. name must match the folder name (kebab-case). description should follow: [What it does] + [When to use it] + [Key capabilities] — under 1024 characters; no XML angle brackets (< >). Avoid vague lines like "Helps with projects"; include specific trigger phrases and, if relevant, file types (e.g. ".fig files", "PDF contract review").

Field Required Description
name Yes kebab-case only; must match skill folder name. Lowercase letters, numbers, and hyphens (max 64 characters).
description Yes [What it does] + [When to use it] + [Key capabilities]. Include trigger phrases (e.g. "Use when user says save, /save"). Mention file types if relevant. Under 1024 characters. No < or >.
argument-hint No Hint shown during autocomplete to indicate expected arguments. Example: [issue-number] or [filename] [format].
disable-model-invocation No Set to true to disable automatic loading; use for workflows you want to trigger manually with /name. Default: false.
user-invocable No Set to false to hide from the / menu. Use for background knowledge users shouldn't invoke directly. Default: true.
allowed-tools No Tools the assistant can use without asking permission when this skill is active.
model No Model to use when this skill is active.
context No Set to fork to run in a forked subagent context.
agent No Which subagent type to use when context: fork is set.
hooks No Hooks scoped to this skill's lifecycle. See Hooks in skills and agents for configuration format.

Optional: license (e.g. MIT for open source), compatibility (1–500 chars: product, system deps, network), metadata (e.g. author, version, mcp-server). See complete skills guide.

Security: No XML angle brackets in frontmatter. Avoid reserved names in the skill name (e.g. host or vendor names).

YAML gotcha: Avoid colons inside a value. They can be read as a new key. Use something like "Scope is" instead of "Scope:" in the text.

Content type
  • Reference content – Conventions, patterns, style. The assistant applies it inline to your current work. No invocation control needed.
  • Task content – Step-by-step instructions for a specific action (deploy, commit, code generation). Often invoked directly with /skill-name. Use disable-model-invocation: true so the skill is not auto-loaded.
Body sections (same order for every skill)

Use the same section order so skills are easy to scan:

  1. # Title – Skill name as H1, then one short intro (what it does).
  2. ## Inputs – What the skill needs (user input, paths, options). Number the items. Use "None" or "Optional" when nothing is required.
  3. ## Output – What you get (a file, a behavior, a handoff). One short block.
  4. ## Process – How to do it. Numbered steps or subsections (e.g. "### 1. Step name"). Put all how-to and rules here. Be specific and actionable (e.g. "Run python scripts/validate.py --input {filename}" not "Validate the data"). Include error handling for common failures; reference bundled files (e.g. "Before queries, consult references/api-patterns.md") when relevant.
  5. ## Examples – Optional but recommended. Common scenarios: "User says X → Actions → Result."
  6. ## Troubleshooting – Optional but recommended. Error or symptom → Cause → Solution.
  7. ## Reference – Optional. Links to related skills or docs.

Skip a section only if it really doesn't apply. When unsure, include Inputs, Output, Process, and Reference; add Examples and Troubleshooting where they help. Match the layout of other skills in the repo.

Substitutions (in the body text)

From the official docs:

  • $ARGUMENTS – All arguments passed when invoking the skill. If not present in the content, arguments are appended as ARGUMENTS: .
  • $ARGUMENTS[N] or $N – The Nth argument (0-based index).
  • ${CLAUDE_SESSION_ID} – The current session ID (host-defined).
  • ${CLAUDE_SKILL_DIR} – The directory containing the skill's SKILL.md file (host-defined).

For injecting shell output before the skill runs, see Inject dynamic context.

3. Checklist when writing or updating

  1. Frontmatter: description follows [What it does] + [When to use it] + [Key capabilities] and is specific (include phrases users might say, e.g. "Use when user says save, /save"). name matches the skill. Task or side-effect skills: disable-model-invocation: true per official docs.
  2. Sections: Inputs, Output, Process, then optionally Examples and Troubleshooting, then Reference. Same order as other skills.
  3. Length: Under 500 lines; long reference in other files, linked from SKILL.md.
  4. Supporting files: If used, say so in SKILL.md and when to load them. Keep SKILL.md focused; put long or detailed docs in references/ and link (progressive disclosure).
  5. Arguments: Use $ARGUMENTS or $N and optionally argument-hint if the skill takes input.
  6. Invocation: Use disable-model-invocation and/or user-invocable so the skill runs when intended (see Control who invokes a skill).

4. Steps to run

  1. Read the target skill path and any source.
  2. Apply the checklist and structure above. Don't change behavior unless the user asked.
  3. Write or update SKILL.md (and supporting files if needed). Only document what the skill does; don't add capabilities that aren't there.

Examples

User says: "Create a skill for validating CSV uploads."

Actions: Create folder skills/validate-csv/ (or the project's skill path; kebab-case). Add SKILL.md with required frontmatter (name: validate-csv, description using [What it does] + [When to use it] + [Key capabilities], e.g. "Validate CSV uploads. Use when user says validate CSV, check upload, /validate-csv. Key capabilities: schema check, encoding detection."). Add Inputs, Output, Process, optional Reference. If the skill runs a script, add scripts/validate.sh and reference it in Process.

Result: New skill that triggers on the stated phrases; coordinator and flows updated if it is part of a flow.

User says: "Update the save skill to mention update-gitignore."

Actions: Open the save skill's SKILL.md (e.g. skills/save/SKILL.md). Add the new step or reference in Process. Update description if trigger phrases change. Sync coordinator and references/coordinator-flows.md if the Save flow changes.

Troubleshooting

Invalid frontmatter / upload error.
Cause: YAML formatting (missing --- delimiters, unclosed quotes, or colons in a value read as a new key).
Solution: Ensure frontmatter is between two --- lines. Avoid colons in description text; use "Use when" not "When:". No < or > in frontmatter.

Skill doesn't trigger.
Cause: Description too vague or missing the full formula (what it does, when to use it, key capabilities) or trigger phrases.
Solution: Use [What it does] + [When to use it] + [Key capabilities] and add specific "Use when user says X, Y, /skill-name". Same phrases should appear in coordinator flow table if the skill is part of a flow. Debug: Ask the assistant "When would you use the [skill name] skill?" and adjust the description from what’s missing.

Skill triggers too often.
Cause: Description too broad or overlapping with other skills.
Solution: Add negative triggers (e.g. "Do NOT use for simple data exploration; use data-viz skill instead"). Narrow scope (e.g. "PDF legal documents for contract review" instead of "Processes documents"). Clarify when not to use (e.g. "Use specifically for online payment workflows, not general financial queries").

Wrong folder name.
Cause: Folder has spaces, underscores, or capitals.
Solution: Rename to kebab-case. Update name in SKILL.md to match. Update all references (coordinator, agents, README, package.json, checklist script, agents/references/).

After writing

  • Coordinator sync: If you changed the description (e.g. "when to use" or key capabilities that match user requests), update the coordinator agent and the flow steps in references/coordinator-flows.md if the skill is part of a flow, so the flow table and agent descriptions stay in sync.
  • Rename/move: If a skill was renamed or moved (e.g. generate-figma → designer-figma), update all references: coordinator, agents, README, package.json, other skills that link to it, verify-task checklist script, agents/references/ (e.g. coordinator-flows.md if the skill appears in a flow), and .gitignore.

Reference

Official skills reference – frontmatter, control who invokes a skill, run in subagent, substitutions. Coordinator – Flow table and agent descriptions should follow [What it does] + [When to use it] + [Key capabilities] and match the phrases users say.

Complete guide to building skills – progressive disclosure, description formula, good/bad examples, optional frontmatter, triggering and troubleshooting, instructions best practices.

正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。

标签

anthropicclaude-codeskill-developmentdocumentationfrontmatterprompt-engineeringstructured-output

同类 Skill