Skip to content

Commit c70bac4

Browse files
committed
Add AI onboarding docs page
1 parent 0586fa9 commit c70bac4

7 files changed

Lines changed: 247 additions & 15 deletions

File tree

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

docs/app/agent_files/_plugin.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
"ai/integrations/mcp-installation.md",
1313
"ai/integrations/mcp-overview.md",
1414
}
15+
AI_ONBOARDING_DOC_PATHS = {
16+
"ai/integrations/ai-onboarding.md",
17+
}
1518
MCP_DOC_ORDER = {
1619
"ai/integrations/mcp-overview.md": 0,
1720
"ai/integrations/mcp-installation.md": 1,
@@ -91,6 +94,7 @@ def _include_in_llms_txt(markdown_file: MarkdownFileEntry) -> bool:
9194
path = markdown_file.url_path.as_posix()
9295
return (
9396
path in MCP_DOC_PATHS
97+
or path in AI_ONBOARDING_DOC_PATHS
9498
or path in SKILLS_DOC_PATHS
9599
or not path.startswith("ai/")
96100
or path.startswith("ai/overview/")
@@ -100,6 +104,8 @@ def _include_in_llms_txt(markdown_file: MarkdownFileEntry) -> bool:
100104
def _section_for_path(url_path: Path) -> str:
101105
"""Return the llms.txt section for a generated markdown asset."""
102106
path = url_path.as_posix()
107+
if path in AI_ONBOARDING_DOC_PATHS:
108+
return "AI Onboarding"
103109
if path in MCP_DOC_PATHS:
104110
return "MCP"
105111
if path in SKILLS_DOC_PATHS:
@@ -117,6 +123,11 @@ def _ordered_sections(
117123
if "AI Builder" in sections and "MCP" in sections:
118124
ordered_sections.remove("MCP")
119125
ordered_sections.insert(ordered_sections.index("AI Builder") + 1, "MCP")
126+
if "AI Builder" in sections and "AI Onboarding" in sections:
127+
ordered_sections.remove("AI Onboarding")
128+
ordered_sections.insert(
129+
ordered_sections.index("AI Builder") + 1, "AI Onboarding"
130+
)
120131
if "MCP" in sections and "Skills" in sections:
121132
ordered_sections.remove("Skills")
122133
ordered_sections.insert(ordered_sections.index("MCP") + 1, "Skills")

docs/app/reflex_docs/templates/docpage/sidebar/sidebar.py

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from .sidebar_items.ai import (
1212
ai_builder_integrations,
1313
ai_builder_overview_items,
14+
ai_onboarding_items,
1415
mcp_items,
1516
skills_items,
1617
)
@@ -281,6 +282,7 @@ def append_to_items(items, flat_items):
281282
+ recipes
282283
+ ai_builder_overview_items
283284
+ ai_builder_integrations
285+
+ ai_onboarding_items
284286
+ mcp_items
285287
+ skills_items
286288
+ api_reference
@@ -363,6 +365,7 @@ def create_sidebar_section(
363365
items: list[SideBarItem],
364366
index: rx.Var[list[str]] | list[str],
365367
url: rx.Var[str] | str,
368+
connected_line: bool = False,
366369
) -> rx.Component:
367370
# Check if the section has any nested sections (Like the Other Libraries Section)
368371
nested = any(len(child.children) > 0 for item in items for child in item.children)
@@ -391,7 +394,10 @@ def create_sidebar_section(
391394
type="multiple",
392395
collapsible=True,
393396
default_value=index[:1].foreach(lambda x: "index" + x.to_string()),
394-
class_name="ml-0 pl-0 w-full !bg-transparent !shadow-none rounded-[0px] flex flex-col gap-1",
397+
class_name=ui.cn(
398+
"ml-0 pl-0 w-full !bg-transparent !shadow-none rounded-[0px] flex flex-col",
399+
"gap-0" if connected_line else "gap-1",
400+
),
395401
),
396402
class_name="flex flex-col items-start ml-0 w-full",
397403
)
@@ -410,6 +416,7 @@ def sidebar_comp(
410416
recipes_index: list[int],
411417
enterprise_usage_index: list[int],
412418
enterprise_component_index: list[int],
419+
ai_onboarding_index: list[int],
413420
mcp_index: list[int],
414421
skills_index: list[int],
415422
#
@@ -457,7 +464,7 @@ def sidebar_comp(
457464
),
458465
sidebar_category(
459466
"MCP/Skills",
460-
ai_builder_pages.integrations.mcp_overview.path,
467+
ai_builder_pages.integrations.ai_onboarding.path,
461468
"plug",
462469
1,
463470
),
@@ -558,18 +565,27 @@ def sidebar_comp(
558565
1,
559566
rx.el.ul(
560567
create_sidebar_section(
561-
"MCP Integration",
568+
"Overview",
569+
ai_builder_pages.integrations.ai_onboarding.path,
570+
ai_onboarding_items,
571+
ai_onboarding_index,
572+
url,
573+
),
574+
create_sidebar_section(
575+
"MCP",
562576
ai_builder_pages.integrations.mcp_overview.path,
563577
mcp_items,
564578
mcp_index,
565579
url,
580+
connected_line=True,
566581
),
567582
create_sidebar_section(
568583
"Skills",
569584
ai_builder_pages.integrations.skills.path,
570585
skills_items,
571586
skills_index,
572587
url,
588+
connected_line=True,
573589
),
574590
class_name="flex flex-col items-start gap-8 w-full list-none list-style-none",
575591
),
@@ -729,6 +745,7 @@ def sidebar(url=None, width: str = "100%") -> rx.Component:
729745
cli_ref_index = calculate_index(cli_ref, url)
730746
ai_builder_overview_index = calculate_index(ai_builder_overview_items, url)
731747
ai_builder_integrations_index = calculate_index(ai_builder_integrations, url)
748+
ai_onboarding_index = calculate_index(ai_onboarding_items, url)
732749
mcp_index = calculate_index(mcp_items, url)
733750
skills_index = calculate_index(skills_items, url)
734751

@@ -745,6 +762,7 @@ def sidebar(url=None, width: str = "100%") -> rx.Component:
745762
recipes_index=recipes_index,
746763
enterprise_usage_index=enterprise_usage_index,
747764
enterprise_component_index=enterprise_component_index,
765+
ai_onboarding_index=ai_onboarding_index,
748766
ai_builder_overview_index=ai_builder_overview_index,
749767
ai_builder_integrations_index=ai_builder_integrations_index,
750768
cli_ref_index=cli_ref_index,

docs/app/reflex_docs/templates/docpage/sidebar/sidebar_items/ai.py

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from ..state import SideBarItem
12
from .item import create_item
23

34

@@ -145,16 +146,28 @@ def get_ai_builder_integrations():
145146
]
146147

147148

149+
def get_sidebar_items_ai_onboarding():
150+
from reflex_docs.pages.docs import ai_builder
151+
152+
return [
153+
SideBarItem(
154+
names="AI Onboarding",
155+
link=ai_builder.integrations.ai_onboarding.path,
156+
),
157+
]
158+
159+
148160
def get_sidebar_items_mcp():
149161
from reflex_docs.pages.docs import ai_builder
150162

151163
return [
152-
create_item(
153-
"MCP Integration",
154-
children=[
155-
ai_builder.integrations.mcp_overview,
156-
ai_builder.integrations.mcp_installation,
157-
],
164+
SideBarItem(
165+
names="Overview",
166+
link=ai_builder.integrations.mcp_overview.path,
167+
),
168+
SideBarItem(
169+
names="Installation",
170+
link=ai_builder.integrations.mcp_installation.path,
158171
),
159172
]
160173

@@ -163,16 +176,15 @@ def get_sidebar_items_skills():
163176
from reflex_docs.pages.docs import ai_builder
164177

165178
return [
166-
create_item(
167-
"Skills",
168-
children=[
169-
ai_builder.integrations.skills,
170-
],
179+
SideBarItem(
180+
names="Overview",
181+
link=ai_builder.integrations.skills.path,
171182
),
172183
]
173184

174185

175186
ai_builder_overview_items = get_sidebar_items_ai_builder_overview()
176187
ai_builder_integrations = get_ai_builder_integrations()
188+
ai_onboarding_items = get_sidebar_items_ai_onboarding()
177189
mcp_items = get_sidebar_items_mcp()
178190
skills_items = get_sidebar_items_skills()

docs/app/reflex_docs/templates/docpage/sidebar/state.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ def set_sidebar_index(self, num) -> int:
4848
@rx.var(initial_value=-1)
4949
def sidebar_index(self) -> int:
5050
route = self.router.url.path
51+
if route.startswith((
52+
"/docs/ai/integrations/ai-onboarding",
53+
"/ai/integrations/ai-onboarding",
54+
)):
55+
return 1
5156
if route.startswith((
5257
"/docs/ai/integrations/skills",
5358
"/ai/integrations/skills",

0 commit comments

Comments
 (0)