skills/custom-command-creator/SKILL.md
Create and manage custom slash commands in Claude Code. Use when: (1) User wants to create a new slash command, (2) User asks about /commands or custom commands, (3) User wants to automate frequent prompts, (4) User says 'create global command' or 'create local command', (5) User mentions 'command-creator'. Covers creation (global/local), command anatomy, frontmatter, arguments, bash, file references, namespacing, command vs skill comparison.
npx skillsauth add takazudo/claude-resources custom-command-creatorInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Guide for creating effective custom slash commands in Claude Code.
Custom slash commands are Markdown files that define reusable prompts. They're simpler than skills - single files for quick, frequently-used prompts.
Use commands when:
Use skills instead when:
| Location | Path | Scope |
|----------|------|-------|
| Project | .claude/commands/<name>.md | This project only (shows as "project") |
| Personal | $HOME/.claude/commands/<name>.md | All your projects (shows as "user") |
Priority: Project commands override personal commands with same name.
Every command is a single Markdown file with optional frontmatter:
---
description: Brief description of what the command does
allowed-tools: Bash(git:*), Read
argument-hint: [filename] [options]
---
# Command Instructions
Your prompt content here with $ARGUMENTS placeholder.
See frontmatter.md for all available fields.
Pass dynamic values to commands using placeholders:
All arguments - $ARGUMENTS:
Fix issue #$ARGUMENTS following our coding standards
Usage: /fix-issue 123 high-priority → $ARGUMENTS = "123 high-priority"
Positional arguments - $1, $2, etc.:
Review PR #$1 with priority $2 and assign to $3
Usage: /review-pr 456 high alice → $1="456", $2="high", $3="alice"
Run shell commands before the prompt is sent using !command`` syntax:
---
allowed-tools: Bash(git:*)
---
## Context
- Git status: !`git status`
- Current branch: !`git branch --show-current`
- Recent commits: !`git log --oneline -5`
## Task
Create a commit based on the above changes.
Important: Must include Bash in allowed-tools for this to work.
Include file contents using @ prefix:
Review the implementation in @src/utils/helpers.js
Compare @src/old.js with @src/new.js
Include thinking keywords to trigger extended thinking mode:
Think deeply about the architecture of this codebase.
Use subdirectories to organize related commands:
.claude/commands/
├── frontend/
│ └── component.md → /component (project:frontend)
├── backend/
│ └── api.md → /api (project:backend)
└── deploy.md → /deploy (project)
Same-named commands in different subdirectories are distinguished by their namespace label.
When the user asks to create a command, follow this workflow.
If the user provides a name, use it. If they describe what they want, derive an appropriate kebab-case name.
Choose location based on context:
$HOME/.claude/commands/<name>.md): User says "global", or wants it available across all projects.claude/commands/<name>.md): User says "local" or "project", or wants it scoped to current repoFor local commands, find the project root first:
git rev-parse --show-toplevel # Use repo root, or cwd if not a git repo
Ensure the target directory exists before writing.
Ask the user if needed:
!command``) for dynamic context?Create the command file with proper structure:
Required best practices:
description fieldargument-hint if the command accepts arguments (e.g., [filename], [pr-number])$ARGUMENTS for all args or $1, $2 for positional argsallowed-tools in frontmatterdisable-model-invocation: trueTemplate:
---
description: Brief description of what the command does
argument-hint: [expected-args]
allowed-tools: Bash(git:*), Read
---
# Command Title
Clear instructions for what Claude should do.
## Context (if using bash execution)
- Dynamic info: !`git status --short`
## Task
What to accomplish with $ARGUMENTS.
Format the created command file using the mdx-formatter to ensure consistent markdown formatting:
pnpm dlx @takazudo/mdx-formatter --write <path-to-command-file.md>
After creating the file:
/<command-name>my-command.mddescription in frontmatter - commands without it are harder to discover$ARGUMENTS / $1 / $2 for dynamic values, not hardcoded values$HOME instead of ~: When command instructions reference home directory paths (e.g., log directories, config files), always write $HOME/cclogs/... or $HOME/.claude/..., NEVER $HOME/cclogs/... or $HOME/.claude/.... The ~ character is only expanded by interactive shell login contexts. In Node.js fs operations, non-login shells, and many tool contexts, ~ is treated as a literal character, which creates an actual directory named $HOME/ inside the working directory. This applies to paths in the command body text, bash execution snippets, and any instructions that an agent will follow---
description: Quick code review
---
Review this code for:
- Security vulnerabilities
- Performance issues
- Code style violations
---
description: Create a git commit with context
allowed-tools: Bash(git:*)
---
## Context
- Status: !`git status`
- Diff: !`git diff HEAD`
- Branch: !`git branch --show-current`
- Recent commits: !`git log --oneline -5`
## Task
Create a single git commit for the staged changes.
Message should be concise and follow conventional commits.
---
description: Review a pull request
argument-hint: [pr-number]
allowed-tools: Bash(gh:*)
---
## PR Context
- PR info: !`gh pr view $1`
- PR diff: !`gh pr diff $1`
- PR comments: !`gh pr view $1 --comments`
## Task
Review PR #$1 for:
1. Code quality and best practices
2. Potential bugs or edge cases
3. Security concerns
4. Test coverage
---
description: Complex analysis with specific model
model: claude-sonnet-4-20250514
---
Perform detailed analysis of $ARGUMENTS.
To prevent Claude from invoking a command automatically via the Skill tool:
---
description: Deploy to production (manual only)
disable-model-invocation: true
---
Deploy the application to production.
Define hooks that run only during command execution:
---
description: Deploy with validation
hooks:
PreToolUse:
- matcher: "Bash"
hooks:
- type: command
command: "./scripts/validate.sh"
once: true
---
Deploy to staging environment.
The once: true option runs the hook only once per session.
.claude/commands/ or $HOME/.claude/commands/).md extension/help to see available commands$ARGUMENTS for all args or $1, $2 for positionalallowed-tools: Bash(...) is in frontmatterdevelopment
Link Claude Code skill names mentioned in a CodeGrid article (data/{series}/{n}.md) to the author's public claude-resources repo, pinned to the latest commit hash so links don't rot. Use when: (1) user says 'linkify cc resources', 'link the skills', 'link skill names', or invokes /dev-linkify-cc-resources; (2) editing a CodeGrid article that mentions `/commits`, `/pr-complete`, `/skill-creator` or other Claude Code skills and they should point to claude-resources. Only links skills that actually exist in the public repo; skips hypothetical examples and code blocks.
development
Second opinion from Claude Opus on a plan or approach. Use when: (1) Planning phase of /big-plan needs a higher-quality review than /codex-2nd / /gco-2nd / /gcoc-2nd, (2) User says 'opus 2nd' or 'opus opinion', (3) Wanting Anthropic's larger model to critique a plan. Spawns a general-purpose Agent with model: opus that reads the plan file and returns structured feedback. Anthropic quota — not free.
tools
AI-based testing via subagent + a per-task test-flow skill. Use when the user wants to verify something that mechanical assertions can't fully capture — image recognition, visual size/position comparison, animation smoothness, multi-step manual flows that need AI judgment. Triggers: 'AI-based test', 'AI test', 'visual verify', 'image recognition test', 'manual operation test', 'human-eye check', 'verify visually', 'compare screenshots', 'looks the same', 'looks correct'. The skill's job is to (1) author a focused test-flow skill that captures the exact procedure + verdict criteria, then (2) dispatch a verification subagent via the Agent tool that loads BOTH the test-flow skill AND a browser-driving skill (/verify-ui primary, /headless-browser fallback) so the subagent has clear context and consistent verdicts. NEVER uses `claude -p` — subagent dispatch goes through the Agent tool exclusively.
development
End-of-workflow audit of touched GitHub issues, PRs, and branches via a Sonnet subagent. Use when: (1) /big-plan, /x-as-pr, or /x-wt-teams finishes its main work and needs to verify every touched resource is in the right state (closed when done, kept when ongoing, deleted when dead), (2) User says 'cleanup resources', 'audit cleanup', or 'check what should be closed', (3) A long workflow ends and the manager wants a structured paper trail of what it closed/kept/deleted. Auto-execute by default — the Sonnet agent proposes, the manager (you) executes safe actions and prints a final report.