command-creator
Install this skill
npx skills add softaworks/agent-toolkitWorks across Claude Code, Cursor, Codex, Copilot & Antigravity
The command-creator skill manages the lifecycle of slash commands for Claude Code environments. These commands act as reusable, markdown-defined instruction sets that expand into prompts when invoked via the CLI. By organizing workflows into project-level or global directories, users can standardize complex procedures like CI validation, stack submission, or iterative debugging. The skill facilitates the entire lifecycle: directory detection, naming convention enforcement, frontmatter configuration, and systematic instruction drafting. It encourages modular automation by turning repetitive task sequences into static files that ensure consistent agent behavior every time they are executed. This approach removes the need for manual prompt repetition, allowing users to call specialized, multi-step agent actions with a simple shorthand prefix, ensuring predictable outcomes across both personal and repository-specific development environments.
When to Use This Skill
- β’Standardizing PR submission procedures across a development team
- β’Automating multi-step diagnostic routines that check logs and run tests
- β’Creating shortcuts for project-specific scaffolding tasks
- β’Defining consistent review protocols for incoming code contributions
How to Invoke This Skill
Example prompts that trigger this skill in Claude Code, Cursor, or Antigravity:
- βHelp me create a new slash command
- βI want to make a reusable command for running tests
- βHow do I save this workflow as a command?
- βSet up a project-level command for my code review process
- βI keep doing this same task manually, let's turn it into a command
Pro Tips
- π‘Design commands to be atomic but composable: smaller commands can be chained together for more complex workflows, promoting reusability and maintainability.
- π‘Leverage command arguments: make your commands dynamic by accepting parameters, allowing for flexible execution without editing the command file.
- π‘Include clear '## Instructions' sections within your command markdown to guide the AI agent on its task, especially for iterative or conditional logic.
What this skill does
- β’Detects and selects optimal storage paths for global or project-local command files
- β’Enforces strict kebab-case naming conventions for command consistency
- β’Generates structured frontmatter including descriptions and argument placeholders
- β’Structures instructions using imperative verbs to maximize agent execution accuracy
- β’Provides templates for common patterns like agent delegation and iterative task fixing
When not to use it
- βWhen a task is performed only once and will never be repeated
- βWhen the workflow requires highly dynamic, non-deterministic logic that cannot be standardized
- βWhen you lack write access to the project repository or system home directory
Example workflow
- Identify the repetitive workflow to automate
- Run the command-creator to select a local or global directory
- Select a command pattern based on the task requirements
- Define command arguments and descriptive frontmatter
- Draft the agent instructions and finalize the markdown file
Prerequisites
- βActive Claude Code installation
- βBasic understanding of Markdown
- βWrite permissions for the target directory
Pitfalls & limitations
- !Using underscores instead of hyphens in command names which causes lookup failures
- !Over-complicating instructions, leading to agent drift during execution
- !Neglecting to define clear error handling within the command content
FAQ
How it compares
While manual prompts are ephemeral and rely on your memory, commands serve as a persistent, version-controlled library of your most efficient workflows.
π Full skill instructions β original source: softaworks/agent-toolkit
This skill guides the creation of Claude Code slash commands - reusable workflows that can be invoked with
/command-name in Claude Code conversations.## About Slash Commands
Slash commands are markdown files stored in
.claude/commands/ (project-level) or ~/.claude/commands/ (global/user-level) that get expanded into prompts when invoked. They're ideal for:- Repetitive workflows (code review, PR submission, CI fixing)
- Multi-step processes that need consistency
- Agent delegation patterns
- Project-specific automation
## When to Use This Skill
Invoke this skill when users:
- Ask to "create a command" or "make a slash command"
- Want to automate a repetitive workflow
- Need to document a consistent process for reuse
- Say "I keep doing X, can we make a command for it?"
- Want to create project-specific or global commands
## Bundled Resources
This skill includes reference documentation for detailed guidance:
- **references/patterns.md** - Command patterns (workflow automation, iterative fixing, agent delegation, simple execution)
- **references/examples.md** - Real command examples with full source (submit-stack, ensure-ci, create-implementation-plan)
- **references/best-practices.md** - Quality checklist, common pitfalls, writing guidelines, template structure
Load these references as needed when creating commands to understand patterns, see examples, or ensure quality.
## Command Structure Overview
Every slash command is a markdown file with:
---
description: Brief description shown in /help (required)
argument-hint: <placeholder> (optional, if command takes arguments)
---
# Command Title
[Detailed instructions for the agent to execute autonomously]## Command Creation Workflow
### Step 1: Determine Location
**Auto-detect the appropriate location:**
1. Check git repository status:
git rev-parse --is-inside-work-tree 2>/dev/null2. Default location:
- If in git repo β Project-level:
.claude/commands/- If not in git repo β Global:
~/.claude/commands/3. Allow user override:
- If user explicitly mentions "global" or "user-level" β Use
~/.claude/commands/- If user explicitly mentions "project" or "project-level" β Use
.claude/commands/Report the chosen location to the user before proceeding.
### Step 2: Show Command Patterns
Help the user understand different command types. Load **references/patterns.md** to see available patterns:
- **Workflow Automation** - Analyze β Act β Report (e.g., submit-stack)
- **Iterative Fixing** - Run β Parse β Fix β Repeat (e.g., ensure-ci)
- **Agent Delegation** - Context β Delegate β Iterate (e.g., create-implementation-plan)
- **Simple Execution** - Run command with args (e.g., codex-review)
Ask the user: "Which pattern is closest to what you want to create?" This helps frame the conversation.
### Step 3: Gather Command Information
Ask the user for key information:
#### A. Command Name and Purpose
Ask:
- "What should the command be called?" (for filename)
- "What does this command do?" (for description field)
Guidelines:
- Command names MUST be kebab-case (hyphens, NOT underscores)
- β CORRECT:
submit-stack, ensure-ci, create-from-plan- β WRONG:
submit_stack, ensure_ci, create_from_plan- File names match command names:
my-command.md β invoked as /my-command- Description should be concise, action-oriented (appears in
/help output)#### B. Arguments
Ask:
- "Does this command take any arguments?"
- "Are arguments required or optional?"
- "What should arguments represent?"
If command takes arguments:
- Add
argument-hint: <placeholder> to frontmatter- Use
<angle-brackets> for required arguments- Use
[square-brackets] for optional arguments#### C. Workflow Steps
Ask:
- "What are the specific steps this command should follow?"
- "What order should they happen in?"
- "What tools or commands should be used?"
Gather details about:
- Initial analysis or checks to perform
- Main actions to take
- How to handle results
- Success criteria
- Error handling approach
#### D. Tool Restrictions and Guidance
Ask:
- "Should this command use any specific agents or tools?"
- "Are there any tools or operations it should avoid?"
- "Should it read any specific files for context?"
### Step 4: Generate Optimized Command
Create the command file with agent-optimized instructions. Load **references/best-practices.md** for:
- Template structure
- Best practices for agent execution
- Writing style guidelines
- Quality checklist
Key principles:
- Use imperative/infinitive form (verb-first instructions)
- Be explicit and specific
- Include expected outcomes
- Provide concrete examples
- Define clear error handling
### Step 5: Create the Command File
1. Determine full file path:
- Project:
.claude/commands/[command-name].md- Global:
~/.claude/commands/[command-name].md2. Ensure directory exists:
mkdir -p [directory-path]3. Write the command file using the Write tool
4. Confirm with user:
- Report the file location
- Summarize what the command does
- Explain how to use it:
/command-name [arguments]### Step 6: Test and Iterate (Optional)
If the user wants to test:
1. Suggest testing:
You can test this command by running: /command-name [arguments]2. Be ready to iterate based on feedback
3. Update the file with improvements as needed
## Quick Tips
**For detailed guidance, load the bundled references:**
- Load **references/patterns.md** when designing the command workflow
- Load **references/examples.md** to see how existing commands are structured
- Load **references/best-practices.md** before finalizing to ensure quality
**Common patterns to remember:**
- Use Bash tool for
pytest, pyright, ruff, prettier, make, gt commands- Use Task tool to invoke subagents for specialized tasks
- Check for specific files first (e.g.,
.PLAN.md) before proceeding- Mark todos complete immediately, not in batches
- Include explicit error handling instructions
- Define clear success criteria
## Summary
When creating a command:
1. **Detect location** (project vs global)
2. **Show patterns** to frame the conversation
3. **Gather information** (name, purpose, arguments, steps, tools)
4. **Generate optimized command** with agent-executable instructions
5. **Create file** at appropriate location
6. **Confirm and iterate** as needed
Focus on creating commands that agents can execute autonomously, with clear steps, explicit tool usage, and proper error handling.
How to Use This Skill Unit
Option A: Project-Specific (Recommended)
- Click "Download" above
- In your project, create the directory:
.agent/skills/command-creator/ - Save the file as
SKILL.md - The agent will automatically discover the skill based on its description.
Option B: Global Installation (All Agents)
Save the file to these locations to make it available across all projects:
- Claude Code:
~/.claude/skills/softaworks/agent-toolkit/command-creator/SKILL.md - Cursor:
~/.cursor/skills/softaworks/agent-toolkit/command-creator/SKILL.md - Antigravity:
~/.gemini/antigravity/skills/softaworks/agent-toolkit/command-creator/SKILL.md
π Install with CLI:npx skills add softaworks/agent-toolkit

