Codex 起手式四關卡:定義任務 → 審計畫 → 核 diff → 驗證才算完
把一句模糊的需求,套成 Codex 的完整工作流:先逼它釐清『完成定義』、用 plan mode 給出計畫讓你核可,再小步實作、自己跑測試、最後產出可審查的 diff 與驗證證據。
別丟一句「幫我加個功能」就放生 Codex。這支把任務拆成四個關卡——定義完成標準、進 plan mode 等你核可、小步實作、跑驗證並交出 diff 與證據——讓 agent 像個會回報的隊友而不是亂改的黑箱。
[ Log in to see the full prompt ]Sign up free to see the full prompt, copy it, save it, and join the discussion. Free content unlocks on login; Pro content is a separate subscription.
何時用:任何非 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]
Suno Engineer's Mindset: 4 Steps to a Song That Doesn't Sound Like AI
A studio engineer's breakdown of Suno's fatal weaknesses (fried vocals, high-frequency artifacts), plus a 4-step DAW workflow and a Suno Studio cleanup prompt.
5 Claude Weekly Workflows That Stuck After 6 Months
Proposal generator / meeting processor / content repurposer / Friday review / shutdown reset — out of 40 I tried, only these 5 survived, each saving 30+ minutes per run.