---
title: Skill
order: 3
description: 预先编写好的能力包，agent 用它们做调研。
---

# Skill

**Skill** 是 agent 可以调用的预先编写好的能力包，封装了领域专业知识 —— 比如「TiKV
写延迟事故怎么分诊」、「Clinic 慢日志怎么查」—— 这样你就不必每次都把流程讲一遍。

## 一个 skill 包含什么

- 一段简短描述，告诉 agent **什么时候** 用它。
- 分步指引和参考资料。
- 可选的辅助脚本和 prompt。
- 依赖的工具 / 连接器。

## 内置技能

Investibook 内置了一批针对常见 TiDB Cloud 调研路径的技能，例如：

- **tikv-slow-diagnosis** —— TiKV 延迟分诊。
- **tikv-fast-tune** —— 性能瓶颈决策树。
- **transaction-oncall-handbook** —— 事务相关事故。
- **pd-oncall-handbook** —— PD 调度、placement rule、TSO。
- **clinic-api** —— 通过 Clinic 查指标、日志、profile。
- **tidb-perf-diagnosis** —— TiDB 端到端性能分析。

完整列表可以在 Skill Hub（Settings → Skill Hub）或任意 workspace 的 sources 面板里查看。

## agent 如何选择 skill

agent 会综合考虑：

1. 当前激活的 sources（集群类型、工单类别）。
2. 你问题里的关键词。
3. skill 自己的描述和触发短语。

你也可以**显式提示** —— 详见
[How-to → 在 CLI 中使用 Investibook](/docs/how-to/use-cli)，例如：

```text
Use skill tidb-perf-diagnosis and skill clinic-api to help me understand
the hotspot issue in cluster xxxx
```

## 自定义技能

你可以编写自己的 skill 并通过 Skill Hub 上传，作用范围限当前 workspace。要分享给团队，
请向 [tidbcloud/nutshell-skills](https://github.com/tidbcloud/nutshell-skills) 提交 PR。
完整流程见 [How-to → 编写并分享技能](/docs/how-to/author-skill)。
