Design, author, and ship a Claude Code slash command. Covers prompt shape, argument handling, tool affordances, review criteria, and shipping checklist.
Claude Code slash commands are reusable prompts plus a small amount of declarative configuration that Claude Code injects when the user types /<name>. They sit on disk (in ~/.claude/commands/ or <repo>/.claude/commands/) as Markdown files with YAML frontmatter. A well-designed slash command turns a recurring agent workflow into a one-keystroke operation without hiding the intent from the user.
This skill covers: when to build a slash command vs. a sub-agent or hook, how to structure the command, how to pass arguments, how to reference files and tools safely, review criteria, and the shipping checklist.
Build a slash command when all of the following hold:
Do not use a slash command if:
CLAUDE.md).A slash command is a Markdown file whose name (minus .md) becomes the invocation. Optional YAML frontmatter controls metadata:
---
description: One-line summary shown in `/help`.
argument-hint: '<issue-number>'
allowed-tools: [Bash, Read, Grep]
---
# Short title
Instructions for Claude. Use $1, $2, $ARGUMENTS to reference positional args.
Reference files with @path/to/file.ts; they are read and included automatically.
Run non-interactive shell snippets with !command substitution when the value
must be fresh at invocation time.
$ARGUMENTS — raw arg string as typed by the user.$1, $2, … — positional tokens split on whitespace.argument-hint (frontmatter) — shown inline when the user starts typing the command; keep it short and literal.Validate args inside the prompt itself — ask Claude to short-circuit and explain if they are missing or shaped wrong. The user sees a useful error instead of a confused action.
@path injects the literal contents of a file at prompt-build time. Use for stable references (style guides, schemas).!command runs a shell command before the prompt is sent and inlines stdout. Use sparingly — every invocation pays the cost.! is for values that must be captured at invocation time (current git branch, clock, hostname).Declare the minimum tool set in allowed-tools. A slash command should not grant broader permissions than the surrounding session already has — treat the list as a tightening, not a widening. Omit the field to inherit the session default.
Avoid: verbose preamble, filler encouragement, duplicate guidance already in the top-level system prompt, tool lists embedded in prose.
---
description: Review the current branch against style rules.
argument-hint: '[optional base-branch]'
allowed-tools: [Bash, Read, Grep]
---
# PR review
Review the changes in the current branch vs. $1 (default: main) for:
1. Lint-clean diffs only — flag any `// eslint-disable-next-line` added.
2. Test coverage on new code paths.
3. Commit messages follow Conventional Commits.
Run `git diff $1..HEAD --stat` first to scope the work. If the branch hasn't
diverged, say so and stop. Produce a short Markdown report with file-grouped
findings. Don't modify code.
---
description: Turn a Linear issue into a branch + initial commit.
argument-hint: '<linear-issue-url>'
---
# Start from issue
Read the Linear issue at $1 via the Linear MCP tool if available, else ask the
user to paste the issue body.
Create a branch named `<owner-handle>/<issue-id>-<slug>`.
Write a draft plan as `./plan.md` with checkboxes derived from the issue.
Commit the plan with message `chore: plan for <issue-id>`.
Do not push.
---
description: Fan out independent investigations to sub-agents.
argument-hint: '<topic>'
---
# Investigate $1
Identify 2–4 independent facets of "$1" that can be researched separately
(e.g., history, current state, tradeoffs, recommendations). Delegate each to
a fresh sub-agent in parallel with a tight scope. Wait for all to return.
Synthesize into a single brief with one recommendation. Cite each fact.
!command executions happen in the user's shell with the user's permissions. Never inline commands that touch secrets or production./foo from within another command.@path happens at build time — the content is the file as-of the invocation moment, not as-read-later. For moving targets, prefer having Claude Read the file at runtime.allowed-tools as a sandbox against a malicious prompt.Other publishers' experience with this skill. Self-rating is blocked.
Ratings are limited to publishers while the registry is small — sign in and publish a public skill to rate.
No ratings yet. Be the first.
Same domains or capabilities as claude-code/slash-commands.