把一句模糊的需求,套成 Codex 的完整工作流:先逼它釐清『完成定義』、用 plan mode 給出計畫讓你核可,再小步實作、自己跑測試、最後產出可審查的 diff 與驗證證據。
別丟一句「幫我加個功能」就放生 Codex。這支把任務拆成四個關卡——定義完成標準、進 plan mode 等你核可、小步實作、跑驗證並交出 diff 與證據——讓 agent 像個會回報的隊友而不是亂改的黑箱。
[ 登入後可看完整內容 ]何時用:任何非 trivial 的 Codex 任務(加功能、修 bug、改架構),尤其是你不想盯著它每一步、又怕它亂改的時候。為何有效:Codex 官方 best practice 就是把任務當『有明確 context 和完成定義的隊友』來帶——這支把它落成四道強制關卡。Gate 1 逼出可驗收的『Done when』,Gate 2 用真實存在的 plan mode(/plan 或 Shift+Tab)讓它先讀碼再給計畫等你核可,避免一頭栽進去改錯方向;Gate 3 要求小步、禁 placeholder;Gate 4 要求『真的跑測試貼 output』而非『應該會過』。技巧:把卡關設計成需要你點頭才前進,等於用 approval 機制換取掌控感;CONTEXT_FILES 用 @ 提及具體檔案能大幅提升計畫品質。
GATE 1 — FRAME Goal: After login, redirect the user back to the page they came from instead of always /dashboard. Done when: visiting /watchlist while logged out, logging in, lands back on /watchlist; existing /dashboard default still works when there's no return path; `npx tsc --noEmit` passes. Open questions: Should the return_to be validated against an allowlist to avoid open-redirect? (recommend yes) — no other blockers. [STOP — awaiting your confirmation] GATE 2 — PLAN 1. middleware.ts: capture original path into a signed `return_to` cookie on the redirect-to-login. 2. app/login/route.ts: after successful auth, read return_to, validate it's a same-origin relative path, else fall back to /dashboard. 3. Add test in __tests__/login-redirect.test.ts covering: valid return, missing return, open-redirect attempt. Risks: open-redirect if return_to isn't validated; cookie must be httpOnly + same-site. [STOP — awaiting plan approval]
以上為此 Prompt 丟進 OpenAI Codex 後可得到的描述性成果,實際畫面會因填入的變數而有差異。
這組 prompt 專為 OpenAI Codex 設計。把 prompt 內 3 個方括號 [變數] 換成你自己的內容,貼進 OpenAI Codex 執行即可。難度中等,照變數說明填好後即可上手。
完整 prompt 免費。註冊並登入 PromptCraft 帳號即可複製、收藏與留言,不需付費。
prompt 文字本身你可自由使用與修改。但 AI 生成物(圖/音樂/影片/文字)的商用授權,取決於你在 OpenAI Codex 使用的方案與其官方服務條款,請以該工具的授權規範為準。
Studio engineer 視角拆解 Suno 致命弱點(油炸 vocals、高頻 artifact)+ 4 步驟 DAW workflow + Suno Studio 修音 prompt
提案產生器 / 會議處理器 / 內容再利用 / 週五回顧 / 收工 reset — 試了 40 個只有這 5 個沒被丟掉、各省 30+ 分鐘 / 次。
適合:部落格、Medium、Notion 公開頁、Substack — 任何支援 iframe / HTML 嵌入的地方。對方點「看完整」會回到本站、是 prompt 庫的免費 backlink。
<iframe src="https://prompt.luvai.net/embed/codex-task-intake-plan-diff-verify" width="100%" height="380" frameborder="0" style="border:1px solid #e0dcd0;border-radius:4px;" loading="lazy" title="PromptCraft Embed"></iframe>