237创建中2e676d59

tools-only2026-10-25查看 947复制 25

技能是包含指令的文件夹,赋予 AI 智能体新的能力。本指南帮助你以最简流程创建、测试和分享技能。

Download (.md)

📘如何使用这个技能

  1. 1
    复制技能内容·点击上方「Copy SKILL.md」复制全部内容,或 Download 下载到本地
  2. 2
    打开你的 AI 客户端·支持 Claude Code、Trae、Cursor、ChatGPT、DeepSeek、Kimi 等任意 AI 助手
  3. 3
    粘贴为系统提示/知识文件·Claude Code:放入 .claude/skills/ 目录;普通对话:作为首条消息发送并说「请严格按这份技能文档执行」
  4. 4
    直接提出你的需求·AI 会按技能定义的工作流、格式和约束来处理,无需再解释背景

💡 提示:技能生效后,每次对话只需一句需求,AI 会按 SKILL.md 的流程执行。

SKILL.md3614 chars
---
title: Creating Skills
---

# Creating Skills

Skills are folders of instructions that give AI agents new capabilities. This
guide helps you create, test, and share a skill with minimal ceremony.

## Quick Start

```bash
agr init my-skill
```

Creates `my-skill/SKILL.md` in your current directory:

```
my-skill/
└── SKILL.md
```

If you're adding the skill to this repo, place it under `./skills/`:

```
skills/
└── my-skill/
    └── SKILL.md
```

From there you can:

1. Write the instructions in `SKILL.md`
2. Add the skill to your tool with `agr add ./skills/my-skill`
3. Add it to `agr.toml` for team sync (see below)

## SKILL.md Format

A skill requires YAML frontmatter with `name` and `description`:

```markdown
---
name: my-skill
description: Brief description of what this skill does and when to use it.
---

# My Skill

Instructions for the agent go here.
```

### Required Fields

| Field | Constraints |
|-------|-------------|
| `name` | Max 64 chars. Lowercase letters, numbers, hyphens. Must match directory name. |
| `description` | Max 1024 chars. Describes what the skill does and when to use it. |

### Optional Fields

| Field | Purpose |
|-------|---------|
| `license` | License name or reference to bundled file |
| `compatibility` | Environment requirements (tools, packages, network) |
| `metadata` | Key-value pairs (author, version, etc.) |

## Example: Complete Skill

```markdown
---
name: code-reviewer
description: Reviews code for bugs, security issues, and best practices. Use when reviewing pull requests or code changes.
license: MIT
metadata:
  author: your-username
  version: "1.0"
---

# Code Reviewer

You are a code review expert. When reviewing code:

1. Check for bugs and logic errors
2. Identify security vulnerabilities
3. Suggest performance improvements
4. Ensure code follows project conventions

Be specific and actionable in your feedback. Reference line numbers when possible.
```

## Skills with Supporting Files

For complex skills, add supporting files:

```
my-skill/
├── SKILL.md
├── references/       # Additional documentation
│   └── style-guide.md
├── scripts/          # Executable code
│   └── validate.py
└── assets/           # Templates, data files
    └── template.json
```

Reference them in your SKILL.md:

```markdown
See [style guide](references/style-guide.md) for formatting rules.

Run the validation script:
scripts/validate.py
```

Keep your main SKILL.md under 500 lines. Put detailed reference material in the `references/` folder.

## Test Your Skill

Add your local skill and test it:

```bash
agr add ./skills/my-skill
```

(If your skill is elsewhere, point to that path instead.)

Your skill is now available in your configured tool. Test it by starting your
agent and invoking the skill.

## Add to agr.toml (Team Sync)

To share a skill with your team, add it to `agr.toml` as a local path
dependency:

```toml
dependencies = [
    {path = "./skills/my-skill", type = "skill"},
]
```

Teammates run:

```bash
agr sync
```

## Share with Others

Push to GitHub. Others install with:

```bash
agr add your-username/my-skill
```

Or from a specific repo:

```bash
agr add your-username/my-repo/my-skill
```

## Tips

- Write clear, specific descriptions—agents use them to decide when to activate your skill
- Keep instructions focused on one task
- Use examples to show expected inputs and outputs
- Test thoroughly before sharing

## Learn More

- [Agent Skills Specification](https://agentskills.io/specification) — Full format details
- [Example Skills](https://github.com/anthropics/skills) — Reference implementations
来源:skillsdirectory

评论0

登录后参与评论

还没有评论,来抢沙发吧