|
| 1 | +--- |
| 2 | +name: write-arena-page |
| 3 | +description: >- |
| 4 | + Write the codeclash.ai arena page for a CodeClash arena. Use when asked to |
| 5 | + "write/add an arena page", "document an arena on the website", or "write up |
| 6 | + <arena> for the site". Produces pages/arenas/<arena>.md matching site conventions. |
| 7 | +--- |
| 8 | + |
| 9 | +# Write an Arena Page |
| 10 | + |
| 11 | +An arena page is a single markdown file, `pages/arenas/<arena>.md`, with a |
| 12 | +key-value front matter block followed by the write-up body. `server.py` serves it |
| 13 | +at `/arenas/<arena>/`, `templates/arena.html` renders it, and `templates/arenas.html` |
| 14 | +auto-lists it on the index (sorted by title) — **no registration anywhere else.** |
| 15 | + |
| 16 | +## Learn the arena first (don't write from the description alone) |
| 17 | + |
| 18 | +The prompt's blurb is a starting point, not the source of truth. Before writing: |
| 19 | + |
| 20 | +1. **Read the arena class** `repo/codeclash/arenas/<arena>/<arena>.py` — its `name`, |
| 21 | + `submission` file, `description`, and `validate_code` define the exact bot contract. |
| 22 | +2. **Read the arena's own repo** (the Dockerfile `git clone`s `CodeClash-ai/<Arena>`). |
| 23 | + Its `README.md` + engine are the ground truth for rules, physics constants, the |
| 24 | + `obs`/state shape, actions, scoring, and win condition. Prefer engine code over the |
| 25 | + README when they disagree, and note the real starting conditions (e.g. balls that |
| 26 | + start at rest, side-swapping across seeded games). |
| 27 | +3. **Read the test config** `repo/configs/test/<arena>.yaml` for player count and the |
| 28 | + `game_description` prompt shown to agents. |
| 29 | +4. **Read 2-3 existing pages** in `pages/arenas/` to match tone and depth. Short |
| 30 | + train-split arenas (`bomberland.md`, `scml.md`) are the default shape; big |
| 31 | + test-split / ladder arenas (`battlesnake.md`, `corewar.md`) add extra sections. |
| 32 | + |
| 33 | +## Front matter (one `key: value` per line, no `---` fences) |
| 34 | + |
| 35 | +``` |
| 36 | +title: <Display name> |
| 37 | +logo: /static/images/arenas/<arena>.png |
| 38 | +preview: /static/images/arenas/<arena>.gif |
| 39 | +preview_width: 55 # optional, % width of the preview (default 50) |
| 40 | +description: <one line, imperative, no period — shown on the index card> |
| 41 | +date-added: <YYYY>-<MM>-<DD>T00:00:00.000000Z # date the arena was added |
| 42 | +players: 2+ # or an exact count, matching the arena/config |
| 43 | +language: Python # comma-separated; must have a matching static/images/languages/<lang>.svg |
| 44 | +split: train # train = no leaderboard; test = renders the Leaderboard section |
| 45 | +ladder: true # optional; adds the 🪜 badge + expects a CC:Ladder section |
| 46 | +``` |
| 47 | + |
| 48 | +Set `split: test` only for arenas that have leaderboard data in `data/leaderboards.json` |
| 49 | +(keyed by the page slug); otherwise `train`. Add `ladder: true` only if a CC:Ladder |
| 50 | +exists — then include a `## 🪜 CC:Ladder` section (see `battlesnake.md`). |
| 51 | + |
| 52 | +## Body |
| 53 | + |
| 54 | +Four bold-question sections in this order, each one tight paragraph: |
| 55 | + |
| 56 | +- **What is `<Arena>`?** — the game in one or two sentences + the win condition. |
| 57 | +- **How does it work?** — the submission file, the entry function + its signature, the |
| 58 | + legal actions/return values, what `obs` (game state) contains, and how a round is scored. |
| 59 | +- **What's the goal?** — the objective and the core scoring mechanic; call out any |
| 60 | + non-obvious rule (e.g. "doing nothing scores nothing"). |
| 61 | +- **What makes it challenging?** — the real strategic tension, concretely. |
| 62 | + |
| 63 | +Then a `---`, an `### References` list (the arena's own repo + the CodeClash repo), and — |
| 64 | +**only if the arena ports an external game** — a `<pre>` BibTeX block crediting the |
| 65 | +original creators (see `bomberland.md`). Original CodeClash games need no third-party |
| 66 | +citation. |
| 67 | + |
| 68 | +## Accuracy rules |
| 69 | + |
| 70 | +- Quote real numbers (grid size, tick budget, key physics constants) from the engine, not |
| 71 | + guesses. Preserve the arena's own terminology. |
| 72 | +- State exact action strings / return values and the entry-function signature verbatim. |
| 73 | +- Don't invent features, external inspirations, or citations the repo doesn't support. |
| 74 | + |
| 75 | +## Assets (separate deliverable) |
| 76 | + |
| 77 | +The page references `static/images/arenas/<arena>.png` (logo) and `.gif` (gameplay |
| 78 | +preview). These are generated from a replay, not hand-authored — if they don't exist yet, |
| 79 | +write the page with the conventional paths and flag that the two image assets still need to |
| 80 | +be produced. Never commit a fabricated/placeholder binary. |
| 81 | + |
| 82 | +## Verify |
| 83 | + |
| 84 | +Run `python server.py` in `website/` and open `/arenas/<arena>/` and `/arenas/`, or |
| 85 | +`python server.py build` to freeze. Confirm the page renders, the card appears on the |
| 86 | +index, and the language icon resolves. |
0 commit comments