mcpField
S
skill-creator

skill-creator

github.com/johnlindquistAgent 工作流2638 次安装45 周前更新
代码仓库

关于 skill-creator

这项指南技能帮助创建用于扩展 Claude 能力的模块化 Agent Skills。它介绍技能结构、个人与项目级位置、辅助文件、描述编写以及验证方法。

主要功能

  1. 01创建个人或项目级技能
  2. 02编写 SKILL.md 元数据和说明
  3. 03添加参考文件、脚本和模板
  4. 04编写便于 Claude 发现技能的描述
  5. 05验证并排查技能配置

适用场景

  1. 01将重复工作流程整理为 Claude 技能
  2. 02通过项目仓库共享技能
  3. 03为技能添加辅助脚本和参考资料
  4. 04排查 Claude 未加载技能的原因

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/johnlindquist/claude --skill skill-creator

安装后在 Claude Code 中输入/skill-creator确认已加载。

详细介绍

Skill Creator

创建模块化的 Agent Skills,以扩展 Claude 的能力。Skills 将专业知识打包成可被发现的文件夹,其中包含指令、脚本和资源。

何时使用

  • “为……创建一个 skill”
  • “制作一个新 skill”
  • “添加一个能……的 skill”
  • “我该如何创建一个 skill?”
  • “将此工作流记录为一个 skill”

快速开始:创建一个 Skill

1. 选择位置
# Personal skill (all projects)
mkdir -p ~/.claude/skills/my-skill

# Project skill (shared via git)
mkdir -p .claude/skills/my-skill
2. 创建 SKILL.md
---
name: my-skill
description: Brief description of what it does and when to use it.
---

# My Skill

## Instructions
Step-by-step guidance for Claude.

## Examples
Concrete usage examples.
3. 测试它

向 Claude 提出一个与你的 description 匹配的问题。Skills 会根据上下文自动激活。


SKILL.md 结构

必需:YAML Frontmatter
---
name: lowercase-with-hyphens    # Max 64 chars, [a-z0-9-] only
description: What it does AND when to use it. Include trigger keywords.
---

关键:description 字段决定 Claude 何时发现并使用你的 skill。

可选:工具权限
---
name: safe-reader
description: Read-only file access. Use for code review without modifications.
allowed-tools: Read, Grep, Glob
---

设置 allowed-tools 后,Claude 只能使用这些工具,且无需请求权限。

内容部分
# Skill Name

Brief overview.

## Prerequisites
Installation or setup if needed.

## CLI Reference
Commands with examples.

## Common Workflows
Step-by-step procedures.

## Best Practices
Guidelines and tips.

Skill 类型

类型位置范围是否共享
个人~/.claude/skills/你的所有项目否
项目.claude/skills/此仓库是(git)
插件通过已安装的插件每个插件通过市场

支持文件

在 SKILL.md 旁边添加文件:

my-skill/
├── SKILL.md           # Required
├── reference.md       # Optional docs
├── examples/          # Optional examples
├── scripts/           # Optional utilities
│   └── helper.ts
└── templates/         # Optional templates

从 SKILL.md 中引用:

See [reference.md](reference.md) for details.

Run the helper:
` ` `bash
bun scripts/helper.ts
` ` `

Claude 仅在需要时读取支持文件(渐进式披露)。


编写好的 Description

差(过于模糊):

description: Helps with data

好(具体的触发条件):

description: Analyze Excel spreadsheets, create pivot tables, generate charts. Use when working with Excel files, .xlsx format, or spreadsheet analysis.

包括:

  • 该 skill 做什么
  • 何时使用它
  • 用户可能说出的关键触发词

完整示例

创建 ~/.claude/skills/api-testing/SKILL.md
---
name: api-testing
description: Test REST APIs with curl and analyze responses. Use when testing endpoints, debugging APIs, or validating HTTP requests.
---

# API Testing

Test and debug REST APIs from the command line.

## Prerequisites

` ` `bash
# Verify curl is available
curl --version
` ` `

## CLI Reference

### Basic Requests
` ` `bash
curl -X GET "https://api.example.com/users"
curl -X POST "https://api.example.com/users" \
  -H "Content-Type: application/json" \
  -d '{"name": "John"}'
` ` `

### With Authentication
` ` `bash
curl -H "Authorization: Bearer $TOKEN" \
  "https://api.example.com/protected"
` ` `

### Save Response
` ` `bash
curl -o response.json "https://api.example.com/data"
` ` `

## Common Workflows

### Test Endpoint Health
` ` `bash
# Check status code
curl -s -o /dev/null -w "%{http_code}" https://api.example.com/health

# Measure response time
curl -w "Time: %{time_total}s\n" -o /dev/null -s https://api.example.com
` ` `

## Best Practices

1. **Use -s for scripts** - Silent mode hides progress
2. **Use -f to fail** - Exit non-zero on HTTP errors
3. **Use jq for JSON** - Pipe to `jq` for pretty output

验证清单

在认为完成之前:

  • SKILL.md 具有有效的 YAML frontmatter
  • 名称为小写加连字符(最多 64 个字符)
  • Description 包括做什么和何时用(最多 1024 个字符)
  • 指令清晰且可操作
  • 命令行命令有说明性注释
  • 已测试 Claude 能发现并使用该 skill

故障排除

Claude 不使用我的 skill
  1. Description 过于模糊 - 添加具体的触发关键词
  2. 位置错误 - 检查路径是否完全符合约定
  3. YAML 无效 - 验证 frontmatter 语法
  4. 需要重启 - 更改后重启 Claude Code
检查 skill 是否加载
# Verify file exists
cat ~/.claude/skills/my-skill/SKILL.md

# List all skills
ls ~/.claude/skills/*/SKILL.md
ls .claude/skills/*/SKILL.md
调试 frontmatter
# View first 10 lines
head -n 10 ~/.claude/skills/my-skill/SKILL.md

确保:

  • 第 1 行以 --- 开头
  • 内容前以 --- 结尾
  • 没有制表符(使用空格)
  • 含特殊字符的字符串已加引号

研究现有 Skills

# See all personal skills
ls ~/.claude/skills/*/SKILL.md

# Good examples to study
cat ~/.claude/skills/beads/SKILL.md     # Task tracking CLI
cat ~/.claude/skills/gemini/SKILL.md    # AI research CLI
cat ~/.claude/skills/github/SKILL.md    # gh CLI patterns

评论

支持 Markdown