Building Blocks — Skills
BB — 02

Skills

Skills are on-demand workflow instructions for Claude — codified best practices that load only when needed, keeping your context clean while enforcing consistent behaviour across every session.

Read time9 min
LevelBeginner
SectionBuilding Blocks
01 — what it is

An On-Demand Onboarding Guide for Claude

A skill is a directory containing a SKILL.md file with YAML frontmatter and Markdown content. The description field determines when Claude invokes it — automatically or on explicit request.

Think of a skill as the difference between telling a new hire "review this PR" every single time versus writing a code review checklist that any team member (human or AI) can follow consistently. Skills codify repeating patterns — API conventions, test structure, review checklists — once, so Claude applies them the same way every time.

Skills are portable across Claude.ai and Claude Code. They load on demand, not every session, which is what makes them token-efficient: Claude only pays attention to a skill when the current task matches its trigger phrases.

yaml
my-skill/
├── SKILL.md          # Main instructions (required)
├── template.md       # Template for Claude to fill in
├── examples/
│   └── sample.md     # Example output showing expected format
└── scripts/
    └── validate.sh   # Script Claude can execute
02 — progressive disclosure

Three-Stage Loading: Pay Only for What You Use

Skills load in three stages, each with a different token cost. This progressive disclosure model means a project with 20 skills does not flood the context window every session.

text
Stage 1 — Frontmatter   ~100 tokens per skill
          Name and description only. Always loaded.

Stage 2 — SKILL.md body  Tokens proportional to file size
          Full instructions. Loaded when Claude matches the trigger.

Stage 3 — Linked files   Loaded only when a specific step needs them
          Templates, example outputs, validation scripts.

The SKILL.md description field is the gatekeeper. It must be written in third person, stay under 1024 characters, and include 3–5 clear trigger phrases so Claude knows exactly when to activate the skill. A vague description means the skill either never fires or fires for the wrong task.

Keep SKILL.md under 500 lines. A skill that is too long becomes expensive to load and harder for Claude to follow faithfully.

03 — three example skills

Skills in Action: Code Review, DB Migration, Bug Fix

Three practical skills used in our TiffinConnect development workflow. Each targets a repeating task type that would otherwise produce inconsistent results without a codified process.

yaml
--- # code-review skill (frontmatter)
name: code-review
description: Use when asked to review a PR, diff, or changed files
  for bugs, security issues, and code quality
model: claude-sonnet-4-6
context:
  - file: .eslintrc.json
  - file: CLAUDE.md
allowed-tools: [Read, Grep, Glob, Bash]
---

## Steps
1. Read every changed file top to bottom
2. Check for: security issues, logic bugs, missing error handling
3. Run `git diff main` to see the full diff
4. Report findings grouped by severity: Critical → Warning → Suggestion

## Rules
- Never approve code with SQL injection or XSS risks
- Flag hardcoded secrets immediately
- If nothing is wrong, say so clearly

The db-migration skill enforces: always write a rollback (down) for every migration, never modify a committed migration file, confirm before any DROP or TRUNCATE. The fix-bug skill enforces: reproduce first, hypothesize before touching code, one bug per commit, no swallowed errors.

04 — two-session workflow

How to Write and Test Skills Reliably

Claude Code ships with a built-in Skill Creator. Anthropic's recommended workflow separates creation from testing across two sessions to catch gaps before relying on the skill in production.

text
Session A (Skill Creator)        Session B (Skill Tester)
─────────────────────────        ────────────────────────
1. Open Claude Code              2. Open a second Claude session
3. Use Skill Creator to draft    4. Write a prompt that should
   the first iteration              trigger the skill
                                 5. Observe: does it fire?
                                    Does it follow the steps?
                                 6. Note the gaps
7. Return to A, share gaps
8. Iterate until satisfactory    ← Repeat until confident
✓
Check before writing
Search skillsmp.com and the anthropics/skills GitHub repo before writing a new skill. Hundreds already exist — saving hours of authoring time.
✗
Don't load all skills every session
Use progressive disclosure. Skills you are not actively working with should stay at Stage 1 (frontmatter only) until triggered.
✓
Write descriptions in third person
"Use when the user asks to review a PR" — not "I will review PRs." Claude needs third-person trigger descriptions to match them correctly.
✗
Don't exceed 1024 characters on description
The description field has a hard cap. Exceeding it silently truncates the trigger phrases, causing the skill to fire inconsistently.
05 — references

Further Reading

ResourceURL
Skill Marketplaceskillsmp.com
Anthropic Official Skills Repositorygithub.com/anthropics/skills
Extend Claude with Skills — Claude Code Docsdocs.anthropic.com/claude-code
Plugins for Claude Code — Anthropicdocs.anthropic.com
Check your understanding
1. In the three-stage progressive disclosure model for skills, what loads at Stage 1?
Correct.Not quite — the correct answer is highlighted above.
2. What is the recommended two-session workflow for building reliable skills?
Correct.Not quite — the correct answer is highlighted above.
3. The description field in SKILL.md frontmatter must be written in which person, and what is its character limit?
Correct.Not quite — the correct answer is highlighted above.