讓 Codex 訪談你的專案,再產出一份結構化、不囉嗦的 AGENTS.md,把建置/測試指令、程式風格、commit 規範、禁區一次寫清楚,每次開工自動載入。
不用離開網站,直接看這組 prompt 跑出來長怎樣(AI 即時生成,扣 1 點)。
不只複製貼上 — 下載後放到 ~/.codex/prompts/agents-md-author.md,之後輸入 /agents-md-author 一鍵呼叫。
mkdir -p ~/.codex/prompts && mv ~/Downloads/agents-md-author.md ~/.codex/prompts/agents-md-author.mdNew-Item -ItemType Directory -Force "$env:USERPROFILE\.codex\prompts" | Out-Null; Move-Item "$env:USERPROFILE\Downloads\agents-md-author.md" "$env:USERPROFILE\.codex\prompts\agents-md-author.md"何時用:剛把 Codex 接上一個既有 repo、或團隊想統一「Codex 開工該知道的事」時。為何有效:Codex 每次啟動會把從 git root 到當前目錄的 AGENTS.md 串起來當系統指引,這支強制它『先讀你的 repo 再下筆』,而不是憑空生一份漂亮但錯誤的設定檔——錯的 build 指令比沒有還糟。技巧:① 先讓它調查 package.json / CI / lockfile 抓出真實指令,再只問你它查不到的事,省掉來回;② 要求對不確定的指令留 TODO(owner) 而非編造,符合『誠實>花俏』;③ commit 格式寫進 AGENTS.md 是最有效的一招(它是 Codex 產出 commit 風格的主分類依據)。進階:子目錄規則不同時讓它建巢狀 AGENTS.md,保持 root 精簡(預設約 32 KiB 上限)。
# AGENTS.md ## Project overview luvai-stock-app — a Taiwan-equities analytics site (technical + institutional flow + AI). Next.js 15 (App Router) + TypeScript, deployed to Cloudflare Workers via OpenNext, data in D1. ## Setup & commands | Task | Command | |------|---------| | Install | `npm ci` | | Dev | `npm run dev` | | Build | `npm run build` | | Typecheck | `npx tsc --noEmit` | | Lint | `npm run lint` | | Deploy | `npm run deploy` | ## Commit & PR rules - Conventional Commits: `feat(scope): ...`, `fix(scope): ...`, `chore: ...`. - Before opening a PR: `npx tsc --noEmit` and `npm run lint` must pass. ## Guardrails / do-not-touch - Never edit `migrations/` files that are already applied to prod — add a new one. - Do not touch credit/entitlement logic in `lib/entitlements.ts` without asking. TODO(owner): confirm whether `npm test` or `npm run test:ci` is the canonical suite — both exist in package.json.
以上為此 Prompt 丟進 OpenAI Codex 後可得到的描述性成果,實際畫面會因填入的變數而有差異。
[PROJECT_NAME]專案名稱,例如 luvai-stock-app
[STACK]主要技術棧/語言,例如 Next.js 15 + TypeScript on Cloudflare Workers
[PROJECT_PURPOSE]專案一兩句話用途,例如 台股技術+籌碼+AI 分析網站
[MAX_QUESTIONS]允許 Codex 反問的最多題數,建議 3-5,避免它一直問
[COMMIT_STYLE]你要的 commit 格式,例如 Conventional Commits(feat/fix/chore…)或團隊自訂格式
填下面的欄位,上方 prompt 會即時替換 [方括號] 內容。填好後按「複製組好的 prompt」直接丟進工具。
You are helping me author an `AGENTS.md` file for this repository so that Codex loads consistent project guidance at the start of every session.
Context you already know about how AGENTS.md works (do NOT lecture me on this, just apply it):
- Codex reads AGENTS.md from the git root down to the current directory, concatenated, closest file wins. Keep the root file focused and lean.
- Content should be operational instructions for an agent, not marketing prose. Think "what would I tell a competent new contributor on day one".
Project: {{PROJECT_NAME}}
Primary stack / language: {{STACK}}
What the project does (1-2 lines): {{PROJECT_PURPOSE}}
STEP 1 — Investigate the repo yourself before writing anything. Read package manifests, lockfiles, CI config, existing README, scripts, and any existing AGENTS.md / CLAUDE.md. From the actual files, determine:
- the real install / build / test / lint / typecheck commands (quote them exactly — do not guess)
- the package manager and runtime version in use
- the directory layout and where the important code lives
- existing conventions (formatter, lint rules, commit style, branch naming)
STEP 2 — Ask me at most {{MAX_QUESTIONS}} sharp clarifying questions ONLY about things you genuinely could not determine from the repo (e.g. which test command is the canonical one, what must never be touched, deployment gotchas). Skip anything you already found. If you found everything, say so and skip straight to STEP 3.
STEP 3 — Write `AGENTS.md` at the repo root with these sections, in this order. Omit any section that does not apply rather than padding it:
1. **Project overview** — 2-3 sentences max: what it is, the stack.
2. **Setup & commands** — exact commands to install, run, build, test, lint, typecheck. Use a table or code blocks. These must be copy-pasteable and correct.
3. **Project layout** — a short map of the key directories and what lives where.
4. **Conventions** — code style, naming, formatting/lint rules to follow, language/framework idioms specific to this repo.
5. **Commit & PR rules** — the commit message format ({{COMMIT_STYLE}}), branch naming, and anything required before opening a PR (e.g. tests green, changelog entry).
6. **Guardrails / do-not-touch** — files, dirs, secrets, generated code, or behaviors Codex must not modify without asking. Be specific.
7. **Verification checklist** — the exact steps Codex should run to self-verify a change before declaring it done.
Writing rules:
- Be terse and imperative. Bullet points over paragraphs. No "you are an expert" filler.
- Only state things you actually confirmed from the repo or from my answers. If something is genuinely unknown, leave a clearly-marked `TODO(owner): ...` line instead of inventing a command — a wrong build command is worse than a flagged gap.
- Keep the root file lean; if a subdirectory has materially different rules, tell me to create a nested `AGENTS.md` there instead of bloating the root.
After writing the file, output a 5-line summary of what you put in it and list any `TODO(owner)` gaps I still need to fill in.這組 prompt 專為 OpenAI Codex 設計。把 prompt 內 5 個方括號 [變數] 換成你自己的內容,貼進 OpenAI Codex 執行即可。難度為入門,新手可以直接套用。
完整 prompt 免費開放閱讀,不用註冊;登入後可一鍵複製、收藏與留言。
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-agents-md-author" width="100%" height="380" frameborder="0" style="border:1px solid #e0dcd0;border-radius:4px;" loading="lazy" title="PromptCraft Embed"></iframe>
You are helping me author an `AGENTS.md` file for this repository so that Codex loads consistent project guidance at the start of every session.
Context you already know about how AGENTS.md works (do NOT lecture me on this, just apply it):
- Codex reads AGENTS.md from the git root down to the current directory, concatenated, closest file wins. Keep the root file focused and lean.
- Content should be operational instructions for an agent, not marketing prose. Think "what would I tell a competent new contributor on day one".
Project: {{PROJECT_NAME}}
Primary stack / language: {{STACK}}
What the project does (1-2 lines): {{PROJECT_PURPOSE}}
STEP 1 — Investigate the repo yourself before writing anything. Read package manifests, lockfiles, CI config, existing README, scripts, and any existing AGENTS.md / CLAUDE.md. From the actual files, determine:
- the real install / build / test / lint / typecheck commands (quote them exactly — do not guess)
- the package manager and runtime version in use
- the directory layout and where the important code lives
- existing conventions (formatter, lint rules, commit style, branch naming)
STEP 2 — Ask me at most {{MAX_QUESTIONS}} sharp clarifying questions ONLY about things you genuinely could not determine from the repo (e.g. which test command is the canonical one, what must never be touched, deployment gotchas). Skip anything you already found. If you found everything, say so and skip straight to STEP 3.
STEP 3 — Write `AGENTS.md` at the repo root with these sections, in this order. Omit any section that does not apply rather than padding it:
1. **Project overview** — 2-3 sentences max: what it is, the stack.
2. **Setup & commands** — exact commands to install, run, build, test, lint, typecheck. Use a table or code blocks. These must be copy-pasteable and correct.
3. **Project layout** — a short map of the key directories and what lives where.
4. **Conventions** — code style, naming, formatting/lint rules to follow, language/framework idioms specific to this repo.
5. **Commit & PR rules** — the commit message format ({{COMMIT_STYLE}}), branch naming, and anything required before opening a PR (e.g. tests green, changelog entry).
6. **Guardrails / do-not-touch** — files, dirs, secrets, generated code, or behaviors Codex must not modify without asking. Be specific.
7. **Verification checklist** — the exact steps Codex should run to self-verify a change before declaring it done.
Writing rules:
- Be terse and imperative. Bullet points over paragraphs. No "you are an expert" filler.
- Only state things you actually confirmed from the repo or from my answers. If something is genuinely unknown, leave a clearly-marked `TODO(owner): ...` line instead of inventing a command — a wrong build command is worse than a flagged gap.
- Keep the root file lean; if a subdirectory has materially different rules, tell me to create a nested `AGENTS.md` there instead of bloating the root.
After writing the file, output a 5-line summary of what you put in it and list any `TODO(owner)` gaps I still need to fill in.把方括號 [ ] 內的變數換成你的內容,丟進 OpenAI Codex。
六個月在 Claude / GPT-4 / Gemini 上用人工 rater A/B 測 200+ prompt 後寫的。包含 persona+constraint stacking / anti-example / role reversal QA / cognitive scaffold / emotional priming / uncertainty CoT / steelman first。
一年的 role-play system prompt + 14-step framework 後總結:真正改變品質的是 5 個單行 prompt。沒有 role、沒有 markdown、沒有「you are an expert」。