让 Codex 先研究再自设可验证目标
先完成需求梳理与研究,再调用 set_goal 形成可验证目标,以缩小搜索空间并提升执行效率。
原始内容
codex tip: just ask codex to set its own goal when you set a goal with /goal codex takes the prompt verbatim and sets it as a goal however by asking codex to do the necessary research (via prompt or subagents) and set_goal, you help it by: - reducing the search space of the problem - helping it come up with a way to verify the goal rule of thumb: if codex can verify a goal it’ll likely be more token efficient and faster at solving the problem
codex tip: ask codex to do its research first and then use set_goal to set an appropriate goal instead of /goal It results in massively better prompt and downstream results! all my prompts would start with requirements gathering and research and once done set_goal
中文译文
机器翻译,保留原文供核对。
codex 提示:直接让 codex 自己设定目标 当你用 /goal 设定目标时,codex 会原样接收提示词,并把它设为目标 但如果你让 codex 先做必要的研究(通过提示词或子智能体),再调用 set_goal,你其实是在帮它: - 缩小问题的搜索空间 - 帮它想出一种验证目标的方法 经验法则:如果 codex 能验证一个目标,它解决这个问题时大概率会更省 token、也更快
codex 提示:让 codex 先自己做研究,然后用 set_goal 设定一个合适的目标,而不是用 /goal 这会带来好得多的提示词和下游结果! 我的所有提示词都会以需求收集和研究开头,完成之后再 set_goal
深度解析
是什么
这是一条关于 Agent 工作流的实践建议:不要直接把用户原话交给 /goal,而是让 Codex 先完成需求梳理和必要研究,再根据已有信息调用 set_goal,生成更精确、可验证的目标。
核心设计 它把任务拆成“探索—收敛—执行—验证”链路。前置研究负责识别约束、缩小候选方案与搜索空间;目标设定负责把开放式请求转换成明确的完成条件;可验证性则帮助 Agent 选择检查方式,减少无效推理和反复尝试。
关键洞察 目标不是越早写下越好,而应在上下文足够后形成。让 Agent 自己设定目标,相当于把研究结果压缩成执行计划,可能同时改善提示词质量、Token 消耗和完成速度,对复杂任务尤其适合。
边界与风险 这不是自动保证正确性的技巧。Agent 的研究可能遗漏关键约束,或设定出看似可验证但偏离真实意图的目标,因此仍需人工确认范围、成功标准和禁止事项。简单且目标清晰的任务直接执行更省步骤。
精选追评与案例
给出了三种可复用的实操模式:文件路径式 goal、强模型评审、定时任务跟踪进度。
yep!! sharing a few patterns i have been using with goal: ``` 1) you can give a file path as input to goal. i found it's helpful to have a structured goal with explicit plan-implement-verificaiton steps etc. that you can review/edit easily. i use a `create-goal-plan` skill to brainstorm a bit to define structure to the goal (like ralph loop has): https://t.co/NgNbqf04Xd earlier i used to invoke it by `/goal <path>` (the skill emits it for easy copy paste), but after seeing @reach_vb's tweets about existence of set_goal and the awareness of it being baked in the context, i started using by just asking "plan looks good, set it as goal and implement" (not sure if the file path input is counterproductive for reasons not visible to me) 2) use a powerful reviewer like 5.6-sol-pro or fable. you can leverage @steipete's oracle cli to have a more powerful model like 5.6-sol-pro (via chatgpt browser use) as a reviewer at relevant milstones towards achieving the goal. i started using this via a dedicated `create-oracle-review-powered-goal-plan` skill: https://t.co/pj8blOiNYw here's my fable advisor skill that can be easily composed with other skills mentioned above: https://t.co/XI8LW3gpJ7 3) you can have a recuring scheduled task in codex observe all goal tasks/threads' progress and summarize progress for you and/or nudge them if blocked. the inter-thread context/messaging is one of the best features of codex! thanks for preaching about it!! ``` loving the codex harness :) so many underrated details that are making it a super app/OS!
中文译文 · 机器翻译
对!!分享几个我一直在用的 goal 模式: ``` 1) you can give a file path as input to goal. i found it's helpful to have a structured goal with explicit plan-implement-verificaiton steps etc. that you can review/edit easily. i use a `create-goal-plan` skill to brainstorm a bit to define structure to the goal (like ralph loop has): https://t.co/NgNbqf04Xd earlier i used to invoke it by `/goal <path>` (the skill emits it for easy copy paste), but after seeing @reach_vb's tweets about existence of set_goal and the awareness of it being baked in the context, i started using by just asking "plan looks good, set it as goal and implement" (not sure if the file path input is counterproductive for reasons not visible to me) 2) use a powerful reviewer like 5.6-sol-pro or fable. you can leverage @steipete's oracle cli to have a more powerful model like 5.6-sol-pro (via chatgpt browser use) as a reviewer at relevant milstones towards achieving the goal. i started using this via a dedicated `create-oracle-review-powered-goal-plan` skill: https://t.co/pj8blOiNYw here's my fable advisor skill that can be easily composed with other skills mentioned above: https://t.co/XI8LW3gpJ7 3) you can have a recuring scheduled task in codex observe all goal tasks/threads' progress and summarize progress for you and/or nudge them if blocked. the inter-thread context/messaging is one of the best features of codex! thanks for preaching about it!! ``` 很喜欢 codex harness :) 里面有很多被低估的细节,让它成了一个超级应用/操作系统!
补充了一条可直接照做的分步流程:先落计划文件,再逐层细化到 goal。
@reach_vb Codex tip: before setting a /goal create a prompt that asks for a comprehensively researched plan with phases in a .md. Then prompt for sub phases then prompt to create the /goal
中文译文 · 机器翻译
@reach_vb codex 提示:在设定 /goal 之前,先写一个提示词,要求产出一份经过全面调研、分阶段的计划并写入 .md 文件。然后再提示它拆出子阶段,接着再提示它创建 /goal
强调用 agent 文件承载目标并定期复盘更新,是可落地的长期用法。
@reach_vb Agreed,have been doing this for sometime now. Instead of trying any long generic viral prompt,asking agent to create goals/agent files basis the available information is way more useful.Ask it to do periodic review of work and update files/goal as needed. https://t.co/lLQCeVIw4I
中文译文 · 机器翻译
@reach_vb 同意,我已经这样用了一段时间了。与其去试那些又长又通用的爆款提示词,不如让智能体根据现有信息来创建 goals/agent 文件,这有用得多。让它定期复盘工作,并按需更新文件/goal。 https://t.co/lLQCeVIw4I
指出自设目标的关键边界:目标容易被压缩精简而丢失原始细节。
@reach_vb I've observed that when I do this, it tends to miss out on details I mentioned in the initial prompt. Tends to make the goal quite concise.
中文译文 · 机器翻译
@reach_vb 我观察到,当我这样做时,它往往会漏掉我在最初提示词里提到的细节。 它倾向于把目标写得相当简略。
提出核心质疑:自设目标把校验责任转移了一层,值得警惕。
@reach_vb but who verifies that codex set the right goal in the first place feels like youre just pushing the misalignment one layer deeper
中文译文 · 机器翻译
@reach_vb 但一开始又是谁来验证 codex 设的目标是对的呢 感觉你只是把错位问题又往下推了一层