Language Bridge

ai-instructions

Print AI-agent rules for a project (or write them to a file).

Prints project-specific rules (which locale to edit, how to push, what never to do) an AI agent can follow.

lb ai-instructions --project my-app            # print to stdout
lb ai-instructions --project my-app --write    # splice into AGENTS.md
lb ai-instructions --project my-app --write CLAUDE.md

--write splices them into the target file (default AGENTS.md) between <!-- lb:start --> / <!-- lb:end --> markers — idempotent, so re-running updates the block in place.

Options

FlagDefaultNotes
-w, --write [file]AGENTS.mdWrite to a file instead of stdout, wrapped in lb markers.

Plus the common options.

What it prints

The block is enriched with the project's real namespaces and locales pulled from the server. For project my-app (source en; locales en, pt-BR, es; namespaces checkout, common) it renders:

# Language Bridge — Translation RulesManaged by `lb ai-instructions`. Project: **my-app**.## Golden rules- Edit the source locale (`en`) by default. Only touch another locale  when the human explicitly asks you to translate into it.- After editing, run `lb push` — it stages your edits as **proposals**.- A push is a **partial upsert**: the JSON only needs the keys you are adding  or changing. Keys absent from a push are never deleted or touched.- NEVER publish. A human reviews each proposal and approves via the UI.- `lb pull` is never required before a push. Pushing an existing key just  updates its draft — it can't corrupt or delete anything.## File layout & push targeting- Files are FLAT: `<json-dir>/<namespace>.json` — the file name IS the  namespace. There are no per-locale folders.- One push targets exactly ONE locale:  - `lb push` → every namespace file, into the source locale (`en`)  - `lb push --locale <code>` → the same files' values, into that locale  - `lb push --namespace <ns>` → only `<ns>.json` (repeatable)  - combine both to send one namespace into one locale- A new namespace is just a new `<name>.json` file — push creates it.## Key format- Nested JSON inside each namespace file.- Dotted logical keys inside a namespace: `home.title`, `nav.buttons.save`.- Interpolation uses i18next `{{name}}` — keep placeholders identical across locales.- Plurals use `key_one` / `key_other` suffixes.## This project- Source locale: `en`- Locales: `en`, `pt-BR`, `es`- Namespaces: `checkout`, `common`## CommandsRun `lb help` (or `lb help <command>`) to discover commands.Three ways to push, fastest first:- **One key**: `lb add <key> "<value>" [-n <namespace>]` — stages the draft in a  single command, no files touched. Prefer this when the human asks for one or  two keys.- **A few keys**: write `<json-dir>/<namespace>.json` containing just those  keys → `lb push`. No pull needed — the push upserts only what the file  contains.- **Full round-trip** (editing existing values): `lb pull` → edit the source  JSON in place → `lb push`. Large namespaces are pushed in chunks  automatically.Either way, a human reviews via `lb review`.CI guard: `lb check` exits non-zero while any key exists only in the playground (unpublished).## Never- Touch a non-source locale unless explicitly asked.- Publish or mark anything live.- Change an existing placeholder's name.

This example is generated from the CLI's own template (cli/src/lib/instructions-template.ts) at build time, so it never drifts from what lb ai-instructions actually prints. With --write, this same block is spliced into the target file between <!-- lb:start --> / <!-- lb:end --> markers.

On this page