mcpField
S
skill-creator

skill-creator

github.com/gentleman-programmingAgent 工作流661167 次安装31 周前更新
代码仓库

关于 skill-creator

用于创建可复用技能的指南,为 AI Agent 提供项目专属模式和工作流说明,涵盖结构、命名、内容与注册。

主要功能

  1. 01技能创建条件
  2. 02目录与文件结构
  3. 03命名规范
  4. 04assets 与 references 的选择
  5. 05Frontmatter 与内容检查清单
  6. 06在 AGENTS.md 中注册

适用场景

  1. 01记录重复使用的项目模式
  2. 02编写分步工作流指南
  3. 03添加模板和本地参考资料
  4. 04注册技能以供 Agent 发现

安装

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

$npx skills add https://github.com/gentleman-programming/gentleman-skills --skill skill-creator

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

附带文件assets/SKILL-TEMPLATE.md

详细介绍

何时创建技能

在以下情况下创建技能:

  • 某种模式会反复使用,且 AI 需要相关指导
  • 项目特定约定与通用最佳实践不同
  • 复杂工作流需要分步说明
  • 决策树有助于 AI 选择正确的方法

以下情况不要创建技能:

  • 已有文档(请改为创建参考资料)
  • 模式很简单,无需说明
  • 这是一次性任务

技能结构

skills/{skill-name}/
├── SKILL.md              # Required - main skill file
├── assets/               # Optional - templates, schemas, examples
│   ├── template.py
│   └── schema.json
└── references/           # Optional - links to local docs
    └── docs.md           # Points to docs/developer-guide/*.mdx

SKILL.md 模板

---
name: {skill-name}
description: >
  {One-line description of what this skill does}.
  Trigger: {When the AI should load this skill}.
license: Apache-2.0
metadata:
  author: gentleman-programming
  version: "1.0"
---

## When to Use

{Bullet points of when to use this skill}

## Critical Patterns

{The most important rules - what AI MUST know}

## Code Examples

{Minimal, focused examples}

## Commands

```bash
{Common commands}

资源

  • 模板:有关 {description},请参阅 assets/
  • 文档:本地文档请参阅 references/

---

## Naming Conventions

| Type | Pattern | Examples |
|------|---------|----------|
| Generic skill | `{technology}` | `pytest`, `playwright`, `typescript` |
| Prowler-specific | `prowler-{component}` | `prowler-api`, `prowler-ui`, `prowler-sdk-check` |
| Testing skill | `prowler-test-{component}` | `prowler-test-sdk`, `prowler-test-api` |
| Workflow skill | `{action}-{target}` | `skill-creator`, `jira-task` |

---

## Decision: assets/ vs references/

需要模板? → assets/ 需要 JSON 架构? → assets/ 需要配置示例? → assets/ 链接到现有文档? → references/ 链接到外部指南? → references/(附带本地路径)


**Key Rule**: `references/` should point to LOCAL files (`docs/developer-guide/*.mdx`), not web URLs.

---

## Decision: Prowler-Specific vs Generic

模式适用于任何项目? → 通用技能(例如 pytest、typescript) 模式是 Prowler 特有的? → prowler-{name} 技能 通用技能需要 Prowler 信息? → 添加指向 Prowler 文档的 references/


---

## Frontmatter Fields

| Field | Required | Description |
|-------|----------|-------------|
| `name` | Yes | Skill identifier (lowercase, hyphens) |
| `description` | Yes | What + Trigger in one block |
| `license` | Yes | Always `Apache-2.0` for Prowler |
| `metadata.author` | Yes | `gentleman-programming` |
| `metadata.version` | Yes | Semantic version as string |

---

## Content Guidelines

### DO
- Start with the most critical patterns
- Use tables for decision trees
- Keep code examples minimal and focused
- Include Commands section with copy-paste commands

### DON'T
- Add Keywords section (agent searches frontmatter, not body)
- Duplicate content from existing docs (reference instead)
- Include lengthy explanations (link to docs)
- Add troubleshooting sections (keep focused)
- Use web URLs in references (use local paths)

---

## Registering the Skill

After creating the skill, add it to `AGENTS.md`:

```markdown
| `{skill-name}` | {Description} | [SKILL.md](skills/{skill-name}/SKILL.md) |

创建前检查清单

  • 技能尚不存在(检查 skills/)
  • 模式可复用(不是一次性任务)
  • 名称符合约定
  • Frontmatter 完整(description 包含触发关键词)
  • 关键模式清晰明确
  • 代码示例精简
  • 包含 Commands 部分
  • 已添加到 AGENTS.md

资源

  • 模板:SKILL.md 模板请参阅 assets/

评论

支持 Markdown