TL;DR A Prompt answers "how do I answer this time." A Skill answers "how do I handle this kind of task from now on." Write Agent Skills like reusable lesson plans: every Skill must answer four things: when to use it, step boundaries, the quality bar, and the failure exit. Put constraints up front, lock quality with a minimal acceptance bar (local build passes, links work, frontmatter complete), and version it in the repo alongside your code.

Every new session starts with three minutes of reciting the same script: project background, directory conventions, and the list of things that are off-limits. What you explained last week, you explain again this week.

The missing piece isn’t the model’s memory — it’s an Agent Skill. A Prompt decides how the AI answers this time; a Skill decides how this kind of task gets done from now on. A Skill is a reusable lesson plan, and it has to answer four things: when to use it, step boundaries, the quality bar, and the failure exit.

This post is the playbook I kept after hitting walls: what a complete Skill looks like, which three workflow types are worth capturing, how to write the acceptance bar as executable commands, and what to steal from EduEvidence’s nine-stage protocol.

Composite collage of a reusable lesson plan: lesson-plan paper, nine-stage ribbon, and the skills directory tree
What a reusable "lesson plan" looks like: a lesson-plan paper on the left, a nine-stage process ribbon in the middle, and the skills/ directory structure with its core SKILL.md file on the right.

Answer Four Questions Before Writing a Skill

Think of a Skill as a lesson plan and none of the four questions can be skipped. When to use it: write it as “what the user says,” not “for writing tasks.” Step boundaries: what comes first, what comes next, where it must stop. Quality bar: what counts as done. Failure exit: the fallback when it gets stuck.

A Skill and a lesson plan differ only in who the student is: an agent. A good lesson plan never assumes the student "should know." A good Skill doesn't either.

A counterexample. My first blog-writing Skill was a single sentence: “Help me write an article about some tech, in the style of my previous blog posts.” It drifted every time — sometimes an academic paper, sometimes an ad, sometimes it just dropped the frontmatter. It answered none of the four questions, so the model had to guess. Guessing is where mystical output begins.

What a Complete Skill Looks Like

Here’s the template. A “write a blog post and run the publishing checks” Skill looks roughly like this:

---
name: publish-blog-post
description: Triggers when the user says "write a blog post",
  "publish an article", or "write a technical note".
  Turns a draft into a publish-ready article per the blog's
  conventions and runs the publishing checks.
  Does not publish automatically; drafting only.
allowed-tools: Read, Write, Edit
---

# Write a blog post and run publishing checks

## Trigger conditions
- The user explicitly mentions writing or publishing a post
- A topic is given, but no finished draft exists yet

## Steps
1. Read 1–2 existing articles to match tone and structure
2. List 3 arguments, each with a concrete example
3. Fill in frontmatter, related articles, and illustration slots
4. Run the acceptance commands below

## Constraints up front
- No vague summaries; every paragraph carries at least one concrete fact
- Never invent things you didn't actually do
- Never skip acceptance and call it done
- Use placeholder markers for illustrations; don't generate images yourself

## Acceptance
- [ ] `npm run build` passes locally
- [ ] Internal links work under the target deploy path
- [ ] Article frontmatter fields are complete
- [ ] No new dependencies that weren't asked for
Three spots people get wrong in the template
The description is a trigger, not an intro. allowed-tools gets the minimum permissions. Constraints come first — prohibitions go before the steps.

The details. The description decides whether the model loads this Skill. “Helps users write” says nothing; “triggers when the user says write a blog post” actually hits. Start with a verb, state the trigger scene in the first sentence, and draw the boundary in the same breath (“does not publish automatically”).

Too many allowed-tools is a hazard. What does writing an article need exec for? Give it a shell and it will “helpfully” restructure your directories. With only Read, Write, and Edit, there’s only so much damage it can do.

Constraints up front are the soul of the template. The more freedom AI has, the more its output looks like the internet average. Put “no vague summaries” and “never invent” before the steps, not buried in a notes section at the end.

For longer flows, steal from EduEvidence’s nine-stage protocol: cut the long process into stages with entries and exits, each with its own acceptance, and only hand downstream what passed. Stuck? Stop at the current stage and don’t contaminate the rest. Nothing mystical — it’s the old lesson-plan rule: know what must be learned by the end of this class.

Three Types Worth Capturing, More Worth Blacklisting

Not every workflow deserves to be a Skill. For student dev work, prioritize three types: publishing (articles, README updates, release notes), engineering (scaffolding, CI, builds, common config fixes), and research (paper summaries, experiment logs, failure postmortems). One thing in common: repeatable steps, checkable results.

The “don’t make this a Skill” list matters more. Tasks with a different goal every time — like “help me brainstorm a product idea” — have no acceptance bar, and a Skill would only box them in. One-off tasks aren’t worth it: writing the Skill takes longer than doing the thing. And never let a Skill make judgment calls that need a human; a Skill deciding for you is overreach.

One test question: will this task come back next month looking roughly the same? Yes, write it. No, the Skill would just be shelf decor.

Hold Quality with an Executable Acceptance Bar

The most overlooked part of a Skill is the definition of “done.” Without an acceptance bar, the agent will confidently hand you a half-finished job. My habit: write acceptance as commands you can actually run, not “check that everything works”:

# 1. The build must pass
npm run build

# 2. No leftover localhost links
! grep -r "localhost:3000" dist/ --include="*.html" -q \
  && echo "no leftover local links"

# 3. Required frontmatter fields are present
python3 - <<'EOF'
import glob, yaml
need = {"title", "description", "date", "tag"}
for f in glob.glob("src/content/blog/*.md"):
    meta = yaml.safe_load(open(f, encoding="utf-8").read().split("---")[1])
    missing = need - set(meta)
    assert not missing, (f, missing)
print("frontmatter OK")
EOF

# 4. No sneaky new dependencies
git diff --stat | grep -q "package.json" \
  && echo "NOTE: dependencies changed, confirm manually" || echo "deps unchanged"
Infographic of the four-question framework and the minimum acceptance checklist: when to use, step boundaries, quality bar, failure exit
The four questions decide whether a Skill is up to standard: when to use, step boundaries, the quality bar, and the failure exit. Nothing moves on until all pass.

The failure exit needs to be hard-coded too. Build breaks? Paste the raw error back, stop at the current step, and do not “try fixing it yourself.” The model is at its best making things worse where you can’t see; the exit exists to make it stop before the damage.

Two pitfalls I learned the hard way. A description written too vaguely and the model never triggers — your Skill becomes repo decoration. allowed-tools set too wide and the model goes wild — today it “helpfully” edits your config with exec, tomorrow you spend the afternoon finding it back. Too vague, too wide: the two main causes of Skill death.

Do It Today

1
Create a skills/ directory in your repo
Same repo as the code. Lowercase hyphenated names, e.g. skills/publish-blog-post/SKILL.md.
2
Pick your first Skill
A flow you've done 2+ times this month and will do again next month. Smaller is better for the first one.
3
Apply the template, starting with the description
One sentence on "what the user says to trigger it," plus one sentence on what it does NOT do.
4
Write 3 prohibitions
Block the three most common ways it drifts. This matters more than 10 correct steps.
5
Write 3–4 acceptance commands and run them yourself first
Make sure each one is green. An acceptance check that doesn't pass is no acceptance.
6
Commit, push, and reference it in your next session
Prefix the commit, e.g. feat(skill): add publish-blog-post. Watch how it triggers, then iterate.

FAQ

What’s the real difference between a Skill and a Prompt?

The biggest waste in student AI projects is re-explaining: restating project background, directory conventions, and hard no-nos every new session. A Prompt answers “how do I answer this time.” A Skill answers “how do I handle this kind of task from now on.”

What does a Skill need to spell out at minimum?

Four things: which tasks trigger it (when to use); what comes first, next, and where it stops (step boundaries); what counts as done and what must be redone (quality bar); and the fallback when it gets stuck (failure exit).

Which workflows deserve to become Skills?

The ones with repeatable steps and checkable results: publishing, engineering, and research. Tasks with a different goal every time just get boxed in when forced into a Skill.

How do you stop the agent from handing in half-finished work?

Hard-code a minimal acceptance bar as runnable commands: npm run build passes, links work, frontmatter complete, no unrequested dependencies.

Where should a Skill live?

Not in your chat history. Put it in the repo’s skills/ directory, versioned alongside your code. State the applicable models, directory conventions, and prohibitions at the top.

The X-thread version

1/10 You’ve told the AI the same rules 50 times. What’s missing isn’t patience — it’s an Agent Skill. A Prompt decides how it answers this time; a Skill decides how this kind of task gets done from now on.

2/10 A Skill is a reusable lesson plan. It must answer four questions: when to use, step boundaries, the quality bar, and the failure exit. Can’t answer them? Don’t write it yet.

3/10 “When to use” should be “what the user says,” not “for writing tasks.” The description is a trigger — write it vaguely and the model never knows when to load it.

4/10 The template: name + description + allowed-tools in the frontmatter; trigger conditions, steps, constraints up front, and an acceptance checklist in the body. Constraints go before the steps.

5/10 allowed-tools gets minimum permissions only. What does writing need exec for? Give it a shell and it will “helpfully” restructure your directories.

6/10 The acceptance bar must be runnable commands: npm run build, grep for localhost leftovers, a Python check on frontmatter, git diff to catch sneaky deps. “Check everything works” is not a check.

7/10 Hard-code the failure exit too: build breaks, paste the raw error back, stop at the current step, don’t “try fixing it yourself.” The exit exists to stop it before the damage.

8/10 Three types worth capturing: publishing, engineering, research. The common trait: repeatable steps, checkable results. Don’t Skill-ify brainstorming — tasks with no acceptance bar only get boxed in.

9/10 Do it today: skills/ in the repo → pick a flow done 2+ times → apply the template, description first → 3 prohibitions → run the acceptance commands yourself → commit.

10/10 Where Vibe Coding really saves time is locking in the parts you’ve already figured out. A Skill is that locked-in form. Full post → https://citygenius-blog.pages.dev/article/agent-skill-as-lesson-plan

一句话总结 Prompt 解决"这一次怎么答",Skill 解决"这类任务以后怎么做"。把 Agent Skill 当成可复用的教案来写:一份 Skill 要回答四件事:适用场景、步骤边界、质量标准和失败出口。约束前置,用最小验收线卡住质量(本地 build 通过、链接可点、frontmatter 齐全),最后放进仓库和代码一起版本管理。

每个新会话开头,先花三分钟复读同一套说辞:项目背景、目录约定,还有哪些事不准干。上周说过的,这周还得重说一遍。

你的方法缺一个零件:Agent Skill。Prompt 决定 AI 这一次怎么答,Skill 决定这类任务以后怎么做。一份 Skill 就是一份可复用的教案,它要回答四件事:适用场景、步骤边界、质量标准和失败出口。

这篇是我撞墙之后留下的写法:完整模板长什么样,三类流程最值得沉淀,验收线怎么写成可执行的命令,还有 EduEvidence 那套九阶段协议里值得偷师的地方。

可复用的教案拼贴:课程计划纸页、九阶段流程缎带与 skills 目录结构
一张可复用的"教案"长什么样:左侧是课程计划纸页,中间是九个阶段的流程缎带,右侧是 skills/ 目录结构与 SKILL.md 核心文件。

写 Skill 之前,先回答四个问题

四个问题一个都省不掉。适用场景写成”用户说了哪句话”,别写”用于写作任务”这种空话。步骤边界说清先做什么、后做什么、哪里必须停。质量标准定义什么算完成。失败出口给出卡住时的降级方案。

Skill 和教案的区别,只在于学生换成了 Agent。好教案从不假设学生"应该懂",好 Skill 也一样。

我最早的博客 Skill 只有一句话:“帮我写一篇关于某某技术的文章,风格像我之前的博客。“结果每次都在跑偏,有时像论文,有时像广告,有时直接漏掉 frontmatter。四个问题一个没答,模型只能靠猜,猜就是玄学输出的开始。

一份完整 Skill 长什么样

直接上模板。一个”写博客文章并发布检查”的 Skill,骨架大概是这样:

---
name: publish-blog-post
description: 用户说"写博客""发布文章""写篇技术笔记"时触发。
  把草稿按博客规范写成正式文章并完成发布检查。
  不自动发布,只负责成稿。
allowed-tools: Read, Write, Edit
---

# 写博客文章并发布检查

## 触发条件
- 用户明确提到"写博客""发布文章""写一篇笔记"
- 给了主题,但还没有成稿

## 步骤
1. 先读 1–2 篇既有文章,对齐语气和结构
2. 列 3 个论点,每个配一个具体例子
3. 补 frontmatter、相关文章、插图位置
4. 跑一遍下面的验收命令

## 约束前置
- 禁止空泛总结,每段至少有一个具体信息
- 禁止编造没有做过的事
- 禁止跳过验收直接收尾
- 插图用占位标记,不自己生成图片

## 验收
- [ ] `npm run build` 本地通过
- [ ] 内部链接在目标部署路径下可点
- [ ] frontmatter 字段齐全
- [ ] 没引入未要求的新依赖
模板里最容易写错的三处
description 是触发器,不是简介;allowed-tools 给最小权限;约束前置,禁止事项写在步骤之前。

展开说说。description 决定模型要不要加载这个 Skill。“帮助用户写作”这种话等于没说,“用户说写博客时触发”才有命中率。动词开头,第一句交代触发场景,顺手划清边界(“不自动发布”)。

allowed-tools 给多了会出事。写文章要 exec 干什么?给了 shell,它就敢顺手帮你”优化”目录结构。只给 Read、Write、Edit,想折腾也折腾不出花样。

约束前置是整份模板的灵魂。AI 越自由,输出越像互联网平均值。“禁止空泛总结""禁止编造”写在步骤之前,别藏在末尾的注意事项里。

流程再长一点的 Skill,可以借 EduEvidence 那套九阶段协议的思路:把长流程切成带入口和出口的阶段,每个阶段有自己的验收,阶段之间只传验收通过的产物。卡住就停在当前阶段,不污染下游。这就是教案的老办法:这节课讲完,必须会什么。

三类值得沉淀,更多值得拉黑

不是所有流程都值得做成 Skill。对学生开发来说,优先沉淀这三类:发布类(写文章、更新 README、整理 release note)、工程类(初始化项目、加 CI、跑构建和修常见配置错误),以及研究类(文献摘要、实验记录、失败复盘)。它们的共同点就一个:步骤可重复,结果可检查。

但”不该做 Skill”的清单更重要。目标每次都不一样的任务,比如”帮我想个产品创意”:创意没有验收线,Skill 只会把它框死。一次性任务也别做,写 Skill 花的时间比直接做还长。需要人拍板的环节更别指望 Skill,它替你做决定属于越权。

判断题就一道:这个任务下个月还会不会以差不多的样子再来一次?会,就值得写。不会,写了也是摆设。

最小验收线:把”差不多了”换成命令

Skill 里最容易被忽略的是”完成”的定义。没有验收线,Agent 会自信地交出半成品。我的习惯是把验收写成能直接跑的命令:

# 1. 构建必须通过
npm run build

# 2. 不留 localhost 残留链接
! grep -r "localhost:3000" dist/ --include="*.html" -q \
  && echo "无残留本地链接"

# 3. frontmatter 必填字段齐全
python3 - <<'EOF'
import glob, yaml
need = {"title", "description", "date", "tag"}
for f in glob.glob("src/content/blog/*.md"):
    meta = yaml.safe_load(open(f, encoding="utf-8").read().split("---")[1])
    missing = need - set(meta)
    assert not missing, (f, missing)
print("frontmatter OK")
EOF

# 4. 没偷偷加新依赖
git diff --stat | grep -q "package.json" \
  && echo "注意:依赖有变更,请人工确认" || echo "依赖无变动"
四问框架与最小验收清单信息图:何时触发、步骤边界、质量标准、失败出口
四个问题决定 Skill 是否合格:何时触发、步骤边界、质量标准和失败出口,全部通过才能进入下一环节。

失败出口也要写死:构建挂了就把报错原文贴回来,停在当前步骤,不准自己”修一下试试”。出口的作用是让它在搞砸之前先停手。

两个踩过的坑:description 写得太泛,模型永远不触发,Skill 就成了仓库装饰品;allowed-tools 给得太宽,模型乱调工具,今天用 exec”顺手”改配置,明天你花一下午找回来。一泛一宽,是 Skill 失效的两个主要死因。

现在就能动手

1
在仓库建 skills/ 目录
和代码同仓库。目录名用小写短横线,如 skills/publish-blog-post/SKILL.md。
2
挑第一个 Skill
选过去一个月做过 2 次以上、下个月还会做的流程。别贪多,第一个越小越好。
3
套模板,先写 description
一句话说清"用户说什么话时触发",再加一句"不做什么"划清边界。
4
写 3 条禁止事项
先堵住最常见的三种跑偏,这比写 10 条正确步骤更重要。
5
写 3–4 条验收命令,自己先跑一遍
确认每条都是绿的。跑不通的验收,等于没有验收。
6
commit 推上去,下次开会话时引用它
提交信息带前缀,如 feat(skill): add publish-blog-post。观察触发情况,再迭代。

常见问题

Skill 和 Prompt 到底有什么区别?

学生做 AI 项目,最大的浪费是重复解释:每次开新会话都要重新交代项目背景、目录约定、禁止事项。Prompt 解决的是”这一次怎么答”,Skill 解决的是”这类任务以后怎么做”。

一份 Skill 至少要写清楚什么?

四件事:什么任务该触发它(适用场景);先做什么、后做什么、哪里必须停(步骤边界);什么样算完成、什么样必须重做(质量标准);卡住时的降级方案是什么(失败出口)。

什么流程值得做成 Skill?

步骤可重复、结果可检查的:发布类、工程类、研究类。每种目标都不一样的任务,硬做成 Skill 反而添乱。

怎么防止 Agent 交出半成品?

写死最小验收线,而且写成能直接跑的命令:npm run build 通过、链接可点、frontmatter 齐全、不偷加依赖。

Skill 写完放哪里?

别躺在聊天记录里。放到仓库的 skills/ 目录,和代码一起版本管理。开头写清适用模型、目录约定和禁止事项。

本篇的 X 速览版

1/10 你跟 AI 讲了 50 遍同一套规则,缺的不是耐心,是一个零件:Agent Skill。Prompt 决定这一次怎么答,Skill 决定这类任务以后怎么做。

2/10 一份 Skill 就是可复用的教案,必须回答四个问题:适用场景、步骤边界、质量标准、失败出口。答不上来就别急着写。

3/10 适用场景要写成”用户说了哪句话”,别写”用于写作任务”。description 是触发器,写泛了模型永远不知道什么时候加载它。

4/10 模板:frontmatter 里 name + description + allowed-tools;正文写触发条件、步骤、约束前置、验收清单。约束必须前置,写在步骤之前。

5/10 allowed-tools 只给最小权限。写文章要 exec 干什么?给了 shell,它就敢顺手帮你”优化”目录结构。

6/10 验收线写成能直接跑的命令:npm run build、grep 查 localhost 残留、python 校验 frontmatter、git diff 确认没偷加依赖。“检查一下”等于没检查。

7/10 失败出口也要写死:构建挂了就把报错贴回来,停在当前步骤,不准自己”修一下试试”。出口的作用是让它在搞砸之前先停手。

8/10 三类最值得沉淀:发布类、工程类、研究类。共同点是步骤可重复、结果可检查。创意 brainstorm 别做成 Skill,没有验收线的任务只会被框死。

9/10 今天就能动手:仓库建 skills/ → 挑一个做过 2 次以上的流程 → 套模板写 description → 写 3 条禁止事项 → 验收命令自己先跑一遍 → commit。

10/10 Vibe Coding 真正省时间的地方,是把你已经想清楚的部分固化下来。Skill 就是这种固化的载体。完整版 → https://citygenius-blog.pages.dev/article/agent-skill-as-lesson-plan