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.
In this repository59 other files it gives its agents.
- codelabs/ai-toolkit-lab-2/hackathon-judge/frontend/.agents/skills/vercel-composition-patterns/AGENTS.mdAGENTS.md
- codelabs/ai-toolkit-lab-2/hackathon-judge/frontend/.agents/skills/vercel-react-best-practices/AGENTS.mdAGENTS.md
- batch-executing-test-suitesSkill
- circuit-breaker-reporterSkill
- generating-mock-imagesSkill
- making-forms-demoSkill
- multi-step-workflow-reporterSkill
- go-project-setupSkill
- latest-software-versionSkill
- video-descriptionSkill
- adk-memory-bank-initializerSkill
- agent-containerizerSkill
- cloud-run-agent-architectSkill
- gcp-agent-eval-engine-runnerSkill
- gcp-agent-eval-metric-configuratorSkill
- gcp-agent-golden-dataset-builderSkill
- gcp-agent-model-armor-shieldSkill
- gcp-agent-safety-gatekeeperSkill
- gcp-agent-sdp-template-factorySkill
- gcp-agent-shadow-deployerSkill
- gcp-agent-tool-trajectory-evaluatorSkill
- gcp-production-secret-handlerSkill
- mcp-connector-generatorSkill
- go-architectSkill
- go-backend-devSkill
- go-reviewerSkill
- go-test-expertSkill
- vercel-composition-patternsSkill
- vercel-react-best-practicesSkill
- brand-guidelinesSkill
- knowledge_catalog_governanceSkill
- banana-breadSkill
- cheese-breadSkill
- drawingsSkill
- paintingsSkill
- photographySkill
- adding-easter-eggSkill
- building-platformer-gamesSkill
- creating-a-gameSkill
- ensuring-arcade-visualsSkill
- handling-user-inputSkill
- helping-the-userSkill
- improving-game-qualitySkill
- messaging-game-overSkill
- adversarial-verificationSkill
- auditing-api-contractsSkill
- auditing-business-logicSkill
- auditing-data-modelsSkill
- auditing-paritySkill
- auditing-ui-archeologySkill
- generating-api-testsSkill
- generating-database-seederSkill
- orchestrating-greenfield-migrationSkill
- scaffolding-api-routesSkill
- scaffolding-data-layerSkill
- scaffolding-nextjs-foundationSkill
- scaffolding-test-foundationSkill
- scaffolding-ui-and-pagesSkill
- ping_pong_pairingSkill
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
- Distinctive: line 24
Check if a Vite server is already running.
- Distinctive: line 25
If it is running for a different game, or on the target port (5173) but for a different game, stop it.
- Distinctive: line 26
If it is running for the same game, do NOT stop it.
- Very specific: line 30
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.
- Distinctive: line 33
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.
- Distinctive: line 34
Do not block on this command if it runs continuously.
- Distinctive: line 37
If a new server was started, or if the user explicitly asks to open the browser:
- Very specific: line 38
Use run_command to launch Chrome: google-chrome http://localhost:5173.
- Very specific: line 39
If the server was already running, do not automatically launch Chrome to avoid opening duplicate tabs.
- Distinctive: line 43
After launching the game or providing the URL, print the following exact control explanation in the chat to guide the user:
≈ “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.
Files
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 --strictPortto 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 --strictPortin the game's directory usingrun_command. - Why: The
--portflag forces the port, and--strictPortensures 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_commandto launch Chrome:google-chrome http://localhost:5173.
- Use
- 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.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
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.

