GenAIHub
← Back to Technical Section

Skills in Claude Code

Custom slash commands and reusable Claude playbooks

⚑ Skills

Create custom /slash commands backed by markdown playbooks β€” reusable instructions that encode your team's best practices.

Official Docs β†’

1. What Are Skills?

Skills (also called custom slash commands) are markdown files stored in .claude/commands/ that become available as /command-name inside Claude Code. Each file contains instructions that Claude executes when the command is invoked.

πŸ“ Skills = Markdown file β†’ /slash-command β†’ Reusable workflow

2. Creating a Skill

Create a .md file in .claude/commands/:

# .claude/commands/pr-review.md

Review the current git diff and provide structured feedback:

1. **Security** β€” check for secrets, injection vulnerabilities, OWASP top 10
2. **Performance** β€” flag N+1 queries, missing indexes, unbounded loops
3. **Code quality** β€” readability, naming, dead code, missing tests
4. **Breaking changes** β€” API changes, DB migrations, removed exports

Format the output as a markdown checklist grouped by severity (πŸ”΄ critical, 🟑 warning, 🟒 suggestion).

This file creates a /pr-review command available in all Claude Code sessions within this project.

3. Skill Namespaces & Scopes

πŸ“ Project Skills

Stored in .claude/commands/

Committed to git β€” shared with the whole team. Invoked as /skill-name

🌍 Global Skills

Stored in ~/.claude/commands/

Personal tools available across all your projects

πŸ”Œ Plugin Skills

Provided by MCP servers

Invoked as /plugin:skill-name

4. Dynamic Arguments

Skills can accept arguments passed at invocation time:

# .claude/commands/explain.md
# Usage: /explain <topic>

Explain the following topic in simple terms suitable for a junior developer: $ARGUMENTS

Include:
- A one-sentence definition
- A concrete code example
- One common pitfall to avoid

Invoke with: /explain dependency injection β€” $ARGUMENTS is replaced with the rest of the input.

5. Best Practices

  • β†’ Encode team standards β€” use skills to distribute code review checklists, commit message formats, and deployment runbooks.
  • β†’ Keep skills focused β€” one skill, one purpose. Combine them at invocation time rather than building monolithic playbooks.
  • β†’ Version control skills β€” commit .claude/commands/ to git so the whole team shares the same workflows.
  • β†’ Use CLAUDE.md for always-on context β€” skills are invoked on demand; persistent instructions belong in CLAUDE.md.