Task frame
You stop asking Codex to “help somehow” and start handing it a concrete unit of work.
Module 03.2
Codex context and prompting
Most disappointing Codex results start earlier than the output. They start with a weak task frame. This lesson teaches the core prompt structure: goal, context, constraints, and done-when, plus when to ask for a plan instead of immediate edits.
模块 03.2
Codex 上下文与提问
大多数让人失望的 Codex 结果,并不是从输出那一刻才出错,而是从任务框架就已经错了。 这个子模块训练的是核心提示词结构:目标、上下文、限制条件、完成标准,以及何时先要求计划而不是直接改代码。
Outcomes
You stop asking Codex to “help somehow” and start handing it a concrete unit of work.
You include files, constraints, examples, and repo facts that actually alter the answer instead of dumping everything you know.
You know when to ask for a short plan first, when to ask for implementation directly, and when the task is still too vague.
学习结果
你不再让 Codex “随便帮一下”,而是给它一个明确的工作单元。
你会只提供真正能改变答案的文件、限制条件、例子和仓库事实,而不是把所有信息一股脑塞进去。
你知道什么时候先要一个短计划,什么时候直接实现,什么时候说明任务本身还太模糊。
Workflow
What exactly should Codex produce or change, and why does it matter?
Which files, examples, docs, or constraints give the task its real shape?
What must not change, what style to follow, and what risks to avoid?
What observable output, diff, test, or behavior proves the task is complete?
Should Codex plan first, implement directly, or explore before making changes?
工作流程
Codex 到底应该产出什么或改什么,为什么这件事重要?
哪些文件、例子、文档或限制,真正决定了任务的形状?
什么不能改、该遵循什么风格、要避免哪些风险?
什么样的输出、diff、测试或行为,能够证明任务真的完成?
应该先计划、直接实现,还是先探索再改动?
Prompt templates
Goal: Add optimistic loading to the save button in SettingsPanel. Context: - Relevant files: src/components/SettingsPanel.tsx, src/hooks/useSettings.ts - Existing pattern: follow the loading treatment used in ProfilePanel. Constraints: - Do not change API shapes. - Keep styling consistent with the current design system. Done when: - The button shows a loading state during save. - Existing tests still pass, and add tests if needed.
Before making changes, inspect the relevant files and give me: 1. A short implementation plan. 2. Key risks or unknowns. 3. The verification steps you intend to run. Then wait for confirmation before editing.
提示词模板
目标:给 SettingsPanel 的保存按钮增加 optimistic loading。 上下文: - 相关文件:src/components/SettingsPanel.tsx, src/hooks/useSettings.ts - 现有模式:参考 ProfilePanel 的 loading 处理方式。 限制条件: - 不要修改 API 形状。 - 样式保持和当前设计系统一致。 完成标准: - 保存期间按钮显示 loading 状态。 - 现有测试继续通过,必要时补测试。
在做任何改动前,先检查相关文件,并告诉我: 1. 一个简短实现计划。 2. 关键风险或未知点。 3. 你准备运行哪些验证步骤。 得到确认后再开始编辑。
Practice
练习
Dumping files, logs, and tickets is not the same as telling Codex what job those materials should support.
Do not micromanage implementation details before you are sure the task frame itself is correct.
把文件、日志和 ticket 全丢进去,不等于你已经告诉 Codex 这些材料到底要服务什么工作。
在你还没确认任务框架是否正确之前,不要先对实现细节进行过度微操。