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.
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.
curl -O https://raw.githubusercontent.com/facebook/lexical/main/AGENTS.mdgit clone --depth 1 https://github.com/facebook/lexicalWrote 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.
[](https://agentmods.dev/instructions/facebook/lexical/agents-md)<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.
<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>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.
| Model | Per session | Once 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 |
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.
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 modepnpm run build-prod- Clean and build all packages in production modepnpm run build-release- Build production release with error codespnpm 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 modepnpm run test-browser- Run browser-mode unit tests (Vitest + Playwright, real browser)pnpm run test-browser-watch- Run browser-mode tests in watch modepnpm run test-e2e-chromium- Run E2E tests in Chromium (requires dev server running)pnpm run test-e2e-firefox- Run E2E tests in Firefoxpnpm run test-e2e-webkit- Run E2E tests in WebKitpnpm 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:
- Start the dev server:
pnpm run start(orpnpm run devif you don't need collab) - 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 filespnpm run lint:fix- Auto-fix lint issuespnpm run prettier- Check code formattingpnpm run prettier:fix- Auto-fix formatting issuespnpm run flow- Run a full foreground Flow check (does not reuse a server)pnpm run tsc- Run TypeScript compilerpnpm run ci-check- Run all checks (TypeScript, Flow, Prettier, ESLint)
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.
- 1mo ago Changed · +39 lines · +629 tokens per session 8b96b88af030
- 1mo ago Changed · +11 lines · +178 tokens per session 7bba8e7c149e
- 1mo ago Changed · +12 lines · +157 tokens per session bdea2104677e
- 1mo ago Changed · +3 lines · +54 tokens per session badbb8a884d3
- 1mo ago Changed · +30 lines · +412 tokens per session a69a3e84e1e9
- 1mo ago Changed · +20 lines · +340 tokens per session b3dd673fd13e
- 2mo ago First seen · 365 lines · 4,615 tokens per session scan A ee9826bd5cf3
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.
lexical AGENTS.md compared with instructions from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| lexical AGENTS.mdfacebook/lexical | Instructions file | 24k | 5d ago | MIT | A | 6,385 | Codex, OpenCode |
| vscode buildNext.instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 9,719 | GitHub Copilot |
| next.js AGENTS.mdvercel/next.js | Instructions file | 143k | today | MIT | A | 7,461 | Codex, OpenCode |
| vscode oss-third-party-notices.instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 5,516 | GitHub Copilot |
| langchain AGENTS.mdlangchain-ai/langchain | Instructions file | 149k | today | MIT | A | 4,680 | Codex, OpenCode |
| vscode copilot-instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 3,093 | GitHub Copilot |
| deepseek-harness AGENTS.mddeepseek-ai/deepseek-harness | Instructions file | 274k | 2d ago | MIT | A | 4,313 | Codex, OpenCode |