codex-rules AGENTS.md

A repository guide that tells coding agents which TypeScript, module, formatting, testing, and runtime conventions to follow.

In plain words
What is it for?
Use it when developing or testing the project, checking types, building, packaging, or verifying Codex hook behavior.
Why use it?
It reduces inconsistent code and helps agents use the project’s required checks and commands correctly.

Instructions file for CodexOpenCode

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/code-yeongyu/codex-rules/agents-md
Clone the repo
git clone --depth 1 https://github.com/code-yeongyu/codex-rules

Made for: Codex, OpenCode.

Per session 377 This file is loaded in full into every session.
When invoked 377 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00377 $0.00377
Opus 5 $0.00188 $0.00188
Sonnet 5 $0.00075 $0.00075
Haiku 4.5 $0.00038 $0.00038

Measured yesterday against content hash d087dbf607e7, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

codex-rules AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

AGENTS.md · 35 lines

What it actually says

Repository Conventions

Conventions for human contributors and AI agents working on this repository.

Style

  • Terse technical prose. No emojis in commits, issues, PR comments, or code.
  • TypeScript strict mode. No any, no @ts-ignore, no @ts-expect-error, no enums.
  • ESM modules with .js suffix in runtime import paths.
  • Tabs for indentation. Double quotes for strings.
  • Tests use vitest with #given .. #when .. #then descriptions or plain // given / // when / // then body comments.

Commands

  • npm install - install dependencies.
  • npm test - run vitest once.
  • npm run typecheck - strict TypeScript check.
  • npm run check - type check, biome, and build.
  • npm pack --dry-run - release package smoke test.
  • node dist/cli.js hook session-start < fixture.json - smoke-test static rule injection.
  • node dist/cli.js hook post-tool-use < fixture.json - smoke-test dynamic rule injection.

Constraints

  • No Bun APIs. Runtime is Node only because Codex launches plugin hooks with Node.
  • Keep SessionStart, UserPromptSubmit, and PostToolUse hook behavior covered by tests.
  • Keep Codex file path extraction for reads, edits, apply_patch, and shell-style tools covered by tests.
  • Hook output must use the stable Codex hook JSON contract.
  • Do not couple this package back to pi, omo, or senpi internal source paths.

Don'ts

  • No git add -A or git add .. Stage only the files you changed.
  • No git commit --no-verify. No force pushes. No history rewriting on shared branches.
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 35 lines · 377 tokens per session scan A d087dbf607e7

Subscribe to this mod's changes

codex-rules AGENTS.md is an instructions file published in the GitHub repository code-yeongyu/codex-rules (11 stars, last pushed 4d ago), licensed MIT. It adds 377 tokens to every session, about $0.0019 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.