Getting started
Install
npm install --save-dev @typpi/eslint-plugin-codex eslint @eslint/markdown @eslint/json
@typpi/eslint-plugin-codex supports Node.js 22+, ESLint 9.15 and 10, and flat config.
Choose a preset
import codex from "@typpi/eslint-plugin-codex";
export default [...codex.configs.recommended];
Presets are arrays because Codex customization spans three languages:
- Markdown for
AGENTS.md,AGENTS.override.md, skills, and legacy prompts - TOML for config layers and custom agents
- JSON for
hooks.json
Always spread the selected preset. recommended is the normal starting point; minimal checks only essential structure, while strict adds security and ambiguity checks. all enables every stable rule.
Shared-config composition
The normal variants register @eslint/markdown and @eslint/json. If an earlier shared config already registers those plugin namespaces, compose the external-registration variant instead:
import codex from "@typpi/eslint-plugin-codex";
import sharedConfig from "your-shared-eslint-config";
export default [
...sharedConfig,
...codex.configs["recommended-without-language-plugins"],
];
The TOML parser is configured directly in both variants.
Override one rule
Place the override after the preset and match the file language:
import codex from "@typpi/eslint-plugin-codex";
export default [
...codex.configs.recommended,
{
files: ["**/.codex/config.toml"],
rules: {
"codex/max-agents-instruction-chain-bytes": ["error", { maxBytes: 48_000 }],
},
},
];
Verify the setup
npx eslint AGENTS.md .agents/skills .codex
Only pass paths that exist in your repository. ESLint reports configuration parse failures separately from plugin rule diagnostics.