# AI Prompts for Game Development — Best Practices That Work

Write AI prompts for game development that work: state the goal and done criteria, attach references and screenshots, keep project rules in AGENTS.md.

_Last updated: 2026-11-29_

The best AI prompts for game development have three parts. First, describe the goal and the done criteria: what the player should experience and how the agent can prove it works. Second, give references and screenshots, because games are visual and a picture removes most of the guessing. Third, keep the rules of your project in an AGENTS.md file, so you never have to repeat them in a prompt again. Everything else in this guide is detail on those three.

These are our recommendations from prompting agents on our own games every day. They work with any capable coding agent: Claude Code, Codex, Cursor or the AI Game Developer app.

## Why Game Prompts Go Wrong

A game mechanic can compile, pass a quick look and still be wrong in a dozen ways. That is why prompts that work for a web app often fail for a game:

- "Make the jump better" has no finish line. The agent changes something, says it is done, and you cannot tell whether it is better.
- Many game bugs are invisible in code. A floating wall, a pink material or a camera that clips through a pillar reads fine in a diff.
- The project has conventions the agent cannot guess, and a new chat forgets the ones you explained yesterday.

Anthropic's prompting guide says to treat the model as a brilliant but new employee who lacks context on your norms. The three parts below are that context.

## Part 1: Describe the Goal and the Done Criteria

The goal says what should change for the player. The done criteria say how anyone, including the agent, can check that it changed. In our experience, done criteria are the single biggest improvement you can make to a prompt, because they turn "I think it works" into something the agent can verify on its own.

Compare two prompts for the same feature.

A weak prompt: "Add a glide to the player."

A strong prompt: "Add a glide: holding jump in the air slows the fall so the player can cross gaps of about 8 metres. Done when: the fall speed while gliding is capped at 2.5 m/s, gliding lasts at most 3 seconds and refills on landing, both rules are covered by play mode tests, the full test suite is green, the console has no new errors after a play session, and you show me a screenshot of the player mid-glide."

The second prompt is longer, but it saves several rounds of back and forth: the agent knows what to build, which numbers matter and when to stop.

### Describe the Outcome, Not the Steps

"Create a third-person player controller in the current scene" works better than a list of tool names or file edits: the agent maps intent to the right tools and may find a better approach than yours. Give steps only when the order really matters, and number them.

### Make Done Criteria Checkable

Good done criteria are things the agent can check without you:

- A number: the fall speed, the frame time, the number of draw calls, the size of a texture.
- A test: "covered by tests that would fail if the feature broke, and the whole suite passes".
- A clean console: no new errors or warnings after compiling and after a play session.
- A picture: "take a screenshot from the player's height and from above".
- A scope limit: "change only the player controller and its tests".

Avoid criteria the agent cannot measure, such as "make it feel good". Feel is your job: write the measurable part into the prompt, then play the game.

### Explain Why

A reason helps the agent generalise. "Keep enemy health a multiple of 10 so damage numbers stay readable" is a rule the agent can also apply to shields or healing, cases you did not mention.

## Part 2: Give References and Screenshots

Games are visual, so prompts for games should be too. A screenshot of the bug, a mockup of the menu or a reference picture of the art style tells the agent more than a paragraph of description.

What to attach, by task:

- A bug: a screenshot of the problem with a short note of what is wrong and where. "The shadow under the crate in this screenshot is detached by about half a metre."
- A UI screen: a sketch or mockup, even a photo of a paper drawing, plus the target resolutions.
- An art style: two or three reference images and one sentence on what to take from each, such as the palette from one and the silhouettes from another.
- A 3D asset: two to four views of the same object from different sides.

References work in both directions. Ask the agent to send pictures back: "after the change, take screenshots from the same angle as my reference and compare them". Comparing its own screenshot with yours is how the agent catches a mismatch before you do.

### Name Things So You Can Refer Back

Give new things a name in the prompt: "create a crate named Crate_Large". Then the next prompt can say "move Crate_Large next to the door" without any ambiguity.

## Part 3: Keep Project Rules in AGENTS.md

Rules that apply to every task do not belong in a prompt. They belong in a file the agent reads at the start of every session. AGENTS.md is the open format for that: a plain Markdown file at the root of your repository, described by its authors as a README for agents. As of November 2026 it is stewarded by the Agentic AI Foundation under the Linux Foundation, and it is read by Codex, Cursor, GitHub Copilot's coding agent, Gemini CLI, Jules, Aider, Zed, Windsurf and many other tools (see https://agents.md).

Claude Code reads AGENTS.md too, from version 2.1.277, but only when no CLAUDE.md is present in the working folder or above it. If you have both, Claude Code reads CLAUDE.md, so pick one, or import AGENTS.md from CLAUDE.md. The details are in the Claude Code documentation at https://code.claude.com/docs/en/memory. The agent in the AI Game Developer app reads the same instruction files from your project.

### What to Put in AGENTS.md for a Game

Write what the agent cannot work out from the code and would otherwise get wrong:

- The engine and version, and the key packages: "Unity 6, new Input System, URP, no third-party tweening library".
- Where things go: scripts, scenes, prefabs, art, audio, tests.
- Naming conventions for scripts, assets and scenes.
- How to check work: which test command or test runner to use, and that the suite must be green before a task is done.
- Hard rules: "never edit files under Plugins", "never change project settings without asking", "physics runs at a fixed 50 Hz".

### Keep It Short

Every line of AGENTS.md costs context in every session. Claude Code's documentation recommends under 200 lines per file, because longer files reduce adherence. In our experience, a short file of hard rules beats a long file of everything. Two habits help:

1. Put rules that apply only to one part of the project in an AGENTS.md inside that folder. Agents read the nearest file, so the rules for your UI code sit next to the UI code.
2. Put design decisions and their reasons somewhere searchable instead of in AGENTS.md. In the AI Game Developer app, the Knowledge Base keeps them as Markdown notes in the project, and the agent opens only the notes a task needs. We show it in ai-game.dev/blog/game-project-knowledge-base-for-ai.

When the agent breaks a rule twice, add one line. When a line has not mattered for months, delete it.

## A Template for AI Prompts for Game Development

Put the three parts together and most prompts follow the same shape. Use it as a checklist, not a form to fill every time:

1. Goal: what should change for the player, in one or two sentences.
2. Context: the scene, object or file it is about, and why it matters.
3. References: screenshots, mockups or reference images, each with one line on what to take from it.
4. Constraints: what must not change, and the scope of files.
5. Done criteria: numbers, tests, a clean console, screenshots.
6. Report: what you want back, such as a short summary, the screenshots and anything the agent was unsure about.

For a first request in a new project, keep it tiny: in the current scene, create a named thing, set one property, then take a screenshot. Once that loop works, build up.

## Prompt Examples by Task

These are the kind of prompts we actually send.

- New mechanic: "Add a double jump to the player. The second jump is 70% of the first and is available once per airtime. Done when it is covered by play mode tests, the suite is green and the console is clean after a play session."
- Bug fix: "In the attached screenshot the player falls through the bridge in Level_02 at the marked spot. First write a test that reproduces it and fails, then fix it, then show me a screenshot from the same angle."
- Level work: "Using my top-down sketch, block out Level_03 with simple cubes: the start on the left, the key on the upper platform, the door on the right. Take a screenshot from above and one from the player's height at the start."
- UI: "Build the pause menu from the attached mockup: Resume, Settings, Quit. It must fit 16:9 and 4:3 without overlapping. Show me screenshots at 1920x1080 and 1024x768."
- Asset: "Generate a stone wall texture that matches the attached reference: warm grey, mossy at the bottom, tileable. Apply it to Wall_Mat and show me a screenshot of the courtyard."

## Mistakes to Avoid

- Many features in one prompt. One task, one feature. A prompt that touches the whole game produces a change nobody can review.
- Only negative instructions. "Do not use singletons" says what to avoid, not what to do. "Pass references through the inspector instead of singletons" works better, a point Anthropic's prompting guide also makes.
- Repeating rules in every prompt. If you type it twice, it belongs in AGENTS.md.
- Accepting "done" without evidence. If the reply has no test result and no screenshot, ask for them before you look at the code.

## If You Need X, Pick Y

- If the task touches more than a couple of files: ask for a plan first and approve it before any change. The AI Game Developer app has a plan mode for exactly this, shown in ai-game.dev/blog/plan-mode-ai-agent-game-development.
- If the problem is visual: attach a screenshot and ask for one back from the same angle.
- If the agent keeps forgetting a convention: one line in AGENTS.md.
- If it keeps forgetting a design decision: a note in the Knowledge Base, with the reason.
- If cost matters, DeepSeek V4.1 Flash comes close to Claude Opus 5.5 at about 65 times lower cost in our usage; Opus 5.5 is best if money is no object (ai-game.dev/blog/best-ai-model-for-game-development).

## The Honest Trade-offs

- Better: fewer rounds of correction, results you can verify, and an agent you can leave alone for longer.
- Worse: a good prompt takes two minutes instead of ten seconds, and tests and screenshots cost time and tokens on every task.
- Worse at first: AGENTS.md and a test setup take an hour. The agent can draft both, but you review them.
- Limit: no prompt makes a mechanic fun. Done criteria prove it works, not that it feels right. Play the game.

Token cost also depends on the agent's tools. Our RQL query tools cut the tokens an agent spends on engine data; the benchmark is at ai-game.dev/docs/rql.

## Prompting in AI Game Developer

AI Game Developer is a desktop app with a built-in AI agent and plugins for Unity, Unreal, Godot, Three.js, Bevy and BRUTAL. It is built so the three parts of a good prompt pay off:

- Done criteria the agent can check: it writes short code and runs it inside the live editor, C# in Unity and Python in Unreal, reads the console, runs tests (in Unity, edit mode and play mode) and takes screenshots of the scene, the game view or a single object.
- References: paste, drop or attach images in the chat, and generate assets from reference pictures in Asset Studio.
- Rules: it reads AGENTS.md and CLAUDE.md from your project, and the Knowledge Base holds the decisions.

Read the request principles and engine-specific example prompts at ai-game.dev/docs/best-practices, download the app at ai-game.dev/download, and add one line to your next prompt: done when the tests pass and you show me a screenshot.

## Related

- Best practices: https://ai-game.dev/docs/best-practices
- Plan mode for AI agents: https://ai-game.dev/blog/plan-mode-ai-agent-game-development
- A knowledge base for your game project: https://ai-game.dev/blog/game-project-knowledge-base-for-ai
- The AI Game Developer App: https://ai-game.dev/docs/app
- Download the app: https://ai-game.dev/download

---

Source (HTML): https://ai-game.dev/blog/ai-prompts-for-game-development
