AI-101

Lesson 22

Creating Custom Skills

AI Confidence: 90%

AI-generated

Creating Custom Skills

Learning Objectives

Create a SKILL.md file with proper frontmatter

Use argument substitution with $ARGUMENTS

Control who can invoke the skill (user, Claude, or both)

Share skills with your team or across projects

Add supporting files for complex skills

Introduction

Bundled skills are useful, but the real power comes from creating your own. A custom skill can encode your team's workflows, automate repetitive tasks, or add domain-specific knowledge.

Skills are just markdown files with instructions. Claude reads them and follows what they say. If you can write instructions for a person, you can write a skill.

This lesson teaches you how to create, configure, and share custom skills.

Skill File Structure

Every skill is a directory with a SKILL.md file:

[@portabletext/react] Unknown block type "codeBlock", specify a component for it in the `components.types` prop

The directory name becomes the skill name. The SKILL.md file contains the instructions.

SKILL.md has two parts:

Frontmatter (optional) - YAML configuration between --- markers

Content - Markdown instructions Claude follows

Example:

[@portabletext/react] Unknown block type "codeBlock", specify a component for it in the `components.types` prop
Frontmatter Options

Frontmatter configures how the skill behaves:

name - Display name (defaults to directory name):

[@portabletext/react] Unknown block type "codeBlock", specify a component for it in the `components.types` prop

description - When to use this skill:

[@portabletext/react] Unknown block type "codeBlock", specify a component for it in the `components.types` prop

Claude uses the description to decide when to apply the skill automatically.

disable-model-invocation - Prevent Claude from invoking automatically:

[@portabletext/react] Unknown block type "codeBlock", specify a component for it in the `components.types` prop

Use for skills with side effects that you want to trigger manually.

allowed-tools - Tools Claude can use without asking:

[@portabletext/react] Unknown block type "codeBlock", specify a component for it in the `components.types` prop

context - Run in a subagent:

[@portabletext/react] Unknown block type "codeBlock", specify a component for it in the `components.types` prop

The skill runs in a separate context, keeping your main session clean.

Argument Substitution

Skills can accept arguments. Use $ARGUMENTS as a placeholder:

[@portabletext/react] Unknown block type "codeBlock", specify a component for it in the `components.types` prop

When you run /fix-issue 123, Claude sees "Fix GitHub issue 123".

Positional arguments:

[@portabletext/react] Unknown block type "codeBlock", specify a component for it in the `components.types` prop

Or shorter:

[@portabletext/react] Unknown block type "codeBlock", specify a component for it in the `components.types` prop

Running /migrate Button React Vue substitutes Button, React, Vue.

If $ARGUMENTS is missing:

If your skill does not include $ARGUMENTS but the user provides arguments, Claude Code appends ARGUMENTS: <value> to the end.

Where to Put Skills

Skill location determines who can use it:

Personal skills (~/.claude/skills/):

Available in all your projects. Good for personal workflows.

Project skills (./.claude/skills/):

Available in this project only. Check into Git to share with your team.

Plugin skills (<plugin>/skills/):

Distributed with plugins. Available where the plugin is enabled.

Priority: Enterprise > Personal > Project. If multiple skills have the same name, higher priority wins.

Example: Deploy Skill

A skill for deploying your application:

[@portabletext/react] Unknown block type "codeBlock", specify a component for it in the `components.types` prop

Invoke with:

[@portabletext/react] Unknown block type "codeBlock", specify a component for it in the `components.types` prop

The disable-model-invocation: true ensures Claude only deploys when you explicitly ask.

Example: Code Review Skill

A skill that adds your team's review checklist:

[@portabletext/react] Unknown block type "codeBlock", specify a component for it in the `components.types` prop

Claude applies your checklist when you run /review-pr.

Adding Supporting Files

Skills can include additional files:

[@portabletext/react] Unknown block type "codeBlock", specify a component for it in the `components.types` prop

Reference them from SKILL.md:

[@portabletext/react] Unknown block type "codeBlock", specify a component for it in the `components.types` prop

Claude loads these files when needed.

Dynamic Context Injection

Skills can run shell commands and inject the output:

[@portabletext/react] Unknown block type "codeBlock", specify a component for it in the `components.types` prop

The ` !command ` syntax runs before Claude sees the skill. The output replaces the placeholder.

Key Takeaways

Skills are directories with SKILL.md files

Frontmatter configures name, description, and behavior

Use $ARGUMENTS for user input substitution

Store in ~/.claude/skills/ for personal or ./.claude/skills/ for project

Set disable-model-invocation: true for skills with side effects

Add supporting files for templates and examples

Use !command for dynamic context injection

Try It Yourself

Create your first custom skill:

Create the directory: mkdir -p ~/.claude/skills/hello

Create SKILL.md with this content:

[@portabletext/react] Unknown block type "codeBlock", specify a component for it in the `components.types` prop

Start Claude Code and run /skills to verify it appears.

Run /hello and see the greeting.

Run /hello world and see how $ARGUMENTS works.

Delete the skill directory when done experimenting.

This exercise shows how simple it is to create skills.

Sources

https://code.claude.com/docs/en/skills - Complete skill documentation

https://code.claude.com/docs/en/memory - How skills relate to CLAUDE.md

https://code.claude.com/docs/en/commands - Skill invocation