lexical: Instructions file for Codex

AGENTS.md

lexical AGENTS.md is an instructions file for Codex, OpenCode from facebook/lexical. It costs 6,385 tokens per session, scanned A, original, MIT.

A set of repository instructions for coding agents working on Lexical, including its build, test, and development commands.

In plain words
What is it for?
It helps run package builds, TypeScript checks, unit tests, browser tests, and end-to-end tests in Chromium, Firefox, or WebKit.
Why use it?
It gives an agent the project-specific commands and workflow needed to change and verify the code correctly.

Instructions file for CodexOpenCode ✓ vendor

Written for Codex and OpenCode: the file is AGENTS.md. Also seen: reads .claude/ paths; mentions Claude Code.

This is facebook/lexical's own configuration. It tells Codex and OpenCode how to work on lexical itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything lexical configures →

About the project

Lexical is a TypeScript framework for embedding editable text fields and rich-text editors in web applications. Developers use it to build accessible, extensible editors with features such as undo history, collaboration, structured content, and import or export formats. The catalogue instructions and setting support development workflows around Lexical.

facebook/lexical · 23,990 stars · on GitHub · lexical.dev

Reuse

Borrowing it

Nothing to install: this file belongs to facebook/lexical. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/facebook/lexical/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/facebook/lexical

Made for: Codex, OpenCode.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for lexical AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/facebook/lexical/agents-md/github.svg)](https://agentmods.dev/instructions/facebook/lexical/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/facebook/lexical/agents-md"><img src="https://agentmods.dev/badge/instructions/facebook/lexical/agents-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for lexical AGENTS.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/facebook/lexical/agents-md"><img src="https://agentmods.dev/badge/instructions/facebook/lexical/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 6,385 This file is loaded in full into every session.
When invoked 6,385 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.06385 $0.06385
Opus 5.5 $0.02554 $0.02554
Sonnet 5.5 $0.01277 $0.01277
Haiku 4.5 $0.00639 $0.00639

Measured 1mo ago against content hash 8b96b88af030, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

lexical 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 1mo ago.

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 · 480 lines

How it starts

The opening of the file, as written. The whole thing — 480 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Lexical Agent Guide

This file provides detailed guidance for AI agents and automated tools working with the Lexical codebase.

Build, Test, and Development Commands

Building

  • pnpm run build - Build all packages in development mode
  • pnpm run build-prod - Clean and build all packages in production mode
  • pnpm run build-release - Build production release with error codes
  • pnpm run build-types - Build TypeScript type definitions and validate them

Testing

  • pnpm run test-unit - Run all unit tests (Vitest, Node/jsdom)
  • pnpm run test-unit-watch - Run unit tests in watch mode
  • pnpm run test-browser - Run browser-mode unit tests (Vitest + Playwright, real browser)
  • pnpm run test-browser-watch - Run browser-mode tests in watch mode
  • pnpm run test-e2e-chromium - Run E2E tests in Chromium (requires dev server running)
  • pnpm run test-e2e-firefox - Run E2E tests in Firefox
  • pnpm run test-e2e-webkit - Run E2E tests in WebKit
  • pnpm run debug-test-e2e-chromium - Run E2E tests in debug mode (headed)
  • pnpm run debug-test-unit - Debug unit tests with inspector

For E2E testing workflow:

  1. Start the dev server: pnpm run start (or pnpm run dev if you don't need collab)
  2. In another terminal: pnpm run test-e2e-chromium

Development Servers

  • pnpm run start - Start playground dev server + collab server (http://localhost:3000)
  • pnpm run dev - Start only the playground dev server (no collab)
  • pnpm run start:website - Start Docusaurus website (http://localhost:3001)
  • pnpm run collab - Start collab server on localhost:1234

Code Quality

  • pnpm run lint - Run ESLint on all files
  • pnpm run lint:fix - Auto-fix lint issues
  • pnpm run prettier - Check code formatting
  • pnpm run prettier:fix - Auto-fix formatting issues
  • pnpm run flow - Run a full foreground Flow check (does not reuse a server)
  • pnpm run tsc - Run TypeScript compiler
  • pnpm run ci-check - Run all checks (TypeScript, Flow, Prettier, ESLint)

Read the full file on GitHub · 480 lines

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. 1mo ago Changed · +39 lines · +629 tokens per session 8b96b88af030
  2. 1mo ago Changed · +11 lines · +178 tokens per session 7bba8e7c149e
  3. 1mo ago Changed · +12 lines · +157 tokens per session bdea2104677e
  4. 1mo ago Changed · +3 lines · +54 tokens per session badbb8a884d3
  5. 1mo ago Changed · +30 lines · +412 tokens per session a69a3e84e1e9
  6. 1mo ago Changed · +20 lines · +340 tokens per session b3dd673fd13e
  7. 2mo ago First seen · 365 lines · 4,615 tokens per session scan A ee9826bd5cf3

Subscribe to this mod's changes

lexical AGENTS.md is an instructions file published in the GitHub repository facebook/lexical (23,990 stars, last pushed 5d ago), licensed MIT. It adds 6,385 tokens to every session, about $0.0255 per session on Opus 5.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.

Related

lexical AGENTS.md compared with instructions from other repositories

lexical AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
lexical AGENTS.mdfacebook/lexicalInstructions file24k5d agoMITA6,385Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143ktodayMITA7,461Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA5,516GitHub Copilot
langchain AGENTS.mdlangchain-ai/langchainInstructions file149ktodayMITA4,680Codex, OpenCode
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode