# The AI Workflow

## The AI Workflow

**Skill level:** Beginner · **Time:** 5 minutes to set up

The same loop works for every change: **save a checkpoint, ask, review, check, then keep or undo.**

<Tabs>
  <TabItem label="AI editors and agents">

    For Cursor, Windsurf, Claude Code, GitHub Copilot in VS Code, Gemini CLI, Codex, and similar tools.

    <Steps>

    1. **Open the whole Lotline project folder** in the tool (the folder with `package.json`), not a single file or the unzipped download around it. The tool needs that folder to find `AGENTS.md` and its own rules file.

    2. **Start the site** with `npm run dev` so you can watch the change happen at [http://localhost:4321/](http://localhost:4321/).

    3. **Save a checkpoint.** If you use git, commit. If not, copy the folder. See [Editing Safely](/lotline/beginner/editing-safely/).

    4. **Ask for one change.** Name the file if you know it. Start your first request with "Read AGENTS.md first." Most tools load it on their own, and the sentence costs nothing in the others. For a bigger job, add "Follow the matching recipe in SKILLS.md." The [Prompt Library](/lotline/ai-customization/prompt-library/) has ready-made requests.

    5. **Review what changed.** Every tool shows a list of edited files and the changes (the "diff"). Check them against the review checklist below before you accept.

    6. **Check the result** in the browser. `npm run dev` picks up a saved change to `config.toml` on its own. Restart it after you change `fonts.json`, `trailingSlash`, or anything in `[settings.multilingual]`, because Astro reads those only when it starts. Ask the assistant to run `npm run astro-check`, or run it yourself.

    7. **Keep it or undo it.** Commit if you are happy. If not, ask the tool to revert, or restore your checkpoint.

    </Steps>

  </TabItem>
  <TabItem label="Chat assistants">

    For ChatGPT, Claude, Gemini, or any assistant in a browser tab.

    <Steps>

    1. **Give it the rules once per conversation.** Open `AGENTS.md` in your editor, copy all of it, and paste it with: "These are the rules of the website theme I'm editing. Follow them in every answer."

    2. **Paste the file you want to change**, with its path. For example: "Here is `src/content/properties/english/riverside-townhouse.md`:" and the whole file.

    3. **Ask for the change and the full file back**: "Return the complete file, ready to paste, and change nothing else."

    4. **Paste the answer over the file** in your editor and save.

    5. **Check the result** in the browser. If the terminal shows an error, copy the error and paste it back into the chat.

    </Steps>

    Chat assistants work best for text: rewriting copy, translating, writing listing descriptions, agent bios, and blog posts. For a change that touches several files, such as a new listing in three languages with its own photo folder, an AI editor saves a lot of copying.

  </TabItem>
</Tabs>

### Give The AI Good Context
The more precise the request, the better the result. Useful things to include:

- **The file.** "Edit `src/content/neighborhoods/english/riverside.md`", not "edit the Riverside page".
- **The page.** "The listings section under the hero on `/home-2/`."
- **Your agency.** One paragraph: where you work, whether you sell, rent, manage, or all three, and what makes you different. Paste it into every copywriting request.
- **Your real facts.** Listing prices, floor areas, bedrooms, agent names and phone numbers, the neighborhoods you cover, your fees, years in business. If you don't give them, tell the assistant to keep the sample values and list them for you to replace.
- **The layout name.** Copy it from the comment next to `layout:` in the section file: "use the `panel` layout of the hero".
- **What must not change.** "Keep every key and the number of items." File names link files together: a listing's `agent: "omar-reyes"` points at `src/content/agents/<language>/omar-reyes.md`, and `neighborhood: "riverside"` at the Riverside guide. Rename a file and every link to it breaks without an error.

### Review Checklist
Before you accept a change, check:

- [ ] Only the files you expected were edited.
- [ ] Text was changed in `src/content/`, `src/config/`, or `src/i18n/`, not typed into a component.
- [ ] Every language was updated: each language folder, `src/i18n/<language>.json`, and `src/config/menu.<language>.json` (unless you turned a language off).
- [ ] A new listing, agent, development, or neighborhood has the same file name in every language folder, and its `agent` and `neighborhood` values match real file names.
- [ ] Prices are plain numbers (`615000`, not `"$615,000"`), and rents are monthly.
- [ ] Keys and indentation in Markdown frontmatter, TOML, and JSON still look like the rest of the file.
- [ ] No new colors like `text-[#123456]` in components. Lotline uses its theme tokens (`bg-brand`, `bg-accent`, `text-ink`).
- [ ] No listings, reviews, ratings, review counts, or figures were made up. Where you didn't provide them, the assistant kept the sample items and told you which ones to replace.
- [ ] `npm run astro-check` reports no errors. It also runs `npm run check-i18n`, which lists missing translations, menu differences, and content files that exist in one language only.
- [ ] The changed pages look right in the browser:
  - at about **375 px** wide (a phone, with the mobile menu) and at **1280 px**
  - in **every language** (the language switch in the footer, or `/fr/` or `/ar/` in front of the path). Arabic pages should read right to left

`astro-check` doesn't validate the files in `src/content/sections/` and `src/content/contact/`, a misnamed page block is ignored without an error, and a wrong `agent` or `neighborhood` file name just leaves the card or link out. Only the page shows those mistakes.

### When The AI Gets Stuck
- **There is an error in the terminal.** Copy the whole error, including the file name and line number, and paste it with: "Fix this error. Explain the cause in one sentence."
- **The change does nothing.** Ask: "Which file does this text come from on this page? Check the route, the page's named block, and the section file." A page block overrides the section file (see [How Lotline Works](/lotline/getting-started/how-lotline-works/)). If the change is in `config.toml`, restart `npm run dev`.
- **A `[business]` value doesn't show.** The terminal prints a `[business]` warning when a value is in the wrong format (for example a phone number that isn't `+15550100199` style) and ignores it. Paste the warning to the assistant.
- **A new home doesn't appear in the list.** Ask it to check `status`, `price`, and `draft` in the listing file. A listing without a `status` or a `price` is left out of `/properties/`.
- **It keeps going in circles.** Undo to your checkpoint, start a new conversation, and ask for a smaller step.

<Aside type="caution">
  Never paste passwords, API keys, or private client data into an AI chat.
  Lotline doesn't need any to be customized: the form endpoints, the Mailchimp
  URL, and analytics IDs are public values.
</Aside>