The AI

Tools ▸ AI holds an assistant that reads and edits the open map with you, and tools that lay out maps, write triggers, names and briefings, review a map and rewrite its strings. They come with the scmjs.dev plugin and run on your own Anthropic API key.
Claude Desktop, Claude Code, Cursor and other AI apps can work on your maps too, the open map included, with each change as one undo step. Claude Desktop needs no terminal: you install scmJS into it from one file. See AI tools.
Adding your key#
- Make an API key at console.anthropic.com.
- Open Edit ▸ Preferences ▸ Plugins ▸ scmjs.dev (or Add your key… in the Account dialog), paste the key under Your Anthropic key and press Check and use.
- The key is checked with Anthropic first, which costs nothing. When it passes, the Tools ▸ AI menu, the assistant and the AI buttons in the editor's dialogs appear.
Only an Anthropic key works: the key is checked with Anthropic, and a key for another service or for a model running on your own computer is refused. No scmjs.dev account is needed for this. Anthropic bills each request to your Anthropic account. The key stays in your browser: scmjs.dev passes it on with each AI request and keeps no copy. Forget the key on the same page removes it, and the AI features with it.
A few things are the same for every feature:
- What is sent. Only what the feature needs: what you typed and the map's facts (size, tileset, players, what is where), and for some features a picture of the map, the strings or the triggers. The map file itself is never sent.
- Undo. Every change the AI makes is one undo step, labelled "AI: …", including what it writes to the name and description, strings, triggers, players and unit settings.
- Cost. Every AI dialog shows its progress while you wait, and what the request cost when it finishes.
Where your key goes#
Each AI request goes from your browser to the scmjs.dev server with your key attached. The server passes it to Anthropic and sends the answer back. It keeps nothing of the request: not what you typed, not the answer, not your key or your address. To hold everyone to 30 requests a minute, 1,000 a day and 4 at once, it counts requests per address, in memory only: the counts are never written to disk. What Anthropic keeps is set by Anthropic's own terms for the API.
What the model is told, and what the editor does with its answer, is public in scm-js/ai-engine. Each AI feature is one file there. The server's sign-in, accounts and limits are not public.
If a feature gives you a bad result, open an issue on ai-engine with what you asked, what came back, and the map if you can share it.
The assistant#

Assistant (Ctrl+Shift+A, or the AI cell in the status bar) opens a conversation about the open map. Ask a question or say what to change, and the assistant reads the map and edits it with the editor's own tools while you watch.
- What it reads: everything, including units and their properties, doodads, sprites, locations, strings, switches, sounds, triggers and the trigger script, unit, upgrade and technology settings, fog, terrain, Check Map results, your selection, and a screenshot of any area.
- What it changes: nearly everything the editor can, from terrain and units to triggers, players and forces, settings and the map's size. It draws terrain as shapes, such as a plateau with a ramp that fits, a lane that stays walkable or a river with a bridge, and can tell you whether units can walk from one place to another.
Each turn is folded into one block under your message. While it runs, the block shows the latest steps (▸ a read, ✎ a change), and the map outlines what is about to change and follows the work, zooming out but never in. Scroll or zoom yourself and the view stays where you put it for the rest of the turn. When the turn ends, the block shows the steps, the time and the cost, with an Undo button that reverses the whole turn. Escape stops a turn.
To start a message, use the suggestion chips above the input, or right-click the map and choose Ask AI about this spot / the selection / this area…. Tick Picture to send a screenshot of the visible area. Player Settings has a Set up with AI… button that sets up players and forces from one sentence. After 24 rounds of tool calls the assistant stops and offers to continue.
Make Scenario#

Make Scenario… builds a whole scenario from a sentence, such as "a madness map" or "a two-lane tower defense". Set the size, tileset and number of players and press Design.
- The design. The model writes a design document first: the premise, the players and
forces, each trigger system and its settings, the layout and its locations, the
objectives and the briefing. Edit it directly, or describe what should change and press
Design again. A location name can include
{p}, as in "Spawn {p}", to build that system once per player. - The build. Build works through the design one step at a time, each step a row that passes or fails on its own: the terrain and locations, players and forces, each system, the objectives and briefing, the name, and a Check Map at the end. Common layouts (corner camps, lanes, arenas, a bound's course, a town) are laid out by the editor itself; others are drawn from the model's shapes. Common systems (spawns, income, waves, lives, shops, leaderboards and the like) are built by the editor and shown in green; anything else is written in TrigScript and shown in gold.
When it finishes, Review it… or Open the assistant to keep going.
Generate Map and Redo Area#

Generate Map… lays out a melee map from a description: the number of players, the kind of terrain, where the bases go and the symmetry. It shows a plan first: a rough grid of terrain, the bases with their resources, ramps, a name and the designer's notes. Apply paints it with the isometric brush onto a new map, or onto the open map if it is the same size. Refine sends the plan back with your changes ("more room around the naturals") and a picture of the result. Treat the result as a starting point, and check the ramps against the cliffs before you play.
Redo Area… does the same for part of an existing map. Mark an area (or right-click it and choose Redo this area with AI…) and describe what should be there; the new ground joins the old at the edges.
Triggers, names and strings#
- Write Triggers… turns a description into TrigScript and applies it, keeping the script with the map. It can add to the map's triggers or replace them.
- Explain Triggers… describes what the triggers do in play: all of them, a range, the mission briefing, or an answer to a question. The Trigger Editor and Mission Briefing Editor have the same Explain, Write… and Ask buttons.
- Name and Describe… suggests three names with descriptions from what is on the map. Map Properties has the same as a Suggest a name button.
- Write Briefing… writes objectives and narration and creates a mission briefing for each player.
- Review Map… critiques the map from a picture, its statistics and Check Map, with a Go to button on each finding that has a place.
- Rewrite Strings… translates, corrects or shortens the map's strings, showing a before-and-after table to tick. It is also the String Editor's Rewrite with AI… button.

Options#
Tools ▸ AI ▸ Options… opens the same Preferences page as the key:
- Quality: Quick, Standard (each feature at the level it was tuned for) or Thorough. Higher quality takes longer and costs more.
- Spending: a ceiling for one assistant message and for one Make Scenario run. At the ceiling the work stops with the map as edited so far. 0 means no ceiling.
- Assistant: rounds per message, the picture tick, following the work on the map, docking the panel on the right, and showing the model's reasoning summary.
- Use the AI features: unticked, it removes the menu, the assistant, the status-bar cell and the AI buttons, and keeps your key.