← BLOG
Tutorial

Create Custom Skills and Commands for Claude Code

Skills turn repetitive prompts into reusable commands. Write a SKILL.md once, invoke it with /skill-name, and Claude Code executes the full workflow every time.

Skills are markdown files that define reusable workflows for Claude Code. Instead of typing the same complex prompt every time you want to deploy, run a code review, or generate documentation, you write a SKILL.md once and invoke it with a slash command.

What is a Claude Code Skill?

A Skill is a markdown file (SKILL.md) that contains instructions Claude Code follows when you invoke it. It can include a description, tool restrictions, context settings, and step-by-step instructions. Think of it as a saved prompt with superpowers.

How do you create a Skill?

Create a SKILL.md file in your project's .claude/skills/ directory (shared with team) or in ~/.claude/skills/ (personal):

markdown
# .claude/skills/deploy.md
---
name: deploy
description: Deploy the current branch to staging
allowed-tools: Bash, Read
---

## Steps
1. Run the test suite: `npm run test`
2. If tests pass, build the project: `npm run build`
3. Deploy to staging: `npm run deploy:staging`
4. Verify the deployment by checking the health endpoint
5. Post a summary of what was deployed

Now you can invoke it:

bash
# In Claude Code
> /deploy

What frontmatter options are available?

OptionWhat it doesExample
nameSlash command namedeploy
descriptionShows in skill listDeploy to staging
allowed-toolsRestrict which tools the skill can useBash, Read, Edit
disable-model-invocationPrevent nested AI callstrue
contextSession handlingfork (runs in isolated context)

What are good use cases for Skills?

  • +Deployment workflows (test → build → deploy → verify)
  • +Code review checklists (security, performance, style)
  • +Documentation generation (API docs, changelogs, READMEs)
  • +Database operations (migration, seeding, backup)
  • +Onboarding new team members (project tour, setup verification)
  • +Release management (version bump, changelog, tag, publish)

How do you use variables in Skills?

Skills support arguments through $ARGUMENTS (full text) and positional variables ($0, $1, etc.):

markdown
# .claude/skills/create-component.md
---
name: create-component
description: Create a new React component
---

Create a new React component named $0 in the components directory.

Requirements:
- TypeScript with proper props interface
- Tailwind CSS for styling
- Export as default
- Include basic unit test in __tests__/

Usage: /create-component UserProfile

Invoking with arguments

bash
# Single argument
> /create-component UserProfile

# Multiple arguments
> /create-component UserProfile --with-tests --with-story

How do you share Skills with your team?

Put Skills in your project's .claude/skills/ directory and commit them to git. Every developer who clones the repo gets the same skills. Personal skills go in ~/.claude/skills/ and don't get shared.

INFO

Skills compose well with Hooks. For example, a "deploy" skill can trigger a PostToolUse hook that sends a Slack notification after deployment. Build your automation in layers.

Frequently asked questions

How many Skills can I have?+
There is no hard limit. Claude Code discovers all SKILL.md files in .claude/skills/ and ~/.claude/skills/ at session start. Keep the number manageable (under 20) so the skill list stays useful.
Can Skills call other Skills?+
Not directly. A Skill is a set of instructions for a single invocation. However, you can create a "meta" skill that includes instructions to run multiple slash commands in sequence.
What's the difference between Skills and CLAUDE.md?+
CLAUDE.md provides passive context that applies to every session. Skills are active commands you invoke for specific tasks. CLAUDE.md says "here's how this project works." Skills say "here's how to do this specific thing."
Can I restrict what a Skill can do?+
Yes. Use the allowed-tools frontmatter option to limit which tools the skill can access. For example, a documentation skill might only need Read and Write, while a deploy skill needs Bash access.
ALL POSTSSTART FREE COURSE →