본문으로 건너뛰기
cccskills
무료GitHub에 공개

skill-developer

Create and maintain Claude Code skills with clear file structure and activation rules. Get guidance on hooks, which run at specific workflow events, plus troubleshooting, edit restrictions, and splitting detailed instructions into reference files.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

원문원문 설명 보기

Create and manage Claude Code skills following Anthropic best practices. Use when creating new skills, modifying skill-rules.json, understanding trigger patterns, working with hooks, debugging skill activation, or implementing progressive disclosure. Covers skill structure, YAML frontmatter, trigger types (keywords, intent patterns, file paths, content patterns), enforcement levels (block, suggest, warn), hook mechanisms (UserPromptSubmit, PreToolUse), session tracking, and the 500-line rule.

연동 도구Sentry
설치 방법 보기

이럴 때 유용합니다

  • Creating a new Claude Code skill
  • Tuning skill activation conditions
  • Investigating missing or unwanted activation
  • Splitting long instructions into reference files

포함된 파일(7)

  • SKILL.md13.7 KB
  • ADVANCED.md3.9 KB
  • HOOK_MECHANISMS.md7.9 KB
  • PATTERNS_LIBRARY.md3.3 KB
  • SKILL_RULES_REFERENCE.md8.5 KB
  • TRIGGER_TYPES.md7.6 KB
  • TROUBLESHOOTING.md9.9 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

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

Hook Architecture (five wired hooks)

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 (regex or optional AI classification)
  • Method: Injects formatted reminder as context (stdout → Claude's input)
  • Enforcement: Only enforcement: "block" skills are marked MANDATORY; suggest/warn skills always appear as recommendations

2. PreToolUse Hook - Skill Verification Guard (Enforcement)

  • File: .claude/hooks/skill-verification-guard.ts
  • Trigger: BEFORE Edit/MultiEdit/Write executes
  • Purpose: Enforce mandatory skill activation (two-try model) and guardrail file/content patterns; optional AI edit analysis
  • Method: Exit code 2 + stderr blocks the tool; only enforcement: "block" skills can block

3. PostToolUse Hook - Edit Tracker

  • File: .claude/hooks/post-tool-use-tracker.sh
  • Trigger: AFTER Edit/MultiEdit/Write completes
  • Purpose: Track edited files and repos (feeds build checks and the error-handling reminder)

4. PostToolUse Hook - Skill Activation Tracker

  • File: .claude/hooks/skill-activation-tracker.ts
  • Trigger: AFTER the Skill tool runs
  • Purpose: Clear the activated skill from pending lists so the guard stops blocking

5. Stop Hook - Session Doc Updater

  • File: .claude/hooks/session-doc-updater.ts
  • Trigger: AFTER Claude finishes responding
  • Purpose: Index dev docs for vector search (Session Intelligence); prunes stale session state

Optional (shipped but not wired): error-handling-reminder.ts (Stop) — a gentle post-response self-check that analyzes edited files for risky patterns instead of blocking edits.

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:

  • frontend-dev-guidelines - Enforce React/TypeScript patterns (the shipped block guardrail)
  • A database-verification skill verifying table/column names before Prisma queries (hypothetical)

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"}' | \
  npx tsx .claude/hooks/skill-activation-prompt.ts

Test PreToolUse:

cat <<'EOF' | npx tsx .claude/hooks/skill-verification-guard.ts
{"session_id":"test","tool_name":"Edit","tool_input":{"file_path":"test.ts"}}
EOF

Step 4: Refine Patterns

Based on testing:

  • Add missing keywords
  • Refine intent patterns to reduce false positives
  • Adjust file path patterns
  • Test content patterns against actual files

Step 5: Follow Anthropic Best Practices

✅ Keep SKILL.md under 500 lines ✅ Use progressive disclosure with reference files ✅ Add table of contents to reference files > 100 lines ✅ Write detailed description with trigger keywords ✅ Test with 3+ real scenarios before documenting ✅ Iterate based on actual usage


Enforcement Levels

BLOCK (Critical Guardrails)

  • Physically prevents Edit/Write tool execution
  • Exit code 2 from hook, stderr → Claude
  • Claude sees message and must use skill to proceed
  • Use For: Critical mistakes, data integrity, security issues
  • Only enforcement: "block" skills can hard-block — in both the UserPromptSubmit mandatory list and the PreToolUse guardrail checks. suggest/warn matches are always advisory.

Example: Database column name verification

SUGGEST (Recommended)

  • Reminder injected before Claude sees prompt
  • Claude is aware of relevant skills
  • Not enforced, just advisory
  • Use For: Domain guidance, best practices, how-to guides

Example: Frontend development guidelines

WARN (Optional)

  • Low priority suggestions
  • Advisory only, minimal enforcement
  • Use For: Nice-to-have suggestions, informational reminders

Rarely used - most skills are either BLOCK or SUGGEST.


Skip Conditions & User Control

1. Session Tracking

Purpose: Don't nag repeatedly in same session

How it works:

  • First edit → Hook blocks, updates session state
  • Second edit (same session) → Hook allows
  • Different session → Blocks again

State File: .claude/hooks/state/skills-used-{session_id}.json

2. File Markers

Purpose: Permanent skip for verified files

Marker: // @skip-validation

Usage:

// @skip-validation
import { PrismaService } from './prisma';
// This file has been manually verified

NOTE: Use sparingly - defeats the purpose if overused

3. Environment Variables

Purpose: Emergency disable, temporary override

Global disable:

export SKIP_MANDATORY_SKILLS=true   # Disables mandatory-skill blocking
export SKIP_PRETOOLUSE_AI=true      # Disables AI edit analysis in the guard

Skill-specific (via skipConditions.envOverride in skill-rules.json):

export SKIP_FRONTEND_GUIDELINES=true
export SKIP_ERROR_REMINDER=true     # Optional Stop-hook reminder

Testing Checklist

When creating a new skill, verify:

  • Skill file created in .claude/skills/{name}/SKILL.md
  • Proper frontmatter with name and description
  • Entry added to skill-rules.json
  • Keywords tested with real prompts
  • Intent patterns tested with variations
  • File path patterns tested with actual files
  • Content patterns tested against file contents
  • Block message is clear and actionable (if guardrail)
  • Skip conditions configured appropriately
  • Priority level matches importance
  • No false positives in testing
  • No false negatives in testing
  • Performance is acceptable (<100ms or <200ms)
  • JSON syntax validated: jq . skill-rules.json
  • SKILL.md under 500 lines ⭐
  • Reference files created if needed
  • Table of contents added to files > 100 lines

Reference Files

For detailed information on specific topics, see:

TRIGGER_TYPES.md

Complete guide to all trigger types:

  • Keyword triggers (explicit topic matching)
  • Intent patterns (implicit action detection)
  • File path triggers (glob patterns)
  • Content patterns (regex in files)
  • Best practices and examples for each
  • Common pitfalls and testing strategies

SKILL_RULES_REFERENCE.md

Complete skill-rules.json schema:

  • Full TypeScript interface definitions
  • Field-by-field explanations
  • Complete guardrail skill example
  • Complete domain skill example
  • Validation guide and common errors

HOOK_MECHANISMS.md

Deep dive into hook internals:

  • UserPromptSubmit flow (detailed)
  • PreToolUse flow (detailed)
  • Exit code behavior table (CRITICAL)
  • Session state management
  • Performance considerations

TROUBLESHOOTING.md

Comprehensive debugging guide:

  • Skill not triggering (UserPromptSubmit)
  • PreToolUse not blocking
  • False positives (too many triggers)
  • Hook not executing at all
  • Performance issues

PATTERNS_LIBRARY.md

Ready-to-use pattern collection:

  • Intent pattern library (regex)
  • File path pattern library (glob)
  • Content pattern library (regex)
  • Organized by use case
  • Copy-paste ready

ADVANCED.md

Future enhancements and ideas:

  • Dynamic rule updates
  • Skill dependencies
  • Conditional enforcement
  • Skill analytics
  • Skill versioning

Quick Reference Summary

Create New Skill (5 Steps)

  1. Create .claude/skills/{name}/SKILL.md with frontmatter
  2. Add entry to .claude/skills/skill-rules.json
  3. Test with npx tsx commands
  4. Refine patterns based on testing
  5. Keep SKILL.md under 500 lines

Trigger Types

  • Keywords: Explicit topic mentions
  • Intent: Implicit action detection
  • File Paths: Location-based activation
  • Content: Technology-specific detection

See TRIGGER_TYPES.md for complete details.

Enforcement

  • BLOCK: Exit code 2, critical only
  • SUGGEST: Inject context, most common
  • WARN: Advisory, rarely used

Skip Conditions

  • Session tracking: Automatic (prevents repeated nags)
  • File markers: // @skip-validation (permanent skip)
  • Env vars: SKIP_MANDATORY_SKILLS, per-skill envOverride (emergency disable)

Anthropic Best Practices

✅ 500-line rule: Keep SKILL.md under 500 lines ✅ Progressive disclosure: Use reference files for details ✅ Table of contents: Add to reference files > 100 lines ✅ One level deep: Don't nest references deeply ✅ Rich descriptions: Include all trigger keywords (max 1024 chars) ✅ Test first: Build 3+ evaluations before extensive documentation ✅ Gerund naming: Prefer verb + -ing (e.g., "processing-pdfs")

Troubleshoot

Test hooks manually:

# UserPromptSubmit
echo '{"prompt":"test"}' | npx tsx .claude/hooks/skill-activation-prompt.ts

# PreToolUse
cat <<'EOF' | npx tsx .claude/hooks/skill-verification-guard.ts
{"tool_name":"Edit","tool_input":{"file_path":"test.ts"}}
EOF

See TROUBLESHOOTING.md for complete debugging guide.


Related Files

Configuration:

  • .claude/skills/skill-rules.json - Master configuration
  • .claude/hooks/state/ - Session tracking
  • .claude/settings.json - Hook registration

Hooks:

  • .claude/hooks/skill-activation-prompt.ts - UserPromptSubmit
  • .claude/hooks/skill-verification-guard.ts - PreToolUse (Edit|MultiEdit|Write)
  • .claude/hooks/post-tool-use-tracker.sh - PostToolUse (Edit|MultiEdit|Write)
  • .claude/hooks/skill-activation-tracker.ts - PostToolUse (Skill)
  • .claude/hooks/session-doc-updater.ts - Stop
  • .claude/hooks/error-handling-reminder.ts - Stop (optional, not wired by default)

All Skills:

  • .claude/skills/*/SKILL.md - Skill content files

Skill Status: COMPLETE - Restructured following Anthropic best practices ✅ Line Count: < 500 (following 500-line rule) ✅ Progressive Disclosure: Reference files for detailed information ✅

Next: Create more skills, refine patterns based on usage

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Build Node.js, Express, and TypeScript APIs with consistent structure. Separate request handling, business logic, and database access, while following guidance for input validation, error tracking, configuration, and tests when adding features or refactoring existing services.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Adding an API endpoint
  • Separating business logic from database access
  • Standardizing input validation and error handling
diet103/claude-code-infrastructure-showcase1만2026년 7월 14일 업데이트

Add Sentry error reporting and performance monitoring to services, scheduled jobs, and database operations. Follow examples for capturing exceptions with useful context and measuring execution time through spans, which record individual operations for investigation.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Adding error reporting to an API
  • Recording failures and execution time for scheduled jobs
  • Measuring database and asynchronous operations
diet103/claude-code-infrastructure-showcase1만2026년 7월 14일 업데이트

Build React and TypeScript pages with guidance for data fetching, loading states, styling, and navigation. Organize code by feature and apply lazy loading, which loads components when needed, using patterns for MUI v7 and TanStack Router/Query.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Creating a React page or component
  • Organizing frontend files by feature
  • Coordinating data fetching and loading states
diet103/claude-code-infrastructure-showcase1만2026년 7월 14일 업데이트

Check a project's Codex infrastructure, fix missing dependencies, script permissions, and configuration errors, then repeat the check until failures are resolved. Receive a summary of repairs and any remaining optional-feature warnings.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Check the Codex environment after setup
  • Fix dependency and script permission errors
  • Repair JSON configuration syntax
diet103/claude-code-infrastructure-showcase1만2026년 7월 14일 업데이트

diet103의 스킬 모두 보기

이 스킬의 문제 신고