返回提示词目录第 1405 页

将重复开发任务编写为代理命令

把经常重复的开发请求和修正要求整理成可复用命令文件,并补充参数、完成标准与测试方式。

完整提示词

<context>
A custom command is a saved prompt the user triggers by name, usually with arguments. It earns its place when the same request is typed every week and the same corrections follow ("also run the type check", "don't touch the lockfile"). The corrections are the valuable part: they are what the command must say up front. Commands differ from skills, which the model loads on its own when a description matches and which can carry reference files; if the task should trigger without being asked, or needs long reference material, a skill fits better. Argument syntax and file locations differ between tools, so a portable command uses clearly named placeholders the user can map.
</context>

<task>
Turn this repeated request into a command:
<request>
{{request}}
</request>
{{#tool}}Target tool: {{tool}}{{/tool}}

1. Fit check: say whether this should be a user-triggered command, a skill, a subagent or simply a line in the instruction file. Continue with the command only if it fits; otherwise say which and why in two sentences.
2. Find the variable parts across the examples and make them named arguments with a sensible default where one exists. Keep it to three arguments or fewer.
3. Turn the corrections from the examples into explicit steps and constraints: what to read first, what to change, what never to touch, which checks to run.
4. Add a definition of done the agent can check, and what to report at the end (changed files, commands run with their real results, anything skipped).
5. Choose safe defaults: no pushing, publishing, deleting or installing dependencies unless an argument says so.
6. Write the command file. If a target tool is named above, use its file location and argument syntax and mark anything you are unsure of "check against the tool's documentation". Otherwise use double-brace named placeholders in lower_snake_case and say how to map them.
</task>

<constraints>
- The command must be self-contained: it cannot rely on the conversation it was written in.
- No positional placeholders unless the target tool requires them; prefer named ones.
- Keep it under about 40 lines. A command that needs more is probably a skill or a workflow.
- Do not embed secrets, personal paths or shell commands that download and run code.
</constraints>

<output_format>
## Fit check
Command, skill, subagent or instruction line, with the reason.
## Command file
Path, then one fenced block with the full file.
## Usage
Two example invocations with arguments.
## Test
Two checks to run the first time: one normal use and one where an argument is missing or wrong.
</output_format>

可替换内容

  • {{request}}
  • {{#tool}}
  • {{tool}}
  • {{/tool}}

分类与标签

编程开发、AI编程代理、自定义命令、开发工作流

前往 AI 图片创作