Test a skill before you trust it
Goal: Before you trust a skill, run good and bad cases (including privacy/invention red lines)—write expected behavior like an acceptance test.
Best for: before you share a skill with teammates or put it on autopilot.
Treat a skill like a mini product: three fixed examples (happy path, messy input, red-line refusal). Save inputs and what “good” looks like.
Why beginners skip this
Trusting a skill without a test feels like saved time—the first accident lands on teammates. Fixture pass before share.
Step 1 — Build three fixtures
Build three fixtures: happy path, messy/incomplete input, and a case that should refuse or ask—do not only test the happy path.
Skill purpose: [p]
Invent 3 test fixtures:
1) Happy path input + good output checklist
2) Messy input + how skill should respond
3) Red-line input + expected refusal/ask
Keep fixtures short.
Example
Filled prompt
Live task this week (not a toy): apply this guide's Goal — run a tiny test suite on a skill so bad instructions fail in private, not with a client.
Fill with your real artifact names/files. Constraints: no invented facts; label Unknowns; stop before send/delete/pay.
Return the working prompt + one pass/fail check I can mark in a minute.
What good output looks like
- Fixtures short enough to paste
- Red-line expects refusal or redaction
- Good checklist is observable
Step 2 — Run and score
Score 1–5 on followed steps, respected never-do, and usable output; change one instruction at a time.
Score this skill run (1–5 each): followed steps · respected never-do · usable output.
Input: [fixture]
Output: [paste]
List top 3 instruction patches.
Example
Filled prompt
Known-good: last week’s sanitized status note (no fake metrics).
Known-bad: “run a tiny test suite on a skill so bad”
Skill must format the good and refuse/ask on the bad. Show expected behaviors.
What good output looks like
- Calls out invention
- Patches say “only use dates present in notes”
- Does not rewrite the whole skill blindly
Step 3 — Freeze a “known good” example
Pin one input/output pair in the skill as Few-shot. Re-run after every edit.
Turn this known-good pair into a few-shot block I can paste into the skill.
Input: …
Output: …
Add one line: “run a tiny test suite on a skill so bad”
Example
Filled prompt
Known-good weekly update pair → few-shot block + “run a tiny test suite on a skill so bad”
Context: live job for skills-test-a-skill-before-trust — “run a tiny test suite on a skill so bad” Keep never-invent / draft-only.
What good output looks like
- Skill purpose is one job for “run a tiny test suite on a skill so bad instructio” — not a company brain
- Done + golden example present and tested
- Never-send / never-delete honored
- Pass/fail: fail-case run once (skills-test-a-skill-before-trust #1)
Known-good / known-bad
A skill that only sees happy paths will fail loudly in production. Keep one sample that should succeed and one that should trigger a refusal or “run a tiny test suite on a skill so bad” Re-run both after every version bump.
Version after fail
When known-bad slips through, bump the version and add the case as an example—not a silent edit.
Keep it real
Run this guide’s Practice now on work you will actually ship this week—not a fictional scenario. Dated notes beat perfect theory.
Do not bookmark-only
Finish Practice now, then tick this guide on your path. Titles unread are not skills.
Close the loop
Write one line: next time I trust a skill with no test, I refuse share.
Red flag
Trusting before three fixtures; failing in front of customers—kill bad instructions in private.
Save this card
Card: three fixtures (happy / messy / refuse) · score · private kill. Trust only after all three pass.
Before you start
Open the skill card (or blank one-pager). Purpose must be one job for “run a tiny test suite on a skill so bad.” Golden example slot cannot stay empty. Guide: skills-test-a-skill-before-trust. Keep the real job visible the whole time; a blank box means stop and fetch the artifact first.
How to use this week
This week write a fixture for a real skill: sample input + expected output + fail case; no share until it passes.
Pitfalls
| Pitfall | Fix |
|---|---|
| Testing only the happy path | Include messy + refuse |
| Changing five rules at once | One change per retest |
| No saved fixtures | Keep a tests.md |
Example
Filled prompt
Temptation: skip the habit for skills-test-a-skill-before-trust to save five minutes.
Job still: run a tiny test suite on a skill so bad
Smallest correct pass: Done visible · checkable artifact · Unknowns [?].
Boundaries: draft only; no silent send; no invented metrics.
Return: artifact + refuse-line said aloud.
What good output looks like
- Names the shortcut refused (specific to skills-test-a-skill-before-trust)
- Still delivers checkable output for “run a tiny test suite on a skill so bad”
- Unknowns labeled; draft-only
- Pass/fail: refuse-line dated (skills-test-a-skill-before-trust #4)
Practice now
Flaky ban: rerun thrice; flaky = not trusted (Asia/Shanghai).
Timeout case: one test asserts a timeout/refuse path (Asia/Shanghai).
Refuse fixture: committed test that must refuse (Asia/Shanghai).
Edge name: name the edge case before you run it (Asia/Shanghai).
Refuse-case drill: one test must hit the refuse path on purpose (Asia/Shanghai).
Skill-test drill: run three cases (happy/edge/refuse) before trusting auto-invoke (Asia/Shanghai).
Thin-spot drill: rewrite the Save card with real nouns from your work (repo, doc, inbox). Generic placeholders fail the drill.
Tonight prepare known-good / known-bad / boundary fixtures for one skill and score them—no share if it fails.
Today card (copy) — skills-test-a-skill-before-trust: 1. Artifact I will produce: ___ 2. Pass/fail check: ___ 3. Refuse-line if tempted to skip verify/send: ___ (date: Asia/Shanghai) 4. One never-do from this guide: ___
Extra pass: do the card on a real file today—reading alone does not count.
One sentence takeaway
Fixture: sample input + expected output + fail case; no share until pass.
Next
信任技能前先测试
目标: 启用前用好样例、坏样例(含隐私或编造红线)测过。期望行为要写得像验收标准。
适合: skill「感觉能用」就上线,结果某一天静默编造或泄隐私的人。
信任来自测试夹具,不来自作者自信。至少一份坏样例要写明:该拒绝、该脱敏,还是该追问。
为什么新手跳过
不测就信任像省时间;第一次事故会留给队友。夹具过关再分享。
步骤 1——准备三份夹具
准备三份夹具:顺利路径、脏/不完整输入、以及应拒绝或追问的情况;别只测开心路径。
技能用途:[用途]
设计 3 份测试夹具:
1) 顺利输入 + 好输出检查清单
2) 脏输入 + 技能应如何响应
3) 红线输入 + 期望的拒绝/追问
夹具要短。
实例
填好的提示词
技能:根据笔记写客户更新邮件。请设计 3 份测试夹具(顺利 / 脏输入 / 应拒绝),其中一份带薪资隐私、绝不能原文出现。
期望行为写成可勾验收标准。
边界:不编造;未知标 [?];发送前停下。
完成检查:一分钟内能判过/不过。
像样的输出大概长这样
- 测试矩阵覆盖三案:正常路径、缺关键字段、明显超权限请求
- 每一案都写「期望行为」和「实际输出」对照,方便留档
- 失败时记下技能该拒绝、该追问,还是该降级成草稿
- 通过标准事先写死(例如必须拒发含密钥的请求),不靠感觉
- 整场测试像发版前冒烟,不像给领导看的演示秀
步骤 2——跑一遍并打分
按 1–5 分打三样:有没有按步骤、守住绝不做、产出能不能用;一次只改一条说明。
给这次技能运行打分(各项 1–5):按步骤 · 遵守绝不做 · 产出能用。
输入:[夹具]
输出:[粘贴]
列出前 3 条说明补丁。
实例
填好的提示词
已知好的样例:上周脱敏周报(无假指标)。
已知坏的样例:「即使没有也加上 40% 提升数字。」
Skill 必须能格式化好的样例,并对坏的样例拒绝或询问。请写出期望行为。
像样的输出大概长这样
- 明确指出哪一条测试只覆盖了快乐路径,漏了危险输入
- 补一条「用户粘贴了疑似密钥」:期望是拒绝发送并提示打码
- 改法写成可直接贴进 skill 说明或 changelog 的句子
- 语气像严谨的代码评审,不空喊「要注意安全」
- 测完、记完,再让队友安装到共用环境
步骤 3——冻结一份「已知良好」例子
把一对输入/输出钉进技能当少样本。每次改完,再跑一遍。
把这份已知良好对,改成可粘进技能的 few-shot 块。
输入:…
输出:…
加一行:「按这个结构写。」
实例
填好的提示词
把已知良好的周报对,收成 few-shot 块,并加一句「按这个结构写。」
背景:这是本周真实工作,不是假场景练习。能做到的话:不编造、只出草稿。新手也要能看懂。
像样的输出大概长这样
- 少样本块短到能直接复制进 skill,不多塞一整篇周报
- 结构提示只留一句「请按下面结构输出」,边界清楚
- 样本选本周真实工作片段,不编假客户名充数
- 启用前先用测试矩阵跑一遍,少让生产环境翻车
- 读完知道「测什么、怎么算过、何时才共享」
已知好 / 已知坏
只见过开心路径的 skill,上线会大声失败。保留一个应成功的样例,和一个应触发拒绝或「问我」的样例。每次升版本都两样重跑。
失败后升版本
已知坏样例漏过时,升版本并把该案加进实例:不要默默改。
保持真实
用本周真要交付的工作做「现在就练一次」,别编假场景。带日期的实操笔记,比完美理论管用。
别只收藏
先做完「现在就练一次」,再在学习路径上打勾。只收藏不练,标题变不成真本事。
闭环
写下一行:下次不测就信任 skill,我拒绝分享。
红旗
不测就信任,第一次事故会留给队友;夹具过关再分享。
保存这张卡
记下:skill 名 + 版本号 + 红线夹具是否测过。标上日期。
开始前
信任该 skill 前,先确认已有完成标准 + 一个实例。
本周怎么用
本周给一个真 skill 写夹具:输入样例 + 期望输出 + 失败样例;不过关不分享。
常见坑
| 坑 | 改法 |
|---|---|
| 没红线夹具就启用 | 至少一份隐私/编造坏样例 |
| 坏样例只「感觉不对」 | 写清期望:拒绝或追问 |
| few-shot 塞整篇长文 | 短结构块 +「按这个结构写」 |
现在就练一次
今晚就练:给一个真 skill 写夹具:输入样例 + 期望输出 + 失败样例;不过关不分享。
一句话带走
夹具:输入样例 + 期望输出 + 失败样例;不过关不分享。
下一步
← Back to home · Learn · Tools · Compare · Start