> ## Documentation Index
> Fetch the complete documentation index at: https://docs.superintern.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Builder Reference

> The rules, files, settings and commands a SuperIntern website follows: for developers and AI coding agents such as Claude Code and Codex.

This page is for whoever writes the website's code: you, a developer, or an AI agent such as Claude Code. Each site's repository contains an `AGENTS.md`, and the site kit it uses ships a `GUIDE.md` and a `CONTRACT.md` with the full detail. Read those first when working on a site; this page is the overview.

## How a site is made

* **Astro, React, TypeScript and Tailwind**, from SuperIntern's template. Pages are prebuilt HTML; pages that show CRM tables are drawn when visited.
* **Two parts.** The site's own files (pages, sections, layouts, styles, content and `src/site.config.ts`) started as a copy of the template and are the site's to change. The **site kit**, `@superintern/site-kit`, is the platform's code: reading the CRM, forms, chat, consent, the shop, customer sign-in, and the build and check steps. See [The site kit](#the-site-kit).
* **One git repository per site**, reached only through SuperIntern: `https://git.superintern.app/<slug>.git`. Get a sign-in with the `site_git_access` tool or a website key.
* **A new site starts as one commit**, *Started from the SuperIntern template*, holding the template's files and none of its history. The template itself is readable (never writable) at `https://git.superintern.app/site-starter.git`, to see what it has now. **Never merge it into a site.** A new site shares no history with it, so `git merge` refuses it; on a site made before November 2026 a merge would go through, and either way it brings the template's sample content back.
* **Push to `main` to build.** Each push is built (`npm ci --ignore-scripts`, then `npm run build`), checked by a safety gate, and stored as a version. **A push never publishes.** Publishing is a separate step the owner asks for.
* **A failed or refused build leaves the live site unchanged.** `site_read` (or `sites status`) gives the failed step and why.

## Commands

| Command | What it does |
| - | - |
| `npm install --ignore-scripts` | Install |
| `npm run use-template -- <name>` | Start from a template: `shop`, `local-service`, `restaurant`, `professional`, `software`, `portfolio`, `events` |
| `npm run strip-examples` | Remove the example content |
| `npm run dev` | Preview at `http://localhost:4321`; `/dev/sections` shows every section |
| `npm run tables` | Prints the `crmTables` lines for the business's public tables |
| `npm run check` | Contract, tests, build, types, page and redirect checks. **Must pass before every push.** |

## The site's files and the platform's

| Edit freely | Never change |
| - | - |
| `src/site.config.ts` | `vendor/` and `node_modules/` (the site kit) |
| `src/styles/global.css` (design tokens, light and dark) | `scripts/` (the checks; never change them to make a check pass) and `astro.config.mjs` (no adapter, no `output: "server"`) |
| `src/pages/`, `src/sections/`, `src/components/` | Install scripts in `package.json` |
| `src/data/*.json`, `public/` | Anything served under `/_v` or `/dev` |
| `src/lib/ui-text.ts` (all wording) | |
| `SITE_NOTES.md` (the owner's lasting preferences) | |

`AGENTS.md`, `CLAUDE.md`, `CONTRACT.md` and `.claude/` are never published.

## The site kit

Every site uses the same kit, at the version written in its `package.json`. It is installed from `vendor/site-kit-<version>.tgz`.

* **Import it, never copy it.** Pages and sections import the kit's parts by name, for example `import { loadRows } from "@superintern/site-kit/tables"` or `import AddToCart from "@superintern/site-kit/components/AddToCart.astro"`. A copy in `src/` stops getting the kit's fixes.
* **Change a part by wrapping it** in a component of the site's own: pass it options, put your markup around it, style it with the site's classes. When the kit can't do something the site needs, build what you can around it and tell the owner what's missing.
* **The site's own files the kit reads:** `src/site.config.ts`, `src/lib/ui-text.ts` (all wording), `src/lib/table-needs.ts` (what the site's own lists hold) and the layout, which renders `<SuperInternHead {...Astro.props} />` in its `<head>` and `<SuperInternBody />` at the end of its `<body>`.
* **The full guide comes with the kit**, at `node_modules/@superintern/site-kit/GUIDE.md` after `npm install` (`npx site-kit guide` prints where), next to its `CONTRACT.md`.
* **Updates arrive by themselves.** SuperIntern moves a live site to a newer kit with one commit that changes only `vendor/`, `package.json` and `package-lock.json`. It's built and checked like any push, and goes live only if it passes and the live version hasn't changed meanwhile; an unpublished draft is carried over on top. A major new version arrives as a draft change for the owner to review and publish. Never update the kit by hand; `npx site-kit version` says which version a site runs.

A site made before the kit keeps the same parts in its own `src/lib/`, `src/components/` and `scripts/`, imported as `@/lib/…`, and its `AGENTS.md` and `CONTRACT.md` describe them. SuperIntern moves such a site onto the kit once, with `npx site-kit migrate`, checking that the site builds the same before and after (the kit's guide, *Moving a site onto the kit*, has the steps). Never merge the template into it to get the kit.

## `site.config.ts`

| Key | For |
| - | - |
| `name`, `description`, `locale`, `translations`, `currency` | The basics |
| `nav`, `action`, `appearance` | Menu, main call to action, look |
| `contact`, `social`, `business` | Contact details, links, and the details Google reads (type, logo, price range, location) |
| `crawlers`, `verification` | Which search engines and AI crawlers may visit; site verification ids |
| `crmTables` | The CRM tables the site reads, e.g. `{ menu: "Dishes" }` or a table id |
| `forms.contact` | A CRM form to use as the contact form |
| `shop.enabled` | Turns on the shop. Only when the owner asked for one and payments are on |
| `chat` | The website chat: agent id, web chat key, skill and greeting |

Tracking tags are set by the owner in the dashboard, not in `analytics` (that key is for sites hosted elsewhere).

## Showing CRM data

* List each table under `crmTables`. `npm run tables` prints the lines.
* A page that shows rows is a **data page**: it sets `export const prerender = false`, reads in its own frontmatter with `await loadRows(Astro, "menu")` or `loadRow(Astro, "menu", slug)`, and returns a 404 for a missing item.
* Only public tables, columns and items can be read. Handle missing fields and empty lists.
* Never copy CRM rows into source files, and never read the CRM from the visitor's browser.

See [Show Your CRM on Your Website](https://docs.superintern.ai/websites/crm-on-your-website.md).

## Forms, shop and sign-in

| Need | Use |
| - | - |
| Contact form → People and inbox | `<ContactForm />` |
| A CRM form → private rows | `<TableForm />` with the form's id |
| Signed-in customers add their own rows | `<MyRowForm table="…" />` |
| Products and buying | `forSale(...)`, `<ProductPrice>`, `<AddToCart>` ([Sell on Your Website](https://docs.superintern.ai/websites/shop.md)) |
| Sign-in and My account | `/sign-in`, `/account`, `<SignIn>`, `<SignedIn>`, `<SignedOut>`; Google and Microsoft buttons and the password links are already in `<SignIn>` and My account ([Customer Accounts](https://docs.superintern.ai/websites/customer-accounts.md)) |

Call `site_table_list` before building any of these. It says whether payments and sign-in are on, and what visitors may do with each table. Parts for features that are off render nothing; never hide or show them yourself.

## Never

* Secrets, `.env` files, CRM keys or tokens anywhere in the repository. The web chat key is the only key allowed.
* Your own cart, checkout, sign-in, or a price typed into a page as the price charged.
* Password or card fields (the safety gate refuses them).
* `_worker.js`, `_headers`, `_routes.json`, `wrangler.*`, `functions/` or `src/middleware.ts`.
* Measurement scripts in pages. Use the owner's tracking tags, and `data-event` or `track("…")` for custom events with no personal data.
* Fonts or scripts loaded from other sites; symlinks, executables or archives.
* Invented prices, reviews or numbers.
* Telling the owner the site is live after a push. It's live after they publish.

## Languages

The main language is served at `/`. Each other language lives in `src/pages/<code>/` with matching paths, and its wording in `src/lib/ui-text.ts`.

## Limits

| | Limit |
| - | - |
| Builds | 20 an hour per site |
| Upload | 25 MB zipped; 200 MB and 5,000 files unpacked; 5 MB per file |
| Per page (compressed) | 60 KB HTML, 40 KB CSS, 150 KB JavaScript |
| Images | 400 KB each |
| Public items per table | 5,000 |
| Kept versions | The newest 30 from code and 10 from CRM updates |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.