Command Development

Create Claude Code slash commands with frontmatter, arguments, and bash execution.

1|Updated Mar 5, 2026
One-click install
npx skills add https://github.com/Clay-HHK/claude-skills --skill command-development-clay-hhk
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: Command Development
Source: https://github.com/Clay-HHK/claude-skills/tree/main/command-development
Command: npx skills add https://github.com/Clay-HHK/claude-skills --skill command-development-clay-hhk

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Writing custom slash commands for Claude Code requires knowing the Markdown file format, YAML frontmatter fields, dynamic argument syntax, and plugin integration patterns, which are easy to get wrong without structured guidance. ## Core Features & Use Cases - Command Format Guidance: Covers Markdown command structure, YAML frontmatter fields (description, allowed-tools, model, argument-hint, disable-model-invocation), and validation rules. - Dynamic Features: Explains $ARGUMENTS and positional arguments, @ file references, and inline bash execution for context-aware commands. - Plugin Integration: Documents ${CLAUDE_PLUGIN_ROOT} usage, plugin command organization, and coordination with agents, skills, and hooks. - Use Case: When you want to add a /review-pr command that takes a PR number, runs git commands, and reviews changed files, this Skill provides the exact frontmatter and prompt structure to implement it correctly. ## Quick Start Ask Claude to create a slash command that reviews a pull request by number using git tools and an argument hint.

Frequently Asked Questions about Command Development

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a custom slash command in Claude Code?▼

Create a Markdown file in .claude/commands/ for project commands or ~/.claude/commands/ for personal commands. Add optional YAML frontmatter with a description field, then write the prompt content as instructions for Claude to execute.

How do I add arguments to a Claude Code slash command?▼

Use $ARGUMENTS to capture all arguments as one string, or positional variables like $1, $2, $3 for individual arguments. Document them with the argument-hint frontmatter field so users see expected inputs in autocomplete.

What frontmatter fields are available for slash commands?▼

Available fields include description, allowed-tools, model (sonnet, opus, haiku), argument-hint, and disable-model-invocation. All fields are optional, and commands work without any frontmatter at all.

Can slash commands run bash commands in Claude Code?▼

Yes, commands can execute bash inline to gather context like git status before Claude processes the prompt. You must include Bash in the allowed-tools frontmatter field, ideally scoped with filters like Bash(git:*).

Why is my slash command not appearing in Claude Code?▼

Check that the file is in the correct commands directory, has a .md extension, and contains valid Markdown. Restart Claude Code after adding the file, and verify the YAML frontmatter syntax has no errors.

How do plugin commands reference plugin files portably?▼

Use the ${CLAUDE_PLUGIN_ROOT} environment variable, which resolves to the plugin's absolute path at runtime. This lets commands execute plugin scripts, load configuration, and reference templates without hardcoded paths.