# What to build

> The tools behind the films, so you or an agent can rebuild them: the project folder, the commands, the Midjourney paste blocks, what code owns and what people own, and how this site is built.

From the TatortatsXD wiki: https://www.tatortatsxd.fun/wiki/toolkit

The films were made by an agent driving a small command-line toolkit, with the owner answering questions at each gate. Nothing here needs that exact toolkit. It needs these files, and these rules in code.

## The project folder

| File | What it holds |
|---|---|
| `BRIEF.md` | The owner's ask, word for word, with the date |
| `DECISIONS.md` | Every owner decision, dated, newest last. Never rewritten: a new line supersedes an old one |
| `project.json` | Title, the lead's identity text, the budget caps, and the gates with what each approval covered |
| `bible/LEAD.md` | Her canon in prose: the constants, the prompt text, the never-list |
| `lyrics/` | The lyrics as sung and as read |
| `analysis/` | Beat map, word timings, sections, the ear-check report |
| `board/shots.json` | The storyboard: the source of truth for the edit |
| `plates/` | The prompt books, every candidate image, and the picks |
| `clips/<clip>.json` | One file per clip: the request, the takes, the measured lip sync |
| `edit/edl.json` | The edit list |
| `render/scan/` | The safety and canon scan of every take the edit plays |
| `ledger.jsonl` | Every paid call, estimated first |

## The commands

```text One command per stage
status                  where the project is, and the next step
decide "..."            log an owner decision
analyze                 stems, beat map, word timings, sections
lyrics display          check the on-screen lyrics against the sung words
board draft | audit | sheet
gate board --approve    only after the owner said yes
plates book             the prompt book for the images
clip sync               measure lip sync per take
edit edl | export
render encode --review
review scan-sheets      six frames per take, for the scan
spend                   real spend, read from the provider
```

Long steps (analysis, renders, scans) run as background jobs that the agent polls, so no time limit cuts them off.

## Midjourney, by paste

- **Four prompts per paste**, as one permutation: `{prompt one\, with its commas escaped, prompt two, ...} --ar 16:9 --raw`. Midjourney asks "Run 4 prompts?". If the number differs, a comma was not escaped: answer No.
- **Never more than 10 queued jobs** on the Basic and Standard plans. Wait for the queue to drain before the next block.
- **One folder per batch** (b01, b02), so the download is that batch and nothing else.
- **Fast mode**, Raw on, Personalization on. About 0.8 Fast GPU minutes per job, 1.3 in HD.
- The person at the keyboard handles logins, passkeys and captchas. The agent never handles them.

## Code owns the gates

| Code owns | People own |
|---|---|
| The approvals, and when they go stale | The story, the looks, the wording |
| The budget caps and the spend record | Which take is better |
| The face check and the lip-sync measure | Whether a frame looks like her |
| The scan record and its verdict | What is fine to publish |

## How this site is built

- `scripts/build_data.py` reads each film's board and plates, runs the face detector on every image with her in it, writes web copies to `public/img/` and the index to `src/data/images.json`.
- `scripts/build_films.sh` encodes each film, a 6-second loop and a poster.
- The site is Next.js. Every page, including all 332 image pages, is built ahead of time from that one index. The [MCP server](https://www.tatortatsxd.fun/agents#mcp) and the [API](https://www.tatortatsxd.fun/agents) read the same data.
