{
  "tab": "mechanics",
  "section": "traitCategories",
  "title": "Trait Categories",
  "summary": "Categories group `traits` together and control how many the player can pick from each group. Each category must be defined before `traits` can be assigned to it - the `traits` array lists which trait names belong to this category.",
  "uiLocation": "Mechanics → Trait Categories",
  "uiSubtitle": "\"Trait categories\"",
  "editor": "JSON + ADD ITEM",
  "sizeLimits": [
    {
      "field": "`traitCategories` (entire section)",
      "limit": "100,000 chars",
      "sections": [
        "mechanics/traitCategories"
      ]
    }
  ],
  "related": "traits - traits are assigned to categories via `category`",
  "wikiUrl": "/mechanics/traitCategories",
  "schema": {
    "_type": "record",
    "domain": "string",
    "codomain": {
      "_type": "required",
      "fields": {
        "name": "string",
        "maxSelections": "number",
        "traits": {
          "_type": "array",
          "of": "string"
        }
      }
    }
  },
  "body": "## Example\r\n\r\n```json\r\n{\r\n  \"Race\": {\r\n    \"name\": \"Race\",\r\n    \"description\": \"Your ancestral heritage. Shapes base capabilities and how the world sees you.\",\r\n    \"maxSelections\": 1,\r\n    \"traits\": [\"Human\", \"Elf\", \"Dwarf\", \"Halfling\"]\r\n  },\r\n  \"Class\": {\r\n    \"name\": \"Class\",\r\n    \"description\": \"Your trained vocation. Determines starting equipment and which abilities are most readily available.\",\r\n    \"maxSelections\": 1,\r\n    \"traits\": [\"Soldier\", \"Scholar\", \"Scout\", \"Healer\", \"Merchant\"]\r\n  },\r\n  \"Background\": {\r\n    \"name\": \"Background\",\r\n    \"description\": \"Where you come from and what shaped you before adventuring. Adjusts base skills and gives one starting item.\",\r\n    \"maxSelections\": 1,\r\n    \"traits\": [\"Noble Household\", \"Working Family\", \"Frontier Town\", \"Coastal Port\"]\r\n  },\r\n  \"Perks\": {\r\n    \"name\": \"Perks\",\r\n    \"description\": \"Edge traits — small advantages from biology, habit, or hard-won experience. Pick up to two.\",\r\n    \"maxSelections\": 2,\r\n    \"traits\": [\"Iron Stomach\", \"Light Sleeper\", \"Sharp-Eyed\", \"Quick Learner\", \"Bookish\", \"Patient\", \"Cool Head\", \"Lucky\"]\r\n  }\r\n}\r\n```\r\n\r\n## Fields\r\n\r\n### maxSelections\r\n\r\nhow many traits from this category the player can choose. Set to `1` for mutually exclusive categories or to the desired multi-select cap. **`0` is empirically broken in the live UI -- the category renders 'Selected 0/0' and no traits can be picked.** For \"pick everything that applies\" categories, set `maxSelections` equal to the number of traits in the category. Typical values: `1` (single-pick), `3-N` (multi-select).\r\n\r\n### traits\r\n\r\n**required** `Array<string>`. Lists all trait names in this category. Validator errors if absent.\r\n\r\n> **📋 Note:** The validator checks `name`, `maxSelections`, and `traits` on traitCategory entries.\r\n\r\n> See [Authoring Guide > Traits](/mechanics/traits#traits-character-creation-depth-and-clarity) for the pattern on hiding trigger-only system traits from the character creator."
}