Racelink
Dokumentacja · Working with an AI assistant

// Dokumentacja · Zaawansowane

Working with an AI assistant

An assistant can write a whole overlay in minutes if it knows the rules. Every project brings those rules along; here is how to put them to work.

Ten przewodnik jest na razie tylko po angielsku.

What the project already tells it

AGENTS.md
Short rules at the project’s root, read by most coding assistants on their own.
CLAUDE.md
The same rules for Claude Code, which reads this file.
node_modules/@racelink/overlay/docs/ai-guide.md
The long version: the SDK on one screen, data rules, settings, testing and publishing. Point the assistant to it for anything beyond a small change.
docs/reference/fields.md
Every field in the same folder, so the assistant does not guess paths.

Describe the task

Say what the player should see, in which games, and what can be set. Ask it to check its own work with the project’s commands:

Prompt
Read node_modules/@racelink/overlay/docs/ai-guide.md first.

Build a fuel overlay: litres left, laps left at the current consumption,
and a warning when the car cannot finish. Every game.
Settings: warning threshold in laps (1..5, default 2), show litres or gallons.

When done, run npm run build and npm run validate, and tell me what to open
to see it on demo data.

Check what it made

Open http://localhost:5173/?demo and try a couple of games with ?demo=<game>. Then go through the list: these are the mistakes assistants make most.

Before you publish

  • Nothing is drawn before ready, and the first frame looks finished.
  • Every value can be null: no NaN, no “undefined” on screen.
  • The page stays transparent: no background on html/body, no color-scheme.
  • The overlay fills any size the player gives it.
  • No fetch or WebSocket of its own, no fonts or scripts from the internet, unless the manifest names the hosts.
  • Settings were changed in racelink.overlay.json, never in src/racelink-settings.ts.
  • npm run build and npm run validate pass.