改完 code 之後,讓 Codex 讀 staged diff,產出符合 Conventional Commits 的訊息,並寫出含背景、改了什麼、為什麼、如何驗證、風險的 PR 描述——不亂併無關改動、不誇大、不編造測試。
改完了,卡在「commit message 和 PR 描述好懶得寫」?這支讓 Codex 讀你的實際 diff,生出語意化 commit 與一份審查者看得懂的 PR——背景、改動、理由、驗證、風險俱全,且只描述真的做過的事。
[ 登入後可看完整內容 ]何時用: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.
以上為此 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-semantic-commit-and-pr" width="100%" height="380" frameborder="0" style="border:1px solid #e0dcd0;border-radius:4px;" loading="lazy" title="PromptCraft Embed"></iframe>