# Add an Arena54 badge to this project

Goal: Show on this site that our game or studio is listed on Arena54, and where it ranks.

You are a coding agent working inside my project. Do the work. Do not ask me anything you can find out by reading the project. Do not invent an endpoint, a field or an error code that is not written below.

## 1. Look at the project first

- Find the framework and language, how the project is run and tested, and the page and the spot where a small badge belongs: a footer, an about page, a game’s own page or the README.
- Find how the project reads configuration and environment variables, and which files git ignores.
- This is a plain web project: add no framework and no build step.
- If the project already has an Arena54 client or key variable, reuse it.
- Tell me in two or three lines what you found and what you will change, then carry on.

## 2. The contract

A badge is an image at a fixed address on `https://arena54.com`. There is no key, no script and no frame.

Addresses:

- GET /badge/game/{slug}.svg: “Listed on Arena54”, for a game.
- GET /badge/creator/{handle}.svg: “Listed on Arena54”, for a studio or a person.
- GET /badge/game-rank/{slug}.svg: A game’s place on the board. ?board=week (default), month or all.
- GET /badge/creator-rank/{handle}.svg: A studio’s or person’s place on the board.

Add `?theme=dark` for a dark page. Add `?board=month` or `?board=all` to a rank badge; the week is the default.

The HTML to place, with the listing’s own page as the link:

```html
<a href="https://arena54.com/g/your-game"><img src="https://arena54.com/badge/game/your-game.svg" alt="Listed on Arena54" height="52"></a>
```

A “Listed” badge is 52 pixels high and a rank badge 64. The width depends on the name, so set only the height. A name that is not a published listing answers 404, and the image then shows its alt text. A listing with no rank says “Not ranked this week”, never a number. Other sites may keep a badge for ten minutes, so a new rank can take that long to show.

## 3. Do this, in order

1. Ask me for the address of our listing on Arena54 if the project does not already hold it. The last part of that address is the slug or the handle.
2. Place the HTML above where the badge belongs, with the right slug or handle, and with `alt` text that reads well if the image fails.
3. If the page has a dark mode, show the `?theme=dark` image there, using the site’s own way of switching. If it has none, use the plain address.
4. Set the image’s height in the markup so the page does not jump when it loads.

## 4. Prove it works

No key is needed.

- Run: `curl -sI "https://arena54.com/badge/game/<slug>.svg"`. Expect HTTP 200 and `content-type: image/svg+xml`.
- Run the same for a name that does not exist. Expect HTTP 404.
- Open the page. The badge shows and links to the listing.

Show me the output of each check.

## 5. Rules you must not break

- Use the image from its address. Do not download and re-host it: a rank would go stale.
- Do not edit the badge or draw your own version of it.
- Do not show a rank as a number in your own text unless you read it from the API on the day.

## 6. Done when

- The badge shows on the page and links to our listing.
- It has alt text and a set height.
- The two curl checks give the answers above.

Then give me a short list of the files you changed and anything I must do by hand.

For a person, not needed for this task: https://developers.arena54.com/docs · This prompt: https://developers.arena54.com/prompts/badges.web.md
