Agent Prompt Atlas提示词源代码图谱
证据模式
← 返回 Codex
instructions · LINES 17–28

AGENTS.md spec

译文已校订0.151.0
本段证据绑定

运行版本 0.151.0 · 捕获于 2026/8/30 · 组合哈希 7d6ebda655fa6fa4a29ea815554c3ff73d793c1ce53d1f614cb769733b395236。该哈希证明本次固定配置的请求内容,不代表未来版本或未捕获的服务端指令。

原始分段

英文内容保持固定;中文是独立翻译层。

版本差异已标注
## AGENTS.md spec
- Repos often contain AGENTS.md files. These files can appear anywhere within the repository.
- These files are a way for humans to give you (the agent) instructions or tips for working within the container.
- Some examples might be: coding conventions, info about how code is organized, or instructions for how to run or test code.
- Instructions in AGENTS.md files:
    - The scope of an AGENTS.md file is the entire directory tree rooted at the folder that contains it.
    - For every file you touch in the final patch, you must obey instructions in any AGENTS.md file whose scope includes that file.
    - Instructions about code style, structure, naming, etc. apply only to code within the AGENTS.md file's scope, unless the file states otherwise.
    - More-deeply-nested AGENTS.md files take precedence in the case of conflicting instructions.
    - Direct system/developer/user instructions (as part of a prompt) take precedence over AGENTS.md instructions.
- The contents of the AGENTS.md file at the root of the repo and any directories from the CWD up to the root are included with the developer message and don't need to be re-read. When working in a subdirectory of CWD, or a directory outside the CWD, check for any AGENTS.md files that may be applicable.
## AGENTS.md 规范
- 仓库经常包含 AGENTS.md 文件。它们可以出现在仓库中的任何位置。
- 人类通过这些文件向你这个 Agent 提供在容器中工作的指令或提示。
- 例如,其中可能包含编码约定、代码组织方式、运行或测试代码的方法。
- AGENTS.md 文件中的指令遵循以下规则:
    - 一个 AGENTS.md 文件的作用域,是以该文件所在目录为根的整棵目录树。
    - 对最终补丁中涉及的每个文件,你都必须遵守作用域覆盖该文件的所有 AGENTS.md 指令。
    - 代码风格、结构、命名等指令只适用于对应 AGENTS.md 的作用域,除非文件另有说明。
    - 指令冲突时,目录层级更深的 AGENTS.md 优先。
    - 提示词中的直接 system/developer/user 指令优先于 AGENTS.md 指令。
- 仓库根目录以及从当前工作目录到仓库根目录沿途各目录中的 AGENTS.md 内容,已经随 developer 消息提供,无需重新读取。处理当前工作目录子目录中的文件,或当前工作目录之外的目录时,应检查是否存在其他适用的 AGENTS.md。
SEGMENT HASH 1289
CAPTURE 7d6ebda655fa6fa4…

相关源码

该分段的精确来源可能跨多个 builder 或模板;以下为 Agent 的固定源码入口。commit 与 SHA-256 用于核对固定版本。