> For the complete documentation index, see [llms.txt](https://docs.convai.com/api-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/ai-coding-assistant/supported-coding-agents.md).

# 受支持的编码代理

Convai Unity SDK 支持的编码代理参考，包括每个代理的准确说明文件路径和安装行为。

Convai Unity SDK 会为每个受支持的编码代理（Codex、Claude Code、Cursor、Gemini 和 VS Code Copilot）在项目文件中写入一个受管指令块。请参阅此参考，了解每个代理对应的确切文件路径和安装行为。

### 各代理的受管指令文件

| 代理              | 受管文件                                 | 位置                  |
| --------------- | ------------------------------------ | ------------------- |
| Codex           | `AGENTS.md`                          | 项目根目录               |
| Claude Code     | `CLAUDE.md`                          | 项目根目录               |
| Cursor          | `.cursor/rules/convai-unity-sdk.mdc` | `.cursor/rules/` 目录 |
| Gemini          | `GEMINI.md`                          | 项目根目录               |
| VS Code Copilot | `.github/copilot-instructions.md`    | `.github/` 目录       |

SDK 会相对于 Unity 项目根目录解析各路径，而不是相对于程序包文件夹。

### SDK 如何安装受管指令块

这五种代理的安装逻辑完全相同。触发安装或更新时，SDK 会读取目标文件（如果文件存在），移除由以下标记界定的现有指令块： `<!-- BEGIN CONVAI UNITY SDK -->` 和 `<!-- END CONVAI UNITY SDK -->`然后在文件末尾附加新的指令块。如果文件不存在，SDK 会创建该文件，并创建所有缺失的上级目录，例如 `.cursor/rules/` 或 `.github/`。标记之外的内容会予以保留，写入时会沿用文件现有的换行符（`\r\n` 或 `\n`).

{% hint style="info" %}
安装、更新或移除受管指令块都需要手动操作，不会自动执行。请在 Convai Editor 窗口的 **AI 编码** 部分触发该操作。可通过以下菜单打开此窗口： **Convai > Convai Editor**.
{% endhint %}

安装的指令块会指示代理读取 `Packages/com.convai.convai-sdk-for-unity/AIAssistantSkills/convai-unity-sdk/SKILL.md` 及其链接的参考资料，以了解 Convai 专属工作流；并使用 Unity MCP 工具执行通用的场景、GameObject、资源、脚本、控制台和 Play Mode 操作，同时将 [Convai 自有工具](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/ai-coding-assistant/mcp-tools-reference.md) 留作 SDK 专属配置和诊断之用。

### 代理专属说明

| 代理              | 注意                                                                    |
| --------------- | --------------------------------------------------------------------- |
| Codex           | 首次安装时会在项目根目录创建该文件。无需额外目录。                                             |
| Claude Code     | 首次安装时会在项目根目录创建该文件。无需额外目录。                                             |
| Cursor          | 如果 `.cursor/rules/` 目录不存在，SDK 会创建该目录。受管指令块上方已有的任何 Cursor 规则前置元数据都会保留。 |
| Gemini          | 首次安装时会在项目根目录创建该文件。无需额外目录。                                             |
| VS Code Copilot | 如果 `.github/` 目录不存在，SDK 会创建该目录。                                       |

### 后续步骤

{% content-ref url="/pages/d8c18409ae9c4e08b59f112c685f31eedd8cba20" %}
[AI 编码助手](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/ai-coding-assistant.md)
{% endcontent-ref %}

{% content-ref url="/pages/fef78cf340cc23d3c5966ea9c7099beadba8f247" %}
[AI 编码助手快速入门](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/ai-coding-assistant/quick-start.md)
{% endcontent-ref %}

{% content-ref url="/pages/2556d68ab00a9475a0e5c6ca8c0541b3d69dc561" %}
[MCP 工具参考](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/ai-coding-assistant/mcp-tools-reference.md)
{% endcontent-ref %}

{% content-ref url="/pages/19bff3d08fa0ba480410597a8a790b68a4f73b14" %}
[排查 AI 编码助手设置问题](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/ai-coding-assistant/troubleshooting.md)
{% endcontent-ref %}


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/ai-coding-assistant/supported-coding-agents.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
