|
| 1 | +# AI Onboarding |
| 2 | + |
| 3 | +```python exec |
| 4 | +import reflex as rx |
| 5 | + |
| 6 | + |
| 7 | +def _resource_card( |
| 8 | + title: str, body: str, href: str, action: str, target: str = "_self" |
| 9 | +) -> rx.Component: |
| 10 | + return rx.el.a( |
| 11 | + rx.el.div( |
| 12 | + rx.el.h3(title, class_name="text-base font-semibold text-secondary-12"), |
| 13 | + rx.el.p(body, class_name="text-sm leading-6 text-secondary-11"), |
| 14 | + rx.el.div(action, class_name="text-sm font-semibold text-primary-10"), |
| 15 | + class_name="flex h-full flex-col gap-2 rounded-lg border border-secondary-a4 bg-white-1 p-4 transition-colors hover:bg-secondary-2 shadow-xs", |
| 16 | + ), |
| 17 | + href=href, |
| 18 | + target=target, |
| 19 | + class_name="no-underline", |
| 20 | + ) |
| 21 | + |
| 22 | + |
| 23 | +def onboarding_resources() -> rx.Component: |
| 24 | + return rx.el.div( |
| 25 | + _resource_card( |
| 26 | + "Docs for Agents", |
| 27 | + "Give your agent current Reflex documentation as Markdown, llms.txt, or structured MCP context.", |
| 28 | + "/llms.txt", |
| 29 | + "Open llms.txt", |
| 30 | + target="_blank", |
| 31 | + ), |
| 32 | + _resource_card( |
| 33 | + "MCP", |
| 34 | + "Connect supported AI tools to Reflex documentation and component information through MCP.", |
| 35 | + "/ai/integrations/mcp-overview/", |
| 36 | + "View MCP overview", |
| 37 | + ), |
| 38 | + _resource_card( |
| 39 | + "Skills", |
| 40 | + "Install Reflex Agent Skills so assistants follow Reflex-specific workflows for docs, setup, and process management.", |
| 41 | + "/ai/integrations/skills/", |
| 42 | + "Install skills", |
| 43 | + ), |
| 44 | + _resource_card( |
| 45 | + "Reflex Build", |
| 46 | + "Use Reflex Build when you want an AI-native environment for creating, editing, previewing, and shipping apps.", |
| 47 | + "/ai/overview/best-practices/", |
| 48 | + "Read best practices", |
| 49 | + ), |
| 50 | + class_name="grid grid-cols-1 gap-3 md:grid-cols-2 my-6", |
| 51 | + ) |
| 52 | +``` |
| 53 | + |
| 54 | +Everything you need to onboard your AI coding assistant to Reflex. |
| 55 | + |
| 56 | +If you are building Reflex apps with AI, combine current docs, structured MCP context, and local skills so the assistant can plan, code, run, and debug with the same assumptions as the Reflex docs. |
| 57 | + |
| 58 | +```python eval |
| 59 | +onboarding_resources() |
| 60 | +``` |
| 61 | + |
| 62 | +## Prerequisite: Choose Your Workflow |
| 63 | + |
| 64 | +You do not need an API key to read Reflex documentation. Start by deciding how your assistant will work with Reflex: |
| 65 | + |
| 66 | +- For local app development, use Python 3.10 or newer and a project virtual environment. |
| 67 | +- For current documentation context, give the assistant Markdown docs or `llms.txt`. |
| 68 | +- For structured tool access, use the Reflex MCP integration. |
| 69 | +- For repeatable agent behavior, install Reflex Agent Skills. |
| 70 | +- For a browser-based AI builder, use Reflex Build. |
| 71 | + |
| 72 | +## Reflex Docs for Agents |
| 73 | + |
| 74 | +You can give your assistant current Reflex documentation in a few ways. |
| 75 | + |
| 76 | +`````md tabs |
| 77 | + |
| 78 | +## Markdown Pages |
| 79 | + |
| 80 | +Every docs page has a Markdown version that agents can read directly. Add `.md` to the docs path: |
| 81 | + |
| 82 | +```text |
| 83 | +https://reflex.dev/docs/ai/integrations/ai-onboarding.md |
| 84 | +``` |
| 85 | + |
| 86 | +Use this when an agent needs one focused page. |
| 87 | + |
| 88 | + |
| 89 | +## llms.txt |
| 90 | + |
| 91 | +Use the generated docs index when an agent needs a broad map of Reflex docs: |
| 92 | + |
| 93 | +```text |
| 94 | +https://reflex.dev/docs/llms.txt |
| 95 | +``` |
| 96 | + |
| 97 | +The index groups docs by section and links to agent-friendly Markdown assets. |
| 98 | + |
| 99 | + |
| 100 | +## MCP |
| 101 | + |
| 102 | +Use MCP when your editor or agent can call tools for structured documentation and component lookup: |
| 103 | + |
| 104 | +```text |
| 105 | +https://mcp.reflex.dev/mcp |
| 106 | +``` |
| 107 | + |
| 108 | +See the [MCP overview](/docs/ai/integrations/mcp-overview/) and [MCP installation](/docs/ai/integrations/mcp-installation/) guides for details. |
| 109 | + |
| 110 | +````` |
| 111 | + |
| 112 | +## Reflex MCP |
| 113 | + |
| 114 | +The Reflex MCP integration gives supported AI tools structured access to Reflex framework docs and component information. Use it when your assistant can connect to an MCP server and benefit from tool-assisted lookup while editing code. |
| 115 | + |
| 116 | +```md alert warning |
| 117 | +# The Reflex MCP integration is currently only available for enterprise customers. Please [book a demo](https://reflex.dev/pricing/) to discuss access. |
| 118 | +``` |
| 119 | + |
| 120 | +## Reflex Agent Skills |
| 121 | + |
| 122 | +Reflex Agent Skills are local instruction packs that teach AI assistants how to work with Reflex projects. They cover: |
| 123 | + |
| 124 | +- Current Reflex docs and concept lookup. |
| 125 | +- Python environment setup for Reflex projects. |
| 126 | +- Reflex compile, run, restart, and debugging workflows. |
| 127 | + |
| 128 | +Install the skill pack from the [reflex-dev/agent-skills](https://github.com/reflex-dev/agent-skills) repository, or follow the [Skills installation guide](/docs/ai/integrations/skills/). |
| 129 | + |
| 130 | +```bash |
| 131 | +npx skills add reflex-dev/agent-skills |
| 132 | +``` |
| 133 | + |
| 134 | +## Quick Start Prompts |
| 135 | + |
| 136 | +Use these prompts to give your agent a strong starting point. |
| 137 | + |
| 138 | +`````md tabs |
| 139 | + |
| 140 | +## New App |
| 141 | + |
| 142 | +```text |
| 143 | +Create a new Reflex app. Use current Reflex documentation, set up a Python 3.10+ virtual environment, initialize the project, and validate it with reflex compile --dry before handing it back. |
| 144 | +``` |
| 145 | + |
| 146 | + |
| 147 | +## Existing App |
| 148 | + |
| 149 | +```text |
| 150 | +Work on this existing Reflex app. First inspect the project structure and current dependencies. Use Reflex docs for current APIs, make the requested change, then run reflex compile --dry or the project's existing test command. |
| 151 | +``` |
| 152 | + |
| 153 | + |
| 154 | +## Debugging |
| 155 | + |
| 156 | +```text |
| 157 | +Debug this Reflex app. Read the error and relevant logs, identify whether the failure is in imports, state, event handlers, routing, components, or runtime setup, then apply the smallest fix and re-run validation. |
| 158 | +``` |
| 159 | + |
| 160 | +````` |
| 161 | + |
| 162 | +## Reflex Build |
| 163 | + |
| 164 | +Reflex Build is the AI-native way to create Reflex apps in the browser. Use it when you want to generate, edit, preview, and share apps without setting up a local environment first. |
| 165 | + |
| 166 | +Start with the [Reflex Build best practices](/docs/ai/overview/best-practices/) guide, then use MCP and Skills when you want your local assistant to keep working with the same Reflex concepts. |
| 167 | + |
| 168 | +## Recommended Validation |
| 169 | + |
| 170 | +Ask your assistant to validate Reflex changes before it hands work back: |
| 171 | + |
| 172 | +```bash |
| 173 | +reflex compile --dry |
| 174 | +``` |
| 175 | + |
| 176 | +For running apps, pair that with the process-management workflow from Reflex Agent Skills so the assistant restarts only the server process it owns. |
0 commit comments