# Agent Skills 作业模板 · Build a Reusable Research Skill

> StatsPAI Summer Bootcamp · 配合知识页 `/courses/summer-bootcamp/topics/agent-skills` 与 `agent_skills_lab.ipynb`。
> 目标：把一段你反复要做的研究流程封装成可发现、可组合、可测试的 Skill。

---

## 中文版

### 目标
选一个你常重复的研究步骤（清洗面板、事件研究、做平衡表、出回归表、稳健性套件），封装成一个 Skill，并证明它可被选择、可组合、可测试。

### 任务
1. **定义合约**：写一个 `SKILL.md`——名称、何时使用（when_to_use）、输入、步骤、产物。
2. **可发现**：用一句任务描述，演示你的技能能从 registry 里被正确选中（描述匹配）。
3. **可组合**：把它接进一个至少 3 步的流水线，并为每步写前置 gate。
4. **可靠性**：给每个技能一个测试通过率，计算流水线整体可靠性，并指出最脆弱的一环。
5. **可测试**：为你的技能写 ≥4 个测试用例（含边界与失败），报告通过率。
6. **上下文经济**：说明渐进式披露（只在触发时加载技能正文）能省多少 token。

### 交付物
- `skills/<name>/SKILL.md` + `scripts/` + `tests/`，以及 `report.md`（≤1 页）。
- 一次选择演示、一次组合演示、一份测试结果。

### 评分要点
| 维度 | 权重 |
|---|---|
| 合约清晰（when_to_use / 步骤 / 产物） | 25% |
| 选择与组合演示 | 25% |
| 测试用例与通过率 | 30% |
| 可靠性与上下文经济分析 | 20% |

---

## English Version

### Goal
Pick a step you repeat often (clean a panel, event study, balance table, regression table, robustness suite), package it as a Skill, and show it can be selected, composed, and tested.

### Tasks
1. **Define the contract**: write a `SKILL.md` — name, when_to_use, inputs, steps, artifacts.
2. **Discoverable**: with one task description, show your skill is correctly selected from a registry (description match).
3. **Composable**: plug it into a pipeline of at least 3 steps with a pre-gate for each.
4. **Reliability**: give each skill a test pass rate, compute the pipeline reliability, and name the weakest link.
5. **Testable**: write >= 4 test cases (incl. edge and failure), report the pass rate.
6. **Context economy**: show how much progressive disclosure (load the body only when triggered) saves.

### Deliverables
- `skills/<name>/SKILL.md` + `scripts/` + `tests/`, plus `report.md` (<= 1 page).
- One selection demo, one composition demo, one test result.

### Rubric
| Dimension | Weight |
|---|---|
| Clear contract (when_to_use / steps / artifacts) | 25% |
| Selection and composition demos | 25% |
| Test cases and pass rate | 30% |
| Reliability and context-economy analysis | 20% |
