meta-command-creator

v2026.09.24

Create custom slash commands for Claude Code with markdown and YAML frontmatter. Use when building workflow automations, creating reusable prompts, or defining custom /commands. Use for slash commands, argument handling, file references, bash execution.

GitHub
安装命令
npx skhub add oakoss/meta-command-creator
Markdown
SKILL.md

Custom Slash Command Creator

Overview

Claude Code slash commands are markdown files with optional YAML frontmatter that create reusable /command workflows. Commands and skills are unified: .claude/commands/ files and .claude/skills/ directories both create slash commands. Skills are the recommended approach since they support additional features like supporting files, but single-file commands still work.

When to use: Repeatable prompts, team workflow standardization, guardrailed operations (deploy, commit), multi-phase tasks, dynamic context injection with bash output.

When NOT to use: Complex capabilities needing multiple files and scripts (use a full skill directory instead), one-off prompts, built-in commands that already exist (/compact, /help, /init).

Quick Reference

FeatureSyntax / LocationKey Points
Project command.claude/commands/name.mdShows "(project)" in /help
Project skill.claude/skills/name/SKILL.mdRecommended over commands, supports extra files
Personal command~/.claude/commands/name.mdAvailable across all projects
Personal skill~/.claude/skills/name/SKILL.mdAvailable across all projects
Plugin command<plugin>/skills/name/SKILL.mdNamespaced as plugin-name:skill-name
Subdirectory commands.claude/commands/git/commit.mdShows "(project:git)" in /help
All arguments$ARGUMENTSEntire argument string
Positional arguments$0, $1, $2 or $ARGUMENTS[0]Zero-based index
Bash injection!`git status`Runs before prompt is sent, output replaces placeholder
File reference@src/file.tsInlines file contents into prompt
Extended thinkingInclude "ultrathink" in contentTriggers deeper reasoning mode
Session ID${CLAUDE_SESSION_ID}Current session identifier for logging
Frontmatter descriptiondescription: What it doesRequired for /help listing and Skill tool
Tool restrictionsallowed-tools: Read, Grep, GlobLimits tools without per-use approval
Manual-only invocationdisable-model-invocation: truePrevents Claude from auto-triggering
Hide from menuuser-invocable: falseBackground knowledge only Claude loads
Argument hintargument-hint: [issue-number]Shown in autocomplete
Model overridemodel: claude-sonnet-4-20250514Specific model for this command
Subagent executioncontext: forkRuns in isolated context
Subagent typeagent: ExploreBuilt-in or custom agent when context: fork

Priority Order

When commands share the same name across levels, higher-priority locations win:

  1. Enterprise (managed settings)
  2. Personal (~/.claude/)
  3. Project (.claude/)

Plugin commands use namespacing (plugin:name) so they never conflict. If a skill and a command share the same name, the skill takes precedence.

Common Mistakes

MistakeImpactCorrect Pattern
Adding name field in command filesIgnored for .md commandsName is inferred from filename
Missing description frontmatterInvisible in /help and Skill toolAlways include description
Using category or tags fieldsSilently ignoredUse subdirectories for organization
$ARGUMENTS without handling empty caseUnexpected behaviorCheck if empty and provide default
!`bash` without allowed-toolsCommands fail to executeAdd allowed-tools: Bash(...) to frontmatter
Expecting project to override personalPersonal wins over projectPersonal commands take priority; rename to avoid conflicts
Using context: fork without a taskSubagent has no actionable workOnly fork skills with explicit step-by-step instructions
Overriding built-in command namesBuilt-ins cannot be overriddenUse different names (/my-help not /help)

Delegation

  • Command pattern discovery: Use Explore agent to find existing commands in .claude/commands/ or .claude/skills/
  • Complex workflow skills: For multi-file capabilities, create a full skill directory with SKILL.md and supporting files

References

发现
标签

此技能尚未发布标签。

版本
最新版本元数据

版本

v2026.09.24

发布时间

2026年9月24日

分类

未分类

许可证

未指定

源路径

skills/meta-command-creator

默认分支

main

最新提交

85e3a39

Tree SHA

a4c9e7b