Command Creator
by @wpank
WHAT: Create Claude Code slash commands - reusable markdown workflows invoked with /command-name. WHEN: User wants to create, make, or add a slash command. User wants to automate a repetitive workflow or document a consistent process for reuse. KEYWORDS: "create a command", "make a slash command", "add a command", "new command", "/command", "automate this workflow", "make this repeatable"
clawhub install command-creatorπ About This Skill
name: command-creator model: fast description: | WHAT: Create Claude Code slash commands - reusable markdown workflows invoked with /command-name. WHEN: User wants to create, make, or add a slash command. User wants to automate a repetitive workflow or document a consistent process for reuse. KEYWORDS: "create a command", "make a slash command", "add a command", "new command", "/command", "automate this workflow", "make this repeatable"
Command Creator
Slash commands are markdown files in .claude/commands/ (project) or ~/.claude/commands/ (global) that expand into prompts when invoked.
Command Structure
---
description: Brief description for /help (required)
argument-hint: or [optional] (if takes arguments)
Command Title
[Instructions for agent to execute autonomously]
Creation Workflow
Step 1: Determine Location
1. Check if in git repo: git rev-parse --is-inside-work-tree
2. Default: Git repo β .claude/commands/, No git β ~/.claude/commands/
3. Override if user explicitly says "global" or "project"
Report chosen location before proceeding.
Step 2: Identify Pattern
Load references/patterns.md and present options:
| Pattern | Structure | Use When | |---------|-----------|----------| | Workflow Automation | Analyze β Act β Report | Multi-step with clear sequence | | Iterative Fixing | Run β Parse β Fix β Repeat | Fix issues until passing | | Agent Delegation | Context β Delegate β Iterate | Complex tasks, user review | | Simple Execution | Parse β Execute β Return | Wrapper for existing tools |
Ask: "Which pattern is closest to what you want?"
Step 3: Gather Information
A. Name and Purpose
my-command)B. Arguments
, Optional: [placeholder]C. Workflow Steps
D. Constraints
Step 4: Generate Command
Load references/best-practices.md for:
Key principles:
make lint", not "Check for errors"Step 5: Create File
mkdir -p [directory-path]
Write the command file. Report:
/command-name [args]Step 6: Test (Optional)
Suggest: "Test with /command-name [args]"
Iterate based on feedback.
Writing Guidelines
Imperative form (verb-first):
Specific, not vague:
make lint to check for errors"Include outcomes:
git status - should show modified files"Realistic examples:
git commit -m "Add OAuth2 authentication"git commit -m "foo bar"Command Patterns Quick Reference
Workflow Automation
1. Check for .PLAN.md
2. Analyze git status/diff
3. Perform actions
4. Report results
Iterative Fixing
1. Run make all-ci (max 10 iterations)
2. Parse errors by category
3. Apply targeted fixes
4. Repeat until success or stuck
Agent Delegation
1. Present context
2. Invoke subagent with Task tool
3. Iterate with user feedback
4. Save output after approval
See references/examples.md for full command examples.
Quality Checklist
Before finalizing:
my-command, not my_command)