> For the complete documentation index, see [llms.txt](https://docs.flatredball.com/gum/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.flatredball.com/gum/using-gum-with-ai/ai.md).

# Using Gum with AI

If you build game UI with the help of an AI assistant — such as Claude Code, Cursor, GitHub Copilot, or any other LLM-based coding tool — Gum gives your assistant several ways to produce correct, up-to-date output instead of relying on whatever it happened to learn during training.

This section is the single home for that story. It is aimed at **developers using an AI assistant to build a Gum UI**, not at contributors working on Gum itself.

## Why this matters

Game UI frameworks change, and an AI assistant's training data is always somewhat stale. Left on its own, an assistant will guess at file formats, invent properties that do not exist, and produce layout that does not behave the way you expect. Gum closes that gap with three complementary pieces:

* A **live documentation server** your assistant can query on demand, so its answers come from the current docs rather than memory.
* A **command-line tool** (`gumcli`) the assistant can drive to generate code, validate projects, and render screenshots to verify its own work.
* A set of **drop-in skills** that give the assistant concept-level guidance on how Gum projects are structured.

## The pieces

* [MCP Documentation Server](/gum/using-gum-with-ai/ai/mcp-server.md) — connect your AI assistant directly to Gum's documentation so it can search and read authoritative guidance live.
* [GumCli for Agents](/gum/using-gum-with-ai/ai/gumcli-for-agents.md) — a recipe-oriented walkthrough of the commands an agent uses most: generating code, checking for errors, and capturing screenshots for self-verification.
* [AI Skills](/gum/using-gum-with-ai/ai/ai-skills.md) — reusable, consumer-facing skills you can drop into your project so your assistant understands Gum's file formats, layout system, and Forms controls.

{% hint style="info" %}
These pieces are complementary, not exclusive. The MCP server keeps your assistant's knowledge current, the skills give it durable context that loads automatically, and `gumcli` lets it act on a project and check the result.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.flatredball.com/gum/using-gum-with-ai/ai.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
