# Tusk-ready starter

A three-page static site (`index.html`, `about.html`, `contact.html`) that is ready for Tusk CMS from the first line of code. Every word, photo, link and list the owner may change already carries a `data-tusk` mark, so connecting the site to Tusk is a formality and the scan finds exactly what you meant.

Copy this folder, replace the words and the design, keep the marks. The guide for building this way is https://tuskcms.com/llms-build.txt; the attribute grammar it uses is https://tuskcms.com/llms-full.txt.

## What is in it

| File | Role |
| --- | --- |
| `index.html`, `about.html`, `contact.html` | One `data-tusk-page` per page. Marked: SEO title and description, headlines, intro paragraphs, photos (including a background photo), buttons and links (web, mailto, tel), a map embed, a toggle, a PDF download, and two lists (services, team). Not marked: the menu, the contact form, the legal line. |
| `styles.css`, `img/`, `downloads/` | Design and placeholder assets. Tusk never touches them. |
| `tusk-pull.mjs`, `tusk-apply.mjs` | The two Tusk build scripts. They are for connected sites, so they download with your build token; `npm run sdk:update` fetches the current copies with `TUSK_TOKEN` and `TUSK_SITE` loaded from your `.env`. |
| `build.mjs` | Stages the site into `dist/`, then runs the two scripts against it. Skips them, with a note, until the site is connected. |
| `env.example` | The variable names the build reads. Save it as `.env.example` in your copy; copy that to `.env` once the site is connected. |
| `gitignore` | Save it as `.gitignore` in your copy: it keeps `.env`, `.tusk/`, `dist/` and `node_modules/` out of git. |

The two dotfiles are shipped without the leading dot because a web server does not serve dotfiles; every file here is at `https://tuskcms.com/starter/<file>`.

## The three commands

```sh
npm run build    # stage dist/, then pull published content and write it into dist/ (skipped until connected)
npm run pull     # the pull step alone: fetches the snapshot into .tusk/published.json and the photos into dist/tusk
npm run apply    # the apply step alone: writes .tusk/published.json into the marked HTML under dist/
```

Set `build` as the host's build command and `dist` as its output folder. Before the first publish the apply step reports zero fields written; that is correct, the words in the HTML are the fallback.

## Connect it

When the site is built and deployed once, open it in your AI tool and paste:

```
Connect this site to Tusk CMS. Read https://tuskcms.com/llms-full.txt first and follow it exactly.
```

The agent registers the site, sets `TUSK_SITE` and `TUSK_TOKEN` in `.env` and in your host, records the deploy hook, scans, publishes and proves it went live. Then invite the owner from Tusk (Manage, People, Give a client access).

## Keep it Tusk-ready as you build

- New copy the owner may change: mark it as you write it (`data-tusk="page.field"`). New photo: mark the `<img>`. New button: mark the `<a>`. New repeated group: `data-tusk-list` on the wrapper, `data-tusk-item` on each child, `data-tusk-field` on each part, and the first item defines the shape.
- New page: `data-tusk-page="Name"` on `<body>`, mark its `<title>` and `<meta name="description">`, add it to the menu on every page, and add it to `SITE_FILES` in `build.mjs` if it lives outside the folders already copied.
- Never use a reserved field id: `id`, `key`, `kind`, `title`, `url`, `order`, `state`, `portal`, `updatedAt`, `tenant`.
- After changing which elements are marked, deploy and re-scan in Tusk so the owner's editor shows the new fields.
