简介
创建 Claude Code 斜杠命令的向导工具,通过结构化工作流将重复性任务封装为可复用的 markdown 工作流命令。
原始描述
WHAT: Create Claude Code slash commands - reusable markdown workflows invoked with /command-name. WHEN: User wants to create, make, or add a slash command. U...
通过你的 Agent 添加
安装目录:command-creator/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。
点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。
或者手动安装
包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可;
目录名不用换,也不要把包直接解压到 skills 根目录。
技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。
中文使用说明 来自收录源
核心用法
doro-command-creator 是专为 Claude Code 设计的斜杠命令创建工具,将用户的手动操作流程自动化封装为可复用的 /command-name 指令。使用时只需描述"创建一个命令"或"把这个流程自动化",即可启动六步结构化向导:确定存储位置(项目级 .claude/commands/ 或全局 ~/.claude/commands/)→ 匹配四种核心模式(工作流自动化、迭代修复、代理委托、简单执行)→ 收集命名、参数、步骤、约束等元信息 → 基于最佳实践生成命令文件 → 创建文件并报告用法 → 可选测试迭代。
显著优点
- 标准化封装:强制遵循 kebab-case 命名、命令式语气、明确成功标准等规范,避免"野生命令"的质量参差
- 模式化思维:预置四种经过验证的命令模式,大幅降低设计决策成本
- 渐进式细化:分步骤信息收集避免一次性信息过载,适合复杂工作流的渐进澄清
- 可迁移性强:生成的 markdown 命令文件纯文本存储,可在项目间、团队间直接共享
潜在局限
- Claude Code 生态绑定:命令格式仅适用于 Claude Code 环境,无法直接迁移至其他 AI 编程工具
- 无版本控制集成:未内建命令版本管理或冲突解决机制,多人协作可能出现覆盖
- 测试覆盖率依赖用户:Step 6 测试为可选环节,缺乏强制验证可能导致缺陷命令入库
- 模式固化风险:四种预设模式虽覆盖常见场景,但可能限制用户对非标准流程的表达
适合人群
- 高频使用 Claude Code 的开发者,需将重复诊断、构建、部署流程固化
- 团队技术负责人,希望统一项目内常用操作的标准执行方式
- 追求"基础设施即代码"理念的工程师,倾向于将操作流程文档化、可版本化
常规风险
风险点
说明
权限扩散
全局命令对所有项目生效,含敏感操作的命令需谨慎评估作用域
命令膨胀
过度拆分导致命令数量激增,反而增加认知负担
隐性依赖
命令内部调用的外部工具(如 make、npm)若未安装会导致失败
维护滞后
底层工具链升级后,命令逻辑若未及时更新可能产生破坏性变更
- Claude Code 生态绑定:命令格式仅适用于 Claude Code 环境,无法直接迁移至其他 AI 编程工具
- 无版本控制集成:未内建命令版本管理或冲突解决机制,多人协作可能出现覆盖
- 测试覆盖率依赖用户:Step 6 测试为可选环节,缺乏强制验证可能导致缺陷命令入库
- 模式固化风险:四种预设模式虽覆盖常见场景,但可能限制用户对非标准流程的表达
适合人群
- 高频使用 Claude Code 的开发者,需将重复诊断、构建、部署流程固化
- 团队技术负责人,希望统一项目内常用操作的标准执行方式
- 追求"基础设施即代码"理念的工程师,倾向于将操作流程文档化、可版本化
常规风险
风险点
说明
权限扩散
全局命令对所有项目生效,含敏感操作的命令需谨慎评估作用域
命令膨胀
过度拆分导致命令数量激增,反而增加认知负担
隐性依赖
命令内部调用的外部工具(如 make、npm)若未安装会导致失败
维护滞后
底层工具链升级后,命令逻辑若未及时更新可能产生破坏性变更
| 风险点 | 说明 |
|---|---|
| 权限扩散 | 全局命令对所有项目生效,含敏感操作的命令需谨慎评估作用域 |
| 命令膨胀 | 过度拆分导致命令数量激增,反而增加认知负担 |
| 隐性依赖 | 命令内部调用的外部工具(如 make、npm)若未安装会导致失败 |
| 维护滞后 | 底层工具链升级后,命令逻辑若未及时更新可能产生破坏性变更 |
来源可信度标注为 T1(官方/一级来源),因该技能直接来自 Claude Code 官方技能库,结构规范、文档完整,且与产品特性深度绑定。
技能正文
name: command-creator model: fast description: | WHAT: Create Claude Code slash commands - reusable markdown workflows invoked with /command-name.
WHEN: User wants to create, make, or add a slash command. User wants to automate a repetitive workflow or document a consistent process for reuse.
KEYWORDS: "create a command", "make a slash command", "add a command", "new command", "/command", "automate this workflow", "make this repeatable"
Command Creator
Slash commands are markdown files in .claude/commands/ (project) or ~/.claude/commands/ (global) that expand into prompts when invoked.
Command Structure
---
description: Brief description for /help (required)
argument-hint: <required> or [optional] (if takes arguments)
---
# Command Title
[Instructions for agent to execute autonomously]
Creation Workflow
Step 1: Determine Location
- Check if in git repo:
git rev-parse --is-inside-work-tree
- Default: Git repo →
.claude/commands/, No git → ~/.claude/commands/
- Override if user explicitly says "global" or "project"
---
description: Brief description for /help (required)
argument-hint: <required> or [optional] (if takes arguments)
---
# Command Title
[Instructions for agent to execute autonomously]
Step 1: Determine Location
git rev-parse --is-inside-work-tree.claude/commands/, No git → ~/.claude/commands/Report chosen location before proceeding.
Step 2: Identify Pattern
Load references/patterns.md and present options:
| Pattern | Structure | Use When |
|---|---|---|
| Workflow Automation | Analyze → Act → Report | Multi-step with clear sequence |
| Iterative Fixing | Run → Parse → Fix → Repeat | Fix issues until passing |
| Agent Delegation | Context → Delegate → Iterate | Complex tasks, user review |
| Simple Execution | Parse → Execute → Return | Wrapper for existing tools |
Ask: "Which pattern is closest to what you want?"
Step 3: Gather Information
A. Name and Purpose
- "What should the command be called?" (kebab-case:
my-command) - "What does it do?" (for description field)
B. Arguments
- "Does it take arguments? Required or optional?"
- Required:
<placeholder>, Optional:[placeholder]
C. Workflow Steps
- "What specific steps should it follow?"
- "What tools or commands should it use?"
D. Constraints
- "Any specific tools to use or avoid?"
- "Any files to read for context?"
Step 4: Generate Command
Load references/best-practices.md for:
- Template structure
- Writing style (imperative form)
- Quality checklist
Key principles:
- Use imperative form: "Run X", not "You should run X"
- Be explicit: "Run
make lint", not "Check for errors" - Include expected outcomes
- Define error handling
- State success criteria
Step 5: Create File
mkdir -p [directory-path]
mkdir -p [directory-path]
Write the command file. Report:
- File location
- What the command does
- How to use:
/command-name [args]
Step 6: Test (Optional)
Suggest: "Test with /command-name [args]"
Iterate based on feedback.
Writing Guidelines
Imperative form (verb-first):
- ✅ "Run git status"
- ❌ "You should run git status"
Specific, not vague:
- ✅ "Run
make lintto check for errors" - ❌ "Check for errors"
Include outcomes:
- ✅ "Run
git status- should show modified files" - ❌ "Run git status"
Realistic examples:
- ✅
git commit -m "Add OAuth2 authentication" - ❌
git commit -m "foo bar"
Command Patterns Quick Reference
Workflow Automation
1. Check for .PLAN.md
2. Analyze git status/diff
3. Perform actions
4. Report results
Iterative Fixing
1. Run make all-ci (max 10 iterations)
2. Parse errors by category
3. Apply targeted fixes
4. Repeat until success or stuck
Agent Delegation
1. Present context
2. Invoke subagent with Task tool
3. Iterate with user feedback
4. Save output after approval
1. Run make all-ci (max 10 iterations)
2. Parse errors by category
3. Apply targeted fixes
4. Repeat until success or stuck
1. Present context
2. Invoke subagent with Task tool
3. Iterate with user feedback
4. Save output after approval
See references/examples.md for full command examples.
Quality Checklist
Before finalizing:
- Name is kebab-case (
my-command, notmy_command) - Description is action-oriented
- Steps are numbered and specific
- Tool usage explicitly specified
- Error handling defined
- Success criteria stated
- Uses imperative form
NEVER
- Use underscores in command names (use hyphens)
- Write vague instructions ("fix errors")
- Skip error handling
- Use second person ("You should...")
- Create commands without testing
- Leave success criteria undefined
正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。