Skill Development

command-development

A Claude Code skill that guides you through creating slash commands. It covers file format, YAML frontmatter, dynamic arguments, file references, bash execution, organization, and plugin-specific patterns.

Last verified: write-up checked

command-development preview image

What it is

Command Development is a skill that gives Claude detailed guidance on building Claude Code slash commands. A slash command is a Markdown file containing a prompt that Claude executes when someone invokes it. Commands are meant to provide reusability, consistency, sharing across a team or projects, and quick access to complex prompts. The skill stresses one rule above the rest: commands are instructions FOR Claude, not messages to the user. Command content should be written as directives telling Claude what to do. The skill then covers: - Command locations: project (.claude/commands/, shown as "(project)" in /help), personal (~/.claude/commands/, shown as "(user)"), and plugin (plugin-name/commands/). - Frontmatter fields: description, allowed-tools, model, argument-hint and disable-model-invocation. - Dynamic arguments: $ARGUMENTS for all arguments as one string, and positional $1, $2, $3. - File references: the @ syntax. - Inline bash execution: the ! backtick syntax. - Organization: flat or namespaced directory structures. For plugin authors, the skill explains the ${CLAUDE_PLUGIN_ROOT} environment variable, which resolves to the plugin's absolute path. It shows how to use it to run plugin scripts, load configuration and use templates portably. It also covers configuration-based, template-based and multi-script command patterns. Further sections address integration with plugin agents, skills and hooks, plus validation patterns for arguments, file existence, plugin resources and error handling. The skill uses progressive disclosure. The core SKILL.md (about 2,470 words) covers fundamentals. Reference files hold detailed specifications, such as frontmatter-reference.md and plugin-features-reference.md. Example files hold complete working commands: simple-commands.md and plugin-commands.md. Claude loads these as needed. The SKILL.md also notes that .claude/commands/ is a legacy format and recommends the .claude/skills/<name>/SKILL.md directory format for new skills, adding that both are loaded identically.

Who it's for

  • Claude Code users who want to create custom slash commands
  • Teams sharing project-specific workflows via .claude/commands/
  • Plugin developers bundling commands with their plugins
  • Developers wanting guidance on command frontmatter, arguments, and best practices

Requirements

Requirements

  • Claude Code
  • For plugin-specific features: a plugin with a commands/ directory (agents in plugin/agents/ and skills in plugin/skills/ for integration patterns)

هاي مهارة لـ Claude Code بتعلّمك كيف تعمل أوامر slash من الأول للآخر. بتشرح شكل الملف، والـ frontmatter، والمتغيرات، وربط الملفات، وتنفيذ أوامر bash، وكمان أنماط خاصة بالـ plugins.

Examples

Command using $ARGUMENTS

markdown
markdown
---
description: Fix issue by number
argument-hint: [issue-number]
---

Fix issue #$ARGUMENTS following our coding standards and best practices.

What it does: Captures all arguments as a single string. Invoking /fix-issue 123 expands to 'Fix issue #123 following our coding standards...'.

Invoking a command with positional arguments

Prompt
prompt
> /review-pr 123 high alice

Expected output: With a command body using $1, $2 and $3, this expands to 'Review pull request #123 with priority level high. After review, assign to alice for follow-up.'

Command with bash execution

markdown
markdown
---
description: Show Git status
allowed-tools: Bash(git:*)
---

Current status: !`git status`
Recent commits: !`git log --oneline -5`

What it does: Runs git commands inline and includes their output as context. The allowed-tools field restricts Bash to git commands only.

Plugin command using CLAUDE_PLUGIN_ROOT

markdown
markdown
---
description: Analyze using plugin script
allowed-tools: Bash(node:*)
---

Run analysis: !`node ${CLAUDE_PLUGIN_ROOT}/scripts/analyze.js $1`

Review results and report findings.

What it does: Runs a script bundled with the plugin through a portable path. This works across installations without hardcoded paths.