Перейти к содержимому

Промпт для ИИ-агента

ИИ-агент в репозитории сайта на Astro подключит его к Seamlet сам: поставит пакет, опишет контент схемой, отметит элементы и соберёт сайт. Вам останется проверить, что владелец сможет править, и подключить сайт в CMS.

  1. В CMS нажмите «Подключить сайт» и скопируйте токен владельца (учётная запись разработчика).
  2. Откройте Claude Code, Cursor или другой агент в репозитории сайта и вставьте промпт ниже. Замените <token> на свой токен, а «Моя кофейня» — на название сайта.
  3. Проверьте схему в src/schema.ts: какие поля будет править владелец и какие тексты агент оставил коду.
  4. Выложите сайт и укажите в CMS адрес предпросмотра — подключить к CMS.

Промпт написан по-английски и одинаков на русской и английской страницах: по-английски написаны README пакета и сообщения его команд, так агенту не нужно переводить термины. Подписи полей он напишет по-русски — их увидит владелец.

Промпт
Connect this Astro site to the Seamlet CMS: the site's owner will edit its texts,
photos and prices right on its pages, while the design and the code stay as they are.
1. Run `npm install @seamlet/astro`.
2. Run `npx @seamlet/astro init --title "Моя кофейня" --token <token>`.
It writes seamlet.json with "ownerToken", src/schema.ts, src/seamlet.ts and a first
page component. If seamlet.json already exists, add "ownerToken": "<token>" to it.
3. In src/schema.ts, describe what the owner edits: texts, photos, prices, lists of
records (dishes, services, events). Write the labels in Russian, as the owner reads
them. Move the texts the pages show now into the initial content, so the site looks
the same.
4. Render that content in the components, and mark every element that shows a field
with `editable<Content>()` from `@seamlet/astro/schema`. Never render content with
set:html.
5. List the pages in src/seamlet.ts and render them all from one route,
src/pages/[...page].astro, with `site.staticPaths(...)`; remove the page files it
replaces. If records need pages of their own, use `recordPages`.
6. Add the integration and a server adapter for the preview:
`npx astro add @seamlet/astro node` (or `vercel`, `netlify`, whichever hosts the site).
7. `npm run build` must pass. With @astrojs/node it lists texts the editor cannot
reach: make each one a field, or mark it `data-cms-fixed` if it belongs to the code.
Docs: node_modules/@seamlet/astro/README.md (also https://www.npmjs.com/package/@seamlet/astro),
and https://docs.seamlet.ru/en/astro/connect/, https://docs.seamlet.ru/en/astro/schema/,
https://docs.seamlet.ru/en/astro/editable/, https://docs.seamlet.ru/en/astro/record-pages/,
https://docs.seamlet.ru/en/astro/preview/.

Агент читает README из node_modules после установки пакета — там описано всё, что умеет установленная версия.