Build with AI

AI editors and coding agents often guess wrong about sitelo — they reach for React, Next, or Astro patterns that don’t apply. This guide shows how to point them at current sitelo docs and keep generated code on-model.

llms.txt

sitelo publishes a machine-readable summary of the framework at sitelo.js.org/llms.txt. Many agents can fetch a URL; ask yours to read that file (and the human docs) before writing sitelo code.

Unlike a docs MCP server, llms.txt needs no install — paste the URL into the chat, add it to project rules, or let the agent fetch it.

Project rules

If your tool supports persistent instructions (AGENTS.md, Cursor rules, Copilot instructions, …), add a short sitelo rule so every session starts with the right mental model. The basic example includes an AGENTS.md you can copy:

# sitelo

This project uses [sitelo](https://sitelo.js.org) — a Vite-powered static site generator.

## Rules

- Pages are modules under `src/` with extensions like `.ht.js` / `.ht.ts` / `.ht.jsx` that **export a default function (or string) returning HTML**.
- Do **not** introduce React, Next.js, Astro, or a component/hydration framework unless the user explicitly asks.
- Routing is file-based: `about.ht.js` → `/about`, `[slug].ht.js` → dynamic (use `generateStaticParams` for `sitelo build`).
- Load data with `export async function data(ctx)`. Use `fetchWithCache` from `sitelo` for cached HTTP.
- Only JS/CSS referenced from HTML is bundled into `dist/`. Keep server-only code unreferenced so it never ships.
- Config lives in `sitelo.config.js`. Put Vite options under `vite`.
- Commands: `sitelo` (dev), `sitelo build`, `sitelo preview`.
- For current APIs, read https://sitelo.js.org/llms.txt and https://sitelo.js.org/docs — do not invent APIs from other frameworks.
- Prefer [javascript-to-html](https://ht.js.org) (`ht.js`) for markup: tag functions that return HTML strings. Docs: https://ht.js.org

Cursor

Create .cursor/rules/sitelo.mdc in your project (or paste the same text into Cursor’s project rules UI):

---
description: sitelo static site conventions
alwaysApply: true
---

# sitelo

Pages are `.ht.js` (etc.) modules that return HTML strings — not React/Next/Astro components.
Prefer javascript-to-html (https://ht.js.org) for markup. Use file-based routing, `data()`, and `sitelo build`.
Prefer https://sitelo.js.org/llms.txt for sitelo APIs.

Tips for AI-assisted sitelo work

Getting started · Basic example · llms.txt