Command Palette

Search for a command to run...

Back to skills
skill № 03719

update-skill

当编写新技能、编辑已有技能,或询问 SKILL.md 结构时使用。

FreeNo executable scripts
john-walks-slowby john-walks-slow★ 30 GitHub stars

Install update-skill in Claude Code & Claude Desktop

Sign up to install this skill

Create a free account to reveal the install command and save the skill to your library.

  • Reveal the one-line install command
  • Save skills to your synced library
  • Get notified when skills update
Sign up freeI already have an account

About this skill

创建技能

技能是 markdown 文件,教会 agent 如何执行特定任务:使用团队标准审查 PR、以偏好格式生成提交消息、查询数据库 schema,或任何专门的工作流。 本技能指导你创建有效的 Agent Skills。

开始之前:收集需求

创建技能之前,从上下文中或用户口中收集以下关键信息:

  1. 目的和范围:这个技能应该帮助完成什么特定任务或工作流?
  2. 目标位置:新技能放在与本技能相同的目录中(即同级的 skills/<name>/ 目录)。如果不确定,直接问。
  3. 触发场景:agent 何时应自动应用这个技能?
  4. 关键领域知识:agent 需要哪些它本身不会知道的专门信息?
  5. 输出格式偏好:是否有特定的模板、格式或样式要求?
  6. 既有模式:是否有现成的示例或约定可以遵循?

用户的逐字文本

如果用户提供了要在技能中使用的确切措辞,请尊重并逐字使用在 SKILL.md 中(相同用词、相同顺序)。不要改写、弱化或扩展他们的原文,也不要在周围添加未经请求的标题或评论。

从上下文推断

如果你有之前的对话上下文,从讨论过的内容中推断技能。你可以基于对话中涌现的工作流、模式或领域知识来创建技能。


技能文件结构

目录布局

技能以目录形式存储,包含一个 SKILL.md 文件:

skill-name/
├── SKILL.md              # Required - main instructions
├── references/            # Optional - detailed docs loaded as needed
│   ├── dependencies.md   #   Environment dependencies (if any)
│   ├── standards.md      #   Detailed reference material
│   └── examples.md       #   Usage examples
├── scripts/              # Optional - utility scripts
│   ├── validate.py
│   └── helper.sh
└── evals/                # Optional - test cases
    └── evals.json

存储位置 — 两级目录结构

技能组织在 skills/ 下的两级目录结构中:

skills/
├── harmonyos/               # Category: HarmonyOS 鸿蒙设备相关
│   ├── view-hilog/          # Skill: 鸿蒙日志
│   └── hvigor-build/        # Skill: 编译构建
├── integration/             # Category: 外部平台集成
│   ├── huashan-log/          # Skill: 华山平台
│   └── codehub-multi-mr/      # Skill: CodeHub 多重挑单 MR
├── knowledge/               # Category: 纯知识参考
│   ├── accessibility/        # Skill: 无障碍规则
│   └── i18n-tips/            # Skill: i18n 避坑
├── meta/                    # Category: 元技能(skill/rule 管理)
│   ├── create-celia-skill/  # This skill
│   └── contribute-celia-suite/
├── tool/                    # Category: 本地工具
│   └── everything-search/
└── workflow/                # Category: 工作方式
    ├── workflow-troubleshoot/
    └── spawn-reviewer/

SKILL.md 结构

每个技能需要一个 SKILL.md 文件,包含 YAML frontmatter 和 markdown 正文:

---
name: your-skill-name
description: Brief description of what this skill does and when to use it
---

# Your Skill Name

## Instructions
Clear, step-by-step guidance for the agent.

## Examples
Concrete examples of using this skill.

必填 Metadata 字段

字段 要求 用途
name 最多 64 字符,仅限小写字母/数字/连字符 技能的唯一标识符
description 最多 1024 字符,非空 帮助 agent 决定何时应用该技能

编写有效的描述

描述对于技能发现至关重要。agent 使用它来决定何时应用你的技能。

描述最佳实践

  1. 使用第三人称(描述会被注入系统提示词):

    • ✅ 好的:"Processes Excel files and generates reports"
    • ❌ 避免:"I can help you process Excel files"
    • ❌ 避免:"You can use this to process Excel files"
  2. 具体且包含触发词:

    • ✅ 好的:"Extract text and tables from PDF files, fill forms, merge documents. Use when working with PDF files or when the user mentions PDFs, forms, or document extraction."
    • ❌ 模糊的:"Helps with documents"
  3. 同时包含 WHAT 和 WHEN:

    • WHAT:技能做什么(具体能力)
    • WHEN:agent 何时应使用它(触发场景)

描述示例

# PDF Processing
description: Extract text and tables from PDF files, fill forms, merge documents. Use when working with PDF files or when the user mentions PDFs, forms, or document extraction.

# Excel Analysis
description: Analyze Excel spreadsheets, create pivot tables, generate charts. Use when analyzing Excel files, spreadsheets, tabular data, or .xlsx files.

# Git Commit Helper
description: Generate descriptive commit messages by analyzing git diffs. Use when the user asks for help writing commit messages or reviewing staged changes.

# Code Review
description: Review code for quality, security, and best practices following team standards. Use when reviewing pull requests, code changes, or when the user asks for a code review.

核心编写原则

1. 简洁是关键

上下文窗口与对话历史、其他技能和请求共享。每个 token 都在争夺空间。

默认假设:agent 已经非常聪明。只添加它不具备的上下文。

对每条信息提出质疑:

  • "agent 真的需要这个解释吗?"
  • "我能假设 agent 已经知道这个吗?"
  • "这段文字值得它消耗的 token 吗?"

好的(简洁):

## Extract PDF text

Use pdfplumber for text extraction:

\`\`\`python
import pdfplumber

with pdfplumber.open("file.pdf") as pdf:
    text = pdf.pages[0].extract_text()
\`\`\`

坏的(冗长):

## Extract PDF text

PDF (Portable Document Format) files are a common file format that contains
text, images, and other content. To extract text from a PDF, you'll need to
use a library. There are many libraries available for PDF processing, but we
recommend pdfplumber because it's easy to use and handles most cases well...

2. 保持 SKILL.md 在 500 行以内

为获得最佳性能,主 SKILL.md 文件应保持简洁。对详细内容使用渐进式披露。

3. 渐进式披露

将关键信息放在 SKILL.md 中;详细参考资料放在单独的文件中,agent 仅在需要时读取。

# PDF Processing

## Quick start
[Essential instructions here]

## Additional resources
- For complete API details, see [references/standards.md](references/standards.md)
- For u
Full SKILL.md on GitHub

Allowed tools

Tools this skill is permitted to call.

No restriction — this skill can use any tool.

FAQ

What does the update-skill skill do?

当编写新技能、编辑已有技能,或询问 SKILL.md 结构时使用。

How do I install the update-skill skill?

Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.

Does the update-skill skill run scripts?

No, this skill is instructions only (SKILL.md) with no executable scripts.

Related skills

Compare update-skill with