GPT WORLD / INDEPENDENT CODEX FIELD MANUAL 出典レビュー · 2026-07-26

フィールドガイド / 15 分

AGENTS.md で repository knowledge を永続化する

Global preferences、team rules、directory instructions を layer する。

トラック
Codex CLI コア
レベル
Repository setup
成熟度
Stable

Codex は作業前に global guidance、repo root から cwd までの project files を結合します。近い guidance が後で override し、各 level では AGENTS.override.md が優先。combined project guidance には default size limit があります。

CLI

検証済みターミナル手順

TERMINAL / 意図を持ってコピー
  1. /init
  2. $codex --ask-for-approval never "Summarize the current instructions."
  3. $codex -C services/payments --ask-for-approval never "List the instruction sources you loaded."
A

作業原則

01

Scope の近くへ

Repo-wide は root、service-specific は service 近く。

02

Recurring friction を encode

繰り返す mistake/review feedback だけ追加。

03

Discovery を verify

Target cwd から loaded sources を列挙させます。

B

フィールド手順

  1. 01

    Scaffold を生成

    /init 後に generic prose を real commands へ。

  2. 02

    Root contract

    layout、build、tests、lint、boundary、done。

  3. 03

    Narrow overrides

    本当に behavior が違う場所だけ。

  4. 04

    Chain を小さく

    default 32 KiB。詳細は docs へ link。

  5. 05

    Multiple dirs で test

    root と specialized subtree で sources 確認。

PASS / FAIL

受入チェック

  • Commands が current。
  • Constraint が正しい closest scope。
  • Sources を検証。
  • Secrets がない。

WATCH / REJECT

失敗パターン

  • AGENTS を security enforcement と誤解。
  • Commands なしの抽象 values。
  • Override shadow を忘れる。