Work with a coding agent
Give a coding agent the IFLoom docs and a brief for your game, and have it check its own work.
Use this when a coding agent, such as Claude Code, Cursor or Codex, writes or changes your game. The agent needs to read the docs and to check what it did, and these steps give it both.
Give it the docs
Hand the agent one of the files the docs site publishes for language models:
llms-full.txtholds every page in one file, about 3 MB. Give it to an agent with room for it in its context.llms/<section>.txtholds one section's pages in one file, such asllms/how-to.txtfor the how-to guides orllms/reference.txt, for an agent with less room.llms.txtlists them.llms.txtlists every page with a link and a one-line description. Give it to an agent with a small context, and let it fetch the pages it needs.
Each page is also plain Markdown under https://ifloom.dev/llms.mdx/docs/. The Copy Markdown button at the top of a page copies it, and the Open menu beside it opens the page in ChatGPT, Claude or Cursor. An agent that works offline in a clone of the IFLoom repository can read the same pages in docs/content/docs/.
Connect it to the MCP server
The docs site runs an MCP server at https://ifloom.dev/api/mcp, over streamable HTTP, so the agent searches the docs and fetches single pages. Add it to the agent's MCP settings, such as .mcp.json for Claude Code or .cursor/mcp.json for Cursor:
{
"mcpServers": {
"ifloom": { "url": "https://ifloom.dev/api/mcp" }
}
}The server has three tools:
searchfinds pages and headings that match a query.list_pageslists every page with its path and description.get_pagereturns one page as Markdown, given a path such as/docs/reference/scenes.
Let AGENTS.md brief it
Every game that npm create ifloom makes has an AGENTS.md, which agents read when they start work in a folder. It points the agent at the docs, the MCP server and the three examples. It also says where each kind of content goes, as Organise your game's files does, and which commands to run after every change.
Add your game's own conventions to it, such as how you name scenes, the tone of the prose, and which plugins the game uses.
Have it check its own work
Tell the agent to run these after every change:
npm run checkloads the game and lists every problem, such as a scene, prose key or id that content names and nothing declares. It printsNo problems.and exits with0when there are none, and exits with1otherwise.npm run playtestplays a few turns with nobody at the keyboard and writes every screen and command to a text file. The agent reads it to find a scene that never shows, a choice that's always refused, or a number that never moves.npm run typecheckruns TypeScript, so a field the agent misspelt fails.
Point it at an example
Ask the agent to follow one of the repository's three examples, which are whole, working games:
examples/novelfor a story in chapters.examples/cafefor a management game built on entities.examples/showcasefor places, characters and a calendar.
Ask for content as data, too. Scenes, conditions and effects are plain objects that check reads, and a rule written as code is harder for the agent and for check to verify.
For more, see:
- The CLI, for
check,playtestand the other commands. - Playtest and snapshot from the command line, to put the same checks in CI.
- The examples, with each example's files.
Last updated on