Skip to main content

Agent instructions — create a Caught minigame

Follow these rules when drafting or generating a minigame for Caught. Prefer the reference patterns in Examples and the contracts in SDK overview and Bundle & manifest.

Download the agent pack

Download caught-minigame-agent-pack.zip — English docs + Pong reference for AI tools.

  1. Download the ZIP.
  2. Give it to your favourite AI coding tool together with your wishes for the minigame (theme, mechanics, win/lose rules, author inputs, languages, art style, …).
  3. Ask the model to follow 00_llm_instructions.md and produce a conforming Caught minigame ZIP.

The pack is always English so the model gets a single unambiguous technical source of truth.

Hard requirements​

  1. Vanilla, self-contained ZIP — HTML/CSS/JS (and allowed assets) only. No node_modules, npm/bundler output that expects Node, CDN <script src="https://…">, or other external runtime dependencies. Everything the game needs must ship in the archive (Caught injects the SDK at publish).
  2. Required files — index.html + manifest.json at the archive root (or one root folder containing both).
  3. manifest.outcomes — declare the non-empty result subset (win/lose/draw) your game will send in CaughtGame.complete. Rank is not supported yet. Runtime rejects undeclared outcomes.
  4. No Property APIs — never invent score/property keys. Authors map your declared outcomes to Properties on the action.
  5. Limits — ZIP ≤ 5 MB, ≤ 50 files, allowed extensions only, no nested archives, relative asset URLs, no connect-src / external fetch.

Author inputs (manifest.inputs)​

If the adventure author must supply configuration (e.g. memory card images, a title, a timer toggle), declare inputs in the manifest. Do not hardcode adventure-specific media when it should be configurable.

RuleValue
Max fields25
Typesstring | boolean | image | color | stringTranslateable | imageTranslateable | stringList | stringListTranslateable | stringImageList | stringImageListTranslateable
String UIoptional format: line (default) | paragraph | select; options (1–24) on string → admin dropdown
List UIstringList* → pills; stringImageList* → sortable tag+image rows (itemMode: either | both)
Stable id[a-zA-Z][a-zA-Z0-9_]{0,31}, unique
Labels / helpen, nl, de required; label ≤ 40 chars, help ≤ 150 chars
requiredPer-field only. true = always mandatory in the action editor; omit/false = optional (editor prefills from mock). No general requiredIf / oneOf — use inputConstraints.matchColumns for column OR/length
mockRequired on every field (optional and required) — review + editor + live fallback when the author has not set a value
String length0 ≤ minLength ≤ maxLength ≤ 2000 (also per item for stringList*)
Image / list countminCount/maxCount, max 50 per field
Image sizeminWidth/maxWidth/minHeight/maxHeight, each 1–2560. Mins = hard reject (no upscale); maxes = Caught auto-downscales on upload. Default mins to 1 unless the game needs a real floor.
Image mocks{ placeholder: true, label?, bg? } arrays — no PNG/JPG in the ZIP; Caught emits SVG data URLs
Same-name updatesMust stay backward compatible. Rejected: remove/rename id, flip type, optional→required on an existing id, raise minLength/minCount/minWidth/minHeight, lower maxLength/maxCount/maxWidth/maxHeight, drop outcome results. OK: widen those bounds, add fields (new required needs a usable mock). Intentional breaks → new minigame name.

Caught authors fill these in a modal of cards on playminigame. Values are validated again on the server and passed on init as:

CaughtGame.onInit((ctx) => {
const { inputs, locale } = ctx.context;
// string | boolean | string[] | { [lang]: string } | { [lang]: string[] }
const title = inputs.headline?.[locale] || inputs.headline?.en || inputs.boardTitle;
const tags = inputs.leftTexts?.[locale] || inputs.leftTexts?.en || [];
});

Translateable author values are Caught multilang maps; authors must fill every active GameType language. Translateable mock must include en, nl, and de.

Do not put mock image files in the bundle — use placeholder objects so review stays offline and CSP-safe.

Use stringList / stringListTranslateable for tag-only arrays (pills UI). Use stringImageList / stringImageListTranslateable when each row is a tag and/or image (itemMode: "either") or tag+image (itemMode: "both") — one reorderable list in admin (see Connect leftItems/rightItems). Prefer these over asking authors to type left | right lines in a paragraph.

Cross-field conditionals​

Column length + text/image OR: declare top-level inputConstraints with type: "matchColumns" (see Bundle & manifest). Caught enforces that on save / preview / session. Keep the four column fields optional; put a valid combo in mock.

Other OR / AND-across-fields (e.g. “timer or attempt limit”) are still not platform-enforced. Use this pattern:

  1. Manifest — leave every branch required: false. Do not invent keys like requiredIf, dependsOn, or oneOf. Put the rule in help. Align mock with one valid combo.
  2. Runtime — in CaughtGame.onInit, validate the combination. On failure: setup/error overlay; no Start / no play.
  3. When multiple branches are filled — use all provided content when the UX allows it.
  4. No silent refill of empty OR branches — do not inject assets/ or hard-coded demo rows. Optional empty = empty (stringList [] stays empty on soft-adapt).
  5. assets/ — Prefer chrome-only. Required gameplay content → author inputs + mock for preview (Memory cardImages, Connect columns). Not OK to paper over an unsatisfied OR.
// Pseudocode — see the Connect example (v2 columns)
const leftTags = inputs.leftTexts?.[locale] || [];
const leftImgs = inputs.leftImages || [];
// matchColumns already blocked bad saves; still guard in-game
if (!leftTags.length && !leftImgs.length) {
errors.push(t('configNeedContent'));
}
// texts + images on a side → show both per row

Reference: Connect in Examples and Bundle & manifest — inputConstraints.

Bundled default media → assets/​

When the game ships its own fallback art/audio (used when an optional author image input is empty, or for always-on chrome the author cannot replace), put those files in a root folder named assets/:

my-minigame/
index.html
manifest.json
cover.png # catalog only — stay at root
assets/
pair-01.webp # gameplay defaults
back.webp
Put hereDo not put here
Embedded defaults the game references with relative URLs (assets/…)Catalog cover.png / cover.jpg / cover.webp (archive root)
Optional logo/sprite/SFX the game always can fall back toAuthor image mocks (use { placeholder: true } in the manifest)
Loose media dumped next to index.html when an assets/ folder would fit

References: Memory and Connect in Examples.

Context you may use (phase 1)​

After CaughtGame.onInit, read from ctx.context (see SDK overview):

FieldSpecNotes
localestringActive language code (e.g. en, nl)
actionIdstringConfiguring playminigame action _id — always present. Seed procedural maps/layouts for consistency. If you use it, set manifest.usesActionId: true so review preview can regenerate a Layout ID.
team.namestringGeneric team label, always present
player.displayNamestringGeneric player label, always present
inputsobjectAuthor config keyed by manifest.inputs[].id (may be {}). Use type color for hex colours (#rrggbb) — do not expect context.theme.

Recommended label pattern: `${player.displayName} (${team.name})`.

Do not expect context.others (other teams) — not shipped yet.

CaughtGame.onInit((ctx) => {
const { team, player, locale, actionId, inputs } = ctx.context;
const label = `${player.displayName} (${team.name})`;
// Seed RNG / layout from actionId when generation must be stable per action.
// …
});

Lifecycle the game must implement​

  1. Wait for CaughtGame.onInit before using context / starting play that depends on inputs.
  2. Keep the UI blank until images are ready: CSS html:not(.cg-ready) body { visibility: hidden }, then CaughtGame.preloadImages(urls) (author + bundled), then document.documentElement.classList.add('cg-ready'). No loading splash — show nothing until then. Canvas-only games still reveal after onInit (empty preload is fine).
  3. Finish with CaughtGame.complete once (declared result: win / lose / draw).
  4. Prefer handling pause / resume / terminate if you use timers or audio.

Exact “start” UX is up to the game (auto-start after init is fine).

Complete vs abort (host behaviour)​

PathWho triggersWhat the game should doCaught step result
CompleteYour gameCall CaughtGame.complete({ status: 'success', result }) once with a declared result (win / lose / draw)Applies matching minigameOutcomeProperties; step succeeds
Fail statusYour game (optional)CaughtGame.complete({ status: 'fail', … })Treated as wrong answer / fail (quiz mode may still continue)
AbortPlayer taps host X (top-left) / backHost confirms, then sends terminate; you clean up — do not call completeAuthor On abort: fail = fail step; skip = advance without competitive outcomes; reset = remount session (play again, no step submit)

Games own competitive outcomes via complete. Host Close is abort, not a game-reported lose. Do not implement your own close/quit that tries to leave the host; do not post a close message.

Host / review corner safe zones (required)​

Caught overlays chrome the game does not own. Leave both corners free of HUD/controls:

  • HOST_CLOSE_SAFE_ZONE = 80 — top-left 80×80 CSS px (host Close X; safe-area aware).
  • REVIEW_SETTINGS_SAFE_ZONE = 80 — top-right 80×80 CSS px (dev / review settings cog; clear in all builds).

In-play info / introduction (required pattern)​

When the game has a start title + explanation, ship a small i control during play that reopens that introduction (same copy as the start screen).

RuleDetail
CornersTR, BR, or BL only — never TL (host Close owns top-left)
ContentTitle + explanation (introduction text); primary action is Continue (localized)
TimersPause all countdowns / attempt clocks while the info overlay is open; resume on Continue
VisibilityHide the i while any blocking overlay is up (start / pause / end / info itself)
ReferenceCodebreaker and Connect examples

Do not put the info control in the top-left. Prefer BR when the footer is free; use TR only below the 80×80 review settings zone (or clear of it).

Win / lose end screen (required pattern)​

Every game that can end in win or lose must use a full-screen overlay end screen (same shell as start / pause / info) — not footer-only copy.

Author inputs​

Input idOverlay roleLimits
winCaption / loseCaptionTitle≤40, stringTranslateable
winText / loseTextBody under title≤80, stringTranslateable, format: "paragraph"

Empty → localized defaults. Score/detail may fill the body only when author text is empty. Never ship a single title string alone.

Overlay structure​

#overlay (.win | .lose | .interactive)
#overlay-title ← caption
#overlay-sub ← body text
#overlay-actions
#btn-end ← End / Finish → CaughtGame.complete

Behaviour​

RuleDetail
Both linesAlways show title + body on win and lose
CompleteDefer CaughtGame.complete until End / Finish (auto-complete only when intentional, e.g. Maze — still use overlay title+body)
Tint#overlay.win / #overlay.lose on the title (green / red)
FooterKeep #message for in-play hints only; hide/disable submit while end overlay is up
Info / pauseDo not open help or treat pause as play once the end overlay is showing
ReferenceMemory, Pong, Connect, Unblock Me examples

Hide scrollbars (keep scrolling)​

Scrollable boards / lists should hide the scrollbar when possible while remaining scrollable (touch + wheel). Use:

.scroll-area {
overflow-y: auto;
scrollbar-width: none; /* Firefox */
-ms-overflow-style: none; /* legacy Edge */
}
.scroll-area::-webkit-scrollbar {
display: none; /* Chrome, Safari, Chromium Edge */
width: 0;
height: 0;
}

Works in Chromium Edge, Chrome, Safari, and Firefox. Prefer this on game boards and long column lists (see Codebreaker and Connect examples).

Deliverable for review​

  • ZIP meeting the submission checklist
  • Manifest name and version set correctly (Caught reads them from the ZIP; they are required). version must be digits-only MAJOR.MINOR.PATCH and strictly greater than any prior version for that name — see Versioning. Every follow-up edit to an example or shipped game must bump version (do not leave it unchanged).
  • Labels ≤ 40 / help ≤ 150 chars per language (en / nl / de); every input has a mock
  • Code paths for every declared outcome and every declared input id