Skip to content

A prompt for an AI agent

An AI agent in the repository of an Astro site connects it to Seamlet itself: it installs the package, describes the content with a schema, marks the elements and builds the site. You check what the owner will be able to edit and connect the site in the CMS.

  1. In the CMS, press «Подключить сайт» (Connect a site) and copy your owner token (a developer’s account).
  2. Open Claude Code, Cursor or another agent in the site’s repository and paste the prompt below. Replace <token> with your token and «Моя кофейня» with the site’s title.
  3. Check the schema in src/schema.ts: which fields the owner will edit and which texts the agent left to the code.
  4. Deploy the site and give the CMS the address of its preview — connect it to the CMS.

The prompt is in English and the same on the Russian and the English page: the package’s README and its commands’ messages are in English, so the agent has no terms to translate. It writes the fields’ labels in Russian, as the owner sees them.

Prompt
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/.

The agent reads the README in node_modules once the package is installed: it describes everything the installed version does.