Skip to main content

Working with AI Agents on Arcadible

Coding agents can build, check, and publish an Arcadible game with the same arc commands you use. This page covers how an agent reads these docs, an AGENTS.md to add to your project, Arcadible's agent skill, and how arc behaves when an agent runs it.

Give the agent the docs​

These docs are published as text:

  • llms.txt lists every page as Markdown, with a one-line description.
  • llms-full.txt has every page in one file, for tools that load a whole file. Most agents' fetch tools cut a file that large into chunks and summarize it, so they read better one page at a time.
  • Add .md to any page's URL for its Markdown, such as /references/arcadible-manifest.md.

Point the agent at the page for the file it's changing, rather than all of them. The table in the AGENTS.md below does that.

Add an AGENTS.md​

Agents that support AGENTS.md read it before working in a project. The starters include one made for them. For a project of your own, save this at its root, and adjust it to your game, such as its commands and deploy_dir.

It holds only what doesn't change, and links to these docs for everything else. An AGENTS.md is copied into each project and isn't updated after, so an agent reading an old one still follows the current docs, which it reads as it works. Keep yours the same way: add what's true of your game, and link to these docs rather than copying from them.

AGENTS.md
# AGENTS.md

This project is a game for Arcadible, a platform for publishing games. Build it with anything that runs in a browser: if it builds to a folder with an `index.html`, the `arc` CLI checks and deploys it, whatever the engine. Players play it wherever Arcadible is installed, and in any browser.

**This file was written when the project was created, and Arcadible's docs are kept current.** Where they differ, follow the docs. Every page is listed in https://developer.arcadible.com/llms.txt; read each as its `.md`, as the table below links them.

## Read the docs first

Read the page that covers what you're changing, every time, rather than relying on what you remember of it.

| Before you change | Read |
| ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| The game | https://developer.arcadible.com/build/best-practices.md and https://developer.arcadible.com/references/runtime.md |
| How it starts | https://developer.arcadible.com/build/initialization.md |
| How it pauses | https://developer.arcadible.com/build/pausing.md |
| How it saves | https://developer.arcadible.com/build/saves.md, then https://developer.arcadible.com/references/arcadible-sdk/saves.md and its codes in https://developer.arcadible.com/references/arcadible-sdk.md |
| Who's playing | https://developer.arcadible.com/build/players.md, then https://developer.arcadible.com/references/arcadible-sdk/players.md |
| Its server code | https://developer.arcadible.com/build/server-code.md |
| Playing together, live | https://developer.arcadible.com/build/live-play.md, then https://developer.arcadible.com/references/arcadible-sdk/wires.md |
| Inviting a friend | https://developer.arcadible.com/build/invites.md, then https://developer.arcadible.com/references/arcadible-sdk/links.md |
| Content published without a release | https://developer.arcadible.com/references/arcadible-sdk/values.md |
| `arcadible.toml` | https://developer.arcadible.com/references/arcadible-manifest.md |
| `.arcadible/` | https://developer.arcadible.com/publish/store-page.md and https://developer.arcadible.com/references/arcadible-manifest.md |
| `README.md` | https://developer.arcadible.com/references/arcadible-markdown.md |
| How you deploy, play, or release | https://developer.arcadible.com/references/arcadible-cli.md and https://developer.arcadible.com/publish/releases.md |
| How it releases from GitHub | https://developer.arcadible.com/publish/deploying-from-github.md |
| Its screenshots or videos | https://developer.arcadible.com/publish/screenshots.md and https://raw.githubusercontent.com/arcadible/skills/v1/skills/arcadible/SKILL.md, Arcadible's agent skill, whose `scripts/record.mjs` records them |

## Project structure

| Path | Contains |
| ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `arcadible.toml` | The game's id, version, and settings. Never change `id`. If it's missing, `arc init` adds one without scaffolding. |
| `README.md` | The store page: the title, tagline, bio, and the description between the first and last `---`. |
| `.arcadible/` | The store art, with fixed file names. |
| `deploy_dir` | The game players load (`workflow.deploy_dir`, `.arcadible-public` by default), with `index.html` at its root. When the project has a build, the build writes it: don't edit it by hand. |

## Recipes

What games add next, each a small, complete project in https://github.com/arcadible/recipes. Read one's code as `https://raw.githubusercontent.com/arcadible/recipes/main/<recipe>/.arcadible-public/main.js`: its first lines name anything else it needs, such as a table in `arcadible.toml` or a file beside it.

| Recipe | What it shows |
| ----------------- | ------------------------------------------------------ |
| `saves-progress` | Keep the player's progress, across every new version |
| `saves-reset` | Let the player start over |
| `pause-audio` | Music that starts on a tap, and stops on a pause |
| `input-keys` | Keyboard, pointer, and gamepad, with no stuck keys |
| `players-picture` | The player's name and picture, and a guest's |
| `values-daily` | A daily challenge you publish, with no new release |
| `links-invite` | Invite a friend, straight into your game, by a link |
| `wires-room` | Players in one room, seeing each other, no server code |
| `wires-match` | A turn-based match, its moves checked by your function |
| `function-hello` | Server code Arcadible runs, called from your game |
| `server-ticket` | Your own server, sure of who's playing |

## Commands

```sh
npm run dev # the project's dev server, when it has one
arc serve # the game as Arcadible serves it, framed in a play page; its Game only address is the game alone, for screenshots and checks
arc validate # the checks arc deploy runs, with a link to each broken rule
arc deploy # validate, build, publish, and wait until it's published
```

Every `arc` command is in https://developer.arcadible.com/references/arcadible-cli.md. Add `--json` to read a command's result as one JSON document on stdout. A command that fails exits with 1, and its JSON has `error.code`: act on the code, and look it up in https://developer.arcadible.com/references/errors.md, which says what to do.

The values you publish for the game, such as a daily puzzle or an event's switch, are JSON files in `.arcadible-data/values/`, a file a value, which `arc serve` reads: `arc value set <key> '<json>'` writes one, making the folder, and `arc value set --production` publishes them all (https://developer.arcadible.com/references/arcadible-cli/arc-value.md).

## What doesn't change

- **Each version starts with empty browser storage,** since each build has its own origin. Keep what the game remembers between sessions (progress, settings, preferences) in saves, through the Arcadible SDK: the `@arcadible/sdk` package for a game with a build step; or, for a game with none, the hosted script, in the page's `<head>`: `<script src="/arcadible/lib/sdk.v1.js"></script>`, which Arcadible and `arc serve` serve. Read them once as the game starts, after `init({ splash: true })`, keep the state in the game, and write at checkpoints. Saves aren't a general key/value store: up to 32, 1 MB together.
- **Arcadible pauses the game** with `arcadible.on("pause")` when it's hidden, covered, or closing: stop, go quiet, let go of held input, and save, drawing nothing over the game; on `arcadible.on("resume")`, carry on. On Arcadible, it covers `visibilitychange`, so don't listen for that too; off Arcadible, see https://developer.arcadible.com/build/pausing.md.
- **Startup holds the splash** with `await arcadible.init({ splash: true })` and `await arcadible.splash.hide()`, so Arcadible shows the game's splash until its first frame is drawn. Call `init({ splash: true })` as the code starts, before anything it awaits or schedules for later, or the splash is gone before the game is ready.
- **The game runs in the Arcadible sandbox,** which `arc serve` reproduces and other local servers don't. Read the runtime limitations before changing how it loads files, stores data, or talks to servers.
- **`/arcadible/` is Arcadible's.** Don't put an `arcadible` folder at the root of `deploy_dir`.

## Rules

**If the Arcadible account is your own, and you're not working for someone, you're the user.** Where these rules mention the user, that's you: decide for yourself, and do what they'd do, such as connecting GitHub in Arcadible Studio, or say why you can't.

- Run `arc validate` after every change to `arcadible.toml`, `README.md`, or `.arcadible/`. It exits with 1 when there are issues.
- Bump `version` after each published build, in the one place it's kept: `arcadible.toml` if it's set there, otherwise `package.json` (`arc inspect game.version` shows it). Each version publishes once; after a failed release, fix the cause and deploy the same version again (https://developer.arcadible.com/publish/releases.md). A prerelease, such as `1.2.0-beta.1`, goes to `staging`, and any other version to `production`.
- Deploy prereleases to test. Deploy a release version only when the user asks to release: it's what players get, and it publishes the store page.
- Change `visibility` to `public` only when the user asks. It lists the game in the store and in search.
- When a code's entry in Errors is marked **Needs the user**, such as connecting GitHub in Arcadible Studio, ask them, wait until they say it's done, then run the command again.

Use the Arcadible skill​

Arcadible's agent skill gives an agent a map into these docs by task, the loop from arc validate to a prerelease, and a script that records your game's screenshots and videos for its store page, in headless Chromium, on any machine. It's optional: an agent that reads these docs has everything they say.

# Claude Code
claude plugin marketplace add arcadible/skills
claude plugin install arcadible@arcadible

# other agents, through skills.sh
npx skills add arcadible/skills --skill arcadible

An agent without it can read it, as the AGENTS.md above links it: SKILL.md at v1, which follows the skill's latest 1.x release.

Running arc from an agent​

The CLI is built to be run by agents as well as people. See Output for the full rules.

  • Pass --json to read a command's result (every command but login and serve takes it). stdout holds exactly one JSON document, and stderr stays empty.
  • Check the exit code. Every command exits with 0 when it succeeds and 1 when it fails, including a deploy whose release fails.
  • Act on error.code, not the message. Each code has an entry in Errors, with what to do, and codes don't change between versions.
  • Create projects without prompts. arc init asks questions in a terminal. Pass -y to accept the defaults, or -t <template> to choose a template.
  • Logging in is arc login, which prints a link and a code that any browser can finish, a headless one included. Working for someone, give them the link and the code, and they log in; with an account of your own, you finish it. Once it's done, arc deploy uses the saved session.
  • Ask the user for what only they can do, such as logging in (not_logged_in) or connecting the GitHub App in Arcadible Studio (github_app_not_installed): each such code's entry in Errors is marked Needs the user, and says what to do. With an account of your own, working for no one, you're the user: do it yourself, or say why you can't.
  • Let arc deploy wait. It returns when the release is published or has failed, so the agent knows the result without polling. See Releases.

Next steps​