---
name: set-agent-driven-development
description: Set's public AGENTS.md and llms.txt, the guide to the whole system. Read first when building a game or a simulation with set.world. It gives the build path from one seed to a running simulation (cast, state, orbs, equipment, combat, rewards, replay), how orbs bridge a game's own economy to Set, the map of every data endpoint, the table of contents of every skill with the API calls and schemas each one owns, how to add the Anima System's models and combat rules, and the terms of use.
license: Free to use when obtained from set.world, commercially too (the API, what it returns, the skills and downloaded models). The source code of Set is © Jimmy Lee under CC BY-NC 4.0 and its commercial use needs a paid waiver.
metadata:
  version: "0.8.10"
  title: AGENTS.md
---

# AGENTS.md

> You are an agent building a simulation with Set: a game, a battle, a dungeon run, a world of NPCs. Set gives you seeded characters and items, their grades and prices, reference tables, in-world text, 3D models and two complete combat rule sets. This file is the guide to the whole system: the same document is served as `AGENTS.md` and as `llms.txt`. It gives the order to build in and the table of contents of everything Set documents. Each line links one skill: a plain-text page with the calls to make, the exact schema of what comes back and a full example.

## What you build with

Set comes in three parts. Each reads only the parts before it, so you can take the first alone, the first two, or all three.

| Part | What it is | Runs | Required |
| --- | --- | --- | --- |
| **1. Set** (the API and its references) | Stateless HTTP `GET` endpoints at `https://set.world/api`. No key, no account. They generate characters and items from a seed, grade them and price them in one currency, orbs. The tables behind them (items, materials, stats, skills, classes, traits, effects) and the formulas are served as JSON or CSV | On Set's server | Yes |
| **2. Anima System** (game rules) | Set's own reading of what a character and its equipment do in a fight: health and stamina, what each material weighs and protects, what each held item's weight, reach, tempo and range are, and two combat modes, turn-based and scene-based. It is arithmetic on API responses with no renderer in it | In your code, in any engine or on a server | Optional: reuse it, change it or replace it |
| **3. Three.js examples** (models, motion, scenes) | The demos on `https://set.world`, built on parts 1 and 2: one rigged body, a model for every item, motion clips, and the scenes that put them together, drawn with Three.js in a browser. The models and clips download as GLB and load in any engine | In the browser | Optional: copy from them or build your own |
| **Your simulation** | Everything that changes over time: health, positions, inventories, wallets, levels, saves | Wherever you run it | Yours. Set stores none of it |

Set generates, grades and prices. The Anima System says what those numbers do in a fight. The examples show both running. Your simulation chooses combat, keeps state and progresses. If a skill says a thing is yours to decide, no endpoint decides it.

**Set.World is a service first, and it is not open source.** The hosted API, everything it returns and everything it lets you download are free to build on, commercial games included. The source code may be read, and reused non-commercially with credit, but a static version for a commercial game (Set's own code running inside your game or on your server, with no call to set.world) needs a paid waiver from the author. Most games never need one. The terms are at the end of this file.

## Build a simulation, step by step

Each step names the call, the schema you receive, the skill that owns both, and what your simulation keeps.

| Step | You do | Call | You get | Skill | You keep |
| ---: | --- | --- | --- | --- | --- |
| 1 | Connect and discover | `GET /api`, `GET /api/spec` | `Spec` | [API connection](https://set.world/skills/api-connection) | The `contentVersion` you build against |
| 2 | Load the vocabulary once | `GET /api/tables`, `/api/stats`, `/api/slots` | `CatalogResponse`, `StatsResponse`, `SlotsResponse` | [Item properties](https://set.world/skills/item-properties), [Stats](https://set.world/skills/character-stats), [Slots](https://set.world/skills/equipment-slots) | A cache per `contentVersion` |
| 3 | Cast the actors | `GET /api/roll/character?seed=` once per actor | `Character` | [Rolling a character](https://set.world/skills/rolling-a-character) | The whole response, unedited |
| 4 | Turn one seed into many | `deriveSeed(seed, i)` in your code | `Roster` | [Rolling a group](https://set.world/skills/rolling-a-group) | The base seed and each member's seed |
| 5 | Give each actor state | None | `GameCharacter` | [Rolling a character](https://set.world/skills/rolling-a-character) | Health, stamina, level, wallet, inventory |
| 6 | Spend orbs for better outcomes | `GET /api/craft?orbs=`, `/api/craft?tier=`, `/api/boost/cost` | `LotteryCraft`, `GuaranteeCraft`, `BoostCost` | [Rolling an item](https://set.world/skills/rolling-an-item), [Crafting an item](https://set.world/skills/crafting-an-item) | The orb balance: orbs are your currency |
| 7 | Decide what equipment does | `GET /api/modifiers?rolls=`, or AnimaSystem's rules | `ModifiersResponse` or `AnimaCharacter` | [Calculations](https://set.world/skills/calculations) or [Derived stats](https://set.world/skills/anima-derived-stats) | Your modifiers beside the birth |
| 8 | Choose how they fight | One of the three options below | `TurnEvent`, `HitEvent` or `DamageResponse` | [Derived combat](https://set.world/skills/anima-derived-combat), [Combat](https://set.world/skills/basic-lightweight-combat) | All combat state |
| 9 | Run the loop | None: no request per hit | `Scene` | [Scenes](https://set.world/skills/anima-scenes) | Your clock and your rule versions |
| 10 | Reward and recycle | `GET /api/drop`, `/api/salvage` | `DropResponse`, `SalvageResponse` | [Crafting an item](https://set.world/skills/crafting-an-item) | An orb ledger and the items |
| 11 | Give it a voice | `GET /api/classes`, `/api/skills`, `/api/effects` | Rows with `flavor` or `description` | [Text flavor](https://set.world/skills/text-flavor) | Your codex and your own text |
| 12 | Save and replay | `GET /roll/character?seed=` for a permanent sheet | A birth certificate URL | [Rolling a character](https://set.world/skills/rolling-a-character) | Seeds, `contentVersion` and full responses |

### Step 6: orbs are your currency

Orbs are the one unit Set prices in, and Set holds none of them. There is no wallet, no balance and no rule for how an orb is earned: your simulation tracks the number, checks it before a call and subtracts the spend after. More orbs buy better outcomes (more candidates, higher grades, exact grades, higher stats), at prices that are the same for every game.

That makes orbs a bridge. A game keeps whatever economy it likes (wood, stone, ore, gold, time, reputation), sets its own rate from each resource to orbs, and converts at the moment of the craft. [Crafting an item](https://set.world/skills/crafting-an-item) owns the prices, the odds and a worked bridge; [Rolling an item](https://set.world/skills/rolling-an-item), [Rolling a character](https://set.world/skills/rolling-a-character) and [Rolling a group](https://set.world/skills/rolling-a-group) show what orbs buy for one item, one character and a whole roster.

### Step 8: three ways to fight

| Option | Led by | Range and position | Where it runs |
| --- | --- | --- | --- |
| **Combat API** | Your code calls it per attack or per window | None | Set's server. Experimental and optional |
| **Turn-based** | Initiative: who acts next | Do not exist | Your client |
| **Scene-based** | Space: reach, range, contact, weight, tempo | Decide everything | Your client |

Turn-based and scene-based are different games; [Derived combat](https://set.world/skills/anima-derived-combat) keeps them apart and gives the rules and state schema of each. Set's home page shows one of each: **Adventure mode with party** is turn-based and **Battle with armies** is scene-based. Or write your own rules on the attributes: that is always allowed.

### A whole simulation in one function

Two parties of four, a turn-based fight on the attributes the API returned, then orbs for the kills and one craft. It uses steps 3, 4, 5, 6, 8, 10 and 12.

```js
const API = 'https://set.world';
const STATS = ['strength', 'dexterity', 'intelligence', 'wisdom', 'agility', 'vitality', 'perception', 'resolve', 'luck'];
const deriveSeed = (seed, i) => ((seed >>> 0) + Math.imul(i, 0x9E3779B9)) >>> 0;
const get = async (path) => {
  const response = await fetch(API + path), body = await response.json();
  if (!response.ok) throw new Error(body.error.message);
  return body;
};

async function simulate(seed, random = Math.random) {        // pass your own seeded generator to replay the fight
  const cast = [];
  for (let i = 0; i < 8; i++) {                               // one request at a time
    const birth = await get(`/api/roll/character?seed=${deriveSeed(seed, i)}`);
    cast.push({ id: `actor-${i}`, side: i < 4 ? 'party' : 'enemy', birth, health: Math.floor(birth.attributes.maxHealth), stamina: Math.floor(birth.attributes.stamina), nextAt: 1000 / birth.attributes.initiative });
  }

  const living = (side) => cast.filter((actor) => actor.side === side && actor.health > 0);
  let clock = 0;
  while (living('party').length && living('enemy').length) {
    const actor = cast.filter((candidate) => candidate.health > 0).sort((a, b) => a.nextAt - b.nextAt)[0];   // initiative leads
    const elapsed = actor.nextAt - clock;
    clock = actor.nextAt;
    actor.nextAt += 1000 / actor.birth.attributes.initiative;
    for (const other of cast) if (other.health > 0) other.stamina = Math.min(Math.floor(other.birth.attributes.stamina), other.stamina + 10 * elapsed / 1000);
    if (actor.stamina < 20) continue;                                // rest
    actor.stamina -= 20;
    const target = living(actor.side === 'party' ? 'enemy' : 'party')[0], attack = actor.birth.attributes, defence = target.birth.attributes;
    if (random() < defence.dodgeRate * (1 - attack.clarity)) continue;   // dodged
    const critical = random() < attack.criticalHitChance;
    target.health -= Math.min(target.health, Math.max(1, Math.floor(attack.physicalDamage * (1 - defence.physicalDamageReduction) * (1 - defence.globalResistance) * (critical ? 2 : 1))));
  }

  let orbs = 0;
  for (const fallen of cast.filter((actor) => actor.side === 'enemy' && actor.health <= 0)) {
    const stats = STATS.map((stat) => fallen.birth.finalStats[stat]).join('-');
    orbs += (await get(`/api/drop?stats=${stats}&class=trash&seed=${fallen.birth.seed}`)).orbs;
  }
  const craft = orbs ? await get(`/api/craft?orbs=${orbs}&seed=${deriveSeed(seed, 1000)}`) : null;
  return { seed, contentVersion: cast[0].birth.contentVersion, winner: living('party').length ? 'party' : 'enemy', cast, orbs, crafted: craft ? craft.item : null };
}
```

Everything the function returns is enough to show the result and to roll the same cast again at the same `contentVersion`.

### Add the Anima System

To make the same simulation visible and spatial, add parts 2 and 3 piece by piece. None of it changes an API response. Steps 1 to 3 are assets from the Three.js examples and work in any engine; steps 4 and 5 are the Anima System's rules and need no renderer; step 6 puts them together.

1. **A body for each actor**: one rigged model, coloured by the character's traits. [Character models](https://set.world/skills/anima-character-models).
2. **A model for each item**, in its rolled material, held or worn by rule. [Item models](https://set.world/skills/anima-item-models).
3. **Motion**: downloadable clips and the timing of every weapon action. [Animations](https://set.world/skills/anima-animations).
4. **Equipment that matters**: weight, protection, ward and hit power from each item's material. [Derived stats](https://set.world/skills/anima-derived-stats).
5. **Combat with positions**: the scene-based rules. [Derived combat](https://set.world/skills/anima-derived-combat).
6. **The scene itself**: queueing requests, clocks, teams, movement, bodies, cleanup. [Scenes](https://set.world/skills/anima-scenes).

### Rebuild one of Set's own pages

Every column of `https://set.world` and each of its pages (`/anima`, `/anima-all-weapons`, `/anima-scene`, `/item-models`) is one of these skills running live. [Scenes](https://set.world/skills/anima-scenes) has a build sheet for each one, says how faithful a replica can be, and maps every mechanic to its skill, its section of the math reference and its source file.

## All of Set's data is an endpoint

Nothing has to be copied out of a document. Every table in the lists below names its endpoint; each answers JSON, most answer CSV with `format=csv`, and the list endpoints take filters (`name`, `id`, `q` and their own), so a game can ask for one row ([API connection](https://set.world/skills/api-connection)). The one set of numbers with no endpoint is the Anima System's own: its material and held-item readings are printed in full in [Derived stats](https://set.world/skills/anima-derived-stats) and [Derived combat](https://set.world/skills/anima-derived-combat).

## The table of contents

This is the sidebar of `https://set.world`, in the same order. Every skill is at `https://set.world/skills/<name>`.

### Set: the API

| Skill | Use it to | Endpoints | Schemas it defines |
| --- | --- | --- | --- |
| [API connection](https://set.world/skills/api-connection) | Reach the API, read errors, pass seeds, keep `contentVersion`, get CSV, filter a table, connect over MCP | `/api`, `/api/spec`, `/mcp` | `Spec`, `ErrorEnvelope`, `Replay`, the MCP tools |
| [Rolling an item](https://set.world/skills/rolling-an-item) | Generate one item or a full equipment set; spend orbs for a better one; share and appraise it | `/api/roll/item`, `/api/roll/set` | `Item`, `Equipment`, `SlotBreakdown`, `InventoryItem` |
| [Rolling a character](https://set.world/skills/rolling-a-character) | Generate a complete character; read its sheet; spend orbs on its gear and stats; save a birth certificate | `/api/roll/character`, `/roll/character` | `Character`, `GameCharacter` |
| [Rolling a group](https://set.world/skills/rolling-a-group) | Turn one seed into a party, an army or a wave; budget orbs across it | `deriveSeed` | `Roster` |
| [Crafting an item](https://set.world/skills/crafting-an-item) | Run the orb economy: orbs as the bridge from your own resources, guarantees, the lottery, salvage, drops, stat boosts | `/api/craft`, `/api/craft/cost`, `/api/salvage`, `/api/drop`, `/api/drop/classes`, `/api/boost/cost` | `GuaranteeCraft`, `LotteryCraft`, `SalvageResponse`, `DropResponse`, `BoostCost`, `OrbLedgerEntry` |

### Anima System: models and Set's own game rules

[Derived stats](https://set.world/skills/anima-derived-stats) and [Derived combat](https://set.world/skills/anima-derived-combat) are part 2, the rules: every formula and table needed to implement them in your own code. [Character models](https://set.world/skills/anima-character-models), [Item models](https://set.world/skills/anima-item-models), [Animations](https://set.world/skills/anima-animations) and [Scenes](https://set.world/skills/anima-scenes) are part 3, the Three.js examples: the downloads, and a build sheet for every demo.

| Skill | Use it to | You get | Schemas it defines |
| --- | --- | --- | --- |
| [Character models](https://set.world/skills/anima-character-models) | Give a character a rigged 3D body and its trait colour | `anima.glb`, the published metadata file | `AnimaMetadata`, `CharacterBody` |
| [Item models](https://set.world/skills/anima-item-models) | Get the model of any held or worn item, and the rules for holding and wearing | A GLB per item | `ItemModelRef`, `ItemExportExtras`, `ItemAsset` |
| [Derived stats](https://set.world/skills/anima-derived-stats) | Decide what materials weigh, how armor protects and how hard a weapon hits | Material tables and formulas | `AnimaSystemReceipt`, `AnimaCharacter` |
| [Derived combat](https://set.world/skills/anima-derived-combat) | Fight turn-based (initiative, no range; Adventure mode with party) or scene-based (all spatial factors; Battle with armies) | Two rule sets and the reading of every held item | `TurnCombatant`, `TurnEncounter`, `TurnEvent`, `CombatantState`, `HitEvent` |
| [Scenes](https://set.world/skills/anima-scenes) | Compose a scene from API responses, or rebuild any of Set's own pages and home columns | A build sheet per scene and the map of every mechanic | `SceneActor`, `Scene` |
| [Animations](https://set.world/skills/anima-animations) | Get motion clips and the timing of weapon actions | A GLB per clip | `ClipMotion`, `AnimationClipAsset` |

### References

One skill per table or formula set. Each gives the endpoint for the full data and the schema of a row.

| Skill | Subject | Endpoint | Schemas it defines |
| --- | --- | --- | --- |
| [Item properties](https://set.world/skills/item-properties) | The 19 item tables, roll vectors and indexes; the whole catalog in one call | `/api/tables`, `/api/tables/:table` | `Table`, `TableEntry`, `CatalogResponse` |
| [Prefixes](https://set.world/skills/item-prefixes) | The prefix table | `/api/tables/prefix` | |
| [Suffixes](https://set.world/skills/item-suffixes) | The suffix table | `/api/tables/suffix` | |
| [Materials](https://set.world/skills/item-materials) | Materials and the grades F to S | `/api/tables/material-wearables`, `/api/tables/material-tools`, `/api/rarity/tiers` | `Grade`, `Material` |
| [Slots](https://set.world/skills/equipment-slots) | The 13 slots and 15 equipped items | `/api/slots` | `Slot`, `SlotsResponse`, `Loadout` |
| [Stats](https://set.world/skills/character-stats) | The nine base stats | `/api/stats` | `StatName`, `StatBlock` |
| [Skills](https://set.world/skills/character-skills) | The 288 character skills | `/api/skills` | `CharacterSkill` |
| [Classes](https://set.world/skills/character-classes) | The 145 classes | `/api/classes` | `CharacterClass` |
| [Advantages](https://set.world/skills/character-advantages) | The 144 advantages | `/api/advantages` | `Advantage` |
| [Disadvantages](https://set.world/skills/character-disadvantages) | The 144 disadvantages | `/api/disadvantages` | `Disadvantage` |
| [Effects](https://set.world/skills/status-effects) | The 48 status effects | `/api/effects` | `StatusEffect`, `EffectRule` |
| [Text flavor](https://set.world/skills/text-flavor) | All of the in-world prose: skill flavor, class descriptions, effect descriptions, and the voice they are written in | `/api/skills`, `/api/classes`, `/api/effects` | `CodexEntry` |
| [Calculations](https://set.world/skills/calculations) | Derived attributes, power rating, trait impacts, rarity, item budgets | `/api/attributes`, `/api/attributes/spec`, `/api/power`, `/api/traits/impact`, `/api/traits/impacts`, `/api/rarity`, `/api/modifiers`, `/api/modifiers/spec` | `AttributesResponse`, `PowerResponse`, `TraitImpact`, `RarityResponse`, `ModifiersResponse` |
| [Algorithms](https://set.world/skills/algorithms) | The full math reference, section by section | `/algorithms` | |
| [Combat](https://set.world/skills/basic-lightweight-combat) | The optional, experimental combat fallback | `/api/basic-lightweight-combat`, `/api/basic-lightweight-combat/spec` | `DamageResponse`, `InitiativeResponse` |

### Testing pages

Pages where a person can look at what the skills describe. They are not needed to use the API.

| Page | Shows |
| --- | --- |
| https://set.world/item-models | Every item on Anima and alone, in any material, with a model download |
| https://set.world/anima | The base model in eight motions, with model and motion downloads |
| https://set.world/anima-all-weapons | Every mainhand held by its own Anima |
| https://set.world/anima-scene | Generated characters fighting with their generated equipment |

## How to read a skill

1. **One skill per task.** Find the task above and fetch that one skill. It owns its calls, its schemas and its rules.
2. **Follow links instead of guessing.** A fact is written in one skill only; every other skill links to it. A schema named in another skill is defined in the skill listed for it above.
3. **Trust the examples.** Examples, counts, prices, odds and rule stamps are computed by Set's own code when a skill is served, against the current tables (`contentVersion` `4.swpi78HUCtcrZ1Eoi9dipw`). The few values recorded by hand name the rule stamp they were recorded under, and anything chosen only for illustration says so.
4. **Read data from endpoints, not from prose.** Tables are served whole as JSON, or as CSV with `format=csv`. A skill shows the columns and a few rows.
5. **Keep what you are told to keep.** Every roll returns a `seed` and a `contentVersion`. Store them with the full response: old snapshots are not hosted.
6. **Name the part.** Grades, prices and attributes are Set's. Weight, protection, hit power and both combat modes are the Anima System's, one reading among many. Models, motion and the look of a scene are the examples'. Label them so in anything you show.

## Install, MCP and versions

```sh
mkdir -p .claude/skills/set-rolling-an-item
curl -s https://set.world/skills/rolling-an-item/SKILL.md -o .claude/skills/set-rolling-an-item/SKILL.md
```

- Save a skill under its frontmatter `name`. This file is served at `https://set.world/AGENTS.md`, `https://set.world/llms.txt`, `https://set.world/llm.txt` and `https://set.world/skills`.
- To call Set through the Model Context Protocol, add `https://set.world/mcp`; [API connection](https://set.world/skills/api-connection) has the tools.
- Every skill carries one version, `metadata.version` in its frontmatter. It is Set's release version and is the same in every skill. **When it differs from the version in a copy you installed or remember, fetch the skills again.**
- `contentVersion` on a response is different: it is the snapshot of the tables and rules that produced that response.

## Terms: free to use, not open source

Set is made by Jimmy Lee, Head of Design at Vmax.ai and Partner at Internet Development Studio Company (INTDEV, internet.dev). Two rules, and they are different:

- **Using set.world is always allowed.** Calling the API, and using anything it returns or lets you download (characters, items, table data, flavor text, these skills, 3D models, animations), is free for any purpose, including commercial games. No key, no fee, no waiver. This is all most games need.
- **The source code is not open source.** Where you can see Set's source, it is © Jimmy Lee under CC BY-NC 4.0: you may read it, and copy and adapt it non-commercially with credit. A static version for a commercial game, meaning Set's own code run, shipped or sold as part of your product, needs a paid waiver from the author: write to j@internet.dev.

So build your simulation on the hosted API and its downloads, and implement any rule or formula these skills describe in your own code. Do not copy Set's source files into a commercial product. Where a skill names a source path, it is for reading and for non-commercial reuse.
