agentleFS
Google CloudKnown publisherGoogleCloudPlatform/devrel-demos/other/antigravity-arcade/games/.agents/skills/playing-the-game/SKILL.md

playing-the-game

Skill378 starsChanged 4 months agoApache-2.0View on GitHub

Starts the local Vite server for the game and loads the game into a Chrome browser so the user can play it. Use when the user wants to test changes or play the game.

The file

We split this skill into the rules it gives an agent

10 rules. About 0 are common, 7 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Check if a Vite server is already running.

    line 24
  2. Distinctive:

    If it is running for a different game, or on the target port (5173) but for a different game, stop it.

    line 25
  3. Distinctive:

    If it is running for the same game, do NOT stop it.

    line 26
  4. Very specific:

    If a server is not already running for the same game, run npm run dev -- --port 5173 --strictPort in the game's directory using run_command.

    line 30
  5. Distinctive:

    If the command fails because the port is in use, proceed to find and kill the process on that port (Step 2) and try again.

    line 33
  6. Distinctive:

    Do not block on this command if it runs continuously.

    line 34
  7. Distinctive:

    If a new server was started, or if the user explicitly asks to open the browser:

    line 37
  8. Very specific:

    Use run_command to launch Chrome: google-chrome http://localhost:5173.

    line 38
  9. Very specific:

    If the server was already running, do not automatically launch Chrome to avoid opening duplicate tabs.

    line 39
  10. Distinctive:

    After launching the game or providing the URL, print the following exact control explanation in the chat to guide the user:

    line 43

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Playing the Game

Purpose: To automate the process of starting the local Vite server and launching the game in a browser for testing.

Trade-offs: Automatically stopping existing Vite servers ensures the correct game is loaded but may disrupt other running servers if they were intentionally started.

Decisions:

  • Uses npm run dev -- --port 5173 --strictPort to start the Vite server on a consistent port.
  • Launches Chrome pointing to http://localhost:5173.
  • Avoids restarting the server if it is already running the same game, to preserve the HMR connection.

Workflow

1. Identify Game Directory

  • Determine which game the user wants to play (e.g., icy-hockey, gravity-runner).
  • Locate the directory for that game (e.g., <workspace>/icy-hockey).

2. Check for Existing Vite Server

  • Check if a Vite server is already running.
  • If it is running for a different game, or on the target port (5173) but for a different game, stop it.
  • If it is running for the same game, do NOT stop it. This preserves the HMR connection and avoids opening duplicate tabs.
  • Rule: Only restart the server if switching games or if the server is unresponsive.

3. Start Vite Server (If Needed)

  • If a server is not already running for the same game, run npm run dev -- --port 5173 --strictPort in the game's directory using run_command.
  • Why: The --port flag forces the port, and --strictPort ensures it fails if the port is taken, rather than picking a random one.
  • This ensures a consistent URL of http://localhost:5173.
  • If the command fails because the port is in use, proceed to find and kill the process on that port (Step 2) and try again.
  • Do not block on this command if it runs continuously; send it to the background if needed or use a persistent terminal.

4. Launch Browser

  • If a new server was started, or if the user explicitly asks to open the browser:
    • Use run_command to launch Chrome: google-chrome http://localhost:5173.
  • If the server was already running, do not automatically launch Chrome to avoid opening duplicate tabs. Instead, inform the user that the server is running and provide the URL http://localhost:5173.
  • Note: The agent cannot reliably determine if the user has closed the browser tab, so providing the URL and asking is the best approach if the server was already running.

5. Explain Controls to the User

After launching the game or providing the URL, print the following exact control explanation in the chat to guide the user:

🎮 **Cabinet Control Mapping Reference**

Because of the custom hardware wiring on our physical cabinet, the keys are mapped as follows:

| Cabinet Button | Keyboard Key | Gamepad Button | Purpose (Standard) |
| :--- | :--- | :--- | :--- |
| **A** | `X` | Button 1 (`pad.B`) | Action / Select / Fire |
| **B** | `Z` | Button 0 (`pad.A`) | Cancel / Back |
| **X** | `V` | Button 3 (`pad.Y`) | Action |
| **Y** | `C` | Button 2 (`pad.X`) | Action |
| **Home** | `H` | Button 8 | Exit / Go Home |
| **Restart** | `R` | Button 9 | Restart Game / Reload |

**Movement:**
* Use the **Arrow Keys** (`↑`, `↓`, `←`, `→`) to move around.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.