# 3865 Plays — AI format guide (play management)

Share this file with ChatGPT, Claude, or any AI assistant together with an
exported `3865-plays.json` file. It describes the input format, the output
format, and the rules the model must follow when editing plays.

## 1. What you receive (input)

A complete playbook export: JSON, schema `version: 2`. Top-level keys:

- `categories`: tag categories. Each has `id`, `name`, `appliesTo`
  (`offense` | `defense` | `general`), `values` (ordered array of
  `{id, label, color?}`), and `includeInName` (boolean).
- `categorizations`: independent boolean labels. Each has `id`, `name`,
  `appliesTo`, optional `color`.
- `plays`: each play has `id`, `side` (`offense` | `defense`),
  optional `customName`, `tags` (object mapping `categoryId -> valueId`),
  and `categorizations` (object mapping `categorizationId -> true`).
- `combos`: call-sheet/wristband pairs. Each combo has `id`, `name`,
  `callSheet` (`side`, `includedPlayIds`, `categorizationIds`, layout and
  print settings) and `wristband` (grid, card size, print settings).
- `wristbandPresets`, `libraryFilter`, `librarySide`, theme and view
  settings: preserve verbatim unless the user asks to change them.

## 2. What you return (output)

Return a **complete** JSON file with `version: 2` containing **all**
original top-level keys. Rules:

1. Never change `version`. Never invent `__proto__`, `constructor`, or
   `prototype` keys.
2. Preserve every existing `id`. Generate new IDs with UUID v4 for new
   categories, values, plays, and combos.
3. Reference integrity: `play.tags` values must be `{categoryId: valueId}`
   pairs that exist in `categories`; `play.categorizations` keys must exist
   in `categorizations`; `includedPlayIds` and `categorizationIds` must
   reference existing plays and categorizations.
4. Limits: max 5000 plays, 200 categories, 500 values per category,
   200 categorizations, 100 combos. Labels max 500 characters.
   Files over 5 MB are rejected on import.
5. Unknown or extra keys are tolerated but prefer the exact export shape.

## 3. Authoring plays (label notation)

When reasoning about plays, use human labels, then convert to IDs:

```json
{
  "side": "offense",
  "name": "Trips Left Smash",
  "tags": { "Formation": "Trips Left", "Concept": "Smash" },
  "categorizations": ["Red Zone"]
}
```

- Match existing value labels **case-insensitively** (`smash` reuses
  `Smash`). Only create a new `TagValue` when no match exists.
- A play's display name is automatic: the labels of all categories with
  `includeInName` that the play is tagged with, joined with spaces in
  categories-array order. Set `customName` only when the user asks for a
  manual name; omit it (or remove it) to return to automatic naming.
- `side` must be `offense` or `defense`. Tags whose category `appliesTo`
  does not include the play side should be left unset.

## 4. Ordering and numbering rules

- Categories array order = Library table column order. Do not reorder
  unless asked.
- Values array order = dropdown order AND call-sheet group order.
- `callSheet.categorizationIds` order = call-sheet group order. A play
  with two listed categorizations appears under both groups.
- Numbering is shared: the call sheet and the wristband of the same combo
  use one number per play (`getSheetPlays`). Never invent separate
  wristband numbers. Within a group, plays sort alphabetically by display
  name.
- Wristband grid (`cols` x `rows`), card size in inches, and print setup
  only affect layout, never which plays or numbers appear.

## 5. Validation errors you may see after import

- `Invalid JSON file.` — the output is not valid JSON.
- `This file is too large. Imports are limited to 5 MB.` — split the
  change into smaller batches.
- `File does not contain valid 3865 Plays data (version mismatch or
  invalid structure).` — usually a wrong `version`, a missing `combos`
  entry (at least one combo is required), or duplicate IDs.

## 6. Ready-to-paste prompt

> I use 3865 Plays, a browser playbook builder. Attached are (1) this
> format guide and (2) my exported `3865-plays.json` (schema version 2).
> Please make the following change: [DESCRIBE YOUR CHANGE, e.g. "add
> these 6 offense plays with Formation and Concept tags, group them under
> the Red Zone categorization"]. Follow the guide exactly: preserve all
> IDs and top-level keys, match tag labels case-insensitively, create new
> UUIDs only for new objects, keep the shared call-sheet/wristband
> numbering intact, and return one complete valid JSON file and nothing
> else.

## 7. Privacy note

The user pastes files to the assistant manually. Do not ask for
credentials. Remind the user to keep an exported backup until the
imported result looks correct on both the call sheet and the wristband.
