plugins/plugin-creator/skills/command-development/SKILL.md
Create and configure slash commands for Claude Code — the legacy .claude/commands/ format. Use when asked to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or for guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices. Commands are the legacy format superseded by skills — for new development prefer /plugin-creator:skill-creator
npx skillsauth add jamie-bitflight/claude_skills command-developmentInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Legacy Format Notice. The
.claude/commands/directory is a legacy format. For new development, use.claude/skills/<name>/SKILL.mdinstead. Both formats are loaded identically — the only difference is file layout. Use/plugin-creator:skill-creatorfor the preferred skills format.Commands remain fully supported for backward compatibility and are still appropriate when maintaining existing command sets or contributing to projects that use the commands/ convention.
Slash commands are Markdown files containing prompts that Claude executes when
invoked via /command-name. They provide reusable, consistent, shareable
workflows with quick access to complex prompts.
Commands are instructions FOR Claude, not messages TO users. When a user
invokes /command-name, the command content becomes Claude's instructions.
Write commands as directives to Claude about what to do.
<!-- Correct: instructions for Claude -->
Review this code for security vulnerabilities including:
- SQL injection
- XSS attacks
- Authentication issues
Provide specific line numbers and severity ratings.
<!-- Wrong: message to user — Claude receives this but has no directive -->
This command will review your code for security issues.
You'll receive a report with vulnerability details.
flowchart TD
Q{"Where should the<br>command live?"}
Q -->|"Shared with team"| Proj[".claude/commands/<br>Scope — this project only<br>Label — '(project)' in /help"]
Q -->|"Personal use<br>across all projects"| User["~/.claude/commands/<br>Scope — all projects<br>Label — '(user)' in /help"]
Q -->|"Bundled with a plugin"| Plugin["plugin-name/commands/<br>Scope — when plugin installed<br>Label — '(plugin-name)' in /help"]
Commands are .md files. No frontmatter is required for basic commands.
.claude/commands/
├── review.md # /review
├── test.md # /test
└── deploy.md # /deploy
Add YAML frontmatter for configuration:
---
description: Review code for security issues
allowed-tools: Read, Grep, Bash(git:*)
model: sonnet
---
Review this code for security vulnerabilities...
All fields are optional. Commands work without any frontmatter.
flowchart TD
Start(["Writing command frontmatter"]) --> D{"Need a description<br>in /help?"}
D -->|Yes| Desc["description — string, under 60 chars<br>Start with verb — Review, Deploy, Generate"]
D -->|No| AT{"Need to restrict<br>tool access?"}
Desc --> AT
AT -->|Yes| Tools["allowed-tools — comma-separated or array<br>Bash(git:*) for filtered bash access"]
AT -->|No| M{"Need a specific<br>model?"}
Tools --> M
M -->|Yes| Model["model — haiku, sonnet, or opus"]
M -->|No| AH{"Command takes<br>arguments?"}
Model --> AH
AH -->|Yes| Hint["argument-hint — e.g. [pr-number] [priority]"]
AH -->|No| DMI{"Should only user<br>invoke manually?"}
Hint --> DMI
DMI -->|Yes| Disable["disable-model-invocation — true"]
DMI -->|No| Done(["Frontmatter complete"])
Disable --> Done
For the complete field specification with examples, validation rules, and edge cases, see ./references/frontmatter-fields.md.
Capture individual arguments with $1, $2, $3:
---
description: Review PR with priority and assignee
argument-hint: [pr-number] [priority] [assignee]
---
Review pull request #$1 with priority level $2.
After review, assign to $3 for follow-up.
Running /review-pr 123 high alice expands to:
Review pull request #123 with priority level high. After review, assign to alice for follow-up.
Capture all arguments as a single string:
---
argument-hint: [issue-number]
---
Fix issue #$ARGUMENTS following our coding standards.
Include file contents using @ syntax:
Review @$1 for code quality and potential bugs.
Running /review-file src/api/users.ts causes Claude to read src/api/users.ts
before processing the command.
Static references also work: Review @package.json and @tsconfig.json for consistency.
Execute shell commands inline with !`command` syntax to gather dynamic context:
---
allowed-tools: Bash(git:*)
---
Files changed: !`git diff --name-only`
Review each file for code quality and potential bugs.
The command output replaces the placeholder before Claude processes the prompt.
Ensure allowed-tools includes the appropriate Bash filter.
flowchart TD
Q{"How many commands?"}
Q -->|"5-15, no clear categories"| Flat["Flat structure<br>.claude/commands/*.md"]
Q -->|"15+, clear categories"| NS["Namespaced structure<br>.claude/commands/ci/*.md<br>.claude/commands/git/*.md<br>.claude/commands/docs/*.md"]
Subdirectory names become namespaces shown in /help. For example,
.claude/commands/ci/build.md appears as /build (project:ci).
---
description: Review code changes
allowed-tools: Read, Bash(git:*)
---
Files changed: !`git diff --name-only`
Review each file for:
1. Code quality and style
2. Potential bugs or issues
3. Test coverage
4. Documentation needs
---
description: Run tests for specific file
argument-hint: [test-file]
allowed-tools: Bash(npm:*)
---
Run tests: !`npm test $1`
Analyze results and suggest fixes for failures.
---
description: Complete PR workflow
argument-hint: [pr-number]
allowed-tools: Bash(gh:*), Read
---
PR #$1 Workflow:
1. Fetch PR: !`gh pr view $1`
2. Review changes
3. Run checks
4. Approve or request changes
/help, under 60 charsargument-hintallowed-tools that works; prefer Bash(git:*) over Bash(*)For commands that need complex user input beyond simple arguments, use the
AskUserQuestion tool. This enables multi-choice decisions, multi-select
scenarios, and conditional workflows.
flowchart TD
Q{"What kind of<br>user input?"}
Q -->|"Simple values —<br>file paths, numbers"| Args["Use command arguments<br>argument-hint + positional vars"]
Q -->|"Complex choices —<br>multiple options with trade-offs"| AUQ["Use AskUserQuestion<br>Include in allowed-tools"]
Q -->|"Both"| Both["Arguments for known values<br>AskUserQuestion for decisions"]
For complete AskUserQuestion patterns including multi-stage workflows, conditional flows, multi-select, and validation loops, see ./references/interactive-commands.md.
Commands can implement multi-step sequences, maintain state across invocations
using .local.md files, coordinate with other commands, and compose into
pipeline workflows.
For state management, command composition, workflow recovery, and error handling patterns, see ./references/advanced-workflows.md.
Plugin commands have access to ${CLAUDE_PLUGIN_ROOT} for portable paths to
plugin resources, auto-discovery from the commands/ directory, and can
integrate with plugin agents, skills, and hooks.
For CLAUDE_PLUGIN_ROOT patterns, plugin component integration, validation patterns, and marketplace distribution guidance, see ./references/plugin-command-patterns.md.
flowchart TD
P{"What is the problem?"}
P -->|"Command not appearing<br>in /help"| NotAppearing["Check file is in correct directory<br>Verify .md extension<br>Ensure valid Markdown format<br>Restart Claude Code"]
P -->|"Arguments not<br>substituting"| ArgsNotWorking["Verify dollar-sign N syntax<br>Check argument-hint matches usage<br>Ensure no extra spaces"]
P -->|"Bash execution<br>failing"| BashFail["Check allowed-tools includes Bash<br>Verify command syntax in backticks<br>Test command in terminal first<br>Check required permissions"]
P -->|"File references<br>not loading"| FileFail["Verify @ syntax correct<br>Check file path is valid<br>Ensure Read tool allowed<br>Use project-relative paths"]
/plugin-creator:skill-creator/plugin-creator:hooks-guide/plugin-creator:agent-creator/plugin-creator:plugin-lifecycle/plugin-creator:component-patternsSource: Adapted from Anthropic's plugin-dev:command-development skill
(../claude-plugins-official/plugins/plugin-dev/skills/command-development/, 11 files).
development
When an application needs to store config, data, cache, or state files. When designing where user-specific files should live. When code writes to ~/.appname or hardcoded home paths. When implementing cross-platform file storage with platformdirs.
testing
Enforce mandatory pre-action verification checkpoints to prevent pattern-matching from overriding explicit reasoning. Use this skill when about to execute implementation actions (Bash, Write, Edit) to verify hypothesis-action alignment. Blocks execution when hypothesis unverified or action targets different system than hypothesis identified. Critical for preventing cognitive dissonance where correct diagnosis leads to wrong implementation.
tools
Reference guide for the Twelve-Factor App methodology — 15 principles (12 original + 3 modern extensions) for building portable, resilient, cloud-native applications. Use when evaluating application architecture, designing cloud-native services, reviewing codebases for methodology compliance, advising on configuration, scaling, observability, security, and deployment patterns. Incorporates the 2025 open-source community evolution and cloud-native reinterpretations of each factor.
tools
Converts user-facing documentation (how-to guides, tutorials, API references, examples) in any format — Markdown, PDF, DOCX, PPTX, XLSX, AsciiDoc, RST, HTML, Jupyter notebooks, man pages, TOML/YAML/JSON configs, and plain text — into Claude Code skill directories with SKILL.md plus thematically grouped references/*.md files. Use when given a docs directory or mixed-format documentation to transform into an AI skill. Uses MCP file-reader server for binary formats.