跳转到主要内容

定制 Slash 命令

9.1 命令文件格式和存放位置

命令文件就是 Markdown 文件,其内容会作为 prompt 注入给 AI。

9.2 使用 /create-command 生成命令

AI 会询问:
  1. 命令名称
  2. 命令目的
  3. 需要读取的文件
  4. 执行步骤
然后自动生成双 IDE 命令文件。

9.3 命令设计最佳实践

好的命令结构

Step 2: Analyze [AI]

Describe what to analyze…

Step 3: Report

Output format…

Step 2: Verify [AI]

Check these items:
  • All tests pass
  • No TODO comments in production code
  • Environment variables are set
  • Database migrations are up to date
  • API endpoints are documented

Step 3: Report

Output a deployment readiness report.