Membangun dengan AI

Editor AI dan agen pengodean sering menebak salah soal sitelo — mereka meraih pola React, Next, atau Astro yang tidak berlaku. Panduan ini menunjukkan cara mengarahkan mereka ke dokumentasi sitelo terkini dan menjaga kode hasil generasi tetap sesuai modelnya.

llms.txt

sitelo menerbitkan ringkasan framework yang terbaca mesin di sitelo.dev/llms.txt. Banyak agen dapat mengambil URL; minta agen Anda membaca berkas itu (dan dokumentasi untuk manusia) sebelum menulis kode sitelo.

Berbeda dengan server MCP dokumentasi, llms.txt tidak perlu dipasang — tempelkan URL-nya ke obrolan, tambahkan ke aturan proyek, atau biarkan agen mengambilnya.

Aturan proyek

Jika perkakas Anda mendukung instruksi permanen (AGENTS.md, aturan Cursor, instruksi Copilot, …), tambahkan aturan sitelo singkat agar setiap sesi dimulai dengan model berpikir yang benar. Contoh dasar menyertakan AGENTS.md yang bisa Anda salin:

# sitelo

This project uses [sitelo](https://sitelo.dev) — 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. Read local JSON with `readJson` / `readJsonCollection` from `sitelo/data`.
- 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.dev/llms.txt and https://sitelo.dev/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

Buat .cursor/rules/sitelo.mdc di proyek Anda (atau tempelkan teks yang sama ke antarmuka aturan proyek Cursor):

---
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.dev/llms.txt for sitelo APIs.

Kiat untuk kerja sitelo berbantuan AI

Memulai · Contoh dasar · llms.txt