一键导入
better-goal
为任意 coding agent 编写高质量任务目标的指南。当用户提到「设定目标」「goal」「任务目标」「持久目标」「完成标准」、或需要为复杂多轮任务(性能优化、调试、迁移、研究复现等)定义可验证的完成条件和约束时触发。
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
为任意 coding agent 编写高质量任务目标的指南。当用户提到「设定目标」「goal」「任务目标」「持久目标」「完成标准」、或需要为复杂多轮任务(性能优化、调试、迁移、研究复现等)定义可验证的完成条件和约束时触发。
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Reviews code diffs, PRs, issue queues, release readiness, commits, pushes, publishing, and project audits. Use when users ask in any language for code review, issue or PR triage, release gates, publishing follow-through, or project audits. Not for debugging root causes or prose review.
Produces distinctive, production-grade UI for pages, components, visual interfaces, typography, and screenshot-driven polish. Use when users ask in any language for UI, page, component, frontend, typography, screenshot-grounded visual polish, or complaints that a screen looks unclear, ugly, inconsistent, or visually wrong. Not for backend logic or data pipelines.
Use when the user requests diagrams, flowcharts, architecture diagrams, ER diagrams, UML / sequence / class diagrams, network topology, ML/DL model figures (Transformer/CNN/LSTM), mind maps, or any visualization. Also use proactively when explaining systems with 3+ components, complex data flows, or relationships that benefit from visual representation. Best suited when the diagram needs custom styling, rich shape vocabulary, swimlanes, or exportable images (PNG/SVG/PDF/JPG). Generates .drawio XML and exports locally via the native draw.io desktop CLI.
Runs a budget-aware agent-assisted engineering health audit for instruction/config drift, hooks/MCP, verifier surfaces, and AI maintainability. Use when users ask in any language to audit Claude, Codex, Pi, agent instructions, MCP or hooks, verifier coverage, or AI-maintainability drift. Not for debugging application code or reviewing PRs.
Finds root cause before applying fixes for errors, crashes, regressions, failing tests, broken behavior, and screenshot-reported defects. Use when users report in any language errors, crashes, broken behavior, regressions, failing tests, screenshot evidence, or something that used to work and now fails. Not for code review or new features.
Runs a six-phase research workflow that turns unfamiliar domains, source bundles, or collected material into publish-ready output. Use when users ask in any language to research, study, deep-dive, compile sources, synthesize unfamiliar material, or turn a source bundle into a coherent reference. Not for quick lookups or single-file reads.
| name | better-goal |
| description | 为任意 coding agent 编写高质量任务目标的指南。当用户提到「设定目标」「goal」「任务目标」「持久目标」「完成标准」、或需要为复杂多轮任务(性能优化、调试、迁移、研究复现等)定义可验证的完成条件和约束时触发。 |
| version | 1.2.0 |
| source | https://developers.openai.com/cookbook/examples/codex/using_goals_in_codex |
| metadata | {"hermes":{"tags":["goal","prompt-engineering","agent","中文"],"related_skills":["writing-plans","code-review"]}} |
Goal 不是 prompt。Goal 是验收契约。
以前我们写 prompt,告诉模型「做什么」就够了。现在 agent 能干活了,要求更高——你得告诉它「做完了怎么验证」「什么情况下停」「边界在哪里」。没有验收标准的 goal 就是猜谜游戏;没有暂停条件的 goal 会让 agent 在死循环里烧 token。
一个好的任务目标让 agent 在多轮探索中持续朝着既定结果工作,证据达标时停止,遇到决策点时暂停等人工判断。
| 一次性任务 | 持久目标 | |
|---|---|---|
| 模式 | 请求 → 工作 → 结果 → 等待 | 工作 → 检查 → 继续或完成 |
| 适用 | 单次明确任务 | 路径不确定的多轮探索任务 |
| 完成 | 任务执行完毕 | 证据验证目标达成 |
应该用: 性能优化、flaky test 排查、依赖迁移、需要复现的 bug 调查、多步重构、基准驱动调优、需要产出最终产物的研究任务。
不要用: 单行修改、简短解释、代码审查、一次性问答。标语式目标(「让代码更好」「重构一下」)也不适合。
适用条件:持久目标 + 可验证的完成线 + 需多轮探索的路径。
/goal [期望结果]
Verification: [用什么证明完成了]
Constraints: [不能改什么 / 不能退化什么]
Boundaries: [允许写哪里 / 禁止碰哪里]
Iteration policy: [每次改多少,改完跑什么检查,如何选下一步]
Stop when: [证据证明完成]
Pause if: [什么情况下暂停等人工决策]
Stop when 和 Pause if 的区别:Stop when 是正向的完成信号(测试全绿、benchmark 达标),Pause if 是需要人介入的决策点(发现两种方案各有利弊、需要确认是否接受 trade-off、外部依赖阻塞需人类操作)。不要一遇到困难就宣告完成——该暂停时暂停,该完成时完成,该报告阻塞时报告阻塞。
弱:/goal Improve performance
强:
/goal Reduce p95 checkout latency below 120 ms
Verification: checkout benchmark 报告 p95 低于 120ms,且 correctness suite 全绿
Constraints: 不退化 correctness suite 任何测试,不修改公开 API
Boundaries: 仅修改 checkout service、benchmark fixtures 和相关测试
Iteration policy: 每次迭代记录改了什么、benchmark 结果、下一最佳实验方向
Stop when: p95 连续 3 次 benchmark 低于 120ms 且 correctness suite 全绿
Pause if: benchmark 无法运行、或连续 5 次实验无改善、或需要动到公开 API
关键差异:强目标命名了结果(<120ms)、验证方式(benchmark)、约束(correctness suite、API)、完成信号(连续3次达标)和暂停点(5次无改善)。即使延迟从 180ms 降到 135ms,目标仍未完成;延迟达标但测试失败,目标也未完成;连续无改善时暂停而非盲目继续。
弱:/goal Reproduce Buehler et al., "Deep Hedging"
强:
/goal Produce the strongest evidence-backed reproduction of Buehler et al., "Deep Hedging"
Verification: 产出分级报告——confirmed(精确复现)/ approximate(近似结果)/ blocked(阻塞项)/ uncertain(不确定项)四层分类
Constraints: 仅使用论文公开材料和本地资源,不做未经证实的结论宣称
Boundaries: 允许使用论文材料、公开数据集、本地计算资源
Iteration policy: 逐一尝试每个 headline 结果,验证输出,记录证据等级
Stop when: 所有 headline 结果分类完毕,报告覆盖四层分级
Pause if: 关键数据不可获取、计算资源不足跑完整实验、论文方法有歧义需判断
关键差异:强目标定义了证据标准(四层分级),防止「看似可行」的产物变成过度宣称的结论。
当你不确定怎么写 goal 时,最有用的技巧是让 AI 反向访谈你——你只知道要做什么,AI 帮你把验收标准、边界条件、暂停规则全部问出来。
Step 1:提交模糊任务,让 AI 反问
/plan Help me turn this vague task into a strong coding agent goal.
Interview me for missing success criteria, verification commands,
constraints, boundaries, iteration policy, stop conditions, and pause
triggers. Then draft a final /goal ... command.
或者中文版:
/plan 帮我把这个模糊任务转成高质量的 coding agent 目标。
请反问我:验收标准是什么、用什么命令验证、有什么约束不能碰、
边界在哪、迭代策略、什么证据算完成、什么情况要暂停等人。
最后生成一份完整的 /goal 命令。
Step 2:回答 AI 的反问
AI 会逐一追问:
Step 3:审查生成的 goal
检查收紧张力:成功条件是否可测量?暂停条件是否覆盖常见卡点?边界是否清晰?然后复制执行。
这就是 Agent 时代的工程规范——需求不再是「你猜我要什么」,而是「我们一起把验收契约写清楚」。