create-command
Guide for creating custom Claude Code slash commands with proper structure, argument handling, frontmatter configuration, and best practices. Use when the user wants to create slash commands, custom commands, reusable prompts, or mentions creating/designing/building commands.
Security Assessment
About create-command
The 'create-command' skill assists in building custom Claude Code slash commands, enabling users to create reusable prompts stored as Markdown files. These commands can be invoked via a simple '/command-name' syntax, making them ideal for frequently-used prompts or specific workflows. The skill guides users through the process of creating these commands with clear steps for structuring arguments, configuring frontmatter, and testing their effectiveness. This helps streamline repetitive tasks, automate workflows, and maintain consistency across projects.
FAQ
How do I create a new slash command?
To create a new slash command, identify its purpose, select a scope (project or personal), choose a descriptive filename, design the arguments (if any), add frontmatter metadata, write the markdown prompt, and test the command with various arguments.
What is the difference between project-level and personal commands?
Project-level commands are stored in the '.claude/commands/' directory and are shared across a team via git, making them ideal for team workflows. Personal commands are stored in the '~/.claude/commands/' directory and are available across all projects for individual use.
Can I use custom arguments in my commands?
Yes, you can use positional arguments ($1, $2, $3, etc.) for specific inputs or use $ARGUMENTS to capture everything passed to the command. These options allow for flexible command design based on your needs.
What is the purpose of frontmatter in a command file?
Frontmatter in a command file provides optional metadata such as a description, allowed tools, argument hints, and the model version to use. This helps define the scope and behavior of the command.
Are there any limitations on the tools I can use in a command?
Yes, you can specify which tools are allowed to be used in your command via the 'allowed-tools' field in the frontmatter, such as 'Read', 'Write', 'Bash', etc.
Install create-command
Quick Setup:
- Copy the skill folder to
.claude/skills/ - Claude will automatically detect and use the skill
Repository
ronnycoding/.claude