定制 Slash 命令
9.1 命令文件格式和存放位置
| 平台 | 位置 | 命名规则 |
|---|---|---|
| Claude Code | .claude/commands/trellis/{name}.md | 调用方式: /{name} |
| Cursor | .cursor/commands/{name}.md | 调用方式: /{name} |
9.2 使用 /create-command 生成命令
- 命令名称
- 命令目的
- 需要读取的文件
- 执行步骤
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