Skip to content

AI yordamchilari bilan ishlash ​

Editor ichida AI yo'q. Bu hujjatlar kod yozadigan AI yordamchilari (Claude Code, Cursor, Copilot va boshqalar) o'qishi uchun ham tayyorlangan, shunda ular siz uchun yozadigan kod haqiqiy API'dan foydalanadi.

Oddiy matn ko'rinishidagi hujjatlar ​

FaylNima u
/llms.txtHar bir sahifa ro'yxati, har biriga bir qatorlik izoh bilan (llmstxt.org formati)
/llms-full.txtButun qo'llanma, retseptlar va to'liq API ma'lumotnomasi bitta faylda, barcha kod misollari ichida
node_modules/@writeon/core/llms-full.txtXuddi shu fayl, paket bilan birga o'rnatiladi: har doim siz ishlatayotgan versiyaning hujjati, sayt kerak emas
/<sahifa>.mdIstalgan sahifaning toza Markdown nusxasi: manziliga .md qo'shing, masalan /guide/kit.md

Ular har build'da (pnpm docs:build; docs:dev'da emas) shu sayt bilan bir xil manbadan yasaladi, shuning uchun hech qachon eskirmaydi. Faqat ingliz tilida.

node_modules'ni o'qiydigan yordamchilar o'rnatilgan nusxani o'zi topadi (har paketning README'si unga ishora qiladi). Aks holda yordamchingizga llms-full.txt bering, sahifalarni o'zi ocha oladigan bo'lsa llms.txt yetarli.

Xato xabarlari ham shu o'quvchilar uchun yozilgan: har biri nimani o'zgartirish kerakligini aytadi, masalan qaysi extension'ni qo'shish yoki command'ni qanday chaqirish kerakligini.

AGENTS.md ​

Yordamchilar loyihadagi doimiy ko'rsatmalar faylini o'qiydi: AGENTS.md, CLAUDE.md yoki vositangizdagi shunga o'xshash fayl. Quyidagi blokni o'sha faylga nusxalang, shunda har bir sessiya eng muhim qoidalar bilan boshlanadi. Blok ingliz tilida: AI yordamchilari uchun shunisi aniqroq.

md
## Rich text editor: Writeon

This project uses Writeon (`@writeon/*`), a headless rich text editor on ProseMirror.
Full documentation for the installed version: `node_modules/@writeon/core/llms-full.txt`
(index: `llms.txt` next to it; also on the docs site). Read it before writing editor code;
do not guess the API. Error messages say how to fix the mistake: follow them.

Packages: `@writeon/core` (editor, `/presets`, `/commands`, `/extension`),
`@writeon/react`, `@writeon/vue`, `@writeon/ui` (headless controllers),
`@writeon/kit` (ready-made UI, `/react`, `/vue`, `/advanced`),
`@writeon/advanced` (+ `/schema`), `@writeon/html`, `@writeon/markdown`,
`@writeon/server`.

Rules:
- Store the document as JSON: `editor.getJSON()` (`DocJSON`). HTML and Markdown are
  derived from it (`toHTML`, `toMarkdown`), never the other way round.
- Define the extensions once, in one shared array, and use the same array in the
  editor, in `@writeon/server` and in `@writeon/html` / `@writeon/markdown`.
- Never trust what the browser sends: on the server, `validate(body, { extensions })`
  first, save `result.doc`, render with `toSafeHTML(result.doc, { extensions })`.
- Every editor needs `label` (a string or `{ labelledBy }`): it names the field for
  screen readers.
- Commands are factories: `editor.run(toggleBold())`, `editor.can(toggleBold())`;
  several in one undo step with `editor.transaction((tx) => { … })`.
- Advanced features: include `advancedSchema()` in the extensions from the start;
  load the behaviour later with `editor.enable(() => import('@writeon/advanced'))`,
  or use the kit's `<Advanced>` / `mountAdvanced()`.
- `editor.pm` (raw ProseMirror) is not a stable API; prefer commands, snapshots
  (`getSnapshot()`, `subscribe()`) and extensions (`defineExtension`).
- Save with `debounce()` from `@writeon/core` and call `.flush()` on `pagehide`.

Undagi har bir qoida shu qo'llanmada tushuntirilgan: saqlash, xavfsizlik, asosiy tushunchalar, oddiy va kengaytirilgan.

Tiplar va JSDoc ​

Har bir ochiq funksiya, tip va parametrda JSDoc bor, ko'pincha misol bilan. node_modules'ni o'qiydigan yoki muharriringizning language server'idan foydalanadigan yordamchilar ham uni ko'radi, aynan siz o'rnatgan versiya uchun.