01

从提示词到工作流

AI 不会只靠一句“请起飞”处理所有任务;它要先像机场塔台一样,识别当前状态,再把请求送进正确跑道。

01 · 先看航班信息牌,再决定跑道

机场塔台:请求如何被分流

✈️
一个请求
🗂️
Skill 目录

按任务状态分配的跑道

🧭

想法还模糊

先访谈或细化想法。

🧱

准备做新功能

先写规格,再拆任务。

🩺

东西坏了

先复现、诊断,再修复并验证。

点任意卡片:Skill 的第一份线索不是“文风”,而是任务何时该走这条路线。
skills/using-agent-skills/SKILL.md · 行 1–4
---
name: using-agent-skills
description: Discovers and invokes agent skills. Use when starting a session or when you need to discover which skill applies to the current task. This is the meta-skill that governs how all other skills are discovered and invoked.
---
白话翻译

这是可被发现的“航班信息牌”。frontmatter 先报出名字。

description 说明它做什么、何时启用;Agent 据此决定是否完整读取后面的流程。

02 · Skill 不是人设,也不是一次命令

🛫

Skill

何时做、按什么步骤做、如何验证。它是一条可发现、可完整加载的流程。

🎙️

Persona

用什么语气、怎样协作。它影响表达方式,不替你决定修复 bug 的步骤。

📣

命令

这一次要做什么。命令提出目的;Skill 提供可重复的路线。

skills/using-agent-skills/SKILL.md · 行 14–41
When a task arrives, identify the development phase and apply the corresponding skill:

```
Task arrives
    │
    ├── Don't know what you want yet? ──────→ interview-me
    ├── Have a rough concept, need variants? → idea-refine
    ├── New project/feature/change? ──→ spec-driven-development
    ├── Have a spec, need tasks? ──────→ planning-and-task-breakdown
    ├── Implementing code? ────────────→ incremental-implementation
    │   ├── UI work? ─────────────────→ frontend-ui-engineering
    │   ├── API work? ────────────────→ api-and-interface-design
    │   ├── Need better context? ─────→ context-engineering
    │   ├── Need doc-verified code? ───→ source-driven-development
    │   └── Stakes high / unfamiliar code? ──→ doubt-driven-development
    ├── Writing/running tests? ────────→ test-driven-development
    │   └── Browser-based? ───────────→ browser-testing-with-devtools
    ├── Something broke? ──────────────→ debugging-and-error-recovery
    ├── Reviewing code? ───────────────→ code-review-and-quality
    │   ├── Too complex? ─────────────→ code-simplification
    │   ├── Security concerns? ───────→ security-and-hardening
    │   └── Performance concerns? ────→ performance-optimization
    ├── Committing/branching? ─────────→ git-workflow-and-versioning
    ├── CI/CD pipeline work? ──────────→ ci-cd-and-automation
    ├── Deprecating/migrating? ────────→ deprecation-and-migration
    ├── Writing docs/ADRs? ───────────→ documentation-and-adrs
    ├── Adding logs/metrics/alerts? ───→ observability-and-instrumentation
    └── Deploying/launching? ─────────→ shipping-and-launch
```
决策地图

先判断开发阶段,而不是先润色一句提示词。

每个分叉是任务状态:想法、规格、实现、测试、故障、审查、发布。

一个任务可以换跑道;例如实现之后,自然进入测试与审查。

03 · 跟着一次故障请求走完全程

这里最容易被跳过的是“完整加载”:不能只看一行描述猜怎么做,而要读进这张工作流的实际步骤。

04 · 把路线说进你的请求里

skills/using-agent-skills/SKILL.md · 行 130–138
## Skill Rules

1. **Check for an applicable skill before starting work.** Skills encode processes that prevent common mistakes.

2. **Skills are workflows, not suggestions.** Follow the steps in order. Don't skip verification steps.

3. **Multiple skills can apply.** A feature implementation might involve `idea-refine` → `spec-driven-development` → `planning-and-task-breakdown` → `incremental-implementation` → `test-driven-development` → `code-review-and-quality` → `code-simplification` → `shipping-and-launch` in sequence.

4. **When in doubt, start with a spec.** If the task is non-trivial and there's no spec, begin with `spec-driven-development`.
操作护栏

开工前先找适用 Skill;它把常见失误提前变成步骤。

流程要按顺序执行,尤其不能跳过验证。

复杂任务可串联多个 Skill;不清楚又任务不小,就先写规格。

你想新增一个功能,但只知道“要更方便”。应先请求哪条路线?

正确时会显示:先澄清和细化,再进入规格流程。

测试失败时,有人说“继续下一项吧”。你该要求什么?

正确时会显示:先走调试流程并返回证据。

一个任务跨实现、测试、审查,最可靠的请求是什么?

正确时会显示:按状态串联工作流并要证据。
02

优秀 Skill 的骨架

一张 Skill 像登山路线卡:先告诉你何时出发,再规定上山顺序、危险信号与抵达证据。

01 · 路线卡封面:让 Agent 找得到

docs/skill-anatomy.md · 行 21–34
### Frontmatter (Required)

```yaml
---
name: skill-name-with-hyphens
description: Guides agents through [task/workflow]. Use when [specific trigger conditions].
---
```

**Rules:**
- `name`: Lowercase, hyphen-separated. Must match the directory name.
- `description`: Start with what the skill does in third person, then include one or more clear "Use when" trigger conditions. Include both *what* and *when*. Maximum 1024 characters.

**Why this matters:** Agents discover skills by reading descriptions. The description is injected into the system prompt, so it must tell the agent both what the skill provides and when to activate it. Do not summarize the workflow — if the description contains process steps, the agent may follow the summary instead of reading the full skill.
路线卡封面

Frontmatter 把名称和触发条件写在封面上。

description 必须同时说清“做什么”和“何时用”,但不能代替完整流程;否则 Agent 可能只读摘要就出发。

02 · 登山前先看:这条路适不适合

skills/test-driven-development/SKILL.md · 行 1–20
---
name: test-driven-development
description: Drives development with tests. Use when implementing any logic, fixing any bug, or changing any behavior. Use when you need to prove that code works, when a bug report arrives, or when you're about to modify existing functionality.
---

# Test-Driven Development

## Overview

Write a failing test before writing the code that makes it pass. For bug fixes, reproduce the bug with a test before attempting a fix. Tests are proof — "seems right" is not done. A codebase with good tests is an AI agent's superpower; a codebase without tests is a liability.

## When to Use

- Implementing any new logic or behavior
- Fixing any bug (the Prove-It Pattern)
- Modifying existing functionality
- Adding edge case handling
- Any change that could break existing behavior

**When NOT to use:** Pure configuration changes, documentation updates, or static content changes that have no behavioral impact.
登山口路牌

TDD 适用于会改变行为的代码:新逻辑、bug、边界情况或既有功能修改。

纯配置、文档、静态内容不改变行为,就不该假装走这条测试路线。

03 · 顺序不是装饰:RED → GREEN → REFACTOR

🔴
RED
🟢
GREEN
🧹
REFACTOR
点击“下一步”开始登山。
skills/test-driven-development/SKILL.md · 行 24–37
## The TDD Cycle

```
    RED                GREEN              REFACTOR
 Write a test    Write minimal code    Clean up the
 that fails  ──→  to make it pass  ──→  implementation  ──→  (repeat)
      │                  │                    │
      ▼                  ▼                    ▼
   Test FAILS        Test PASSES         Tests still PASS
```

### Step 1: RED — Write a Failing Test

Write the test first. It must fail. A test that passes immediately proves nothing.
三个检查站

RED 先证明测试能抓到问题;一开始就通过,反而没有证明它测到了目标。

GREEN 只做最小修复;REFACTOR 才整理,并让测试继续通过。

04 · 山路迷雾:借口与危险信号

登山路线卡 · 点选一段,查看它在合同里的职责

1
Frontmatter

路线名与发现线索

2
When to Use

何时出发,何时绕行

3
Process

必须按顺序走的路

4
Common Rationalizations

识别诱人的借口

5
Red Flags

及时停下、回到流程

6
Verification

交出可复查的抵达证据

从封面到山顶:点任一段,路线卡会显示它为什么不可省略。
🌫️

“等代码能跑再写测试”

现实:事后测试容易只验证现有实现,不能证明行为本身。

🌫️

“这太简单,不用测”

现实:简单代码会变复杂;测试同时记录预期行为。

🌫️

“我手动试过了”

现实:手动结果不会留下可重复的保护网;下一次修改仍可能弄坏它。

skills/test-driven-development/SKILL.md · 行 349–380
## Common Rationalizations

| Rationalization | Reality |
|---|---|
| "I'll write tests after the code works" | You won't. And tests written after the fact test implementation, not behavior. |
| "This is too simple to test" | Simple code gets complicated. The test documents the expected behavior. |
| "Tests slow me down" | Tests slow you down now. They speed you up every time you change the code later. |
| "I tested it manually" | Manual testing doesn't persist. Tomorrow's change might break it with no way to know. |
| "The code is self-explanatory" | Tests ARE the specification. They document what the code should do, not what it does. |
| "It's just a prototype" | Prototypes become production code. Tests from day one prevent the "test debt" crisis. |
| "Let me run the tests again just to be extra sure" | After a clean test run, repeating the same command adds nothing unless the code has changed since. Run again after subsequent edits, not as reassurance. |

## Red Flags

- Writing code without any corresponding tests
- Tests that pass on the first run (they may not be testing what you think)
- "All tests pass" but no tests were actually run
- Bug fixes without reproduction tests
- Tests that test framework behavior instead of application behavior
- Test names that don't describe the expected behavior
- Skipping tests to make the suite pass
- Running the same test command twice in a row without any intervening code change

## Verification

After completing any implementation:

- [ ] Every new behavior has a corresponding test
- [ ] All tests pass: `npm test`
- [ ] Bug fixes include a reproduction test that failed before the fix
- [ ] Test names describe the behavior being verified
- [ ] No tests were skipped or disabled
迷雾警报与山顶证据

借口卡提醒你:手动试过、太简单、以后再测,都不能替代可重复的证据。

红旗是可观察的异常;回归样本、命令结果和未跳过的测试,才是抵达证明。

05 · 山顶检查站:把“我试过了”变成证据

1
每个新行为都有测试

先有失败样本,才知道测试确实覆盖了目标。

2
运行完整测试

报告实际命令与结果,不用“应该没问题”替代。

3
保留 bug 的复现测试

修复后仍能证明原问题不会悄悄回来。

新增会改变结算逻辑的功能,下一步是什么?

正确时会显示:结算逻辑属于行为变更,应走 TDD。

你只修改一段静态文档,路线卡告诉你什么?

正确时会显示:静态内容不触发 TDD,但仍应进行相应检查。

bug 修复后,AI 说“我手动试过了”。下一步应要求什么?

正确时会显示:补复现测试并给出运行结果。
03

触发边界与正确路由

医院分诊先看可观察的症状;Skill 路由也先看任务事实,而不是被“很急”三个字带偏。

01 · 分诊不是猜:状态准确,路线才准确

医院分诊 → 软件工作

🩺
状态准确

正确分流带来的结果

🧯

正确工作流

故障发生时先停下诊断,不继续堆功能。

📋

正确证据

调试返回根因、修复和验证;审查返回发现与决定。

🧭

少走弯路

纯文档改动不被硬塞进调试或审查事故。

点选“状态准确”:路由依据是事实,不是模糊的紧急感。
💡
先问:现在发生了什么?

“代码有问题”不足以路由。正在失败的 CI、待合并的 PR、静态指南改词,分别需要不同路线。

02 · 两张分诊卡:故障与合并前审查

Debugging:故障正在发生

skills/debugging-and-error-recovery/SKILL.md · 行 1–34
---
name: debugging-and-error-recovery
description: Guides systematic root-cause debugging. Use when tests fail, builds break, behavior doesn't match expectations, or you encounter any unexpected error. Use when you need a systematic approach to finding and fixing the root cause rather than guessing.
---

# Debugging and Error Recovery

## Overview

Systematic debugging with structured triage. When something breaks, stop adding features, preserve evidence, and follow a structured process to find and fix the root cause. Guessing wastes time. The triage checklist works for test failures, build errors, runtime bugs, and production incidents.

## When to Use

- Tests fail after a code change
- The build breaks
- Runtime behavior doesn't match expectations
- A bug report arrives
- An error appears in logs or console
- Something worked before and stopped working

## The Stop-the-Line Rule

When anything unexpected happens:

```
1. STOP adding features or making changes
2. PRESERVE evidence (error output, logs, repro steps)
3. DIAGNOSE using the triage checklist
4. FIX the root cause
5. GUARD against recurrence
6. RESUME only after verification passes
```

**Don't push past a failing test or broken build to work on the next feature.** Errors compound. A bug in Step 3 that goes unfixed makes Steps 4-6 wrong.
白话翻译

这张卡处理意外错误:测试、构建、runtime 行为、日志都可能是入口。

第一步不是继续开发,而是保存证据、找root cause、修复,并用 verification 证明可以恢复。

Review:变更待合并

skills/code-review-and-quality/SKILL.md · 行 1–25
---
name: code-review-and-quality
description: Conducts multi-axis code review. Use before merging any change. Use when reviewing code written by yourself, another agent, or a human. Use when you need to assess code quality across multiple dimensions before it enters the main branch.
---

# Code Review and Quality

## Overview

Multi-dimensional code review with quality gates. Every change gets reviewed before merge — no exceptions. Review covers five axes: correctness, readability, architecture, security, and performance.

**The approval standard:** Approve a change when it definitely improves overall code health, even if it isn't perfect. Perfect code doesn't exist — the goal is continuous improvement. Don't block a change because it isn't exactly how you would have written it. If it improves the codebase and follows the project's conventions, approve it.

## When to Use

- Before merging any PR or change
- After completing a feature implementation
- When another agent or model produced code you need to evaluate
- When refactoring existing code
- After any bug fix (review both the fix and the regression test)

## The Five-Axis Review

Every review evaluates code across these dimensions:
白话翻译

这张卡在变更进入主分支前评估:它不是救火,而是在合并前检查正确性、可读性、架构、安全和性能。

完成实现、有人交来代码、重构或 bug 修复后,都可以审查;修复还要检查 regression 测试,返回发现和合并决定。

docs/skill-anatomy.md · 行 30–34
**Rules:**
- `name`: Lowercase, hyphen-separated. Must match the directory name.
- `description`: Start with what the skill does in third person, then include one or more clear "Use when" trigger conditions. Include both *what* and *when*. Maximum 1024 characters.

**Why this matters:** Agents discover skills by reading descriptions. The description is injected into the system prompt, so it must tell the agent both what the skill provides and when to activate it. Do not summarize the workflow — if the description contains process steps, the agent may follow the summary instead of reading the full skill.
为什么写在 description

description 必须同时说“做什么”和“何时用”,因为 Agent 用它发现候选路线。

它只负责发现,不摘要流程;匹配后仍要完整加载 Skill。

03 · 五步消息流:事实 → Skill → 证据

🧑‍🎓
学习者
🩺
分诊台(Agent)
🗂️
Skill 目录
🧰
目标 Skill / Agent
点击“下一步”查看基于事实的路由。
🧯

故障正在发生

触发:失败测试、构建断裂、日志错误。
目标:定位根因并安全恢复。
先做:停止新增变更、保存证据。
返回:根因、修复、验证。

🔎

变更待合并

触发:完成的 change 等待进主分支。
目标:判断变更是否改善整体代码健康。
先做:多维评估变更。
返回:审查发现与决定。

📝

纯文档任务

触发:只改静态文字,没有故障或待审代码。
目标:使内容准确、清晰且适合读者。
先做:选择合适的文档工作流并核对内容。
返回:已核对的文档改动。

04 · 路由测验:观察事实,再选路线

某次提交后,CI 新增一个失败测试,日志也出现错误。下一步?

选择后检查答案。

一个完成的变更正等待进入 main branch。该走哪条路线?

选择后检查答案。

你只需改正一份静态指南中的措辞。如何路由?

选择后检查答案。
04

渐进披露:分层工具箱

工具箱不是装得越多越好;渐进披露是只在工作流走到需要处时才加载细节。

01 · 出发时只拿必要工具

每次启动:轻量入口

🧰
名称 + description

两种装箱方式

🧳

全塞进主说明

每次加载都背长参考、命令和例外;注意力先被不相关细节占走。

🗄️

按需打开抽屉

主路径保留入口和判断;细节与确定性动作在需要时再取。

点选轻量入口:上下文成本来自每次都加载的内容,而不是文件数量本身。
启动上下文:轻

主路径只带入口、判断和当前步骤;详细参考仍在抽屉,工作流走到需要处才打开。

18 / 100

点“把长参考搬进主路径”,观察计量器增长:成本来自每次都要带上的详细 prose,而非文件夹本身。

📏
可见主路径与可选抽屉要分开

主 Skill 不能把关键判断藏进抽屉;抽屉也不是必须配置。没有可运行助手时,不要创建空的 scripts/ 目录。

02 · 三层工具箱:谁负责什么

🗺️

主 Skill

SKILL.md 负责入口、步骤和判断。它先被完整读取,不能被脚本或参考资料替代。

⚙️

脚本

scripts/ 负责确定性的机械动作。它可按需运行,但不决定工作流,也不生成方向。

📚

支持文件

保存长参考和按需细节。直接关联时才读,也不替代主工作流。

skills/idea-refine/SKILL.md · 行 1–23
---
name: idea-refine
description: Refines raw ideas into sharp, actionable concepts through structured divergent and convergent thinking. Use when an idea is still vague, when you need to stress-test assumptions before committing to a plan, or when you want to expand options before converging on one. Triggers on "ideate", "refine this idea", or "stress-test my plan".
---

# Idea Refine

Refines raw ideas into sharp, actionable concepts worth building through structured divergent and convergent thinking.

## How It Works

1.  **Understand & Expand (Divergent):** Restate the idea, ask sharpening questions, and generate variations.
2.  **Evaluate & Converge:** Cluster ideas, stress-test them, and surface hidden assumptions.
3.  **Sharpen & Ship:** Produce a concrete markdown one-pager moving work forward.

## Usage

This skill is primarily an interactive dialogue. Invoke it with an idea, and the agent will guide you through the process.

```bash
# Optional: Initialize the ideas directory
bash skills/idea-refine/scripts/idea-refine.sh
```
始终打开的上层托盘

主文件先说明用途与触发条件,再给出发散、收敛、交付的三阶段主流程。

初始化助手明确是 optional:对话式构思仍由主工作流引导。

03 · 可视文件树:按时打开正确抽屉

idea-refine 工具箱 · 点亮文件查看加载时刻与边界

skills/idea-refine/一个主 Skill、三个支持 Markdown、一个脚本
SKILL.md主入口 · 先读
references/按需长参考
frameworks.md发散构思时选择性打开
examples.md需要示例时打开
prompts.md需要提问模板时打开
scripts/有确定性动作才存在
idea-refine.sh按需初始化
先点 SKILL.md、再点脚本或 frameworks.md:每个抽屉都写清何时打开,以及“不替代主工作流”。
skills/idea-refine/SKILL.md · 行 82–85
**If running inside a codebase:** Use `Glob`, `Grep`, and `Read` to scan for relevant context — existing architecture, patterns, constraints, prior art. Ground your variations in what actually exists. Reference specific files and patterns when relevant.

Read `frameworks.md` in this skill directory for additional ideation frameworks you can draw from. Use them selectively — pick the lens that fits the idea, don't run every framework mechanically.
刚好需要时的抽屉

先扫描真实代码库,再让想法扎根在已有架构、模式和限制中。

只有发散时需要额外视角,才选择性打开 frameworks.md;不是机械地跑完每个框架。

skills/idea-refine/scripts/idea-refine.sh · 行 1–15
#!/bin/bash
set -e

# This script helps initialize the ideas directory for the idea-refine skill.

IDEAS_DIR="docs/ideas"

if [ ! -d "$IDEAS_DIR" ]; then
  mkdir -p "$IDEAS_DIR"
  echo "Created directory: $IDEAS_DIR" >&2
else
  echo "Directory already exists: $IDEAS_DIR" >&2
fi

echo "{\"status\": \"ready\", \"directory\": \"$IDEAS_DIR\"}"
确定性侧袋工具

脚本只创建或检查一个目录,并输出 JSON 状态。

它不生成想法,也不选择方向;这些判断仍在主 Skill 的互动流程里。

docs/skill-anatomy.md · 行 99–118
## Supporting Files

Create supporting files only when:
- Reference material exceeds 100 lines (keep the main SKILL.md focused)
- Code tools or scripts are needed
- Checklists are long enough to justify separate files

Keep patterns and principles inline when under 50 lines.

If a skill does not need runnable helpers, do not create an empty `scripts/` directory just to mirror other skills. Empty directories add noise without changing how the skill works.

## Context Efficiency

Skills load on demand: only the skill name and description sit in context at startup. The full `SKILL.md` loads only when an agent decides the skill is relevant. To keep that load cheap:

- **Keep `SKILL.md` under 500 lines.** Move detailed reference material into supporting files.
- **Write specific descriptions.** A precise description helps the agent activate the skill at the right moment and skip it otherwise.
- **Use progressive disclosure.** Reference supporting files that are read only when the workflow reaches them.
- **Prefer scripts over inline code.** Executing a script consumes no context; only its output does. Inline code blocks are paid for on every load.
- **Keep file references one level deep.** Link directly from `SKILL.md` to supporting files rather than chaining through intermediate documents.
工具箱收纳规则

长参考、确有必要的工具、很长的清单才值得拆出;短模式和原则留在主文件。

启动时只有名称与 description;相关时才加载全文,支持文件从主 Skill 直接一层链接出去。

04 · 架构选择题:信息何时需要,谁承担动作

工作流选择某个供应商后,才需要一份 180 行供应商 API 参考。放哪里?

选择后检查答案。

一个命令每次都创建目录并返回 JSON。谁承担?

选择后检查答案。

一条 20 行决策规则要求每个动作前都使用。放哪里?

选择后检查答案。
05

评测:产品三道质检门

Skill 能被包装出来,不等于它会被正确找到,更不等于 Agent 真按流程行动。

01 · 同一件产品,三道不能互代的门

🔩
结构
触发与路由
🧾
行为
可信交付
点击“下一步”通过三道质检门。
1

能发现

结构层核对 frontmatter、目录名、必需章节与命令一致性。

2

不串台

路由层检查请求是否进入正确 Skill,而不是只看词看起来相近。

3

真照做

行为层检查执行痕迹是否兑现工作流承诺。前两门通过也不能替代它。

02 · 前两道门:免费、确定性的目录质检

evals/README.md · 行 14–37
## The three tiers

| Tier | What it checks | Runs | Cost |
|---|---|---|---|
| 1. Structural | Frontmatter, naming, required sections, command parity | CI (`validate-skills.js`, `validate-commands.js`) | Free |
| 2. Trigger & routing | Positive prompts rank their skill top-k; negative prompts don't; no two descriptions near-collide | CI (`run-evals.js`) | Free |
| 3. Behavioral | An agent following the skill satisfies its `expectations[]` | On demand (`run-evals.js --behavioral`) | Tokens |

Tier 2 is a **lexical approximation** of routing (stemmed TF-IDF over descriptions). It cannot judge semantics — that's Tier 3's job — but it catches the two failure modes that dominate real trigger bugs: a description missing the vocabulary users say (false negative), and an over-broad description that outranks the right skill (false positive). A Tier-2 failure usually means *fix the description*, not the eval.

## Running

```bash
# Tier 2 — deterministic, runs in CI
node scripts/run-evals.js

# Tier 3 — behavioral, runs each eval through headless claude, then grades it
node scripts/run-evals.js --behavioral test-driven-development            # spends tokens
node scripts/run-evals.js --behavioral test-driven-development --dry-run  # prints the plan only
```

Tier 3 runs each eval in a throwaway workspace (fixtures from `files[]` are materialized out of `evals/fixtures/`), captures the full `--output-format stream-json --verbose` execution trace, and grades the **trace** (tool calls included) rather than the model's final prose, so expectations like "a failing test was run before the fix" are judged on what happened, not what was narrated. The executor runs with an explicit permission mode (`--permission-mode acceptEdits` plus a pre-approved tool list) so the agent can genuinely edit files and run commands in the workspace rather than being denied and narrating instead. The trace is fenced as untrusted data in the grader prompt and piped to the grader over stdin (traces can be megabytes; argv would hit the OS argument-size limit), executor and grader calls carry timeouts, and grader output is validated as JSON before being written to `evals/results/` (gitignored) in skill-creator's `grading.json` shape.

Behavioral evals without fixtures carry a provisional trust level: treat their results as sanity checks, not evidence. Graduation criteria live in [#352](https://github.com/addyosmani/agent-skills/issues/352).
三道质检门

Tier 1 看零件与标签;Tier 2 看订单能否到正确工位;两者都是 CI 中免费、确定性的门。

Tier 2 只是基于 description 词汇的近似,不是语义理解;失败通常先修 description。

Tier 3 按需消耗 tokens,评分完整 trace,包括工具调用,而不是最后写得漂亮的回答。

📊
本次可复查的确定性结果

124 checks passed;rank-1 86%(65/76)

⚠️
证据边界

本次没有运行付费行为评测。Tier 3 仍是按需、消耗 tokens 的证据层,不能由前两层结果代替。

03 · 传送带要把负向请求送回正确 owner

evals/cases/test-driven-development.json · 行 1–42
{
  "skill_name": "test-driven-development",
  "trigger": {
    "positive": [
      {
        "prompt": "Write a failing test for this bug before fixing it",
        "top_k": 3
      },
      {
        "prompt": "Implement the streak calculator using red-green-refactor",
        "top_k": 3
      },
      {
        "prompt": "What tests should cover this new parsing logic before I write it?",
        "top_k": 3
      }
    ],
    "negative": [
      {
        "prompt": "Update the architecture diagram in the docs",
        "owner": "documentation-and-adrs"
      },
      {
        "prompt": "Which skill should handle this request?",
        "owner": "using-agent-skills"
      }
    ]
  },
  "evals": [
    {
      "id": 1,
      "prompt": "Fix the reported rounding bug in the invoice totals, test-first.",
      "expected_output": "A failing test demonstrating the bug, a minimal fix turning it green, full suite passing",
      "expectations": [
        "A failing test is written and shown failing before the fix",
        "The implementation is the minimum needed to pass",
        "The full suite is run after the fix to catch regressions"
      ],
      "trust_level": "provisional"
    }
  ]
}
三类证据

正向提示要把 TDD 排进 top-k;这证明用户的说法能找到它。

负向提示不是“离开 TDD”就够:图表更新应到 documentation-and-adrs,选 Skill 的问题应到 using-agent-skills。

行为期望要求先红、最小修复、全量测试。没有 fixtures 的结果标为 provisional,只能作 sanity check。

📨
提示传送带
TDD
正向 owner
📐
documentation-and-adrs
🧭
using-agent-skills
点击“下一步”,看两条负向提示被送到声明的 owner。

正向:写失败测试

TDD

进入 top-k

描述覆盖用户词汇

负向传送带 A

“Update the architecture diagram in the docs” → documentation-and-adrs

负向传送带 B

“Which skill should handle this request?” → using-agent-skills

04 · 行为门看 trace,不收口头保证

docs/skill-anatomy.md · 行 83–97
The heart of the skill. This is the step-by-step workflow the agent follows. Must be specific and actionable — not vague advice.

**Good:** "Run `npm test` and verify all tests pass"
**Bad:** "Make sure the tests work"

### Common Rationalizations
The most distinctive feature of well-crafted skills. These are excuses agents use to skip important steps, paired with rebuttals. They prevent the agent from rationalizing its way out of following the process.

Think of every time an agent has said "I'll add tests later" or "This is simple enough to skip the spec" — those go here with a factual counter-argument.

### Red Flags
Observable signs that the skill is being violated. Useful during code review and self-monitoring.

### Verification
The exit criteria. A checklist the agent uses to confirm the skill's process is complete. Every checkbox should be verifiable with evidence (test output, build result, screenshot, etc.).
可评分的路线

只有具体命令和可见退出证据,才能检查行为;“确保没问题”没有可评分动作。

反合理化写出常见借口与事实反驳;红旗帮助审查者在 trace 中找偏离。

1

失败测试
先显示红

2

最小修复
转绿

3

全量测试
检查回归

拒收:只有漂亮结论,没有 trace

“已修复且已测试”若没有修复前失败测试、最小改动与全量测试的执行痕迹,不能证明行为门通过。

05 · 应用测验:缺的是哪一道门?

Skill 目录被重命名,frontmatter 的 name 没跟着改。哪一道门先抓到它?

选择后检查答案。

“Update the architecture diagram in the docs” 把 TDD Skill 排第一。下一步?

选择后检查答案。

Agent 说已修复 rounding bug,但 trace 中没有修复前的失败测试。缺什么?

选择后检查答案。
06

设计你的 Skill:可执行升级操作卡

不要只写“谨慎升级”;写明入口、检查点、禁行项与完成凭据,让另一位 Agent 也能执行同一套操作。

01 · 任务卡:把模糊提醒变成可走路线

操作卡的风险

🧪
dependency-update-safety

先分开两条请求

更新依赖

升级 package、framework、runtime 或 lockfile version:启动操作卡。

×

修改 README 安装段落

只做文档工作:不进入操作卡,交给 documentation work。

点选操作卡:风险不是“装新包”本身,而是遗漏兼容性、测试或回滚证据。
🪪
练习 Skill 的固定 description

Guides safe dependency upgrades with compatibility checks and rollback evidence. Use when updating a package, framework, runtime, or lockfile version.

🧷
路线术语路牌

聚焦测试先检查受影响路径;全量测试再检查整体;回滚记录让路线始终有退路。

02 · 入口牌与禁行牌:先守住边界

何时使用

更新 package、framework、runtime 或 lockfile version 时,启动这张操作卡。

何时不用

修改 README 安装段落 是明确排除项:路由到 documentation work,而不是弱提醒“谨慎使用”。

SKILL.md(学习者草稿)· 行 1–20 · 非复制来源
---
name: dependency-update-safety
description: Guides safe dependency upgrades with compatibility checks and rollback evidence. Use when updating a package, framework, runtime, or lockfile version.
---

## When to Use
- [positive triggers]

**When NOT to use:** 修改 README 安装段落

## Core Process
1. 检查当前约束
2. 阅读官方迁移说明
3. 一次更新一组依赖
4. 运行聚焦测试
5. 运行全量测试
6. 记录回滚方法

## Verification
- [evidence of official migration notes, focused tests, full-suite tests, and rollback method]
操作卡翻译

description 是操作入口:说清做什么、何时启动;排除项把 README 文案修改明确送去文档工作。

每一步都是行动加记录;Verification 是签收凭据,不是“应该没问题”的一句话。

03 · 六个检查点:顺序是安全的一部分

1
约束
2
迁移说明
3
单组更新
4
聚焦测试
5
全量测试
6
回滚记录
点击“下一步”沿检查点前进。

把检查点放回固定顺序(可选互动;下方工作纸不依赖 JavaScript)

一次更新一组依赖
检查当前约束
记录回滚方法
运行聚焦测试
阅读官方迁移说明
运行全量测试
一次升级所有依赖
跳过聚焦测试
等出问题再找迁移说明

1 · 检查当前约束

放到这里

2 · 阅读官方迁移说明

放到这里

3 · 一次更新一组依赖

放到这里

4 · 运行聚焦测试

放到这里

5 · 运行全量测试

放到这里

6 · 记录回滚方法

放到这里

04 · 五步静态工作纸:写成可评测的合同

📝
不保存、不发送

这是一张页面内练习纸:不使用 localStorage、账号、网络提交或分析上报;关闭页面后不会恢复输入。

何时使用

版本更新的正向触发。

何时不用

README 安装段落 → 文档工作。

按什么顺序做

六个固定检查点。

如何证明完成

迁移说明、两类测试、回滚方法。

  1. 1
    写正向触发

    写出 package、framework、runtime 或 lockfile version 更新这些进入条件。

  2. 2
    写负向触发

    明确排除“修改 README 安装段落”,并路由到 documentation work。

  3. 3
    放入六个有序检查点

    依次写:当前约束、官方迁移说明、单组更新、聚焦测试、全量测试、回滚方法。

  4. 4
    列出验证证据

    要求官方迁移说明、聚焦测试结果、全量测试结果和回滚方法这四项可检查证据。

  5. 5
    写一条行为期望

    写清 Agent 必须在宣布升级完成前展示什么,而不是只说“测试通过”。

查看完成的参考答案
SKILL.md(参考答案)· 行 1–31 · 学习者产出
---
name: dependency-update-safety
description: Guides safe dependency upgrades with compatibility checks and rollback evidence. Use when updating a package, framework, runtime, or lockfile version.
---

## When to Use
- Update a package version, framework version, runtime version, or lockfile version.

**When NOT to use:** 修改 README 安装段落 — route this to documentation work.

## Core Process
1. 检查当前约束。
2. 阅读官方迁移说明。
3. 一次更新一组依赖。
4. 运行聚焦测试。
5. 运行全量测试。
6. 记录回滚方法。

## Verification
- Evidence of official migration notes, focused-test results, full-suite results, and a rollback method.
- The Agent reads official migration notes and shows focused plus full-suite test evidence before declaring the upgrade complete.
操作卡的四条车道

何时使用:版本更新;何时不用:README 文案。

按什么顺序做:六个固定检查点;如何证明完成:迁移说明、两类测试与回滚方法。

05 · 验收:少一份证据,就不能签收

📄

迁移说明

已阅读并记录官方兼容性变化。

🎯

聚焦测试

展示受影响路径的实际结果。

🧪

全量测试

展示完整套件结果,检查回归。

回滚方法

记录可以执行的退路。

🔒
证据门:四项齐全才能标记路线完成

逐项勾选实际拿到的证据;未勾选的项目会在点击完成时标红。没有 JavaScript 时,仍可用这四项清单人工核对,且不能把缺项当作完成。

尚未标记完成:请先核对四项证据。

要升级 web framework 与 lockfile。如何路由?

选择后检查答案。

只需编辑 README 的安装段落。怎么办?

选择后检查答案。

升级 runtime 的报告只写“tests passed”,没有迁移说明、聚焦测试或全量测试输出。缺什么?

选择后检查答案。