Create new Claude Code commands with best practices and automatic validation
Creates new Claude Code commands with proper structure, tool permissions, and validation. Use when you need to add custom commands to your project with best practices for arguments, dynamic context, and slash command availability.
/plugin marketplace add lpasqualis/lpclaude/plugin install lpclaude-config@lpclaude-marketplace[description of what the command should do] (command name optional - can be embedded in description or will be generated)commands/Parse the user's input to extract:
.claude/commands/) unless "global" or "all projects" mentionedFrom the description, determine:
$ARGUMENTS or positional via $1, $2, etc.)disable-model-invocation: true) if: Maintenance/admin only, rarely needed programmatically, very long description consuming excessive context, highly specialized manual-only operationUse complete logical groupings:
Read, LS, Glob, GrepRead, Write, Edit, MultiEdit, LS, Glob, GrepWebFetch, WebSearchBash, Read, LS, Glob, GrepTask for subagent coordinationCommands are USER INPUT TEMPLATES - write in second person as instructions TO Claude:
---
description: Brief description of functionality (defaults to first line of prompt if omitted)
argument-hint: [specific arguments expected]
allowed-tools: [appropriate tool grouping]
---
[Concise, directive instructions]
## Arguments
Use $ARGUMENTS for all arguments, or $1, $2, $3 for individual positional parameters.
## Dynamic Context (optional)
- Bash execution: Exclamation mark followed by backtick-wrapped command
- File references: @path/to/file
[Any constraints or output format requirements]
Note: Command name is derived from the filename (e.g., optimize.md creates /optimize), not from frontmatter.
claude-3-5-haiku-20241022 for simple operations)
All Arguments Pattern ($ARGUMENTS):
/fix-issue $ARGUMENTS → /fix-issue refactor auth module → $ARGUMENTS = "refactor auth module"Positional Arguments Pattern ($1, $2, $3):
/review-pr $1 priority $2 → /review-pr 456 high → $1 = "456", $2 = "high"Bash Command Execution (exclamation mark):
allowed-tools---
allowed-tools: Bash(git status:*), Bash(git diff:*)
---
Current status: [Use exclamation-backtick syntax with: git status]
Recent changes: [Use exclamation-backtick syntax with: git diff HEAD]
File References (@):
@path/to/fileReview the implementation in @src/auth.js
Compare @old/version.js with @new/version.js
Extended Thinking:
disable-model-invocation: true based on command purpose$ARGUMENTS or positional parameters for customizationFor complex commands requiring validation:
template = Read('workers/commands-create-workers/command-validator.md')
Task(subagent_type: 'general-purpose', prompt: template + draft_command)
Apply validation feedback to optimize the command before saving.
If creating parallel execution workers for a command:
workers/{command-name}-workers/workers/{namespace}-{name}-workers//optimize workers go in workers/optimize-workers//commands:optimize workers go in workers/commands-optimize-workers/$ARGUMENTS or $1, $2, etc. for user customizationdisable-model-invocation: true for:
$ARGUMENTS