command-creator
Create Claude Code custom slash commands with proper structure, frontmatter, and best practices. Use this skill whenever the user wants to create a new command, add a slash command, build a custom command, or mentions "create-command", "new command", "add command", or "make a command" for Claude Code. Also trigger when the user wants to turn a workflow into a reusable command.
What this skill does
# Command Creator
Create Claude Code custom slash commands with proper structure and best practices.
## Understanding Commands
Claude Code commands are Markdown files with YAML frontmatter that define reusable workflows invoked via `/command-name`. They live in specific locations depending on scope:
- **Project-level**: `.claude/commands/` in the project root (shared via git)
- **User-level**: `~/.claude/commands/` (personal, available everywhere)
- **Categorized**: Nest under subdirectories for namespacing (e.g., `gh/review-pr.md` becomes `/gh:review-pr`)
## Process
### 1. Clarify Intent
Before writing anything, understand:
- What should the command do? (single clear purpose)
- Who uses it — just this user, or the whole team? (determines project vs user-level)
- Does it need arguments? What kind?
- What tools does it need access to?
- Is there a category it belongs to? (e.g., `gh` for GitHub, `cc` for Claude Code meta-commands)
### 2. Write the Command
Every command file follows this structure:
```markdown
---
description: Brief description shown in command list
argument-hint: [expected-arguments]
allowed-tools: Tool1, Tool2, Bash(prefix:*)
---
# Command Name
What this command does and when to use it.
## Process:
Step-by-step instructions for the agent to follow.
## Your Task:
Act on "$ARGUMENTS" following these guidelines.
```
#### Frontmatter fields
| Field | Required | Purpose |
|-------|----------|---------|
| `description` | Yes | Short description shown when listing commands |
| `argument-hint` | No | Hint for expected arguments (shown in autocomplete) |
| `allowed-tools` | No | Restrict which tools the command can use |
#### Key conventions
- **`$ARGUMENTS`** is replaced with whatever the user types after the command name. Always reference it in the "Your Task" section so the command acts on user input.
- **`allowed-tools`** uses patterns: exact names (`Read`, `Write`), or prefix globs for Bash (`Bash(git:*)`, `Bash(npm:*)`).
- Keep commands **focused and single-purpose** — one command, one job.
- Write instructions in the **imperative form** ("Analyze the code", not "You should analyze the code").
- Include **concrete examples** of usage and expected behavior.
### 3. Choose the Right Location
| Scope | Path | When to use |
|-------|------|-------------|
| Project (shared) | `.claude/commands/` | Team workflows, project-specific tasks |
| Project (categorized) | `.claude/commands/<category>/` | Grouped commands (e.g., `gh/`, `db/`) |
| User (personal) | `~/.claude/commands/` | Personal productivity, cross-project tools |
### 4. Validate
After creating the command file:
- Verify the YAML frontmatter parses correctly (no syntax errors)
- Confirm the file is in the right directory
- Check that `$ARGUMENTS` is referenced if the command accepts input
- Ensure `allowed-tools` includes everything the command needs
## Example: A Simple Command
```markdown
---
description: Review a pull request with detailed analysis
argument-hint: [PR-number-or-URL]
allowed-tools: Bash(gh:*), Read, Grep, Glob
---
# Review PR
Perform a thorough code review of a GitHub pull request.
## Process:
1. Fetch PR details and diff using `gh pr view` and `gh pr diff`
2. Read changed files for full context
3. Analyze changes for:
- Correctness and potential bugs
- Code style consistency
- Missing tests or edge cases
- Security concerns
4. Provide a structured review summary
## Your Task:
Review PR "$ARGUMENTS" following these guidelines. If no PR number is given,
use `gh pr list` to show recent PRs and ask which one to review.
```
## Best Practices
- **Descriptive names**: The filename becomes the command name — make it clear (`fix-issue.md` not `fi.md`)
- **Graceful argument handling**: Always handle the case where `$ARGUMENTS` is empty
- **Minimal tool permissions**: Only list tools the command actually needs in `allowed-tools`
- **Follow existing patterns**: Look at other commands in the same directory for conventions
- **Test before shipping**: Try the command with different inputs to verify it works
## Your Task
Create a new command based on "$ARGUMENTS":
1. If the purpose is unclear, ask clarifying questions
2. Determine the appropriate location and category
3. Create the command file with proper structure
4. Explain what was created and how to use it
Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.