Skip to content
Back to skills

Skill Authoring

ASecurity

Best practices for building Claude Code / Claude.ai Skills, distilled from Anthropic's official "Complete Guide to Building Skills". Use when creating a new skill, writing or fixing a SKILL.md, choosing a folder name or description, debugging why a skill over- or under-triggers, or reviewing a skill before shipping. Triggers: "build a skill", "write a SKILL.md", "skill best practices", "skill frontmatter", "why is my skill not triggering", "/skill-authoring". Do NOT use this skill for: invok...

  • 13 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added November 16, 2026
ai-agentspythongotestingdebugginggitapiperformance

Works with

  • claude code
  • api

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned November 16, 2026

npx -y skills add ao92265/claude-code-playbook --skill skill-authoring --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Skill Authoring?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Skill Authoring
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ao92265-skill-authoring/badge)](https://www.skillsdirectory.com/skills/ao92265-skill-authoring)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: skill-authoring
description: >
  Best practices for building Claude Code / Claude.ai Skills, distilled from
  Anthropic's official "Complete Guide to Building Skills". Use when creating a
  new skill, writing or fixing a SKILL.md, choosing a folder name or description,
  debugging why a skill over- or under-triggers, or reviewing a skill before
  shipping. Triggers: "build a skill", "write a SKILL.md", "skill best practices",
  "skill frontmatter", "why is my skill not triggering", "/skill-authoring".

  Do NOT use this skill for: invoking an existing skill to do its job, managing the
  skill registry (use the skill manager), or non-skill markdown/docs work.
metadata:
  user-invocable: true
  slash-command: /skill-authoring
  proactive: false
---

# Skill Authoring

How to write a skill that loads at the right time and does the right thing. Source: Anthropic's *Complete Guide to Building Skills for Claude*.

## The mental model: progressive disclosure (3 levels)

1. **Frontmatter (YAML)** — always in the system prompt. Just enough for Claude to decide *when* to load the skill. This is the highest-leverage thing you write.
2. **SKILL.md body** — loaded only when Claude judges the skill relevant. The full instructions.
3. **Linked files** (`references/`, `scripts/`, `assets/`) — loaded on demand. Push detail here to keep the body lean.

Goal: minimal tokens resident, full expertise available when needed.

## Folder structure

```
your-skill-name/        # kebab-case, matches `name`
├── SKILL.md            # required, exact case
├── scripts/            # optional — executable code
├── references/         # optional — docs loaded as needed
└── assets/             # optional — templates, fonts, icons
```

- **`SKILL.md`** — exactly that, case-sensitive. No `skill.md`, `SKILL.MD`.
- **No `README.md` inside the skill folder.** Docs go in SKILL.md or `references/`. (A repo-level README for humans is fine when distributing on GitHub — that lives outside the skill folder.)

## The `description` field (get this right first)

Formula: **[What it does] + [When to use it / trigger phrases] + [Key capabilities]**.

Rules:
- Must state both *what* and *when* (the phrases a user actually says).
- < 1024 characters.
- **No `< >` angle brackets** anywhere in frontmatter — they can inject as tags into the system prompt. Write "followed by a URL", not `<url>`. Write "over 1k RPS", not `>1k`.
- `name`: kebab-case, no spaces/underscores/capitals, matches the folder. Never contains "claude" or "anthropic" (reserved).
- Add explicit trigger phrases and, for broad auto-triggering skills, a negative trigger ("Do NOT use this for…").

Good vs bad:
- ✅ `Analyzes Figma files and generates dev handoff docs. Use when user uploads .fig files, asks for "design specs", or "design-to-code handoff".`
- ❌ `Helps with projects.` (vague, no triggers)
- ❌ `Implements the Project entity model with hierarchical relationships.` (technical, no user triggers)

## Writing the body

- **Specific and actionable.** `Run python scripts/validate.py --input {file}` — not "validate the data".
- **Always include error handling / troubleshooting** (a `## Common Issues` section with concrete fixes).
- **Reference bundled files explicitly:** "Before X, consult `references/api-patterns.md`."
- Keep the body focused; move depth to `references/`.

## Testing (3 areas)

1. **Triggering** — loads on obvious + paraphrased requests; does NOT load on unrelated topics. Write an explicit should-trigger / should-NOT-trigger list.
2. **Functional** — produces correct outputs; scripts succeed; edge cases covered.
3. **Performance** — compare with vs without the skill (tokens consumed, tool/API calls, back-and-forth turns).

**Controlled comparison (the terum-skills method).** When a new skill replaces an old one, or you want to know if a skill earns its place: run the same task three ways (no skill, old skill, new skill), at least 3 fresh `claude -p` runs each, because one run is noise. Let deterministic checks decide first (tests pass, file exists, output matches). Use an LLM judge only to break a tie, comparing outputs in pairs with the labels hidden. Verdict: PASS if the new skill beats the old one on the checks, NEUTRAL if it ties, FAIL if it loses. Record the cost and time next to the verdict.

Pro tip: iterate on one hard task until it works, *then* extract the skill. Faster signal than broad testing.

## Trigger tuning

- **Under-triggering** (skill doesn't load when it should; users enable it manually) → add detail and keywords to the description, especially technical terms.
- **Over-triggering** (loads for irrelevant queries; users disable it) → add negative triggers, narrow the description.

## Pre-ship checklist + field reference

See `references/checklist.md` for the full field-requirements table and a copy-paste pre-ship checklist.

## Distribution (brief)

Zip the folder → Claude.ai Settings > Capabilities > Skills, or drop in the Claude Code skills directory. For GitHub: public repo, human README at repo root (not in the skill folder), example screenshots. API path needs `container.skills` + the Code Execution Tool beta. Use the `compatibility` frontmatter field for platform-specific requirements.

Files in this skill

  • SKILL.md5.2 KB
  • references/checklist.md2.2 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.