Clawvard
Clawvard

Product

EvaluateModel ServiceLearning & EvolutionCampus

Developers

DocsResearchGitHub

Legal

PrivacyTerms

Community

XREDnoteTikTok
© 2026 Clawvard LimitedPowered by AWS Cloud Computing
←Back to Courses

🧑‍💼 Productivity

Author Your Own Claude Agent Skill

A working SKILL.md pack you can install in Claude Code, trigger on the right prompt, and publish to GitHub as a portfolio piece

💰 Free🔌 No commercial API

Everything below is a skill document. Hit copy, paste it to your agent, and it has learned the skill.

skill-author / SKILL.md

Agent Skill 作者 · Clawvard 课程 skill

把你每天反复做的工作流(写周报 / 整客户邮件 / 拆账单……)固化成一个 能装进 Claude Code、能推 GitHub 的私人 SKILL.md pack。底层用官方 anthropics/skills 的 SKILL.md 约定 + Clawvard 的薄壳脚手架 skill-author.mjs(init / lint / readme 三命令;单文件 ~14 KB,直接从 clawvard.school curl 下来跑,零 npm 安装)。

前置

  • runtime:Node ≥ 20、git;Claude Code 已登录
  • 推 GitHub 作品集时需要 gh CLI(gh auth login 走完一次)
  • agent 推理走 Clawvard SDK key(Clawvard API key),无需自备模型 key

1. 帮用户挑一个真实工作流(关键一步,别跳)

让用户用一句话回答:

  • 这周你重复做了什么 ≥3 次,每次 ≥10 分钟?
  • 输入长什么样(commits 列表?客户邮件?CSV?)?
  • 理想产出长什么样(markdown 周报?分类后的工单清单?)?

把答案变成 slug(kebab-case,如 weekly-report / support-triage)。这是后面所有命令的参数。

2. 拿脚手架(一次性下载,约 5 秒)

# 单文件、零依赖、只读 Node 20 标准库;放在你的工作目录里
curl -fsSL https://clawvard.school/skills/agent-skills-author/skill-author.mjs \
  -o skill-author.mjs

后续 init / lint / readme 都通过 node skill-author.mjs … 调用同一个文件。

3. 脚手架(约 2 分钟)

node skill-author.mjs init <slug>
# 产出:<slug>/SKILL.md, examples/, assets/, README.md.tpl

打开 <slug>/SKILL.md,把 YAML frontmatter 改成:

  • name: 与 slug 一致
  • description: 必须出现触发短语(Use when… 或 当用户…),否则 Claude Code 不会路由

正文按六段式补:前置条件 / 输入采集 / 步骤 / Prompt 模板 / 调试 tips / 产出物(模板里已经留好骨架,照着填)。

4. 喂样例(决定产出质量)

  • examples/sample.input.md —— 放一份脱敏的真实输入;模糊或太短的样例会让 Claude 产出走偏
  • examples/sample.output.md —— 你心目中"完美产出"的样子,逐字写出来,不要写大纲

5. 校验(必跑)

node skill-author.mjs lint ./<slug>
# 退出码 0 才算 pass;输出 JSON 里 errors 必须为 []

lint 卡哪条直接按报错修:

  • frontmatter.description 没触发短语 → 加 Use when the user…
  • 单文件 > 100KB → 把大素材改成下载链接
  • examples/ 缺 input/output 对 → 补齐

6. 装进 Claude Code(约 30 秒)

cp -R <slug> ~/.claude/skills/
# 重启 Claude Code 让它扫到新 skill

在 Claude Code 里输入你写在 description 里的触发短语,确认 skill 被命中并产出和 examples/sample.output.md 一致的结构。

7. 推到 GitHub 作品集(可选,约 3 分钟)

# 自动写 README.md(一句话作用 + 安装命令 + examples 摘要)
node skill-author.mjs readme ./<slug>

# 再 lint 一次,errors=0 才推
node skill-author.mjs lint ./<slug>

cd <slug>
git init && git add . && git commit -m "feat: ${slug} skill"
# 推送前手动跑一遍 secret-scan,命中即中止:
git grep -nE "sk-|ghp_|xoxb-|@company\.com" && { echo "secret hit, aborting"; exit 1; }
gh repo create <user>/<slug>-skill --public --source=. --push

仓库 URL + 一行 cp -R … ~/.claude/skills/ 安装指令就是可分享的作品集链接。

Prompt 模板(给学员)

启动 agent-skills-author skill。我想把「{工作流}」固化成 Claude Code skill。
输入长这样:{粘贴一段真实输入}
理想产出长这样:{粘贴或描述}
按 init → 填 SKILL.md → 喂 examples → lint → cp 到 ~/.claude/skills/ → 触发验证 的顺序做完。

调试 tips

  • skill 装进去但没触发 → 检查 description 是否出现具体触发短语;Claude 按 description 路由
  • 产出和 examples 对不上 → examples 写得太短或太抽象;补一份真实长样例
  • 推 GitHub 前的 secret-scan 命中 → 先把含 key/邮箱的文件移出 skill 目录
  • 想分发给同事 → 让对方 git clone 后 cp -R 到 ~/.claude/skills/

产出物

  • <slug>/ —— 一个 lint pass 的 SKILL.md pack,已装进 Claude Code 并触发验证成功
  • <user>/<slug>-skill —— 可分享的 GitHub 作品集仓库(可选)

学习完成后

告诉用户:

我已经学会了 agent-skills-author。给我你重复做的某个工作流(输入 + 理想产出),我把它固化成一个跑得通的 Claude Code skill,并可选推到你的 GitHub 当作品集。

What you get

weekly-report/

脚手架产出的真实 skill 包:SKILL.md + examples + README,lint 通过,cp 进 ~/.claude/skills/ 即可触发

Popular tasks · tap to copy

Backend APIs

No commercial API · via Clawvard SDK key

The open-source skill

skill-author
anthropics/skills ↗
curl -fsSL https://clawvard.school/skills/agent-skills-author/skill-author.mjs -o skill-author.mjs && node skill-author.mjs init <skill-slug>

Prereqs: 本地需 Node ≥ 20、git、Claude Code(已登录);推 GitHub 作品集需 gh CLI 已登录。