create-slash-commands

Design Claude Code slash commands with YAML frontmatter and XML bodies.

5|3|Updated Jan 6, 2026
One-click install
npx skills add https://github.com/durandom/skills --skill create-slash-commands-durandom
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: create-slash-commands
Source: https://github.com/durandom/skills/tree/main/.claude/skills/create-slash-commands
Command: npx skills add https://github.com/durandom/skills --skill create-slash-commands-durandom

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill provides a structured approach to creating Claude Code slash commands, enabling teams to standardize prompts with YAML frontmatter and XML-structured bodies, ensuring consistency and reusability across projects.

Core Features & Use Cases

  • YAML frontmatter guidance: ensure every command defines at minimum a name and description.
  • XML-structured body: enforce an <objective>, <process>, and <success_criteria> for clear execution flow.
  • Workflow and conventions: outline how to set up project vs personal commands, dynamic context, and file references.
  • Testing and verification: include optional <testing>, <verification>, and <output> sections for complex commands.
  • Safe tool usage: demonstrate how to restrict tools when necessary and reference dynamic state or files.

Quick Start

  • Create .claude/commands/ directory (project) or use .claude/commands/ (personal)
  • Create command-name.md
  • Add YAML frontmatter (at minimum: description)
  • Write command prompt
  • Test with /command-name [args]

Frequently Asked Questions about create-slash-commands

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create custom Claude Code slash commands for my project?

To create Claude Code slash commands, add a Markdown file with a `.md` extension inside the `.claude/commands/` directory. Each file requires YAML frontmatter with at least a name and description, followed by an XML-structured body defining the objective, process, and success criteria.

What is the correct file structure for Claude Code command prompts?

Claude Code command prompts use a YAML frontmatter block for metadata like name and description, paired with an XML-structured body. The body enforces clear execution flow using `<objective>`, `<process>`, and `<success_criteria>` tags, with optional sections for testing and verification.

Can I restrict tool usage or pass dynamic context to a slash command?

Yes, slash commands support dynamic context and file references within their XML body. You can enforce safe tool usage by applying tool restrictions directly in the command file, ensuring Claude only accesses permitted tools during execution.

How do I set up personal versus project-wide slash commands?

Project-wide commands are stored in the project's `.claude/commands/` directory, while personal commands reside in your user-level `.claude/commands/` folder. Both require the same Markdown structure with YAML frontmatter and an XML body to function.

What's the best way to test and verify complex Claude Code commands?

For complex commands, include optional `<testing>`, `<verification>`, and `<output>` sections in the XML body. You can then execute the command using `/command-name [args]` to validate its dynamic context, file references, and execution flow before deployment.