home / skills / basher83 / agent-auditor / command-creator

command-creator skill

/skills/command-creator

This skill helps you create well-structured slash commands for Claude Code plugins with frontmatter and markdown body guidance.

npx playbooks add skill basher83/agent-auditor --skill command-creator

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
4.1 KB
---
name: command-creator
description: >
  This skill should be used when the user asks to "create a slash command", "write a command file",
  "add command to plugin", "create /command", "write command frontmatter", "add command arguments",
  "configure command tools", needs guidance on command structure, YAML frontmatter fields
  (description, argument-hint, allowed-tools), markdown command body, or wants to add custom slash
  commands to Claude Code plugins with proper argument handling and tool restrictions.
---

# Command Creator

## Overview

Creates slash commands for Claude Code plugins. Commands are user-invoked prompts that
expand into detailed instructions for Claude.

**When to use:** User wants to create a command, add command to plugin, or needs command structure help.

**References:** See
`plugins/meta/claude-docs/skills/claude-docs/reference/plugins-reference.md` for command specifications.

## Command Structure Requirements

Every command MUST:

1. Be a `.md` file in `commands/` directory
2. Include frontmatter with `description`
3. Contain clear instructions for Claude
4. Use descriptive kebab-case filename
5. Instructions written from Claude's perspective

## Creation Process

### Step 1: Define Command Purpose

Ask the user:

- What should this command do?
- What inputs/context does it need?
- What should Claude produce?

### Step 2: Choose Command Name

Create concise kebab-case name:

- "generate tests" → `generate-tests.md`
- "review pr" → `review-pr.md`
- "deploy app" → `deploy-app.md`

Name becomes the command: `/generate-tests`

### Step 3: Write Frontmatter

Required frontmatter:

```markdown
---
description: Brief description of what command does
---
```

### Step 4: Write Instructions

Write clear instructions for Claude:

```markdown
# Command Title

Detailed instructions telling Claude exactly what to do when this command is invoked.

## Steps

1. First action Claude should take
2. Second action
3. Final action

## Output Format

Describe how Claude should present results.

## Examples

Show example scenarios if helpful.
```

### Step 5: Verify Against Official Docs

Check
`plugins/meta/claude-docs/skills/claude-docs/reference/plugins-reference.md` for command specifications.

## Key Principles

- **Clarity**: Instructions must be unambiguous
- **Completeness**: Include all steps Claude needs
- **Perspective**: Write as if instructing Claude directly
- **Frontmatter**: Always include description

## Examples

### Example 1: Test Generator Command

User: "Create command to generate tests for a file"

Command file `commands/generate-tests.md`:

```markdown
---
description: Generate comprehensive tests for a source file
---

# Generate Tests

Generate test cases for the file provided by the user.

## Process

1. Read and analyze the source file
2. Identify testable functions and methods
3. Determine test scenarios (happy path, edge cases, errors)
4. Write tests using the project's testing framework
5. Ensure tests are comprehensive and follow best practices

## Test Structure

- One test file per source file
- Clear test names describing what's tested
- Arrange-Act-Assert pattern
- Cover edge cases and error conditions

## Output

Present the generated tests and explain coverage.
```

Invoked with: `/generate-tests`

### Example 2: PR Review Command

User: "Create command for reviewing pull requests"

Command file `commands/review-pr.md`:

```markdown
---
description: Conduct thorough code review of a pull request
---

# Review PR

Review the specified pull request for code quality, correctness, and best practices.

## Review Process

1. Fetch PR changes using git or gh CLI
2. Analyze changed files for:
   - Code correctness and logic errors
   - Style and formatting issues
   - Test coverage
   - Documentation completeness
   - Security concerns
   - Performance implications
3. Provide structured feedback

## Feedback Format

**Summary**: Brief overview of PR

**Strengths**: What's done well

**Issues**: Categorized by severity
- Critical: Must fix
- Important: Should fix
- Minor: Nice to have

**Suggestions**: Specific improvements with examples

## Usage

`/review-pr <pr-number>` or provide PR URL
```

Invoked with: `/review-pr 123`

Overview

This skill helps create and validate slash command files for Claude Code plugins. It guides you through choosing a kebab-case command name, writing required YAML frontmatter (description), and composing the Markdown instructions Claude will execute. Use it to generate ready-to-add command files with clear argument handling and tool restrictions.

How this skill works

It inspects the requested command purpose and desired inputs, then outputs a complete .md command file formatted for the commands/ directory. The skill generates frontmatter (description), a command title, step-by-step instructions from Claude's perspective, output format rules, and optional examples. It can also suggest allowed-tools and argument hints to enforce tool restrictions and clarify invocation.

When to use it

  • You need a new slash command for a Claude Code plugin (create /command).
  • You want help writing or validating command frontmatter and Markdown body.
  • You need to add arguments, argument-hints, or allowed-tools to a command.
  • You want a kebab-case filename and a precise command description.
  • You need instructions written from Claude’s perspective for consistent behavior.

Best practices

  • Use concise kebab-case filenames; the name becomes the slash command.
  • Always include frontmatter with a brief description field.
  • Write instructions as direct steps Claude should perform, in first person.
  • Specify input requirements, expected output format, and examples.
  • Include allowed-tools when the command must be limited to certain helpers.

Example use cases

  • Create commands like /generate-tests that analyze a file and produce test code.
  • Add a /review-pr command that fetches a PR, inspects diffs, and returns structured feedback.
  • Write a /deploy-app command that outlines deployment steps and required environment inputs.
  • Add argument-hint fields for commands that accept filenames, PR numbers, or URLs.
  • Configure allowed-tools to restrict a command to read-only analysis or to permit specific CLIs.

FAQ

What filename and location should I use?

Save the file as a kebab-case .md inside the commands/ directory; the filename (without .md) becomes the slash command.

What frontmatter is required?

At minimum include YAML frontmatter with a description field: ---\ndescription: Brief description\n---