Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# AI Onboarding
# Agent Toolkit

```python exec
import reflex as rx
Expand All @@ -20,7 +20,7 @@ def _resource_card(
)


def onboarding_resources() -> rx.Component:
def agent_toolkit_resources() -> rx.Component:
return rx.el.div(
_resource_card(
"Docs for Agents",
Expand Down Expand Up @@ -51,12 +51,10 @@ def onboarding_resources() -> rx.Component:
)
```

Everything you need to onboard your AI coding assistant to Reflex.

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.
The Agent Toolkit gives AI coding assistants the Reflex context they need to plan, code, run, and debug with the same assumptions as the Reflex docs.

```python eval
onboarding_resources()
agent_toolkit_resources()
```

## Prerequisite: Choose Your Workflow
Expand All @@ -71,7 +69,7 @@ You do not need an API key to read Reflex documentation. Start by deciding how y

## Reflex Docs for Agents

You can give your assistant current Reflex documentation in a few ways.
You can give your assistant current Reflex documentation in a few ways. These Agent Toolkit resources are designed for assistants that need focused Markdown pages, a broad docs index, structured MCP lookup, or repeatable local skills.

`````md tabs

Expand All @@ -80,7 +78,7 @@ You can give your assistant current Reflex documentation in a few ways.
Every docs page has a Markdown version that agents can read directly. Add `.md` to the docs path:

```text
https://reflex.dev/docs/ai/integrations/ai-onboarding.md
https://reflex.dev/docs/ai/integrations/agent-toolkit.md
```

Use this when an agent needs one focused page.
Expand Down
2 changes: 1 addition & 1 deletion docs/ai_builder/integrations/agents_md.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ cp AGENTS.md /path/to/your/reflex-project/AGENTS.md

## Combining With Skills and MCP

`AGENTS.md` and `CLAUDE.md` anchor the assistant in your project. Pair them with the other onboarding tools for deeper Reflex knowledge:
`AGENTS.md` and `CLAUDE.md` anchor the assistant in your project. Pair them with the Agent Toolkit resources for deeper Reflex knowledge:

- [Reflex Agent Skills](/docs/ai/integrations/skills/) provide reusable workflows that the file references by name.
- [Reflex MCP](/docs/ai/integrations/mcp-overview/) provides structured documentation lookup at runtime.
Expand Down
26 changes: 18 additions & 8 deletions docs/app/agent_files/_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@
"ai/integrations/mcp-installation.md",
"ai/integrations/mcp-overview.md",
}
AI_ONBOARDING_DOC_PATHS = {
"ai/integrations/ai-onboarding.md",
AGENT_TOOLKIT_DOC_PATHS = {
"ai/integrations/agent-toolkit.md",
}
LEGACY_MARKDOWN_ALIASES = {
Path("ai/integrations/ai-onboarding.md"): Path("ai/integrations/agent-toolkit.md"),
}
MCP_DOC_ORDER = {
"ai/integrations/mcp-overview.md": 0,
Expand Down Expand Up @@ -190,7 +193,7 @@ def _include_index_entry_in_llms_txt(markdown_file: MarkdownIndexEntry) -> bool:
path = markdown_file.url_path.as_posix()
return (
path in MCP_DOC_PATHS
or path in AI_ONBOARDING_DOC_PATHS
or path in AGENT_TOOLKIT_DOC_PATHS
or path in SKILLS_DOC_PATHS
or not path.startswith("ai/")
or path.startswith("ai/overview/")
Expand All @@ -200,8 +203,8 @@ def _include_index_entry_in_llms_txt(markdown_file: MarkdownIndexEntry) -> bool:
def _section_for_path(url_path: Path) -> str:
"""Return the llms.txt section for a generated markdown asset."""
path = url_path.as_posix()
if path in AI_ONBOARDING_DOC_PATHS:
return "AI Onboarding"
if path in AGENT_TOOLKIT_DOC_PATHS:
return "Agent Toolkit"
if path in MCP_DOC_PATHS:
return "MCP"
if path in SKILLS_DOC_PATHS:
Expand All @@ -219,10 +222,10 @@ def _ordered_sections(
if "AI Builder" in sections and "MCP" in sections:
ordered_sections.remove("MCP")
ordered_sections.insert(ordered_sections.index("AI Builder") + 1, "MCP")
if "AI Builder" in sections and "AI Onboarding" in sections:
ordered_sections.remove("AI Onboarding")
if "AI Builder" in sections and "Agent Toolkit" in sections:
ordered_sections.remove("Agent Toolkit")
ordered_sections.insert(
ordered_sections.index("AI Builder") + 1, "AI Onboarding"
ordered_sections.index("AI Builder") + 1, "Agent Toolkit"
)
if "MCP" in sections and "Skills" in sections:
ordered_sections.remove("Skills")
Expand Down Expand Up @@ -847,9 +850,16 @@ def generate_agent_files() -> tuple[tuple[Path, str | bytes], ...]:
(entry.url_path, generate_markdown_file_content(entry))
for entry in markdown_file_entries
)
markdown_files_by_path = dict(markdown_files)
legacy_markdown_files = tuple(
(legacy_path, markdown_files_by_path[target_path])
for legacy_path, target_path in LEGACY_MARKDOWN_ALIASES.items()
if target_path in markdown_files_by_path
)

all_markdown_files = [
*markdown_files,
*legacy_markdown_files,
*dynamic_api_reference_files,
]

Expand Down
1 change: 1 addition & 0 deletions docs/app/reflex_docs/pages/docs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ def get_previews_from_frontmatter(filepath: str) -> dict[str, str]:
"docs/library/graphing/general/tooltip.md": "Graphing Tooltip",
"docs/recipes/content/grid.md": "Grid Recipe",
"docs/hosting/deploy-to-gcp.md": "Deploy to GCP",
"docs/ai_builder/integrations/agent_toolkit.md": "Agent Toolkit",
}


Expand Down
10 changes: 7 additions & 3 deletions docs/app/reflex_docs/reflex_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,13 @@ def _llms_txt_directive() -> rx.Component:

# Add redirects.
redirects = [
(route.path.replace("/ai/", "/ai-builder/", 1), route.path)
for route in routes
if route.path.startswith("/ai/")
("/ai/integrations/ai-onboarding/", "/ai/integrations/agent-toolkit/"),
("/ai-builder/integrations/ai-onboarding/", "/ai/integrations/agent-toolkit/"),
*[
(route.path.replace("/ai/", "/ai-builder/", 1), route.path)
for route in routes
if route.path.startswith("/ai/")
],
]


Expand Down
19 changes: 12 additions & 7 deletions docs/app/reflex_docs/templates/docpage/docpage.py
Original file line number Diff line number Diff line change
Expand Up @@ -640,12 +640,14 @@ def breadcrumb(path: str, nav_sidebar: rx.Component, doc_content: str | None = N
docs_sidebar_drawer,
)

# Split the path into segments, removing 'docs' and capitalizing each segment
segments = [
segment.capitalize()
for segment in path.split("/")
if segment and segment != "docs"
]
# Split the path into segments, removing 'docs'. Some legacy URLs keep
# their old slugs for compatibility while using newer public labels.
segments = [segment for segment in path.split("/") if segment and segment != "docs"]
segment_labels = {
"ai": "AI",
"ai-onboarding": "Agent Toolkit",
"agent-toolkit": "Agent Toolkit",
}

# Initialize an empty list to store the breadcrumbs and their separators
breadcrumbs = []
Expand All @@ -658,7 +660,10 @@ def breadcrumb(path: str, nav_sidebar: rx.Component, doc_content: str | None = N
# Add the breadcrumb item to the list
breadcrumbs.append(
rx.el.a(
to_title_case(to_snake_case(segment), sep=" "),
segment_labels.get(
segment,
to_title_case(to_snake_case(segment), sep=" "),
),
class_name="min-h-8 flex items-center text-sm font-[525] text-m-slate-12 dark:text-m-slate-3 last:text-m-slate-7 dark:last:text-m-slate-6 hover:text-primary-10 dark:hover:text-primary-9"
+ (" truncate" if i == len(segments) - 1 else ""),
underline="none",
Expand Down
22 changes: 11 additions & 11 deletions docs/app/reflex_docs/templates/docpage/sidebar/sidebar.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
from reflex_site_shared.styles.colors import c_color

from .sidebar_items.ai import (
agent_toolkit_items,
ai_builder_integrations,
ai_builder_overview_items,
ai_onboarding_items,
mcp_items,
skills_items,
)
Expand Down Expand Up @@ -305,7 +305,7 @@ def append_to_items(items, flat_items):
+ recipes
+ ai_builder_overview_items
+ ai_builder_integrations
+ ai_onboarding_items
+ agent_toolkit_items
+ mcp_items
+ skills_items
+ api_reference
Expand Down Expand Up @@ -440,7 +440,7 @@ def sidebar_comp(
recipes_index: list[int],
enterprise_usage_index: list[int],
enterprise_component_index: list[int],
ai_onboarding_index: list[int],
agent_toolkit_index: list[int],
mcp_index: list[int],
skills_index: list[int],
#
Expand All @@ -461,7 +461,7 @@ def sidebar_comp(
is_docs_hosting = path.startswith("/hosting/")
is_docs_ai_builder = path.startswith("/ai/")
is_ai_mcp_or_skills = path.startswith((
"/ai/integrations/ai-onboarding/",
"/ai/integrations/agent-toolkit/",
"/ai/integrations/skills/",
"/ai/integrations/agents-md/",
"/ai/integrations/mcp",
Expand Down Expand Up @@ -505,8 +505,8 @@ def sidebar_comp(
ai_category == 0,
),
sidebar_category(
"MCP/Skills",
ai_builder_pages.integrations.ai_onboarding.path,
"Agent Toolkit",
ai_builder_pages.integrations.agent_toolkit.path,
"plug",
ai_category == 1,
),
Expand All @@ -516,9 +516,9 @@ def sidebar_comp(
rx.el.ul(
create_sidebar_section(
"Overview",
ai_builder_pages.integrations.ai_onboarding.path,
ai_onboarding_items,
ai_onboarding_index,
ai_builder_pages.integrations.agent_toolkit.path,
agent_toolkit_items,
agent_toolkit_index,
url,
),
create_sidebar_section(
Expand Down Expand Up @@ -732,7 +732,7 @@ def sidebar(url=None, width: str = "100%") -> rx.Component:
ai_builder_integrations_index = calculate_index(
ai_builder_integrations, normalized_url
)
ai_onboarding_index = calculate_index(ai_onboarding_items, normalized_url)
agent_toolkit_index = calculate_index(agent_toolkit_items, normalized_url)
mcp_index = calculate_index(mcp_items, normalized_url)
skills_index = calculate_index(skills_items, normalized_url)

Expand All @@ -750,7 +750,7 @@ def sidebar(url=None, width: str = "100%") -> rx.Component:
recipes_index=recipes_index,
enterprise_usage_index=enterprise_usage_index,
enterprise_component_index=enterprise_component_index,
ai_onboarding_index=ai_onboarding_index,
agent_toolkit_index=agent_toolkit_index,
ai_builder_overview_index=ai_builder_overview_index,
ai_builder_integrations_index=ai_builder_integrations_index,
cli_ref_index=cli_ref_index,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,13 @@ def get_ai_builder_integrations():
]


def get_sidebar_items_ai_onboarding():
def get_sidebar_items_agent_toolkit():
from reflex_docs.pages.docs import ai_builder

return [
SideBarItem(
names="AI Onboarding",
link=ai_builder.integrations.ai_onboarding.path,
names="Agent Toolkit",
link=ai_builder.integrations.agent_toolkit.path,
),
]

Expand Down Expand Up @@ -189,6 +189,6 @@ def get_sidebar_items_skills():

ai_builder_overview_items = get_sidebar_items_ai_builder_overview()
ai_builder_integrations = get_ai_builder_integrations()
ai_onboarding_items = get_sidebar_items_ai_onboarding()
agent_toolkit_items = get_sidebar_items_agent_toolkit()
mcp_items = get_sidebar_items_mcp()
skills_items = get_sidebar_items_skills()
18 changes: 11 additions & 7 deletions docs/app/tests/test_agent_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ def test_generate_llms_txt_groups_docs_at_public_root(monkeypatch):
section="MCP",
),
MarkdownIndexEntry(
url_path=Path("ai/integrations/ai-onboarding.md"),
title="AI Onboarding",
section="AI Onboarding",
url_path=Path("ai/integrations/agent-toolkit.md"),
title="Agent Toolkit",
section="Agent Toolkit",
),
MarkdownIndexEntry(
url_path=Path("ai/integrations/mcp-installation.md"),
Expand Down Expand Up @@ -103,9 +103,9 @@ def test_generate_llms_txt_groups_docs_at_public_root(monkeypatch):
)
assert "Resend Integration" not in content
assert "Reflex Build IDE" not in content
assert "### AI Onboarding\n\n" in content
assert "### Agent Toolkit\n\n" in content
assert (
"- [AI Onboarding](https://reflex.dev/docs/ai/integrations/ai-onboarding.md)"
"- [Agent Toolkit](https://reflex.dev/docs/ai/integrations/agent-toolkit.md)"
in content
)
assert "### MCP\n\n" in content
Expand All @@ -119,8 +119,8 @@ def test_generate_llms_txt_groups_docs_at_public_root(monkeypatch):
)
assert "### Skills\n\n" in content
assert "- [Skills](https://reflex.dev/docs/ai/integrations/skills.md)" in content
assert content.index("### AI Builder") < content.index("### AI Onboarding")
assert content.index("### AI Onboarding") < content.index("### MCP")
assert content.index("### AI Builder") < content.index("### Agent Toolkit")
assert content.index("### Agent Toolkit") < content.index("### MCP")
assert content.index("### MCP") < content.index("### Skills")
assert content.index("mcp-overview.md") < content.index("mcp-installation.md")

Expand Down Expand Up @@ -365,6 +365,10 @@ def test_generate_agent_files_emits_trailing_slash_variants():
path for path in files if path.suffix == ".md" and path.name != ".md"
]
assert markdown_paths, "expected at least one markdown asset"
assert (
files[Path("ai/integrations/ai-onboarding.md")]
== files[Path("ai/integrations/agent-toolkit.md")]
)

for path in markdown_paths:
twin = markdown_path_for_trailing_slash_url(path)
Expand Down
4 changes: 3 additions & 1 deletion docs/app/tests/test_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,12 @@ def test_ai_builder_routes_use_ai_prefix(routes_fixture):
paths = {route.path for route in routes_fixture if route.path}

assert "/ai/overview/best-practices/" in paths
assert "/ai/integrations/ai-onboarding/" in paths
assert "/ai/integrations/agent-toolkit/" in paths
assert "/ai/integrations/mcp-overview/" in paths
assert "/ai/integrations/skills/" in paths
assert "/ai/integrations/ai-onboarding/" not in paths
assert "/ai-builder/overview/best-practices/" not in paths
assert "/ai-builder/integrations/ai-onboarding/" not in paths
assert "/ai-builder/integrations/agent-toolkit/" not in paths
assert "/ai-builder/integrations/mcp-overview/" not in paths
assert "/ai-builder/integrations/skills/" not in paths
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ def footer_index(class_name: str = "", grid_class_name: str = "") -> rx.Componen
footer_link("AI Builder", REFLEX_BUILD_URL),
footer_link(
"Agent Toolkit",
"/docs/ai/integrations/overview/",
"/docs/ai/integrations/agent-toolkit/",
),
footer_link(
"Enterprise",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ def products_build_column_body() -> rx.Component:
"Get started with our MCP and Skills.",
class_name="text-secondary-11 text-sm font-[475] px-6 pb-6",
),
href="/docs/ai/integrations/ai-onboarding/",
href="/docs/ai/integrations/agent-toolkit/",
class_name="group flex flex-col gap-2 items-center text-center",
),
class_name="flex flex-col text-center justify-center items-center min-h-[252px]",
Expand Down
Loading