.agents/skills/command-creator/README.md
A comprehensive skill for creating optimized, agent-executable slash commands in Claude Code. This skill guides you through the entire process of designing, implementing, and testing reusable workflow automation commands.
The Command Creator skill helps you transform repetitive workflows into reusable slash commands that can be invoked with /command-name in Claude Code conversations. It provides expert guidance on command structure, agent optimization, and best practices to ensure your commands execute reliably and autonomously.
Purpose: Create high-quality, agent-executable slash commands with proper structure, clear instructions, and optimal tool usage patterns.
Target Users: Developers who want to:
Invoke this skill when you need to:
Trigger Phrases:
Slash commands are markdown files stored in .claude/commands/ (project-level) or ~/.claude/commands/ (global/user-level) that get expanded into prompts when invoked.
Structure:
---
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]
Invocation:
/command-name [arguments]
Storage Locations:
.claude/commands/my-command.md (only available in this project)~/.claude/commands/my-command.md (available everywhere)Automatically determines whether commands should be project-level or global based on:
Guides you through proven command patterns:
Creates commands that agents can execute autonomously with:
Includes comprehensive best practices for:
Provides three comprehensive reference files:
The Command Creator follows a structured 6-step workflow:
Auto-detection Logic:
.claude/commands/) if in git repo~/.claude/commands/) if not in git repoUser is informed of the chosen location before proceeding.
Present available command patterns to help frame the conversation:
User selects the closest pattern to their needs.
Interactive Q&A to collect:
A. Command Name and Purpose
my-command, not my_command)/help outputB. Arguments
<required> or [optional])C. Workflow Steps
D. Tool Restrictions
Create agent-executable instructions using:
mkdir -p)Use Case: Multi-step processes requiring analysis, action, and reporting
Example: Submit PR stack
1. Analyze git history to identify commit stack
2. Create PRs for each commit with proper dependencies
3. Report created PRs with links and status
Key Characteristics:
Use Case: Continuous improvement until success criteria met
Example: Ensure CI passes
1. Run tests and capture output
2. Parse failures and errors
3. Fix identified issues
4. Repeat until all tests pass
Key Characteristics:
Use Case: Complex tasks requiring specialized agent expertise
Example: Create implementation plan
1. Gather context (requirements, codebase)
2. Delegate to subagent agent
3. Iterate on plan with user feedback
4. Save final plan to .PLAN.md
Key Characteristics:
Use Case: Direct tool/script execution with arguments
Example: Code review
1. Run codex review on specified files
2. Present results to user
Key Characteristics:
.claude/commands/)When to Use:
Examples:
/submit-stack (project's PR submission workflow)/ensure-ci (project's test suite)/deploy-staging (project's deployment process)Advantages:
~/.claude/commands/)When to Use:
Examples:
/codex-review (code review any files)/create-implementation-plan (generic planning)/git-cleanup (git maintenance anywhere)Advantages:
This skill includes three comprehensive reference files in the references/ directory:
Purpose: Detailed command design patterns with implementation guidance
Contents:
Load When: Designing the command workflow and choosing the right pattern
Purpose: Real-world command implementations with full source code
Contents:
/submit-stack: Submit PR stack from git history/ensure-ci: Iteratively fix CI failures/create-implementation-plan: Delegate to planner agentLoad When: Need concrete examples of how to structure specific command types
Purpose: Quality checklist and writing guidelines
Contents:
Load When: Finalizing command to ensure quality and completeness
User Request: "I keep fixing CI failures manually. Can we make a command for this?"
Skill Flow:
ensure-ci.claude/commands/ensure-ci.md/ensure-ciUser Request: "Create a global command to review code with Codex"
Skill Flow:
codex-review<files> (required)~/.claude/commands/codex-review.md/codex-review src/app.py src/utils.pyUser Request: "Make a command that analyzes my commits and creates a PR stack"
Skill Flow:
submit-stack[base-branch] (optional, defaults to main).claude/commands/submit-stack.md/submit-stack or /submit-stack developMUST use kebab-case (hyphens, not underscores):
submit-stack, ensure-ci, create-from-plansubmit_stack, ensure_ci, create_from_plan<angle-brackets> for required arguments[square-brackets] for optional argumentsargument-hint: <file-path> (required)argument-hint: [base-branch] (optional)argument-hint: <command> [args...] (mixed)Write in imperative/infinitive form:
Be explicit about tools:
pytest tests/"Define success criteria:
Include error handling:
Use Bash tool for:
pytest, pyright, ruff, prettiermake, npm, yarngt (git-town commands)Use Task tool for:
subagent, subagents)Avoid in commands:
The Command Creator skill provides a comprehensive, guided workflow for creating high-quality slash commands in Claude Code. By following proven patterns, gathering detailed requirements, and generating agent-optimized instructions, it ensures your commands are:
Next Steps:
Get Started:
/command-creator
Or simply say: "I want to create a command that [does something]"