# KX ACR: setup for AI agents

You are an AI agent (Claude Code, Codex, Gemini CLI, Cursor or similar) helping a Guild Wars 2 player write or tune a KX ACR (automatic combat rotation) for KX Client. These are the official steps from docs.kxtools.xyz. Do them yourself with your own tools. Ask the player only for what you cannot do or find.

## 1. Get the guide onto disk and read all of it

The full API and rules are in one Markdown file of about 100 KB:

https://docs.kxtools.xyz/client/acr/kx-acr-lua-api.md

Download the raw file into a work folder of your own, **outside** `%APPDATA%\KX Client\acr\` (KX loads every `.lua` and `.json` file in that folder). For example:

```powershell
New-Item -ItemType Directory -Force "$env:USERPROFILE\kx-acr" | Out-Null
Invoke-WebRequest "https://docs.kxtools.xyz/client/acr/kx-acr-lua-api.md" -OutFile "$env:USERPROFILE\kx-acr\kx-acr-lua-api.md"
```

```sh
mkdir -p ~/kx-acr && curl -fsSL -o ~/kx-acr/kx-acr-lua-api.md https://docs.kxtools.xyz/client/acr/kx-acr-lua-api.md
```

Then read the file **from disk, every line**, in parts if your reader has a limit. Do not read it through a web-fetch or browse tool that summarizes pages: a summary drops the exact function names, ids and rules the build depends on. Download it again at the start of every new session. Its first lines say which KX version it matches.

## 2. Pick the mode

**A. Self-improving (preferred).** You can write `%APPDATA%\KX Client\acr\`, read `%APPDATA%\KX Client\acr\logs\` and run scripts on this PC. Follow section 20 of the guide, and take the prompt in section 20.6 as your instructions, with the player's build link. The player has to do the one-time setup in 20.1 (for example starting the game with `-acr`); walk them through it.

**B. Write once.** You can't do all of that. Follow the rules in section 1 and the template in section 19: give the player one complete `.lua` file and tell them how to load it (section 4). Never claim that you tested anything.

## 3. What you need from the player

- **Mode A:** the build link. Get everything else from it yourself, as section 20 says.
- **Mode B:** the fields of the section 19 template: build, weapons, skills and their ids, how to play it.

If the player didn't give you the build link, ask for it before you start.
