Ultra Codex AGENTS.md is a small, reusable instruction file for Codex users. It gives coding agents four practical rules that reduce common failure modes: rushing into code, overengineering, touching unrelated files, and finishing without verification.
The project is intentionally tiny. Copy the content of AGENTS.md
into Codex global instructions or place it in a repository root.
-
Think Before Coding Identify the goal, assumptions, ambiguity, and success criteria before changing code.
-
Simplicity First Implement the minimum solution. Avoid speculative features, abstractions, configurability, and broad error handling.
-
Surgical Changes Touch only what the request requires. Do not refactor, reformat, rename, or clean up unrelated code.
-
Goal-Driven Execution Turn the task into verifiable success criteria and report what was verified.
Codex App users can install the rules from the UI:
- Open Settings.
- Go to Personalization.
- Find Custom instructions.
- Paste the content of
AGENTS.md. - Save, then start a new Codex thread.
This is the easiest path if you use the Codex desktop app.
Codex also reads global guidance from your Codex home directory.
Windows:
New-Item -ItemType Directory -Force "$env:USERPROFILE\.codex"
Copy-Item .\AGENTS.md "$env:USERPROFILE\.codex\AGENTS.md"macOS or Linux:
mkdir -p ~/.codex
cp AGENTS.md ~/.codex/AGENTS.mdCodex reads AGENTS.override.md first if it exists, otherwise AGENTS.md.
Use an override file only when you want a temporary global replacement.
To apply these rules to one repository only, copy AGENTS.md into that
repository root:
<PROJECT_ROOT>/AGENTS.md
Project instructions are layered after global instructions, so repository rules can refine or override the global defaults.
Start a new Codex thread and ask:
Summarize the current global coding rules you are following.
A successful setup should mention the four rules:
- Think Before Coding
- Simplicity First
- Surgical Changes
- Goal-Driven Execution
For a behavior check, ask Codex to propose a small code change plan without editing files. It should state assumptions, keep the scope narrow, and describe how it would verify the result.
Use this file as a baseline for:
- personal Codex App setup
- repository-level AI coding guidance
- team coding-agent onboarding
- safer default behavior before introducing heavier workflows or skills
This file is not a replacement for project documentation, tests, or specialized skills. It is the baseline discipline that should apply before those tools are used.
Ultra Codex AGENTS.md 是一份面向 Codex 用户的轻量级全局指令模板。 它用四条规则约束 AI 编程代理最常见的失败模式:没想清就写、过度设计、 顺手乱改、没有验证就交付。
轻量化调整,你可以把 AGENTS.md 的内容粘贴到
Codex 全局自定义指令里,也可以把它放到项目根目录。
-
Think Before Coding 改代码前先明确目标、假设、歧义和成功标准。
-
Simplicity First 使用能解决问题的最小实现,不添加未请求的功能、抽象、配置项或复杂兜底。
-
Surgical Changes 只改与请求直接相关的文件和代码行,不顺手重构、格式化、重命名或清理无关代码。
-
Goal-Driven Execution 把任务转成可验证的成功标准,并在完成后说明验证了什么。
如果你使用 Codex 桌面 App,可以直接通过界面安装:
- 打开 设置。
- 进入 个性化。
- 找到 自定义指令。
- 粘贴
AGENTS.md的内容。 - 保存,然后新开一个 Codex 线程。
这也是 Codex App 用户最直观的安装方式。
Codex 也会从全局 home 目录读取指令。
Windows:
New-Item -ItemType Directory -Force "$env:USERPROFILE\.codex"
Copy-Item .\AGENTS.md "$env:USERPROFILE\.codex\AGENTS.md"macOS 或 Linux:
mkdir -p ~/.codex
cp AGENTS.md ~/.codex/AGENTS.md如果存在 AGENTS.override.md,Codex 会优先读取它;否则读取 AGENTS.md。
只有在你想临时覆盖全局规则时,才建议使用 override 文件。
如果只想让某个项目使用这套规则,把 AGENTS.md 放到项目根目录:
<PROJECT_ROOT>/AGENTS.md
项目级指令会叠加在全局指令之后,因此可以细化或覆盖全局默认规则。
新开一个 Codex 线程,然后询问:
请总结你当前遵循的全局编码规则。
如果安装成功,Codex 应该能提到这四条规则:
- Think Before Coding
- Simplicity First
- Surgical Changes
- Goal-Driven Execution
你也可以让 Codex 只提出一个小改动计划但不要改文件。正常情况下,它应该先说明 假设、保持范围很小,并说明准备如何验证结果。
这份文件适合用作:
- Codex App 个人全局设置
- 仓库级 AI 编程指导
- 团队 AI coding agent 入门约束
- 引入更复杂工作流或 skills 之前的默认行为底线
它不是项目文档、测试体系或专业技能的替代品。它是一层更基础的工程纪律。
AGENTS.md
README.md
LICENSE
CONTRIBUTING.md
SECURITY.md
CODE_OF_CONDUCT.md
This project is licensed under the Apache License 2.0. See
LICENSE.