Skip to content
meta logo

Writing effective Claude Code skills

meta

Guide for writing and improving Claude Code skills. Use when creating new skills, debugging why skills aren't activating, or improving skill descriptions and structure.

SKILL.md

Full skill instructions

Writing effective Claude Code skills

Required structure

skill-name/
├── SKILL.md (required)
├── reference.md (optional)
├── scripts/ (optional)
└── templates/ (optional)

SKILL.md frontmatter

---
name: lowercase-with-hyphens
description: Explain WHAT it does AND WHEN to use it. Include trigger terms users would say.
allowed-tools: [Read, Write, Bash]  # optional: restrict permissions
---

Critical best practices

  1. Keep skills focused - one capability per skill
  2. Write specific descriptions - include actual terms users would mention
  3. Test activation - verify Claude invokes it when expected
  4. Use allowed-tools - restrict permissions for security

Description examples

❌ Bad: "Helps with data" ✅ Good: "Analyze Excel spreadsheets, generate pivot tables, create charts. Use when working with .xlsx files."

❌ Bad: "Manages configuration" ✅ Good: "Read and update YAML/​JSON config files. Use when modifying settings, environment variables, or application configuration."

Debugging checklist

If Claude doesn't use your skill:

  • Description lacks trigger terms users would say
  • YAML syntax errors (check --- markers, indentation)
  • Description not specific enough about WHEN to use it
  • Wrong file path or permissions

Finding and fixing frontmatter issues

Check if frontmatter exists:

# View first 10 lines of SKILL.md
head -10 ~/​.claude/​skills/​*/​SKILL.md

Common frontmatter problems:

  1. Missing frontmatter block - File starts with # instead of ---
    • Fix: Add YAML block at top of file
  2. Missing closing --- - Only one --- marker
    • Fix: Ensure both opening and closing markers exist
  3. Missing required fields - No name: or description:
    • Fix: Add both required fields
  4. Wrong indentation - YAML is indentation-sensitive
    • Fix: Use 2 spaces, no tabs
  5. Missing description trigger terms - Generic description
    • Fix: Add specific keywords users would say

Validation script:

# Check all skills for frontmatter
for skill in ~/​.claude/​skills/​*/​SKILL.md; do
  echo "=== $skill ==="
  if head -1 "$skill" | grep -q "^---$"; then
    echo "✓ Has frontmatter"
  else
    echo "✗ Missing frontmatter"
  fi
done

Systematic skill debugging workflow

When debugging skills that aren't working:

  1. List all skills - Verify skill exists

    ls -la ~/​.claude/​skills/
    
  2. Check frontmatter - Validate YAML structure

    head -10 ~/​.claude/​skills/​skill-name/​SKILL.md
    
  3. Verify required fields - Ensure name and description exist

    • name: must match directory name
    • description: must include trigger terms
  4. Test description specificity - Does it explain WHEN to use?

    • Include file types, actions, or domain terms
    • Avoid generic phrases like "helps with" or "manages"
  5. Check allowed-tools - If restricted, verify needed tools included

    allowed-tools: [Read, Write, Edit, Bash, Glob, Grep]
    
  6. Review content - Ensure instructions are clear and actionable

Skills vs slash commands

Use skills for:

  • Complex workflows with multiple files
  • Automatic contextual invocation
  • Comprehensive capabilities

Use slash commands for:

  • Simple single prompts
  • Manual explicit control
  • Quick frequently-used operations

More Security skills

supabase logo
Security

supabase

Handles the full Supabase workflow from schema changes to deployment, with built-in security guardrails that catch common traps like RLS...

2.7K 308.9K
View

Comprehensive guides and best practices for Neon Serverless Postgres, covering setup, connection methods, authentication, and platform APIs.

98 216.2K
View

Guide for setting up and using Firebase Authentication. Use this skill when the user's app requires user sign-in, user management, or secure data access using auth rules.

462 163.8K
View

A skill to evaluate how secure Firestore security rules are. Use this when Firestore security rules are updated to ensure that the generated rules are extremely secure and robust.

462 127.7K
View

Official skill for integrating Firebase AI Logic (Gemini API) into web applications. Covers setup, multimodal inference, structured output, and security.

462 125.1K
View

Complete Better Auth server and client setup with database adapters, session management, plugins, and security configuration.

222 118.2K
View

Deploy and manage projects on Vercel using token-based authentication. Use when working with Vercel CLI using access tokens rather than interactive login — e.g. "deploy to vercel", "set up vercel", "add environment variables to vercel".

31.9K 116.1K
View
cloudflare logo
Security

cloudflare

Complete Cloudflare platform integration with decision trees for compute, storage, AI, networking, security, and infrastructure-as-code.

3K 110.7K
View

Run Azure compliance and security audits with azqr plus Key Vault expiration checks. Covers best-practice assessment, resource review, policy/compliance validation, and security posture checks. WHEN: compliance scan, security audit, BEFORE running azqr (compliance cli tool), Azure best practices, Key Vault expiration check, expired certificates, expiring secrets, orphaned resources, compliance assessment.

253 103K
View
gws-gmail logo
Security

gws-gmail

Send, read, and manage Gmail messages, drafts, labels, and account settings.

31.2K 78.9K
View

Comprehensive website auditing across 230+ rules in 21 categories including SEO, performance, security, and accessibility.

94 72.3K
View
gws-shared logo
Security

gws-shared

Shared authentication, CLI syntax, and output formatting patterns for gws Google Workspace commands.

31.2K 63.4K
View

Security AI tools

StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
GeoSpy logo
Security

GeoSpy

GeoSpy: Pricing, Features, FAQs, and Alternatives for AI Teams

Free
View

Detect AI-generated voices to protect against audio fraud.

Paid
View

Ensure Your Content's Originality with AI Plagiarism Checker

Freemium
View
Img Upscaler logo
Security

Img Upscaler

Upscale images by 400% without quality loss

Freemium
View
AICheatCheck logo
Security

AICheatCheck

Accurately Detect AI-Generated Content with TheChecker.AI

Free
View
D
Security

Detect GPT

Chrome extension that detects and flags AI-generated content

Free
View