Slash Command Authoring

VerifiedSafe

Guide for authoring and improving slash commands that delegate to agents or skills. Covers design patterns, best practices, and architecture for simple, focused commands.

Sby Skills Guide Bot
DevelopmentIntermediate
3/4/2026
Claude Code
#slash-commands#claude-code#delegation#command-design#prompt-authoring

Recommended for

Automated summary

This skill guides the authoring, review, and improvement of Claude Code slash commands that delegate to agents or skills.

Strengths

  • States a clear, memorable rule: commands delegate, they don't implement
  • Explicitly separates commands (user-invoked) from skills (auto-triggered)
  • Ships detailed reference files covering four design patterns, a 7-step creation workflow, and analyzed real examples
  • Defines required versus optional command structure elements and the simple versus documented delegator formats

Limitations

  • Heavily tied to the Claude Code ecosystem (frontmatter fields, /help, allowed-tools) and not easily portable
  • Argument handling and command versioning are only lightly covered in the visible instructions
  • Assumes the user already has target agents or skills to delegate to
When to use it

Use it when drafting a new slash command, fixing an existing command that has grown too complex, or deciding between a command and a skill.

When not to use it

Avoid it when the goal is to write the actual domain logic of a skill or agent rather than a thin delegation wrapper.

Security analysis

Safe
Quality score85/100

The skill is a documentation/guidance file about authoring slash commands. It lists Bash among allowed tools, but contains no destructive commands, credential exfiltration, obfuscated payloads, or safety-disabling instructions. Execution risk is minimal.

No concerns found

How this analysis is made

Examples

New delegating command
Create a /audit-bash slash command that delegates to the bash-audit skill to check shell scripts for security and portability issues.
Command or skill?
I want a reusable code-review workflow — should this be a slash command or a skill, and why?
Refactor a bloated command
Review my .claude/commands/deploy.md — it has 60 lines of implementation logic. Help me turn it into a simple delegator.

name: command-authoring description: Guide for authoring, creating, writing, building, reviewing, or improving slash commands that delegate to agents or skills. Use when designing /commands for user shortcuts, fixing existing commands, or learning command best practices. Helps design simple command files, choose delegation targets, handle arguments, and decide when to use commands vs skills. Also triggers when asking how to create commands, whether to use a command vs skill, or understanding command patterns. Expert in command patterns, best practices, and keeping commands focused. allowed-tools:

  • Read
  • Grep
  • Glob
  • Bash
  • AskUserQuestion model: sonnet

Reference Files

Detailed command authoring guidance:


About Commands

Commands are user-invoked shortcuts that provide explicit control over when capabilities are used. They're typed as /command-name and typically delegate to agents or skills.

Key characteristics:

  • User-invoked - Typed explicitly as /command-name (not auto-triggered)
  • Simple - Delegate to agents/skills rather than containing complex logic
  • Focused - Single, clear purpose
  • Explicit - User controls timing of invocation
  • Discoverable - Shown in /help output

When to use commands:

  • User wants explicit shortcut for frequent task
  • Simple delegation pattern
  • User should control timing
  • Creating convenience wrapper for agent/skill

Core Philosophy

Commands Should Be Simple

Golden rule: Commands delegate, they don't implement.

Good command (simple delegation):

---
description: Audit shell scripts for best practices, security, and portability
---

# audit-bash

Audit shell scripts for best practices, security, and portability using the bash-audit skill.

Bad command (complex logic):

# bad-example

# DON'T DO THIS - complex logic in command

Read all shell scripts, run ShellCheck, analyze results, generate report...
[50 lines of implementation details]

Why keep it simple:

  • Easier to maintain
  • Clear delegation target
  • Less prone to errors
  • Follows single responsibility principle

Commands Are Explicit

Unlike skills (which auto-trigger), commands require user action.

Use commands when:

  • User wants control over timing
  • Action shouldn't happen automatically
  • Frequently-used prompt that deserves shortcut
  • Explicit workflow trigger

Use skills when:

  • Should auto-trigger based on context
  • User doesn't need to remember to invoke it
  • Complex domain knowledge that enhances conversation

Delegation Pattern

Commands use descriptive delegation - see ../../references/delegation-patterns.md for complete validation criteria and patterns.

Command Structure

Required Elements

Every command must have:

  1. description field (in frontmatter) - Required for /help and model invocation
  2. Command name heading (# command-name)
  3. Clear purpose - What the command does

Optional Elements

Depending on complexity:

  • Usage section - How to invoke, with/without arguments
  • What It Does - Detailed explanation
  • Examples - Sample invocations
  • Delegation - Which agent/skill it uses
  • Use Cases - When to use the command
  • Output - What to expect

Two Patterns

Pattern 1: Simple Delegator (6-10 lines)

  • Just frontmatter + brief description
  • Minimal documentation
  • Clear delegation statement

Pattern 2: Documented Delegator (30-80 lines)

  • Full usage instructions
  • Examples and use cases
  • Detailed delegation explanation
  • What It Does section

Choose based on:

  • Complexity of underlying agent/skill
  • Whether arguments need explanation
  • How often users will reference it

See command-design-patterns.md for detailed design patterns and examples.

See command-creation-process.md for step-by-step creation workflow.

Commands vs Skills Decision Guide

📄 See when-to-use-what.md for complete decision guide including agents and output-styles (shared)

Quick guide:

Use a Command when:

  • User wants explicit control over timing
  • Action should be deliberate, not automatic
  • Frequently-used prompt deserves shortcut
  • User-initiated workflow
  • Simple wrapper around agent/skill

Use a Skill when:

  • AI should auto-discover capability
  • Complex domain knowledge
  • Should trigger on user queries automatically
  • Needs progressive disclosure with references/
  • Automatic workflow assistance

Common Mistakes to Avoid

  1. Complex logic in command - Commands should delegate, not implement
  2. Missing description - Frontmatter description is required
  3. No delegation info - Unclear what agent/skill it uses
  4. Vague purpose - Command should have single, clear focus
  5. Too many arguments - Keep it simple, 0-2 args typically
  6. Not testing with /help - Verify command appears correctly
  7. Poor naming - Use descriptive, action-oriented names

See command-examples.md for complete examples with analysis.

Tips for Success

  1. Keep commands under 50 lines unless truly necessary
  2. Delegate, don't implement - let agents/skills do the work
  3. Test with /help to verify display
  4. Use descriptive names - action verbs work well
  5. Document delegation target - make it clear what runs
  6. Make purpose immediately clear - no guessing
  7. Optional arguments are better - provide defaults
  8. Start simple - can always add documentation later

Related Skills

This skill is part of the authoring skill family:

  • agent-authoring - Guide for creating agents
  • skill-authoring - Guide for creating skills
  • command-authoring - Guide for creating commands (this skill)
  • output-style-authoring - Guide for creating output styles

For validation, use the corresponding audit skills:

  • command-audit - Validate command configurations
  • audit-coordinator - Comprehensive multi-faceted audits

Quick Start Checklist

Creating a new command:

  • [ ] Identify what agent/skill to delegate to
  • [ ] Choose descriptive name (kebab-case)
  • [ ] Write clear description (50-150 chars)
  • [ ] Decide: simple (6-10 lines) or documented (30-80 lines)?
  • [ ] Create file at ~/.claude/commands/command-name.md
  • [ ] Add required frontmatter with description
  • [ ] Document delegation target
  • [ ] Test with /help and invocation
  • [ ] Verify arguments work correctly (if any)

Reference to Standards

For detailed standards and validation:

  • Naming conventions - Use kebab-case for command names
  • Frontmatter requirements - description field is required
  • File organization - ~/.claude/commands/command-name.md

See audit-coordinator skill for comprehensive standards.

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/slash-command-authoring-mmbizju6/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/slash-command-authoring-mmbizju6' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/slash-command-authoring-mmbizju6/download' --output '.skill-downloads/slash-command-authoring-mmbizju6/SKILL.md.part' && mv '.skill-downloads/slash-command-authoring-mmbizju6/SKILL.md.part' '.skill-downloads/slash-command-authoring-mmbizju6/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/slash-command-authoring-mmbizju6/SKILL.md' && test -s '.skill-downloads/slash-command-authoring-mmbizju6/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/command-authoring' && cp -R '.skill-downloads/slash-command-authoring-mmbizju6' '.claude/skills/command-authoring'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/slash-command-authoring-mmbizju6'

openskills read 'slash-command-authoring-mmbizju6'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/slash-command-authoring-mmbizju6/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills