Codex 收尾官:把已寫好的改動整理成語意化 commit + 一份能過審的 PR
改完 code 之後,讓 Codex 讀 staged diff,產出符合 Conventional Commits 的訊息,並寫出含背景、改了什麼、為什麼、如何驗證、風險的 PR 描述——不亂併無關改動、不誇大、不編造測試。
改完了,卡在「commit message 和 PR 描述好懶得寫」?這支讓 Codex 讀你的實際 diff,生出語意化 commit 與一份審查者看得懂的 PR——背景、改動、理由、驗證、風險俱全,且只描述真的做過的事。
[ 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.
何時用:code 已經改完、要把它變成乾淨的 commit 和一份審查者願意看的 PR 時。為何有效:Codex 沒有內建『一鍵 commit/PR』的 slash command,這類工作是靠 prompt 驅動它跑 git——所以指令必須明確要它『讀真實 diff 再下筆』。重點防呆:① 強制依 AGENTS.md 的 commit 慣例、否則用 Conventional Commits(官方說這是讓 agent 產出專業 commit 最有效的一招);② 禁止把無關改動 add 進同一個 commit、禁止 type 與實際 diff 不符(refactor 不能寫成 feat);③ 禁止捏造『測試已過』——沒跑就標 not yet verified,符合誠實協定;④ 用 gh 開 PR、沒有就吐出可貼的標題與內文,並在 push 前要你確認、絕不 force-push 或直推 base。技巧:先讓它對 diff 做一次自我審查(漏掉的 secret/console.log/註解掉的碼)再寫描述,PR 品質明顯更高。
STEP 2 — Proposed commit fix(login): return user to original page after auth instead of /dashboard Logged-out users hitting a protected page were always bounced to /dashboard after login, losing their place. Capture the original path in a signed, httpOnly return_to cookie and restore it post-auth, validating it's a same-origin relative path to avoid open redirects. Refs #482 [awaiting approval before committing] STEP 3 — PR description (base: main) ## What Redirect users back to the page they originally requested after logging in. ## Why Protected-page visitors lost context (#482); always landing on /dashboard hurt the watchlist/portfolio flows. ## How Signed return_to cookie set in middleware.ts; validated + consumed in app/login/route.ts. Falls back to /dashboard when absent or invalid. ## Testing `npx tsc --noEmit` passed; added __tests__/login-redirect.test.ts (3 cases incl. open-redirect attempt) — `npm test` green. ## Risk / rollback Low; revert this commit to restore prior behavior. Open-redirect guarded by same-origin check. ## Out of scope Does not change the OAuth provider flow or session expiry.
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.