agentleFS
anhnguyen0905anhnguyen0905/codex-mcp/AGENTS.md

codex-mcp

AGENTS.md4 starsChanged 4 days agoMITView on GitHub

Source of the codex-mcp npm package and the codex-flow Claude Code plugin. The plugin's behavior is defined in markdown instruction files, not runtime code. - npm test — vitest (tests/*.test.ts, AAA style). Must stay green before any commit. - npm run build — tsc to dist/. - node scripts/check-command-sync.mjs — command-mirror gate (see below). - node scripts/check-release-consistency.mjs — version-agreement gate (only on version bumps). - In the Codex sandbox, if vitest fails with EPERM writing node_modules/.vite-temp, use npx vitest run…

  • Reads credentials

The file

We split this AGENTS.md into the rules it gives an agent

6 rules. About 0 are common, 1 is distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Run npm run data:guard before every commit once it exists (multiscope Phase 3, T1).

    line 21
  2. Very specific:

    Command mirror: every commands/<name>.md (codex-flow.md, brainstorm.md) has a

    line 28
  3. Very specific:

    Skill reachability: every codex-flow:<token> referenced in commands/codex-flow.md must resolve to an existing skills/<token>/SKILL.md …

    line 36
  4. Very specific:

    Run-state writes: create STATE.md with init.

    line 44
  5. Very specific:

    Harness changes: every commit that changes commands/, skills/ or scripts/ records one node scripts/harness-change.mjs add --title … …

    line 79
  6. Distinctive:

    Prefer small additive edits over invasive rewrites.

    line 91

≈ “Common” is an estimate: at least 1 in 5 of the 45,344 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

AGENTS.md — codex-mcp / codex-flow

Source of the codex-mcp npm package and the codex-flow Claude Code plugin. The plugin's behavior is defined in markdown instruction files, not runtime code.

Build & test

  • npm test — vitest (tests/*.test.ts, AAA style). Must stay green before any commit.
  • npm run build — tsc to dist/.
  • node scripts/check-command-sync.mjs — command-mirror gate (see below).
  • node scripts/check-release-consistency.mjs — version-agreement gate (only on version bumps).
  • In the Codex sandbox, if vitest fails with EPERM writing node_modules/.vite-temp, use npx vitest run <file> --configLoader runner; host-run results remain the source of truth.

No real data (public repository)

  • This repository is PUBLIC. Never commit text, numbers, ids, SKUs, country splits, CSVs or reports taken from real analysis work (game data, BigQuery/AppsFlyer exports, pilot reports). Fixtures, examples and docs use invented data only. Real evaluation holdouts live outside the git tree (~/.codex-mcp/quality-holdout/); the repo may hold only their hashes.
  • Run npm run data:guard before every commit once it exists (multiscope Phase 3, T1).
  • The STATE key packs is written only through flow-state init --packs from the router's initFlags; never hand-edit it.
  • language-check uses the first-use gloss rule: the first use of each English term in Vietnamese prose is <Vietnamese term> (<English term>); later bare uses of that term are accepted.
  • tests/holdoutLocal.test.ts runs the real-holdout frozen check only when ~/.codex-mcp/quality-holdout/cases.json exists; an approved holdout change needs --freeze --approve and the regenerated manifest, or the suite goes red locally.

Hard conventions (CI-gated — violating these red-fails tests)

  • Command mirror: every commands/<name>.md (codex-flow.md, brainstorm.md) has a byte-identical mirror at .claude/commands/<name>.md. Every edit to one must be cp-copied to the other. Gates: scripts/check-command-sync.mjs (SYNC_PAIRS) + tests/flowDocs.test.ts.
  • Skill files: skills/<name>/SKILL.md. Frontmatter is exactly two unquoted fields: name: and a one-line description:. Body follows the existing skills — # <Title> (embed into Codex prompts), then ## Standards block with a fenced ``` block whose contents are what gets embedded into a Codex prompt (label line + terse - Key: value bullets). Match skills/exec-deliverable/SKILL.md.
  • Skill reachability: every codex-flow:<token> referenced in commands/codex-flow.md must resolve to an existing skills/<token>/SKILL.md (tests/flowDocs.test.ts). Add the token and the SKILL.md together. Skill tokens named in the command must sit inside a **Load skills first...**: line to be recognized.
  • Release consistency: on a version bump, the version must agree across package.json, package-lock.json (2 spots), server.json (2 spots), .claude-plugin/plugin.json, the .mcp.json npx pin, and a ## [<version>] heading in CHANGELOG.md.
  • Run-state writes: create STATE.md with init; change phase and the three approvals only through approve, advance, requirement-delta, plan-drift, improvement-gate, and resume; change other keys through set, task Status lines through task, and validate with check — the helper is required, never optional. It validates keys, phases, task stages, and status transitions. Never hand-edit those files in the flow, and never fall back to editing them when the helper is missing: a missing helper means the plugin install is broken, so the flow STOPS and the user is told to reinstall it; a helper that exits non-zero surfaces its error and STOPS.
  • Runtime scripts: a new scripts/*.mjs helper the plugin invokes at runtime follows the scripts/task-waves.mjs idiom — Node stdlib only, pure named exports, CLI behind a pathToFileURL direct-run guard — and MUST be added to package.json files[] to reach the plugin cache. Tests import its exports with // @ts-expect-error — plain .mjs script. Gate the CLI with isDirectRun(import.meta.url) from scripts/direct-run.mjs (realpath-safe); never inline the pathToFileURL(process.argv[1]) comparison. Any script referenced by an npm script (dev tooling included) also belongs in files[]: CI's node scripts/pack-smoke.mjs fails otherwise — run it locally before tagging.
  • Jev (TypeSafe.ai) decision helper: scripts/jev-client.mjs wraps POST https://api.typesafe.ai/v1/systemone for optional fast-classification assists (fast-path routing, review-dual triage, skill-selection ranking). Reads TYPESAFE_API_KEY (never written to disk or logged) and CODEX_FLOW_JEV_MODE (off|shadow|enforce, default shadow when a key is set, else off). off/missing key is always a silent no-op — never a hard error. Shadow-mode comparisons land in .codex-flow/notes/jev-shadow.log (already covered by the **/.codex-flow/ gitignore rule). The procedures live in the opt-in skill skills/jev-assist.
  • Profile pilot (multiscope Phase 1): switches CODEX_FLOW_PROFILE_MODE (off|shadow|enforce, default shadow), CODEX_FLOW_EVIDENCE (off|shadow|enforce, default off), CODEX_FLOW_RUN_LANGUAGE (off|on, default off); defaults must keep today's behaviour. The behaviour-changing rules live in the conditional skill skills/profile-pilot (not in PHASE_SKILL_MAP). Byte guards: command ≤ 15 000 B and the code-run flow total ≤ 158 686 B, with a fast-path lane ≤ 5 000 tokens (chars/4) and per-phase loaded ceilings pinned in tests/flowDocs.test.ts — pay for new command text by trimming unpinned duplicates; never touch Phase 2 skills.

Harness changes (process rule, not CI-enforced)

  • Harness changes: every commit that changes commands/, skills/ or scripts/ records one node scripts/harness-change.mjs add --title … --evidence … --cause <label> --fix … --expect … --at-risk … --filter key=value --after-runs <n> [--commit <sha>] entry with a falsifiable expectation, at-risk area, run-ledger filter, and run count after which due compares cohorts; close it later with harness-change.mjs verdict. The local store is ~/.codex-mcp/harness-changes.jsonl, overridable with CODEX_MCP_HARNESS_CHANGES, and is never committed.

Style

  • Instruction prose: English, imperative, concise. Match the section style of neighboring skills (## headings, bullet rules, fenced templates).
  • Prefer small additive edits over invasive rewrites; keep diffs reviewable.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.