plugins/create-command/skills/slash-command-writing/SKILL.md
Use this skill when creating, updating, or maintaining Claude Code slash commands. Activates when user asks to create a new command, modify an existing command, or asks questions about slash command syntax and best practices.
npx skillsauth add nsheaps/ai-mktpl slash-command-writingInstall 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.
This skill provides comprehensive guidance for creating and maintaining Claude Code slash commands.
Activate when:
Do NOT activate when:
| Scope | Location | Label in /help |
| ------- | ------------------------------ | -------------- |
| Project | .claude/commands/<name>.md | (project) |
| User | ~/.claude/commands/<name>.md | (user) |
Precedence: Project commands override user commands with the same name.
---
allowed-tools: Tool1, Tool2, Bash(command:*)
argument-hint: [arg1] [arg2]
description: Brief description shown in /help
model: claude-opus-4-5-20251101
disable-model-invocation: false
---
# Command Title
Your command instructions here.
Use $ARGUMENTS for all arguments or $1, $2, etc. for positional arguments.
| Field | Required | Description |
| -------------------------- | -------- | ---------------------------------------------------- |
| description | Yes | Brief text shown in /help output |
| allowed-tools | No | Tools the command can use (inherits if not set) |
| argument-hint | No | Shows expected arguments in autocomplete |
| model | No | Specific model for this command |
| disable-model-invocation | No | Prevent programmatic execution via SlashCommand tool |
Use $ARGUMENTS to capture everything after the command name:
---
description: Search codebase
argument-hint: [search query]
---
Search the codebase for: $ARGUMENTS
Usage: /search function that handles auth → $ARGUMENTS = function that handles auth
Use $1, $2, $3, etc. for specific positions:
---
description: Compare two files
argument-hint: [file1] [file2]
---
Compare the following files:
- First file: $1
- Second file: $2
Usage: /compare src/old.js src/new.js → $1 = src/old.js, $2 = src/new.js
Execute shell commands using the ! backtick syntax. Output is included in the command context.
allowed-tools frontmatter with appropriate Bash permissions!`command` syntax (exclamation mark followed by backticks)---
allowed-tools: Bash(git status:*), Bash(git diff:*), Bash(git log:*)
description: Show git context
---
## Current State
- Git status: !`git status`
- Recent commits: !`git log --oneline -5`
- Current branch: !`git branch --show-current`
| Pattern | Allows |
| -------------------- | ----------------------------- |
| Bash(git:*) | Any git command |
| Bash(git status:*) | git status with any arguments |
| Bash(npm:*) | Any npm command |
| Bash(ls:*) | ls with any arguments |
## Git Context
---
## allowed-tools: Bash(git:\*)
- Status: !`git status --short`
- Branch: !`git branch --show-current`
- Diff (staged): !`git diff --staged`
- Recent commits: !`git log --oneline -10`
## Package Info
---
## allowed-tools: Bash(npm:_), Bash(cat:_)
- Node version: !`node --version`
- Dependencies: !`npm ls --depth=0`
Include file contents using the @ prefix:
## Context Files
Review the implementation in @src/utils/helpers.js
Compare:
- Old: @src/old-version.js
- New: @src/new-version.js
Behavior:
@ references automatically include CLAUDE.md files from the file's directory treeTrigger extended thinking by including thinking keywords:
---
description: Complex architecture design
---
ultrathink: Design a comprehensive caching layer
Consider performance, memory usage, and invalidation strategies.
Keywords: ultrathink, megathink, think hard, etc.
description frontmatter for discoverabilityargument-hint when arguments are expectedallowed-tools when using Bash commands| Complexity Level | Use | | -------------------- | -------------------------- | | Quick prompts | Slash command | | Simple templates | Slash command | | Multi-step workflows | Skill | | Complex capabilities | Skill + supporting scripts |
Organize related commands in subdirectories:
.claude/commands/
├── optimize.md → /optimize (project)
├── frontend/
│ └── component.md → /component (project:frontend)
└── backend/
└── test.md → /test (project:backend)
Subdirectories appear in /help descriptions but don't affect the command name.
~/.claude/commands/): Personal, available everywhere.claude/commands/): Team-shared, repository-specific# User commands
ls -la ~/.claude/commands/
# Project commands (from git root)
ls -la .claude/commands/
# User command
mkdir -p ~/.claude/commands
touch ~/.claude/commands/my-command.md
# Project command
mkdir -p .claude/commands
touch .claude/commands/my-command.md
descriptionallowed-tools if using Bash$ARGUMENTS or $1, $2 for parameters!`command` if needed@path if needed/my-command test arguments---
description: Generate unit tests for a function
argument-hint: [function name or file path]
---
Generate comprehensive unit tests for: $ARGUMENTS
Include:
- Happy path tests
- Edge cases
- Error handling
- Mock dependencies where appropriate
---
allowed-tools: Bash(git status:*), Bash(git diff:*), Bash(git log:*)
argument-hint: [commit message prefix]
description: Smart commit with context
---
# Smart Commit
## Current State
- Status: !`git status`
- Changes: !`git diff HEAD`
- Recent style: !`git log --oneline -5`
## Task
Create a commit with the following requirements:
- Prefix: $ARGUMENTS (if provided)
- Follow conventional commit format
- Match existing commit style
---
description: Review PR changes comprehensively
argument-hint: [focus area]
allowed-tools: Bash(git:*)
---
# Code Review
## Changed Files
!`git diff --name-only HEAD~1`
## Full Diff
!`git diff HEAD~1`
## Review Focus
$ARGUMENTS
## Instructions
Provide feedback on:
1. Code quality and style
2. Potential bugs or issues
3. Performance considerations
4. Security implications
.mdallowed-tools frontmatter with Bash permissions!`command` (not just backticks)$ARGUMENTS for all args, $1, $2 for positional$ and numberdisable-model-invocation: true to prevent programmatic executiontools
Manually reproduce what the github-app plugin's SessionStart hook does to make a GitHub App installation token usable in the current session — materialize the PEM, generate the token, isolate GH_CONFIG_DIR, write the runtime env file, and wire CLAUDE_ENV_FILE so every Bash call sees GH_TOKEN/GITHUB_TOKEN. Use when the hook did not run, the token is missing from the environment, or a shell/teammate needs the token wired up by hand. <example>GH_TOKEN isn't set even though github-app is configured</example> <example>the github-app SessionStart hook didn't run, set up the token manually</example> <example>wire the github app token into CLAUDE_ENV_FILE</example> <example>gh keeps falling back to the wrong account, isolate GH_CONFIG_DIR</example>
tools
Manually configure the GitHub App bot git identity the way the github-app plugin's SessionStart hook does — resolve the app slug and bot user ID, build the <slug>[bot] name and noreply email, set GIT_AUTHOR_*/GIT_COMMITTER_* env vars, and write an isolated GIT_CONFIG_GLOBAL with the gh auth git-credential helper. Use when commits are attributed to the wrong account, "Author identity unknown" appears, or git identity must be set up by hand. <example>my commits are showing up as the handler, not the bot</example> <example>git says Author identity unknown after the github-app hook ran</example> <example>configure the github app bot git identity manually</example> <example>set up the gh credential helper for git push</example>
tools
Manages spec files for requirements capture and validation
tools
# Bash Chaining Alternatives This skill teaches you how to work around the bash command chaining restriction enforced by this plugin. ## Why Chaining is Blocked The `bash-command-rejection` plugin blocks these operators: | Operator | Name | Why Blocked | | -------- | ---------- | ----------------------------------------------------------------------------------- | | `&&` | AND chain | Runs cmd2 only if cmd1 su