Learn to build Claude Code Skills step by step. Create reusable AI instructions, templates, and automation to boost your development workflow and productivity.

TL;DR: Claude Code Skills are reusable, modular SKILL.md files that let developers package instructions, templates, and automation for Claude Code. Skills are automatically invoked based on task context -- no manual prompting required. They support personal, project-scoped, and plugin distribution models with built-in security via allowed-tools restrictions. This guide covers the full specification, four ready-to-use skill examples, and best practices for teams adopting Claude Code in 2026.
Want to make Claude Code work smarter for your specific codebase and team? Claude Code Skills are the answer. Instead of repeating the same instructions or relying on ad-hoc prompts, Skills let you create structured, reusable AI capabilities that Claude automatically selects based on what you are working on -- whether that is generating conventional commits, writing unit tests, or enforcing your team's coding standards.
This guide walks you through everything from creating your first SKILL.md file to building advanced Skills for test generation, documentation, code review, and CI/CD automation. Whether you are a solo developer looking to speed up your workflow or a team lead wanting to standardize practices across your organization, you will find practical examples and best practices you can start using today.
Claude Code Skills represent a paradigm shift in how developers interact with AI assistants, moving from ad-hoc instructions to structured, reusable capabilities. Skills enable developers to encapsulate complex workflows, coding conventions, and domain expertise into discoverable modules that Claude automatically invokes based on context.
These characteristics make Skills ideal for automating repetitive tasks, enforcing coding standards, integrating with external tools, and capturing team knowledge in executable form.
Every Skill consists of a directory containing a required SKILL.md file with YAML frontmatter and optional supporting resources:
The YAML frontmatter defines Skill metadata and behavior:
Required Fields:
Optional Fields:
After the frontmatter, provide clear instructions in Markdown format:
Location: ~/.claude/skills/
Personal Skills cater to individual developer workflows and productivity patterns.
Use Cases:
Example Directory Structure:
Location: .claude/skills/
Project Skills are version-controlled capabilities shared across development teams.
Use Cases:
Example Directory Structure:
Location: Bundled with Claude Code plugins
Plugin Skills provide advanced capabilities from the marketplace and community.
Use Cases:
Let's build a comprehensive Skill that generates conventional commit messages following team standards.
For team-wide usage:
For personal usage:
The Commit Helper Skill consists of a YAML frontmatter section followed by detailed instructions. Here's how to structure it:
YAML Frontmatter:
Skill Instructions:
The Skill begins with a clear purpose statement, followed by a structured workflow that Claude follows when generating commit messages.
Core Workflow:
Example Commit Messages:
The Skill includes several concrete examples to guide Claude's output:
Feature Addition Example:
Bug Fix Example:
Breaking Change Example:
Edge Cases Handled:
Quality Checks:
Before finalizing, Claude verifies:
Start Claude Code and trigger the Skill:
Then interact naturally:
Claude will automatically invoke the commit-helper Skill, analyze the changes, and generate an appropriate commit message.
A sophisticated Skill that generates comprehensive unit tests for code functions.
YAML Frontmatter:
Skill Purpose:
The Test Generator automatically creates comprehensive unit tests using Jest framework with coverage for happy paths, edge cases, and error conditions.
Core Workflow:
Test Structure Pattern:
The Skill instructs Claude to organize tests into nested describe blocks:
Example Test Scenario:
For a calculateDiscount function, the Skill would guide Claude to generate tests covering:
Quality Standards:
The Skill enforces these testing standards:
A Skill that creates comprehensive JSDoc/TSDoc documentation for code elements.
YAML Frontmatter:
Skill Purpose:
Generate detailed, standards-compliant documentation for code elements following JSDoc/TSDoc conventions.
Core Workflow:
Function Documentation Pattern:
Class Documentation Pattern:
Method Documentation Pattern:
Example Transformation:
Before Documentation:
After Documentation:
Documentation Standards:
The Skill enforces these documentation standards:
A comprehensive Skill for conducting thorough code reviews with detailed feedback categorization.
YAML Frontmatter:
Skill Purpose:
Conduct thorough code reviews focusing on correctness, security, performance, and maintainability.
Review Checklist:
The Skill guides Claude through a systematic evaluation across five dimensions:
Review Process:
The Skill outlines a five-step process:
Review Output Format:
The Skill instructs Claude to structure review results in markdown format with sections for each severity level. Each issue includes:
Example Issues by Severity:
CRITICAL Issues might include:
MAJOR Issues might include:
MINOR Issues might include:
SUGGESTION Level might include:
Edge Cases:
The Skill handles special scenarios:
Bad Example:
Good Example:
The good description provides:
Each Skill should address a single, well-defined responsibility:
Good Architecture:
Poor Architecture:
Always provide examples demonstrating expected inputs and outputs. For instance, an API response formatter Skill should show:
Standard Format:
Success Response Example:
Error Response Example:
Limit tool access to improve security and prevent unintended operations:
This Skill can read and search code but cannot modify files or execute commands.
Document version history to track changes and improvements:
Before deploying Skills, test with diverse scenarios:
For complex Skills, organize resources systematically:
API Scaffolder Example:
Create Test Scenarios:
In Claude Code:
Verify Skill Invocation:
Claude should mention using the Skill or demonstrate behavior consistent with Skill instructions.
Test Edge Cases:
Possible Causes:
Solutions:
Debugging Steps:
Solution: Add allowed-tools restrictions:
Personal Skills in ~/.claude/skills/ require manual distribution:
Export the Skill:
Document Requirements in README.md:
Include installation instructions, dependencies, configuration requirements, and usage examples. For instance:
Project Skills are automatically shared via version control:
Create the Skill:
Commit to Repository:
Document in Project README:
Include a section describing available Claude Code Skills with usage instructions and conventions enforced by each Skill.
For distributing multiple related Skills:
install.sh:
Example repository structure for community Skills:
A Skill for managing continuous integration and deployment workflows:
Skill Purpose:
Generate and manage GitHub Actions workflows, GitLab CI, or Jenkins pipelines following best practices.
Supported Platforms:
Core Workflow:
Example GitHub Actions Workflow:
The Skill guides Claude to create workflows with:
Best Practices Enforced:
Claude Code Skills represent a powerful paradigm for extending AI-assisted development with domain-specific knowledge, team conventions, and reusable automation. By packaging instructions, templates, and scripts into modular Skills, development teams can standardize workflows, capture institutional knowledge, and dramatically enhance productivity.
The comprehensive examples and implementation patterns provided in this guide demonstrate how to build sophisticated Skills for diverse use cases—from commit message generation to comprehensive code reviews. As AI-assisted development becomes increasingly central to software engineering workflows, Skills will play a crucial role in customizing these tools to match team practices and domain requirements.
The future of developer productivity lies in the seamless integration of AI capabilities with human expertise and organizational knowledge. Claude Code Skills provide the framework for this integration, enabling developers to focus on creative problem-solving while AI handles routine tasks according to established conventions and standards.
Claude Code Skills are reusable, modular SKILL.md files that let developers package instructions, templates, and automation for Claude Code. Each Skill consists of a directory containing a required SKILL.md file with YAML frontmatter (defining name, description, and optional tool restrictions) and optional supporting resources like templates, scripts, and reference data. Skills are automatically invoked by Claude based on task context -- no manual prompting required. They enable developers to encapsulate complex workflows, coding conventions, and domain expertise into discoverable modules that Claude selects and applies when relevant to the current task.
To create a custom Claude Code Skill: (1) Choose a deployment location -- use .claude/skills/ for project-scoped team Skills or ~/.claude/skills/ for personal Skills. (2) Create a directory for your Skill (e.g., mkdir -p .claude/skills/my-skill). (3) Create a SKILL.md file with YAML frontmatter containing name (lowercase with hyphens, max 64 characters), description (max 1024 characters explaining what the Skill does and when to use it), and optional allowed-tools (glob patterns restricting tool access). (4) Write clear Markdown instructions below the frontmatter covering purpose, step-by-step instructions, concrete examples, and edge cases. (5) Optionally add supporting directories for templates, scripts, and reference data. (6) Test by launching Claude Code and using natural language that matches the Skill description.
Claude Code Skills and Cursor Rules both provide custom instructions for AI coding assistants, but they differ in architecture and capability. Claude Code Skills use a modular, model-invoked architecture where Claude automatically selects the appropriate Skill based on task context -- each Skill is a self-contained directory with its own SKILL.md definition, templates, scripts, and data files. Skills support tool restrictions via allowed-tools for security and can be distributed as personal, project-scoped, or plugin packages. Cursor Rules are typically a single .cursorrules file at the project root containing global instructions that apply to all interactions. Skills offer more granular control, modularity (one Skill per capability), and automatic context-based invocation rather than always-on global rules.
Claude Code Skills are stored in three possible locations depending on their scope: (1) Personal Skills are stored in ~/.claude/skills/ and are available only to the individual developer across all projects. (2) Project Skills are stored in .claude/skills/ within the project repository root and are shared with the entire team via version control (git). (3) Plugin Skills are bundled with Claude Code plugins from the marketplace or community packages. Each Skill directory contains a required SKILL.md file and optional subdirectories for templates, scripts, and data. Project Skills are the recommended approach for team-wide standardization since they are automatically version-controlled and shared when team members pull the repository.
Aaron is a senior software engineer and AI researcher specializing in generative AI, multimodal systems, and cloud-native AI infrastructure. He writes about cutting-edge AI developments, practical tutorials, and deep technical analysis at fp8.co.
Build AI agents with Amazon Bedrock AgentCore. Step-by-step Python examples for memory, code execution, browser automation, and tool integration.
AI Agents, Amazon Bedrock, Conversational AIHow to use Amazon Nova for video analysis, object detection with bounding boxes, and content annotation. Includes TypeScript examples for S3 and local video processing with the AWS Bedrock SDK.
Multimodal AI, Video Processing, Amazon NovaMaster the art of context engineering for AI agents. Learn 6 battle-tested techniques from production systems: KV cache optimization, tool masking, filesystem-as-context, attention manipulation, error preservation, and few-shot pitfalls.
AI Engineering, Agent Frameworks