What problem does it solve?
Setting up Lexicon-to-TypeScript code generation in the atproto monorepo involves subtle wiring: the right codegen:lex script, prebuild hooks, gitignore rules, --include filters, and a lex binary name collision between @atproto/lex and legacy @atproto/lex-cli. This Skill captures the canonical setup pattern and the fixes for the failures that follow stale or misconfigured codegen.
Core Features & Use Cases
- Package wiring: Add the standard
codegen:lex / prebuild / build script trio, gitignore src/lexicons, and compile with tsgo.
- Codegen control: Use
lex build flags like --include, --exclude, --lib, --indexFile, and --clear to scope and shape generated output.
- Troubleshooting: Diagnose stale generated trees after lexicon edits,
lex binary collisions with legacy lex-cli, and migration off gen-api/gen-server output.
- Use Case: After editing a Lexicon JSON file, a build fails with "type X is not assignable to Y" — this Skill directs you to regenerate via
pnpm codegen and explains why the stale tree caused it.
Quick Start
Ask the AI to wire up @atproto/lex code generation for a package in this repo, including the codegen script, prebuild hook, and gitignore entry.