# Review checklist for AI-written code

Source: https://help.ruuster.com/idx/ai-review-checklist

> The checklist to run over code an AI coding tool wrote for your listing pages before you merge it, covering keys, display rules, hidden addresses, status codes, forms and fair housing.

Run this checklist over code an assistant wrote before you merge it. Each item says how to check it.
The [launch audit prompt](https://help.ruuster.com/idx/prompt-launch-audit) runs the same checks for
you and changes nothing until you approve, and the [launch checklist](https://help.ruuster.com/idx/launch-checklist)
adds the SEO checks for launch day.

<p class="code-title"><code>review-checklist.md</code></p>

```markdown
# Review checklist for AI-written listing code

Check every item before you merge code an assistant wrote. Each item says how to check it.

## Keys

- [ ] IDX_SECRET_KEY is read only in server code: server components, route handlers and middleware. After `npm run build`, `grep -rE "idx_sk_[A-Za-z0-9]{8}" .next/static` finds nothing (the pattern matches a real key, not the components' own check for one).
- [ ] No key appears in a URL, a log line or a commit. `git log -p | grep -c "idx_sk_"` answers 0.
- [ ] No key appears in any page source (search the built pages for idx_). With `npm run build` and `npm start` running, `curl -s http://localhost:3000/search | grep -c "idx_"` answers 0, and the same holds for your home page, an area page and a listing page.
- [ ] The search box, the filters and the mortgage calculator call your own /api/idx route, made with `@ruuster/idx/route` (or, with no server, the widgets call the API with no key from your approved website address). No component gets a `publishableKey` and no widget has a `data-rw-key`.

## What every page shows

- [ ] Every listing card shows its attribution line where the board requires one.
- [ ] Every listing page shows the attribution and courtesy lines and the board's logo and disclaimer.
- [ ] Every page with listings, and the map frame, shows every board's disclaimer and the "Data last updated" line.

## Hidden addresses

- [ ] A listing whose address is hidden shows no street in its URL, title, description, Open Graph tags, JSON-LD, map or CRM payload. Its URL is the id-only slug.

## Status codes and indexing

- [ ] A removed listing answers HTTP 410 with noindex and links to similar homes. Check it with `curl -sI`.
- [ ] An outdated slug answers 301 to the current URL, and an unknown id answers 404.
- [ ] A search with filters a visitor picked carries `noindex,follow`, and area pages carry `index,follow`.
- [ ] Pagination and card links are plain `<a href>` links in the first HTML.

## Forms and your CRM

- [ ] The contact consent box and the alerts box both start unchecked, and the form does not submit until the contact box is checked.
- [ ] Forms post to your own server route, which sends to your CRM. No CRM key is in browser code.
- [ ] The lead source your CRM shows is your site's name (SITE_NAME).
- [ ] A test lead sent from a listing page arrives in your CRM with the listing attached.

## Words on the page

- [ ] Fair housing: the copy describes homes, places and amenities only. Nothing describes the people in an area or who a home or area suits, and schools are named but never ranked as a reason to buy.
- [ ] Area copy is your own writing, not listing remarks.
```
