create-slash-commands

Standardize Claude slash command YAML frontmatter and XML bodies.

Updated Apr 14, 2026
One-click install
npx skills add https://github.com/gerald-ica/opencode-config-snapshot --skill create-slash-commands-gerald-ica
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: create-slash-commands
Source: https://github.com/gerald-ica/opencode-config-snapshot/tree/main/opencode/skills/create-slash-commands
Command: npx skills add https://github.com/gerald-ica/opencode-config-snapshot --skill create-slash-commands-gerald-ica

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill guides teams and AI assistants in designing robust Claude Code slash commands. It covers YAML frontmatter, XML structured bodies, dynamic context, argument handling, and safe tool usage to ensure commands load consistently and securely.

Core Features & Use Cases

  • Design project-wide and personal slash commands stored as Markdown files.
  • Enforce frontmatter conventions (name, description, argument hints, allowed tools).
  • Define clear XML bodies with <objective>, <process>, and <success_criteria> sections.
  • Use dynamic context and file references to load state without leaking sensitive data.
  • Provide examples for common patterns like file references, file comparisons, and multi-step workflows.

Quick Start

Create a new command file at .claude/commands/my-command.md with frontmatter and a complete XML body.

Frequently Asked Questions about create-slash-commands

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

FAQPage Schema
How do I define Claude slash commands with YAML frontmatter and XML structure?

To define Claude slash commands, create Markdown files with YAML frontmatter for metadata and XML bodies containing <objective>, <process>, and <success_criteria> tags. This standardizes discovery, execution, and safety across project and personal command directories.

What fields are required in YAML frontmatter for Claude Code slash commands?

Required YAML frontmatter fields for Claude Code slash commands include name, description, argument hints, and allowed tools. These fields ensure consistent command discovery, proper argument handling, and safe tool usage restrictions across project and personal command directories.

Can I use dynamic context and file references in Claude slash command bodies?

Yes, Claude slash command bodies support dynamic context and file references to load state without leaking sensitive data. You can use XML structured bodies with <objective>, <process>, and <success_criteria> sections to implement file references, comparisons, and multi-step workflows.

How do I restrict tool usage in Claude Code custom commands?

You can restrict tool usage in Claude Code custom commands by specifying allowed tools in the YAML frontmatter. This ensures safe execution by limiting which tools the command can access during operation, maintaining security across project and personal command directories.

What's the best way to structure multi-step workflows in Claude slash commands?

The best way to structure multi-step workflows in Claude slash commands is using XML bodies with <objective>, <process>, and <success_criteria> sections. Combine this with dynamic context, argument handling, and optional scripts or references to support repeatable automation.

Where should I store project-wide versus personal Claude slash commands?

Project-wide Claude slash commands are stored in the project's .claude/commands directory, while personal commands go in your personal command directory. Both use Markdown files with standardized YAML frontmatter and XML bodies for consistent discovery and execution.