跳到正文
Skillpedia
智能体48k · #5792

skill-developer

它能做什么

这份指南讲解如何为 Claude Code 这款 AI 创建和管理技能(工具)。它说明如何让 AI 建议甚至阻止某些操作,并遵循最佳实践。

适用场景

  • ✓当你想教 AI 如何创建新工具时。
  • ✓想了解 AI 如何决定何时使用某个工具时。
  • ✓当你调整规则,让 AI 使用正确的工具时。

技能链接

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/skill-developer/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/skill-developer/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“我要怎样为 Claude Code 创建一个新工具?”

每周 5 个新技能,1 分钟读完。

工作原理

系统使用“钩子”(hooks),它们就像触发器。其中一个钩子会在 AI 回复之前检查你的提问,并建议相应的工具;另一个钩子则在 AI 完成任务后,帮它记住良好的做法。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Skill Developer Guide

Purpose

Comprehensive guide for creating and managing skills in Claude Code with auto-activation system, following Anthropic's official best practices including the 500-line rule and progressive disclosure pattern.

When to Use This Skill

Automatically activates when you mention:

  • Creating or adding skills
  • Modifying skill triggers or rules
  • Understanding how skill activation works
  • Debugging skill activation issues
  • Working with skill-rules.json
  • Hook system mechanics
  • Claude Code best practices
  • Progressive disclosure
  • YAML frontmatter
  • 500-line rule

System Overview

Two-Hook Architecture

1. UserPromptSubmit Hook (Proactive Suggestions)

  • File: .claude/hooks/skill-activation-prompt.ts
  • Trigger: BEFORE Claude sees user's prompt
  • Purpose: Suggest relevant skills based on keywords + intent patterns
  • Method: Injects formatted reminder as context (stdout → Claude's input)
  • Use Cases: Topic-based skills, implicit work detection

2. Stop Hook - Error Handling Reminder (Gentle Reminders)

  • File: .claude/hooks/error-handling-reminder.ts
  • Trigger: AFTER Claude finishes responding
  • Purpose: Gentle reminder to self-assess error handling in code written
  • Method: Analyzes edited files for risky patterns, displays reminder if needed
  • Use Cases: Error handling awareness without blocking friction

Philosophy Change (2025-10-27): We moved away from blocking PreToolUse for Sentry/error handling. Instead, use gentle post-response reminders that don't block workflow but maintain code quality awareness.

Configuration File

Location: .claude/skills/skill-rules.json

Defines:

  • All skills and their trigger conditions
  • Enforcement levels (block, suggest, warn)
  • File path patterns (glob)
  • Content detection patterns (regex)
  • Skip conditions (session tracking, file markers, env vars)

Skill Types

1. Guardrail Skills

Purpose: Enforce critical best practices that prevent errors

Characteristics:

  • Type: "guardrail"
  • Enforcement: "block"
  • Priority: "critical" or "high"
  • Block file edits until skill used
  • Prevent common mistakes (column names, critical errors)
  • Session-aware (don't repeat nag in same session)

Examples:

  • database-verification - Verify table/column names before Prisma queries
  • frontend-dev-guidelines - Enforce React/TypeScript patterns

When to Use:

  • Mistakes that cause runtime errors
  • Data integrity concerns
  • Critical compatibility issues

2. Domain Skills

Purpose: Provide comprehensive guidance for specific areas

Characteristics:

  • Type: "domain"
  • Enforcement: "suggest"
  • Priority: "high" or "medium"
  • Advisory, not mandatory
  • Topic or domain-specific
  • Comprehensive documentation

Examples:

  • backend-dev-guidelines - Node.js/Express/TypeScript patterns
  • frontend-dev-guidelines - React/TypeScript best practices
  • error-tracking - Sentry integration guidance

When to Use:

  • Complex systems requiring deep knowledge
  • Best practices documentation
  • Architectural patterns
  • How-to guides

Quick Start: Creating a New Skill

Step 1: Create Skill File

Location: .claude/skills/{skill-name}/SKILL.md

Template:

---
name: my-new-skill
description: Brief description including keywords that trigger this skill. Mention topics, file types, and use cases. Be explicit about trigger terms.
---

# My New Skill

## Purpose
What this skill helps with

## When to Use
Specific scenarios and conditions

## Key Information
The actual guidance, documentation, patterns, examples

Best Practices:

  • ✅ Name: Lowercase, hyphens, gerund form (verb + -ing) preferred
  • ✅ Description: Include ALL trigger keywords/phrases (max 1024 chars)
  • ✅ Content: Under 500 lines - use reference files for details
  • ✅ Examples: Real code examples
  • ✅ Structure: Clear headings, lists, code blocks

Step 2: Add to skill-rules.json

See SKILL_RULES_REFERENCE.md for complete schema.

Basic Template:

{
  "my-new-skill": {
    "type": "domain",
    "enforcement": "suggest",
    "priority": "medium",
    "promptTriggers": {
      "keywords": ["keyword1", "keyword2"],
      "intentPatterns": ["(create|add).*?something"]
    }
  }
}

Step 3: Test Triggers

Test UserPromptSubmit:

echo '{"session_id":"test","prompt":"your test prompt"}' | \

…
常见问题

什么是“技能”?

“技能”就像一些小型指令或工具,你可以交给 Claude Code,让它更好地帮你做事。它们既可以用来引导 AI,也可以确保它遵守特定规则。

500 行规则是什么?

这是一条建议:每个技能的主要内容尽量控制在 500 行以内,这样更容易理解和使用。

“护栏”类和“领域”类技能有什么区别?

“护栏”类技能用于防止严重错误,是必须遵守的;“领域”类技能则针对某个特定主题提供指南和建议,但不是强制性的。

详情

作者的原始描述

Comprehensive guide for creating and managing skills in Claude Code with auto-activation system, following Anthropic's official best practices including the 500-line rule and progressive disclosure pattern.

repo: sickn33/agentic-awesome-skills

热度

GitHub 星标
48k
排名
#5792
许可证
MIT
更新时间
2026/10/15

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能