slash-command-factory

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Slash Command Factory

斜杠命令工厂

A comprehensive system for generating production-ready Claude Code slash commands through a simple question-based workflow.
一个通过简单的问答工作流生成可用于生产环境的Claude Code斜杠命令的综合系统。

When to Use This Skill

何时使用该技能

Use this skill when:
  • Creating new custom slash commands for Claude Code
  • Generating command templates from presets
  • Validating slash command YAML frontmatter syntax
  • Organizing commands into proper folder structures
  • Converting workflows into reusable slash commands

在以下场景使用该技能:
  • 为Claude Code创建新的自定义斜杠命令
  • 从预设生成命令模板
  • 验证斜杠命令的YAML前置语法
  • 将命令整理为规范的文件夹结构
  • 将工作流转换为可复用的斜杠命令

Overview

概述

This skill helps you create custom slash commands for Claude Code by:
  • Asking 5-7 straightforward questions about your command needs
  • Generating complete command .md files with proper YAML frontmatter
  • Providing 10 powerful preset commands for common use cases
  • Validating command format and syntax
  • Creating well-organized folder structures
  • Offering installation guidance
Output: Complete slash commands ready to use in Claude Code

该技能通过以下方式帮助你为Claude Code创建自定义斜杠命令:
  • 提出5-7个关于你命令需求的简单问题
  • 生成带有正确YAML前置内容的完整命令.md文件
  • 提供10个针对常见场景的强大预设命令
  • 验证命令格式与语法
  • 创建结构清晰的文件夹目录
  • 提供安装指导
输出:可直接在Claude Code中使用的完整斜杠命令

Official Command Structure Patterns

官方命令结构模式

This skill generates commands following three official patterns from Anthropic documentation:
该技能生成的命令遵循Anthropic文档中的三种官方模式

Pattern A: Simple (Context → Task)

模式A:简单型(上下文 → 任务)

Best for: Straightforward tasks with clear input/output Example: Code review, file updates, simple analysis Official Reference: code-review.md
Structure:
markdown
---
allowed-tools: Bash(git diff:*), Bash(git log:*)
description: Purpose description
---
最佳适用场景:输入输出明确的简单任务 示例:代码审查、文件更新、简单分析 官方参考:code-review.md
结构
markdown
---
allowed-tools: Bash(git diff:*), Bash(git log:*)
description: 用途描述
---

Context

上下文

  • Current state: !
    bash command
  • Additional data: !
    another command
  • 当前状态: !
    bash command
  • 额外数据: !
    another command

Your task

你的任务

[Clear instructions with numbered steps] [Success criteria]

**When to use**:

- Simple, focused tasks
- Quick analysis or reviews
- Straightforward workflows
- 1-3 bash commands for context

---
[带编号步骤的清晰指令] [成功标准]

**使用时机**:

- 简单、聚焦的任务
- 快速分析或审查
- 直接的工作流
- 1-3个用于获取上下文的bash命令

---

Pattern B: Multi-Phase (Discovery → Analysis → Task)

模式B:多阶段型(发现 → 分析 → 任务)

Best for: Complex discovery and documentation tasks Example: Codebase analysis, comprehensive audits, system mapping Official Reference: codebase-analysis.md
Structure:
markdown
---
allowed-tools: Bash(find:*), Bash(tree:*), Bash(ls:*), Bash(grep:*), Bash(wc:*), Bash(du:*)
description: Comprehensive purpose
---
最佳适用场景:复杂的发现与文档类任务 示例:代码库分析、全面审计、系统映射 官方参考:codebase-analysis.md
结构
markdown
---
allowed-tools: Bash(find:*), Bash(tree:*), Bash(ls:*), Bash(grep:*), Bash(wc:*), Bash(du:*)
description: 全面用途说明
---

Command Title

命令标题

Phase 1: Project Discovery

阶段1:项目发现

Directory Structure

目录结构

!
find . -type d | sort
!
find . -type d | sort

File Count Analysis

文件数量分析

!
find . -type f | wc -l
!
find . -type f | wc -l

Phase 2: Detailed Analysis

阶段2:详细分析

[More discovery commands] [File references with @]
[更多发现命令] [带@的文件引用]

Phase 3: Your Task

阶段3:你的任务

Based on all discovered information, create:
  1. Deliverable 1
    • Subsection
    • Details
  2. Deliverable 2
    • Subsection
    • Details
At the end, write output to [filename].md

**When to use**:

- Comprehensive analysis needed
- Multiple discovery phases
- Large amounts of context gathering
- 10+ bash commands for data collection
- Generate detailed documentation files

---
基于所有发现的信息,创建:
  1. 交付物1
    • 子部分
    • 详细内容
  2. 交付物2
    • 子部分
    • 详细内容
最后,将输出写入[filename].md

**使用时机**:

- 需要全面分析
- 多阶段发现流程
- 大量上下文收集
- 10个以上用于数据收集的bash命令
- 生成详细的文档文件

---

Pattern C: Agent-Style (Role → Process → Guidelines)

模式C:Agent风格(角色 → 流程 → 指南)

Best for: Specialized expert roles and coordination Example: Domain experts, orchestrators, specialized advisors Official Reference: openapi-expert.md
Structure:
markdown
---
name: command-name
description: |
  Multi-line description for complex purpose
  explaining specialized role
color: yellow
---

You are a [specialized role] focusing on [domain expertise].

**Core Responsibilities:**

1. **Responsibility Area 1**
   - Specific tasks
   - Expected outputs

2. **Responsibility Area 2**
   - Specific tasks
   - Expected outputs

**Working Process:**

1. [Step 1 in workflow]
2. [Step 2 in workflow]
3. [Step 3 in workflow]

**Important Considerations:**

- [Guideline 1]
- [Guideline 2]
- [Constraint or best practice]

When you encounter [scenario], [action to take].
When to use:
  • Need specialized domain expertise
  • Orchestrating complex workflows
  • Coordinating multiple sub-processes
  • Acting as expert advisor
  • Require specific procedural guidelines

最佳适用场景:专业领域角色与协调类任务 示例:领域专家、编排器、专业顾问 官方参考:openapi-expert.md
结构
markdown
---
name: command-name
description: |
  针对复杂用途的多行描述
  解释专业角色
color: yellow
---

你是专注于[领域专长]的[专业角色]。

**核心职责**
1. **职责领域1**
   - 具体任务
   - 预期输出

2. **职责领域2**
   - 具体任务
   - 预期输出

**工作流程**
1. [工作流步骤1]
2. [工作流步骤2]
3. [工作流步骤3]

**重要注意事项**
- [指南1]
- [指南2]
- [约束或最佳实践]

当你遇到[场景]时,[执行操作]。
使用时机
  • 需要专业领域知识
  • 编排复杂工作流
  • 协调多个子流程
  • 担任专家顾问
  • 需要特定的流程指南

Comprehensive Naming Convention

全面命名规范

Command File Naming Rules

命令文件命名规则

All slash command files MUST follow kebab-case convention:
Format:
[verb]-[noun].md
,
[noun]-[verb].md
, or
[domain]-[action].md
Rules:
  1. Case: Lowercase only with hyphens as separators
  2. Length: 2-4 words maximum
  3. Characters: Only
    [a-z0-9-]
    allowed (letters, numbers, hyphens)
  4. Start/End: Must begin and end with letter or number (not hyphen)
  5. No: Spaces, underscores, camelCase, TitleCase, or special characters

所有斜杠命令文件必须遵循kebab-case命名规范:
格式
[动词]-[名词].md
[名词]-[动词].md
[领域]-[动作].md
规则
  1. 大小写:仅使用小写字母,用连字符分隔
  2. 长度:最多2-4个单词
  3. 字符:仅允许
    [a-z0-9-]
    (字母、数字、连字符)
  4. 首尾:必须以字母或数字开头和结尾(不能是连字符)
  5. 禁止:空格、下划线、驼峰式、标题式或特殊字符

Conversion Algorithm

转换算法

User InputCommand Name
Input: "Analyze customer feedback and generate insights"
1. Extract action: "analyze"
2. Extract target: "feedback"
3. Combine: "analyze-feedback"
4. Validate: Matches [a-z0-9-]+ pattern ✓
5. Output: analyze-feedback.md
More Examples:
  • "Review pull requests" →
    pr-review.md
    or
    review-pr.md
  • "Generate API documentation" →
    api-document.md
    or
    document-api.md
  • "Update README files" →
    update-readme.md
    or
    readme-update.md
  • "Audit security compliance" →
    security-audit.md
    or
    compliance-audit.md
  • "Research market trends" →
    research-market.md
    or
    market-research.md
  • "Analyze code quality" →
    code-analyze.md
    or
    analyze-code.md

用户输入命令名称
输入: "分析客户反馈并生成洞察"
1. 提取动作: "analyze"
2. 提取目标: "feedback"
3. 组合: "analyze-feedback"
4. 验证: 符合[a-z0-9-]+模式 ✓
5. 输出: analyze-feedback.md
更多示例
  • "Review pull requests" →
    pr-review.md
    review-pr.md
  • "Generate API documentation" →
    api-document.md
    document-api.md
  • "Update README files" →
    update-readme.md
    readme-update.md
  • "Audit security compliance" →
    security-audit.md
    compliance-audit.md
  • "Research market trends" →
    research-market.md
    market-research.md
  • "Analyze code quality" →
    code-analyze.md
    analyze-code.md

Official Examples (From Anthropic Docs)

官方示例(来自Anthropic文档)

Correct:
  • code-review.md
    (verb-noun)
  • codebase-analysis.md
    (noun-noun compound)
  • update-claude-md.md
    (verb-noun-qualifier)
  • openapi-expert.md
    (domain-role)
Incorrect:
  • code_review.md
    (snake_case - wrong)
  • CodeReview.md
    (PascalCase - wrong)
  • codeReview.md
    (camelCase - wrong)
  • review.md
    (too vague - needs target)
  • analyze-customer-feedback-data.md
    (too long - >4 words)

正确示例
  • code-review.md
    (动词-名词)
  • codebase-analysis.md
    (名词-名词复合)
  • update-claude-md.md
    (动词-名词-限定词)
  • openapi-expert.md
    (领域-角色)
错误示例
  • code_review.md
    (蛇形命名 - 错误)
  • CodeReview.md
    (帕斯卡命名 - 错误)
  • codeReview.md
    (驼峰命名 - 错误)
  • review.md
    (过于模糊 - 需要指定目标)
  • analyze-customer-feedback-data.md
    (过长 - 超过4个单词)

Bash Permission Patterns

Bash权限模式

Critical Rule: Subcommand-Level Specificity

关键规则:子命令级别的 specificity

❌ NEVER ALLOWED:
yaml
allowed-tools: Bash
Blanket Bash permission is prohibited per official Anthropic patterns.
❌ TOO BROAD (for commands with subcommands):
yaml
allowed-tools: Bash(git:*), Bash(gh:*), Bash(npm:*)
Command-level wildcards allow dangerous operations (
git reset --hard
,
gh repo delete
).
✅ REQUIRED (subcommand-level specificity):
yaml
allowed-tools: Bash(git add:*), Bash(git commit:*), Bash(git push:*), Bash(gh repo view:*)
Must specify exact subcommands for commands with subcommand hierarchies.
✅ OK (commands without subcommands):
yaml
allowed-tools: Bash(cp:*), Bash(mkdir -p:*), Bash(date:*), Bash(open:*)
Simple commands without subcommand hierarchies can use command-level.

❌ 绝对禁止
yaml
allowed-tools: Bash
根据官方Anthropic模式,全面的Bash权限是被禁止的。
❌ 过于宽泛(针对带有子命令的命令):
yaml
allowed-tools: Bash(git:*), Bash(gh:*), Bash(npm:*)
命令级别的通配符允许危险操作(如
git reset --hard
gh repo delete
)。
✅ 必须遵循(子命令级别的 specificity):
yaml
allowed-tools: Bash(git add:*), Bash(git commit:*), Bash(git push:*), Bash(gh repo view:*)
对于带有子命令层级的命令,必须指定精确的子命令
✅ 允许(无命令层级的简单命令):
yaml
allowed-tools: Bash(cp:*), Bash(mkdir -p:*), Bash(date:*), Bash(open:*)
无子命令层级的简单命令可以使用命令级别的权限。

Official Permission Patterns

官方权限模式

Based on Anthropic's documented examples:
Git Operations (code-review, update-docs):
yaml
allowed-tools: Bash(git status:*), Bash(git diff:*), Bash(git log:*), Bash(git branch:*), Bash(git add:*), Bash(git commit:*)
File Discovery (codebase-analysis):
yaml
allowed-tools: Bash(find:*), Bash(tree:*), Bash(ls:*), Bash(du:*)
Content Analysis (comprehensive discovery):
yaml
allowed-tools: Bash(grep:*), Bash(wc:*), Bash(head:*), Bash(tail:*), Bash(cat:*)
Data Processing (custom analysis):
yaml
allowed-tools: Bash(awk:*), Bash(sed:*), Bash(sort:*), Bash(uniq:*)
Combined Patterns (multi-phase commands):
yaml
allowed-tools: Bash(find:*), Bash(tree:*), Bash(ls:*), Bash(grep:*), Bash(wc:*), Bash(du:*), Bash(head:*), Bash(tail:*), Bash(cat:*), Bash(touch:*)

基于Anthropic文档中的示例:
Git操作(代码审查、更新文档):
yaml
allowed-tools: Bash(git status:*), Bash(git diff:*), Bash(git log:*), Bash(git branch:*), Bash(git add:*), Bash(git commit:*)
文件发现(代码库分析):
yaml
allowed-tools: Bash(find:*), Bash(tree:*), Bash(ls:*), Bash(du:*)
内容分析(全面发现):
yaml
allowed-tools: Bash(grep:*), Bash(wc:*), Bash(head:*), Bash(tail:*), Bash(cat:*)
数据处理(自定义分析):
yaml
allowed-tools: Bash(awk:*), Bash(sed:*), Bash(sort:*), Bash(uniq:*)
组合模式(多阶段命令):
yaml
allowed-tools: Bash(find:*), Bash(tree:*), Bash(ls:*), Bash(grep:*), Bash(wc:*), Bash(du:*), Bash(head:*), Bash(tail:*), Bash(cat:*), Bash(touch:*)

Permission Selection Guide

权限选择指南

Command TypeBash PermissionsExample Commands
Git Commands
git status, git diff, git log, git branch
code-review, commit-assist
Discovery
find, tree, ls, du
codebase-analyze, structure-map
Analysis
grep, wc, head, tail, cat
search-code, count-lines
Update
git diff, find, grep
update-docs, sync-config
Data Processing
awk, sed, sort, uniq
parse-data, format-output
ComprehensiveAll of the abovefull-audit, system-analyze

命令类型Bash权限示例命令
Git命令
git status, git diff, git log, git branch
code-review, commit-assist
发现类
find, tree, ls, du
codebase-analyze, structure-map
分析类
grep, wc, head, tail, cat
search-code, count-lines
更新类
git diff, find, grep
update-docs, sync-config
数据处理类
awk, sed, sort, uniq
parse-data, format-output
全面类以上所有权限full-audit, system-analyze

Two Paths to Generate Commands

两种命令生成路径

Path 1: Quick-Start Presets (30 seconds)

路径1:快速启动预设(30秒)

Choose from 10 powerful preset commands:
Business & Research:
  1. /research-business - Comprehensive market research and competitive analysis
  2. /research-content - Multi-platform content trend analysis and SEO strategy
Healthcare & Compliance: 3. /medical-translate - Translate medical terminology to 8th-10th grade (German/English) 4. /compliance-audit - HIPAA/GDPR/DSGVO compliance validation
Development & Integration: 5. /api-build - Generate complete API integration code with tests 6. /test-auto - Auto-generate comprehensive test suites
Documentation & Knowledge: 7. /docs-generate - Automated documentation creation 8. /knowledge-mine - Extract and structure insights from documents
Workflow & Productivity: 9. /workflow-analyze - Analyze and optimize business processes 10. /batch-agents - Launch and coordinate multiple agents for complex tasks
从10个强大的预设命令中选择:
商业与研究
  1. /research-business - 全面的市场研究与竞争分析
  2. /research-content - 多平台内容趋势分析与SEO策略
医疗与合规:3. /medical-translate - 将医学术语转换为8-10年级水平(德语/英语)4. /compliance-audit - HIPAA/GDPR/DSGVO合规性验证
开发与集成:5. /api-build - 生成带有测试的完整API集成代码6. /test-auto - 自动生成全面的测试套件
文档与知识:7. /docs-generate - 自动化文档创建8. /knowledge-mine - 从文档中提取并结构化洞察
工作流与生产力:9. /workflow-analyze - 分析并优化业务流程10. /batch-agents - 启动并协调多个Agent完成复杂任务

Path 2: Custom Command (5-7 Questions)

路径2:自定义命令(5-7个问题)

Create a completely custom command for your specific needs.

创建完全符合你特定需求的自定义命令。

Question Flow (Custom Path)

问答流程(自定义路径)

Question 1: Command Purpose

问题1:命令用途

"What should this slash command do?
Be specific about its purpose and when you'll use it.
Examples:
  • 'Analyze customer feedback and generate actionable insights'
  • 'Generate HIPAA-compliant API documentation'
  • 'Research market trends and create content strategy'
  • 'Extract key insights from research papers'
Your command's purpose: ___"

"这个斜杠命令应该实现什么功能?
请具体说明其用途和使用场景。
示例:
  • '分析客户反馈并生成可执行的洞察'
  • '生成符合HIPAA规范的API文档'
  • '研究市场趋势并制定内容策略'
  • '从研究论文中提取关键洞察'
你的命令用途:___"

Question 2: Arguments (Auto-Determined)

问题2:参数(自动判定)

The skill automatically determines if your command needs arguments based on the purpose.
If arguments are needed, they will use
$ARGUMENTS
format:
  • User types:
    /your-command argument1 argument2
  • Command receives:
    $ARGUMENTS
    = "argument1 argument2"
Examples:
  • /research-business "Tesla" "EV market"
    → $ARGUMENTS = "Tesla EV market"
  • /medical-translate "Myokardinfarkt" "de"
    → $ARGUMENTS = "Myokardinfarkt de"
No user input needed - skill decides intelligently.

该技能会根据命令用途自动判定是否需要参数。
如果需要参数,将使用
$ARGUMENTS
格式:
  • 用户输入:
    /your-command argument1 argument2
  • 命令接收:
    $ARGUMENTS
    = "argument1 argument2"
示例
  • /research-business "Tesla" "EV market"
    → $ARGUMENTS = "Tesla EV market"
  • /medical-translate "Myokardinfarkt" "de"
    → $ARGUMENTS = "Myokardinfarkt de"
无需用户输入 - 技能会智能判定。

Argument Short-Form Convention (MANDATORY)

参数简写规范(强制要求)

Every flag/option MUST have a short form for quick command-line entry.
Rules:
  1. Prefer 1-letter:
    -b
    for
    --branch
    ,
    -v
    for
    --verbose
  2. Use 2-letters only if needed:
    -nb
    for
    --no-branch
    (when
    -n
    conflicts)
  3. Document both forms: Always show
    [-short|--long]
    in argument-hint
Format in argument-hint:
yaml
argument-hint: "[slug] [-b|--branch] [-v|--verbose]"
Format in Arguments table:
markdown
| Argument    | Short | Description           | Default |
| ----------- | ----- | --------------------- | ------- |
| `--branch`  | `-b`  | Create feature branch | false   |
| `--verbose` | `-v`  | Enable verbose output | false   |
Letter Selection Priority:
  1. First letter of the flag name (
    --branch
    -b
    )
  2. Distinctive letter if first conflicts (
    --debug
    -d
    , but if
    -d
    taken, use
    -D
    or
    -db
    )
  3. Mnemonic association (
    --quiet
    -q
    ,
    --force
    -f
    )
This is a MANDATORY success criterion - commands without short forms will fail validation.

每个标记/选项必须有简写形式,以便快速命令行输入。
规则
  1. 优先使用1个字母
    -b
    代表
    --branch
    -v
    代表
    --verbose
  2. 仅在必要时使用2个字母
    -nb
    代表
    --no-branch
    (当
    -n
    存在冲突时)
  3. 同时记录两种形式:在argument-hint中始终显示
    [-short|--long]
argument-hint中的格式
yaml
argument-hint: "[slug] [-b|--branch] [-v|--verbose]"
参数表中的格式
markdown
| 参数    | 简写 | 描述           | 默认值 |
| ----------- | ----- | --------------------- | ------- |
| `--branch`  | `-b`  | 创建功能分支 | false   |
| `--verbose` | `-v`  | 启用详细输出 | false   |
字母选择优先级
  1. 标记名称的首字母(
    --branch
    -b
  2. 如果首字母冲突,则使用独特的字母(
    --debug
    -d
    ,如果
    -d
    已被占用,则使用
    -D
    -db
  3. 助记关联(
    --quiet
    -q
    --force
    -f
这是强制的成功标准 - 没有简写形式的命令将无法通过验证。

Question 3: Which Tools?

问题3:使用哪些工具?

"Which Claude Code tools should this command use?
Available tools:
  • Read - Read files
  • Write - Create files
  • Edit - Modify files
  • Bash - Execute shell commands (MUST specify exact commands)
  • Grep - Search code
  • Glob - Find files by pattern
  • Task - Launch agents
CRITICAL: For Bash, you MUST specify exact commands, not wildcards.
Bash Examples:
  • ✅ Bash(git status:), Bash(git diff:), Bash(git log:*)
  • ✅ Bash(find:), Bash(tree:), Bash(ls:*)
  • ✅ Bash(grep:), Bash(wc:), Bash(head:*)
  • ❌ Bash (wildcard not allowed per official patterns)
Tool Combination Examples:
  • Git command: Read, Bash(git status:), Bash(git diff:)
  • Code generator: Read, Write, Edit
  • Discovery command: Bash(find:), Bash(tree:), Bash(grep:*)
  • Analysis command: Read, Grep, Task (launch agents)
Your tools (comma-separated): ___"

"这个命令应该使用哪些Claude Code工具?
可用工具:
  • Read - 读取文件
  • Write - 创建文件
  • Edit - 修改文件
  • Bash - 执行shell命令(必须指定精确的命令)
  • Grep - 搜索代码
  • Glob - 按模式查找文件
  • Task - 启动Agent
关键提示:对于Bash,必须指定精确的命令,不能使用通配符。
Bash示例
  • ✅ Bash(git status:), Bash(git diff:), Bash(git log:*)
  • ✅ Bash(find:), Bash(tree:), Bash(ls:*)
  • ✅ Bash(grep:), Bash(wc:), Bash(head:*)
  • ❌ Bash(根据官方模式,通配符不被允许)
工具组合示例
  • Git命令:Read, Bash(git status:), Bash(git diff:)
  • 代码生成器:Read, Write, Edit
  • 发现命令:Bash(find:), Bash(tree:), Bash(grep:*)
  • 分析命令:Read, Grep, Task(启动Agent)
你的工具选择(逗号分隔):___"

Question 4: Agent Integration

问题4:Agent集成

"Does this command need to launch agents for specialized tasks?
Examples of when to use agents:
  • Complex analysis (launch rr-architect, rr-security)
  • Implementation tasks (launch rr-frontend, rr-backend)
  • Quality checks (launch rr-qa, rr-test-runner)
Options:
  1. No agents - Command handles everything itself
  2. Launch agents - Delegate to specialized agents
Your choice (1 or 2): ___"
If "2", ask: "Which agents should it launch? ___"

"这个命令是否需要启动Agent来完成专业任务?
使用Agent的示例场景:
  • 复杂分析(启动rr-architect、rr-security)
  • 实现任务(启动rr-frontend、rr-backend)
  • 质量检查(启动rr-qa、rr-test-runner)
选项:
  1. 不使用Agent - 命令自行处理所有任务
  2. 启动Agent - 委托给专业Agent
你的选择(1或2):___"
如果选择"2",则询问:"应该启动哪些Agent?___"

Question 5: Output Type

问题5:输出类型

"What type of output should this command produce?
  1. Analysis - Research report, insights, recommendations
  2. Files - Generated code, documentation, configs
  3. Action - Execute tasks, run workflows, deploy
  4. Report - Structured report with findings and next steps
Your choice (1, 2, 3, or 4): ___"

"这个命令应该生成什么类型的输出?
  1. 分析报告 - 研究报告、洞察、建议
  2. 文件 - 生成的代码、文档、配置
  3. 操作执行 - 执行任务、运行工作流、部署
  4. 结构化报告 - 包含发现结果与后续步骤的结构化报告
你的选择(1、2、3或4):___"

Question 6: Model Preference (Optional)

问题6:模型偏好(可选)

"Which Claude model should this command use?
  1. Default - Inherit from main conversation (recommended)
  2. Sonnet - Best for complex tasks
  3. Haiku - Fastest, cheapest (for simple commands)
  4. Opus - Maximum capability (for critical tasks)
Your choice (1, 2, 3, or 4) or press Enter for default: ___"

"这个命令应该使用哪个Claude模型?
  1. 默认 - 继承自主对话(推荐)
  2. Sonnet - 最适合复杂任务
  3. Haiku - 最快、成本最低(适用于简单命令)
  4. Opus - 功能最强(适用于关键任务)
你的选择(1、2、3或4)或按Enter使用默认值:___"

Question 7: Additional Features (Optional)

问题7:附加功能(可选)

"Any special features?
Optional features:
  • Bash execution - Run shell commands and include output (!
    command
    )
  • File references - Include file contents (@file.txt)
  • Context gathering - Read project files for context
Features you need (comma-separated) or press Enter to skip: ___"

"是否需要任何特殊功能?
可选功能:
  • Bash执行 - 运行shell命令并包含输出(!
    command
  • 文件引用 - 包含文件内容(@file.txt)
  • 上下文收集 - 读取项目文件以获取上下文
你需要的功能(逗号分隔)或按Enter跳过:___"

Generation Process

生成流程

After collecting answers:
  1. Generate YAML Frontmatter:
yaml
---
description: [From command purpose]
argument-hint: [If $ARGUMENTS needed]
allowed-tools: [From tool selection]
model: [If specified]
---
  1. Generate Command Body:
markdown
[Purpose-specific instructions]

[If uses agents]:

1. **Launch [agent-name]** with [specific task]
2. Coordinate workflow
3. Validate results

[If uses bash]:

- Context: !`bash command`

[If uses file refs]:

- Review: @file.txt

Success Criteria: [Based on output type]
  1. Create Folder Structure:
generated-commands/[command-name]/
├── [command-name].md    # Command file (ROOT)
├── README.md            # Installation guide (ROOT)
├── TEST_EXAMPLES.md     # Testing examples (ROOT)
└── [folders if needed]  # standards/, examples/, scripts/
  1. Validate Format:
  • ✅ YAML frontmatter valid
  • ✅ $ARGUMENTS syntax correct (if used)
  • ✅ allowed-tools format proper
  • ✅ Folder organization clean
  1. Provide Installation Instructions:
Your command is ready!

Output location: generated-commands/[command-name]/

To install:
1. Copy the command file:
   cp generated-commands/[command-name]/[command-name].md .claude/commands/

2. Restart Claude Code (if already running)

3. Test:
   /[command-name] [arguments]
收集答案后:
  1. 生成YAML前置内容
yaml
---
description: [来自命令用途]
argument-hint: [如果需要$ARGUMENTS]
allowed-tools: [来自工具选择]
model: [如果指定]
---
  1. 生成命令主体
markdown
[针对用途的具体指令]

[如果使用Agent]:

1. **启动[agent-name]**执行[特定任务]
2. 协调工作流
3. 验证结果

[如果使用bash]:

- 上下文:!`bash command`

[如果使用文件引用]:

- 审阅:@file.txt

成功标准:[基于输出类型]
  1. 创建文件夹结构
generated-commands/[command-name]/
├── [command-name].md    # 命令文件(根目录)
├── README.md            # 安装指南(根目录)
├── TEST_EXAMPLES.md     # 测试示例(根目录)
└── [必要时的文件夹]  # standards/, examples/, scripts/
  1. 验证格式
  • ✅ YAML前置内容有效
  • ✅ $ARGUMENTS语法正确(如果使用)
  • ✅ allowed-tools格式规范
  • ✅ 文件夹结构清晰
  1. 提供安装说明
你的命令已准备就绪!

输出位置:generated-commands/[command-name]/

安装步骤:
1. 复制命令文件:
   cp generated-commands/[command-name]/[command-name].md .claude/commands/

2. 重启Claude Code(如果已运行)

3. 测试:
   /[command-name] [arguments]

Plugin Command Invocation Format

插件命令调用格式

When commands are installed in a plugin (via
commands/
directory), users invoke them with the full namespace:
/plugin-name:command-name [arguments]
Installation LocationInvocation FormatExample
~/.claude/commands/
(user-level)
/command-name
/research-business
plugin/commands/
(plugin)
/plugin-name:command-name
/my-plugin:research-business
Shortcut rules:
  • Commands like
    /my-plugin:research-business
    can be invoked as
    /research-business
    if no naming conflicts exist
  • Exception: When
    command-name
    =
    plugin-name
    (e.g.,
    /foo:foo
    ), you must use the full format—typing
    /foo
    alone is interpreted as the plugin prefix, not the command

当命令安装在插件中(通过
commands/
目录),用户需要使用完整命名空间调用:
/plugin-name:command-name [arguments]
安装位置调用格式示例
~/.claude/commands/
(用户级)
/command-name
/research-business
plugin/commands/
(插件)
/plugin-name:command-name
/my-plugin:research-business
快捷规则
  • 类似
    /my-plugin:research-business
    的命令,如果没有命名冲突,可以简写为
    /research-business
  • 例外情况:当
    command-name
    =
    plugin-name
    时(如
    /foo:foo
    ),必须使用完整格式——仅输入
    /foo
    会被解释为插件前缀,而非命令

Preset Command Details

预设命令详情

1. /research-business

1. /research-business

Purpose: Comprehensive business and market research
Arguments:
$ARGUMENTS
(company or market to research)
YAML:
yaml
---
description: Comprehensive business and market research with competitor analysis
argument-hint: [company/market] [industry]
allowed-tools: Read, Bash, Grep
---
What it does:
  • Market size and trends analysis
  • Competitor SWOT analysis
  • Opportunity identification
  • Industry landscape overview
  • Strategic recommendations

用途:全面的商业与市场研究
参数
$ARGUMENTS
(要研究的公司或市场)
YAML
yaml
---
description: 包含竞争分析的全面商业与市场研究
argument-hint: [公司/市场] [行业]
allowed-tools: Read, Bash, Grep
---
功能
  • 市场规模与趋势分析
  • 竞争对手SWOT分析
  • 机会识别
  • 行业格局概述
  • 战略建议

2. /research-content

2. /research-content

Purpose: Multi-platform content trend analysis
Arguments:
$ARGUMENTS
(topic to research)
YAML:
yaml
---
description: Multi-platform content trend analysis for data-driven content strategy
argument-hint: [topic] [platforms]
allowed-tools: Read, Bash
---
What it does:
  • Analyze trends across Google, Reddit, YouTube, Medium, LinkedIn, X
  • User intent analysis (informational, commercial, transactional)
  • Content gap identification
  • SEO-optimized outline generation
  • Platform-specific publishing strategies

用途:多平台内容趋势分析
参数
$ARGUMENTS
(要研究的主题)
YAML
yaml
---
description: 用于数据驱动内容策略的多平台内容趋势分析
argument-hint: [主题] [平台]
allowed-tools: Read, Bash
---
功能
  • 分析Google、Reddit、YouTube、Medium、LinkedIn、X等平台的趋势
  • 用户意图分析(信息型、商业型、交易型)
  • 内容缺口识别
  • SEO优化大纲生成
  • 平台特定发布策略

3. /medical-translate

3. /medical-translate

Purpose: Translate medical terminology to patient-friendly language
Arguments:
$ARGUMENTS
(medical term and language)
YAML:
yaml
---
description: Translate medical terminology to 8th-10th grade reading level (German/English)
argument-hint: [medical-term] [de|en]
allowed-tools: Read
---
What it does:
  • Translate complex medical terms
  • Simplify to 8th-10th grade reading level
  • Validate with Flesch-Kincaid (EN) or Wiener Sachtextformel (DE)
  • Preserve clinical accuracy
  • Provide patient-friendly explanations

用途:将医学术语转换为患者易懂的语言
参数
$ARGUMENTS
(医学术语与语言)
YAML
yaml
---
description: 将医学术语转换为8-10年级阅读水平(德语/英语)
argument-hint: [医学术语] [de|en]
allowed-tools: Read
---
功能
  • 翻译复杂医学术语
  • 简化为8-10年级阅读水平
  • 使用Flesch-Kincaid(英语)或Wiener Sachtextformel(德语)验证
  • 保留临床准确性
  • 提供患者友好的解释

4. /compliance-audit

4. /compliance-audit

Purpose: Check code for regulatory compliance
Arguments:
$ARGUMENTS
(path and compliance standard)
YAML:
yaml
---
description: Audit code for HIPAA/GDPR/DSGVO compliance requirements
argument-hint: [code-path] [hipaa|gdpr|dsgvo|all]
allowed-tools: Read, Grep, Task
---
What it does:
  • Scan for PHI/PII handling
  • Check encryption requirements
  • Verify audit logging
  • Validate data subject rights
  • Generate compliance report

用途:检查代码是否符合法规要求
参数
$ARGUMENTS
(路径与合规标准)
YAML
yaml
---
description: 审计代码是否符合HIPAA/GDPR/DSGVO合规要求
argument-hint: [代码路径] [hipaa|gdpr|dsgvo|all]
allowed-tools: Read, Grep, Task
---
功能
  • 扫描PHI/PII处理情况
  • 检查加密要求
  • 验证审计日志
  • 确认数据主体权利
  • 生成合规报告

5. /api-build

5. /api-build

Purpose: Generate complete API integration code
Arguments:
$ARGUMENTS
(API name and endpoints)
YAML:
yaml
---
description: Generate complete API client with error handling and tests
argument-hint: [api-name] [endpoints]
allowed-tools: Read, Write, Edit, Bash, Task
---
What it does:
  • Generate API client classes
  • Add error handling and retries
  • Create authentication logic
  • Generate unit and integration tests
  • Add usage documentation

用途:生成完整的API集成代码
参数
$ARGUMENTS
(API名称与端点)
YAML
yaml
---
description: 生成包含错误处理与测试的完整API客户端
argument-hint: [api名称] [端点]
allowed-tools: Read, Write, Edit, Bash, Task
---
功能
  • 生成API客户端类
  • 添加错误处理与重试逻辑
  • 创建认证逻辑
  • 生成单元与集成测试
  • 添加使用文档

6. /test-auto

6. /test-auto

Purpose: Auto-generate comprehensive test suites
Arguments:
$ARGUMENTS
(file path and test type)
YAML:
yaml
---
description: Auto-generate comprehensive test suite with coverage analysis
argument-hint: [file-path] [unit|integration|e2e]
allowed-tools: Read, Write, Bash
---
What it does:
  • Analyze code to test
  • Generate test cases (happy path, edge cases, errors)
  • Add test fixtures and mocks
  • Calculate coverage
  • Provide testing documentation

用途:自动生成全面的测试套件
参数
$ARGUMENTS
(文件路径与测试类型)
YAML
yaml
---
description: 自动生成包含覆盖率分析的全面测试套件
argument-hint: [文件路径] [unit|integration|e2e]
allowed-tools: Read, Write, Bash
---
功能
  • 分析要测试的代码
  • 生成测试用例(正常路径、边缘情况、错误场景)
  • 添加测试夹具与模拟
  • 计算覆盖率
  • 提供测试文档

7. /docs-generate

7. /docs-generate

Purpose: Automated documentation generation
Arguments:
$ARGUMENTS
(code path and doc type)
YAML:
yaml
---
description: Auto-generate documentation from code (API docs, README, architecture)
argument-hint: [code-path] [api|readme|architecture|all]
allowed-tools: Read, Write, Grep
---
What it does:
  • Extract code structure and functions
  • Generate API documentation
  • Create README with usage examples
  • Build architecture diagrams (Mermaid)
  • Add code examples

用途:自动化文档生成
参数
$ARGUMENTS
(代码路径与文档类型)
YAML
yaml
---
description: 从代码自动生成文档(API文档、README、架构图)
argument-hint: [代码路径] [api|readme|architecture|all]
allowed-tools: Read, Write, Grep
---
功能
  • 提取代码结构与函数
  • 生成API文档
  • 创建包含使用示例的README
  • 构建架构图(Mermaid)
  • 添加代码示例

8. /knowledge-mine

8. /knowledge-mine

Purpose: Extract structured insights from documents
Arguments:
$ARGUMENTS
(document path and output format)
YAML:
yaml
---
description: Extract and structure knowledge from documents into actionable insights
argument-hint: [doc-path] [faq|summary|kb|all]
allowed-tools: Read, Grep
---
What it does:
  • Read and analyze documents
  • Extract key insights
  • Generate FAQs
  • Create knowledge base articles
  • Summarize findings

用途:从文档中提取结构化洞察
参数
$ARGUMENTS
(文档路径与输出格式)
YAML
yaml
---
description: 从文档中提取并结构化知识,转换为可执行的洞察
argument-hint: [文档路径] [faq|summary|kb|all]
allowed-tools: Read, Grep
---
功能
  • 读取并分析文档
  • 提取关键洞察
  • 生成FAQ
  • 创建知识库文章
  • 总结发现结果

9. /workflow-analyze

9. /workflow-analyze

Purpose: Analyze and optimize business workflows
Arguments:
$ARGUMENTS
(workflow description)
YAML:
yaml
---
description: Analyze workflows and provide optimization recommendations
argument-hint: [workflow-description]
allowed-tools: Read, Task
---
What it does:
  • Map current workflow
  • Identify bottlenecks
  • Suggest automation opportunities
  • Calculate efficiency gains
  • Create implementation roadmap

用途:分析并优化业务工作流
参数
$ARGUMENTS
(工作流描述)
YAML
yaml
---
description: 分析工作流并提供优化建议
argument-hint: [工作流描述]
allowed-tools: Read, Task
---
功能
  • 绘制当前工作流
  • 识别瓶颈
  • 建议自动化机会
  • 计算效率提升
  • 创建实施路线图

10. /batch-agents

10. /batch-agents

Purpose: Launch multiple coordinated agents
Arguments:
$ARGUMENTS
(agent names and task)
YAML:
yaml
---
description: Launch and coordinate multiple agents for complex tasks
argument-hint: [agent-names] [task-description]
allowed-tools: Task
---
What it does:
  • Parse agent list
  • Launch agents in parallel (if safe) or sequential
  • Coordinate outputs
  • Integrate results
  • Provide comprehensive summary

用途:启动多个协同工作的Agent
参数
$ARGUMENTS
(Agent名称与任务)
YAML
yaml
---
description: 启动并协调多个Agent完成复杂任务
argument-hint: [Agent名称] [任务描述]
allowed-tools: Task
---
功能
  • 解析Agent列表
  • 并行(如果安全)或顺序启动Agent
  • 协调输出
  • 整合结果
  • 提供全面总结

Output Structure

输出结构

Commands are generated in your project's root directory:
[your-project]/
└── generated-commands/
    └── [command-name]/
        ├── [command-name].md      # Command file (ROOT level)
        ├── README.md              # Installation guide (ROOT level)
        ├── TEST_EXAMPLES.md       # Testing guide (ROOT level - if applicable)
        ├── standards/             # Only if command has standards
        ├── examples/              # Only if command has examples
        └── scripts/               # Only if command has helper scripts
Organization Rules:
  • All .md files in ROOT directory
  • Supporting folders separate (standards/, examples/, scripts/)
  • No mixing of different types in same folder
  • Clean, hierarchical structure

命令将生成在你的项目根目录:
[你的项目]/
└── generated-commands/
    └── [command-name]/
        ├── [command-name].md      # 命令文件(根目录)
        ├── README.md              # 安装指南(根目录)
        ├── TEST_EXAMPLES.md       # 测试指南(根目录 - 如适用)
        ├── standards/             # 仅当命令有标准时存在
        ├── examples/              # 仅当命令有示例时存在
        └── scripts/               # 仅当命令有辅助脚本时存在
组织规则
  • 所有.md文件位于根目录
  • 支持文件夹单独存放(standards/、examples/、scripts/)
  • 同一文件夹中不混合不同类型的文件
  • 清晰的层级结构

Installation

安装步骤

After generation:
  1. Review output:
    bash
    ls generated-commands/[command-name]/
  2. Copy to Claude Code (when ready):
    bash
    # Project-level (this project only)
    cp generated-commands/[command-name]/[command-name].md .claude/commands/
    
    # User-level (all projects)
    cp generated-commands/[command-name]/[command-name].md ~/.claude/commands/
  3. Restart Claude Code (if running)
  4. Test command:
    bash
    /[command-name] [arguments]

生成命令后
  1. 查看输出
    bash
    ls generated-commands/[command-name]/
  2. 复制到Claude Code(准备就绪后):
    bash
    # 项目级(仅当前项目)
    cp generated-commands/[command-name]/[command-name].md .claude/commands/
    
    # 用户级(所有项目)
    cp generated-commands/[command-name]/[command-name].md ~/.claude/commands/
  3. 重启Claude Code(如果已运行)
  4. 测试命令
    bash
    /[command-name] [arguments]

Usage Examples

使用示例

Generate a Preset Command

生成预设命令

@slash-command-factory

Use the /research-business preset
Output: Complete business research command ready to install

@slash-command-factory

使用/research-business预设
输出:可直接安装的完整商业研究命令

Generate a Custom Command

生成自定义命令

@slash-command-factory

Create a custom command for analyzing customer feedback and generating product insights
Skill asks 5-7 questionsGenerates complete commandValidates formatProvides installation steps

@slash-command-factory

创建一个用于分析客户反馈并生成产品洞察的自定义命令
技能会提出5-7个问题生成完整命令验证格式提供安装步骤

Command Format (What Gets Generated)

生成的命令格式示例

Example generated command (
my-command.md
):
markdown
---
description: Brief description of what the command does
argument-hint: [arg1] [arg2]
allowed-tools: Read, Write, Bash
model: claude-3-5-sonnet-20241022
---
生成的命令示例
my-command.md
):
markdown
---
description: 命令功能的简要描述
argument-hint: [arg1] [arg2]
allowed-tools: Read, Write, Bash
model: claude-3-5-sonnet-20241022
---

Command Instructions

命令指令

Do [task] with "$ARGUMENTS":
  1. Step 1: First action
  2. Step 2: Second action
  3. Step 3: Generate output
Success Criteria:
  • Criterion 1
  • Criterion 2
  • Criterion 3

---
使用"$ARGUMENTS"执行[任务]:
  1. 步骤1:第一个操作
  2. 步骤2:第二个操作
  3. 步骤3:生成输出
成功标准
  • 标准1
  • 标准2
  • 标准3

---

Validation

验证规则

Every generated command is automatically validated for:
  • ✅ Valid YAML frontmatter (proper syntax, required fields)
  • ✅ Correct argument format ($ARGUMENTS, not $1 $2 $3)
  • Short forms for all flags (mandatory 1-2 letter shortcuts)
  • argument-hint includes both forms (
    [-b|--branch]
    )
  • Bash subcommand-level specificity (no
    Bash(git:*)
    , use
    Bash(git add:*)
    )
  • ✅ allowed-tools syntax (comma-separated string)
  • ✅ Clean folder organization (if folders used)
  • ✅ No placeholder text
If validation fails, you'll get specific fix instructions.

每个生成的命令都会自动验证以下内容:
  • ✅ YAML前置内容有效(语法正确、包含必填字段)
  • ✅ 参数格式正确(使用$ARGUMENTS,而非$1 $2 $3)
  • 所有标记都有简写形式(强制要求1-2个字母的快捷方式)
  • argument-hint包含
    [-b|--branch]
    格式
  • Bash使用子命令级别的权限(不使用
    Bash(git:*)
    ,而使用
    Bash(git add:*)
  • ✅ allowed-tools语法正确(逗号分隔的字符串)
  • ✅ 文件夹结构清晰(如果使用文件夹)
  • ✅ 无占位符文本
如果验证失败,你将收到具体的修复说明。

Best Practices

最佳实践

For Command Design:
  • Keep commands focused (one clear purpose)
  • Use descriptive names (kebab-case for files)
  • Document expected arguments clearly
  • Include success criteria
  • Add examples in TEST_EXAMPLES.md
For Tool Selection:
  • Read: For analyzing files
  • Write/Edit: For generating/modifying files
  • Bash: For system commands, web research
  • Task: For launching agents
  • Grep/Glob: For searching code
For Agent Integration:
  • Use Task tool to launch agents
  • Specify which agents clearly
  • Coordinate outputs
  • Document agent roles

命令设计
  • 保持命令聚焦(一个清晰的用途)
  • 使用描述性名称(文件使用kebab-case)
  • 清晰记录预期参数
  • 包含成功标准
  • 在TEST_EXAMPLES.md中添加示例
工具选择
  • Read:用于分析文件
  • Write/Edit:用于生成/修改文件
  • Bash:用于系统命令、网络研究
  • Task:用于启动Agent
  • Grep/Glob:用于搜索代码
Agent集成
  • 使用Task工具启动Agent
  • 明确指定要启动的Agent
  • 协调输出
  • 记录Agent角色

Important Notes

重要注意事项

Arguments:
  • ✅ Always use
    $ARGUMENTS
    (all arguments as one string)
  • ❌ Never use
    $1
    ,
    $2
    ,
    $3
    (positional - not used by this factory)
Folder Organization:
  • ✅ All .md files in command root directory
  • ✅ Supporting folders separate (standards/, examples/, scripts/)
  • ✅ No mixing of different types
Output Location:
  • Commands generate to:
    ./generated-commands/[command-name]/
  • User copies to:
    .claude/commands/[command-name].md
    (when ready)

参数
  • ✅ 始终使用
    $ARGUMENTS
    (所有参数作为单个字符串)
  • ❌ 永远不要使用
    $1
    $2
    $3
    (位置参数 - 本工厂不支持)
文件夹组织
  • ✅ 所有.md文件位于命令根目录
  • ✅ 支持文件夹单独存放(standards/、examples/、scripts/)
  • ✅ 不混合不同类型的文件
输出位置
  • 命令生成到:
    ./generated-commands/[command-name]/
  • 用户将其复制到:
    .claude/commands/[command-name].md
    (准备就绪后)

Example Invocations

调用示例

Use a Preset

使用预设命令

@slash-command-factory

Generate the /research-content preset command
→ Creates content research command with all features

@slash-command-factory

生成/research-content预设命令
→ 创建包含所有功能的内容研究命令

Create Custom Healthcare Command

创建自定义医疗命令

@slash-command-factory

Create a command that generates German PTV 10 therapy applications
Skill asks:
  • Purpose? (Generate PTV 10 applications)
  • Tools? (Read, Write, Task)
  • Agents? (Yes - health-sdk-builder related agents)
  • Output? (Files - therapy application documents)
  • Model? (Sonnet - for quality)
Result:
/generate-ptv10
command ready to use

@slash-command-factory

创建一个生成德国PTV 10治疗申请的命令
技能会询问
  • 用途?(生成PTV 10治疗申请)
  • 工具?(Read, Write, Task)
  • Agent?(是 - 与health-sdk-builder相关的Agent)
  • 输出?(文件 - 治疗申请文档)
  • 模型?(Sonnet - 保证质量)
结果:可直接使用的
/generate-ptv10
命令

Create Business Intelligence Command

创建商业智能命令

@slash-command-factory

Build a command for competitive SWOT analysis
Skill asks 5-7 questionsGenerates
/swot-analysis
command
ValidatesReady to install

@slash-command-factory

构建一个用于竞争对手SWOT分析的命令
技能会提出5-7个问题生成
/swot-analysis
命令
验证格式可安装使用

Integration with Factory Agents

与Factory Agent的集成

Works with:
  • factory-guide (can delegate to this skill via prompts-guide pattern)
  • Existing slash commands (/build, /validate-output, etc.)
Complements:
  • skills-guide (builds Skills)
  • prompts-guide (builds Prompts)
  • agents-guide (builds Agents)
  • slash-command-factory (builds Commands) ← This skill
Complete ecosystem for building all Claude Code augmentations!

兼容的Agent
  • factory-guide(可通过prompts-guide模式委托给本技能)
  • 现有斜杠命令(/build、/validate-output等)
互补工具
  • skills-guide(构建Skill)
  • prompts-guide(构建Prompt)
  • agents-guide(构建Agent)
  • slash-command-factory(构建命令)← 本技能
完整的生态系统,用于构建所有Claude Code增强功能!

Output Validation

输出验证

Generated commands are validated for:
YAML Frontmatter:
  • Has
    description
    field
  • Proper YAML syntax
  • Valid frontmatter fields only
Arguments:
  • Uses $ARGUMENTS if needed
  • Has argument-hint if $ARGUMENTS used
  • No $1, $2, $3 positional args
  • All flags have short forms (1-2 letters)
  • argument-hint shows
    [-short|--long]
    format
Tools:
  • Valid tool names
  • Proper comma-separated format
  • Appropriate for command purpose
  • Bash uses subcommand-level for git/gh/npm (not
    Bash(git:*)
    )
  • No blanket
    Bash
    permission
Organization:
  • .md files in root
  • Folders properly separated
  • No scattered files

生成的命令会验证以下内容:
YAML前置内容
  • 包含
    description
    字段
  • YAML语法正确
  • 仅包含有效的前置内容字段
参数
  • 必要时使用$ARGUMENTS
  • 如果使用$ARGUMENTS,则包含argument-hint
  • 无$1、$2、$3位置参数
  • 所有标记都有简写形式(1-2个字母)
  • argument-hint显示
    [-short|--long]
    格式
工具
  • 工具名称有效
  • 格式为逗号分隔的字符串
  • 工具与命令用途匹配
  • 对于git/gh/npm等命令,Bash使用子命令级别的权限(而非
    Bash(git:*)
  • 无全面的Bash权限(单独的
    Bash
    是被禁止的)
组织结构
  • .md文件位于根目录
  • 文件夹结构清晰
  • 无分散的文件

Success Criteria

成功标准

Generated commands should:
  • ✅ Have valid YAML frontmatter
  • ✅ Use $ARGUMENTS (never positional)
  • All flags have short forms (1-2 letters, e.g.,
    -b|--branch
    )
  • argument-hint shows both forms (
    [-b|--branch]
    )
  • Bash uses subcommand-level specificity for commands with subcommands
    • Bash(git:*)
      - too broad
    • Bash(git add:*)
      ,
      Bash(git commit:*)
      - correct
  • No blanket Bash permission (
    Bash
    alone is prohibited)
  • ✅ Work when copied to .claude/commands/
  • ✅ Execute correctly with arguments
  • ✅ Produce expected output
  • ✅ Follow organizational standards

Build powerful custom slash commands in minutes!

生成的命令应满足:
  • ✅ 具有有效的YAML前置内容
  • ✅ 使用$ARGUMENTS(永远不使用位置参数)
  • 所有标记都有简写形式(1-2个字母,如
    -b|--branch
  • argument-hint显示两种形式
    [-b|--branch]
  • Bash对带有子命令的命令使用子命令级别的权限
    • Bash(git:*)
      - 过于宽泛
    • Bash(git add:*)
      Bash(git commit:*)
      - 正确
  • 无全面的Bash权限(单独的
    Bash
    被禁止)
  • ✅ 复制到.claude/commands/后可正常工作
  • ✅ 带参数可正确执行
  • ✅ 生成预期输出
  • ✅ 遵循组织标准

几分钟内构建强大的自定义斜杠命令!

Troubleshooting

故障排除

IssueCauseSolution
Command not foundNot installed to commands dirCopy .md file to ~/.claude/commands/ or .claude/
YAML syntax errorInvalid frontmatterValidate YAML with
yq
or online validator
$ARGUMENTS not expandingUsing $1 $2 insteadUse $ARGUMENTS for all arguments as single string
Bash permission deniedUsing blanket BashSpecify subcommand-level: Bash(git add:*)
Command too verboseName exceeds 4 wordsShorten to 2-4 word kebab-case name
Agent not launchingTask tool not in allowed-toolsAdd Task to allowed-tools for agent commands
Validation fails on flagsMissing short formsAdd 1-2 letter shortcuts for all flags
Output not generatedMissing Write in allowed-toolsAdd Write tool for file-generating commands
问题原因解决方案
命令未找到未安装到commands目录将.md文件复制到~/.claude/commands/或.claude/
YAML语法错误前置内容无效使用
yq
或在线验证工具验证YAML
$ARGUMENTS未展开使用了$1 $2而非$ARGUMENTS对所有参数使用$ARGUMENTS作为单个字符串
Bash权限被拒绝使用了全面的Bash权限指定子命令级别的权限:Bash(git add:*)
命令名称过于冗长名称超过4个单词缩短为2-4个单词的kebab-case名称
Agent未启动allowed-tools中没有Task工具为Agent命令添加Task到allowed-tools
标记验证失败缺少简写形式为所有标记添加1-2个字母的快捷方式
未生成输出allowed-tools中缺少Write为生成文件的命令添加Write工具