Create a new custom Claude Code command file with proper frontmatter and structure.
Creates new custom Claude Code commands with proper frontmatter and structure.
/plugin marketplace add lttr/claude-marketplace/plugin install cc@lttr-claude-marketplacecommand/Create a new custom Claude Code command file with proper frontmatter and structure.
Create a new Claude Code command based on the arguments provided or by asking the user for details.
Arguments format: $ARGUMENTS may contain:
test, deploy, command/edit)project (default) or globalIf any required information is missing from $ARGUMENTS, ask the user:
Command name (required):
/ (e.g., command/create, git/cleanup)deploy, test-e2e, command/editScope (optional, default: project):
project -> .claude/commands/ in current git repositoryglobal -> ~/.claude/commands/ for all projectsproject if not specifiedDescription (required):
Allowed tools (optional):
Bash, Read, Write, Bash(npm:*), Bash(node:*), allallowed-tools frontmatter fieldAdditional prompts (optional):
For project scope:
REPO_ROOT=$(git rev-parse --show-toplevel 2>/dev/null)
TARGET_DIR="$REPO_ROOT/.claude/commands"
For global scope:
TARGET_DIR="$HOME/.claude/commands"
Handle subdirectories:
/ (e.g., command/create), create subdirectoriescommand/create -> $TARGET_DIR/command/create.mdCheck if the command file already exists:
if [[ -f "$TARGET_FILE" ]]; then
echo "WARNING: Command already exists: $TARGET_FILE"
exit 1
fi
If it exists, inform the user and ask if they want to overwrite it.
Create directory structure:
mkdir -p "$(dirname "$TARGET_FILE")"
Generate file content with frontmatter:
---
description: <description>
allowed-tools: <allowed-tools>
argument-hint: <argument-hint>
---
## Context
<Provide any context Claude needs to understand the task>
## Your task
<Clear instructions for what Claude should do when this command is invoked>
<If the command accepts arguments, explain how to use $ARGUMENTS>
Frontmatter rules:
descriptionallowed-tools only if specifiedargument-hint only if command accepts argumentsUse the Write tool to create the command file with the generated content.
Report success to the user:
SUCCESS: Created <scope> command: /<command-name>
Location: <full-path>
Description: <description>
Try it: /<command-name>
Example output:
SUCCESS: Created project command: /test-e2e
Location: /home/user/project/.claude/commands/test-e2e.md
Description: Run end-to-end tests with Playwright
Try it: /test-e2e
project: Report error and suggest using global scopeCreating a simple project command:
/command:create deploy project "Deploy application to production" "Bash"
Creating a global command with subdirectory:
/command:create command/edit global "Edit an existing command" "Read, Write, Glob"
Interactive creation (no arguments):
/command:create
- Asks for command name
- Asks for scope
- Asks for description
- Asks for allowed tools
- Creates the command