Skip to content

Commit 0586fa9

Browse files
committed
Improve AI skills docs layout
1 parent d36f785 commit 0586fa9

1 file changed

Lines changed: 126 additions & 61 deletions

File tree

docs/ai_builder/integrations/skills.md

Lines changed: 126 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -2,41 +2,88 @@
22

33
```python exec
44
import reflex as rx
5+
6+
7+
def _summary_card(kicker: str, title: str, body: str) -> rx.Component:
8+
return rx.el.div(
9+
rx.el.div(kicker, class_name="text-xs font-semibold uppercase text-violet-9"),
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+
class_name="flex flex-col gap-2 rounded-lg border border-slate-4 bg-slate-1 p-4",
13+
)
14+
15+
16+
def skills_summary_cards() -> rx.Component:
17+
return rx.el.div(
18+
_summary_card(
19+
"Docs",
20+
"Current Reflex guidance",
21+
"Point agents to the right Reflex docs for state, vars, components, routing, styling, deployment, and more.",
22+
),
23+
_summary_card(
24+
"Setup",
25+
"Python environment workflow",
26+
"Teach agents how to create a virtual environment, install Reflex, and initialize a new project safely.",
27+
),
28+
_summary_card(
29+
"Runtime",
30+
"Process management",
31+
"Give agents a repeatable way to compile, run, restart, and debug Reflex apps without guessing at processes.",
32+
),
33+
_summary_card(
34+
"Context",
35+
"Pairs well with MCP",
36+
"Use skills for durable local instructions and MCP for structured lookup of current docs and component data.",
37+
),
38+
class_name="grid grid-cols-1 gap-3 md:grid-cols-2 my-6",
39+
)
540
```
641

7-
Reflex Agent Skills give AI coding assistants up-to-date guidance for building Reflex applications. They package Reflex-specific knowledge, setup steps, and process-management workflows into reusable skill files that agents can load when the conversation or codebase calls for them.
42+
Reflex Agent Skills give AI coding assistants up-to-date guidance for building Reflex applications. They package Reflex-specific knowledge, setup steps, and process-management workflows into reusable `SKILL.md` files that agents can load when the conversation or codebase calls for them.
843

944
The skills are maintained in the [reflex-dev/agent-skills](https://github.com/reflex-dev/agent-skills) repository and are designed for agents that support the Agent Skills standard, including Claude Code, Cursor, OpenCode, OpenAI Codex, and Pi.
1045

11-
## Why Use Skills
46+
```python eval
47+
skills_summary_cards()
48+
```
49+
50+
## When to Use Skills
1251

13-
AI assistants can be very helpful when building Reflex apps, but their built-in training data may be stale or too general. Reflex Agent Skills help by giving the assistant project-specific instructions about:
52+
Use Reflex Agent Skills when you want an AI assistant to follow Reflex-specific workflows instead of relying only on general training data. They are especially useful when an assistant needs to:
1453

15-
- How Reflex apps are structured.
16-
- Which docs to consult for core concepts such as state, vars, events, components, routing, styling, database usage, API routes, authentication, and deployment.
17-
- How to set up a Python environment for a new Reflex project.
18-
- How to compile, run, reload, and debug Reflex app processes safely.
54+
- Build or edit a Reflex app.
55+
- Set up a new Python environment.
56+
- Decide which Reflex docs apply to the task.
57+
- Compile, run, restart, or debug a local Reflex server.
58+
- Keep generated code aligned with current Reflex patterns.
1959

20-
Skills are loaded contextually by the agent. For example, when an assistant sees a Python file importing `reflex as rx`, it can load the Reflex docs skill. When you ask it to start a new app, it can load the Python environment setup skill before running project commands.
60+
Skills load contextually. For example, when an assistant sees a Python file importing `reflex as rx`, it can load the Reflex docs skill. When you ask it to start a new app, it can load the Python environment setup skill before running project commands.
2161

2262
## Skills vs MCP
2363

24-
Skills and MCP solve related but different problems.
64+
Skills and MCP solve related but different problems. For the best experience, use both.
2565

26-
Skills are local instruction packs. They tell the agent how to work with Reflex, which workflows to follow, and which references matter for common development tasks.
66+
```md definition
67+
# Skills
68+
69+
Local instruction packs that tell the agent how to work with Reflex, which workflows to follow, and which references matter for common development tasks.
2770

28-
MCP provides structured runtime access to Reflex documentation and component information through a hosted server. It is useful when the agent or editor can call MCP tools directly while working.
71+
# MCP
2972

30-
For the best experience, use both:
73+
Structured runtime access to Reflex documentation and component information through a hosted server. Use it when an agent or editor can call MCP tools directly.
74+
```
3175

32-
- Use Skills for durable local guidance and repeatable workflows.
33-
- Use MCP for structured documentation lookup and richer tool-assisted context.
76+
```md alert info
77+
# Use Skills for durable local guidance. Use MCP for structured documentation lookup and richer tool-assisted context.
78+
```
3479

3580
## Installation
3681

37-
The Reflex skills repository can be installed in several ways depending on your assistant.
82+
Choose the install path that matches your assistant.
3883

39-
### Claude Code
84+
`````md tabs
85+
86+
## Claude Code
4087

4188
Install the plugin from the Claude Code plugin marketplace:
4289

@@ -45,33 +92,40 @@ Install the plugin from the Claude Code plugin marketplace:
4592
/plugin install reflex@reflex-agent-skills
4693
```
4794

48-
### Cursor
95+
Restart or refresh Claude Code after installation if the skills do not appear immediately.
96+
97+
98+
## Cursor
4999

50100
Install from the Cursor Marketplace, or add the repository manually from:
51101

52102
```text
53103
reflex-dev/agent-skills
54104
```
55105

56-
In Cursor, you can add it through **Settings > Rules > Add Rule > Remote Rule (Github)**.
106+
In Cursor, add it through **Settings > Rules > Add Rule > Remote Rule (GitHub)**.
107+
57108

58-
### npx skills
109+
## CLI
59110

60111
If your environment supports the `skills` CLI, install the package with:
61112

62113
```bash
63114
npx skills add reflex-dev/agent-skills
64115
```
65116

66-
### Clone or Copy
117+
Use the CLI's update command later to keep the skill pack current.
67118

68-
You can also clone the repository and copy the skill folders into your assistant's skills directory:
119+
120+
## Manual
121+
122+
Clone the repository:
69123

70124
```bash
71125
git clone https://github.com/reflex-dev/agent-skills.git
72126
```
73127

74-
Then copy the folders from `skills/` into the appropriate location:
128+
Then copy the folders inside `skills/` into the appropriate location:
75129

76130
| Agent | Skill Directory |
77131
| --- | --- |
@@ -81,57 +135,50 @@ Then copy the folders from `skills/` into the appropriate location:
81135
| OpenAI Codex | `~/.codex/skills/` |
82136
| Pi | `~/.pi/agent/skills/` |
83137

138+
Copy the skill folders themselves, not the parent `skills/` directory.
139+
140+
`````
141+
84142
## Included Skills
85143

86144
The Reflex skill pack includes three core skills.
87145

88-
### reflex-docs
146+
`````md tabs
147+
148+
## Docs
89149

90150
The `reflex-docs` skill gives the assistant a Reflex-specific reference map and a summary of the framework's core concepts.
91151

92-
Use this skill when the assistant is:
152+
### Use this skill when the assistant is:
93153

94154
- Building full-stack Python web apps with Reflex.
95155
- Writing files that import `reflex` or use the `rx` namespace.
96156
- Creating components.
97157
- Managing state, vars, computed vars, or event handlers.
98158
- Working with routing, styling, database models, assets, authentication, client storage, API routes, custom components, or wrapped React components.
99159

100-
The skill points the agent to the official Reflex docs for topics such as:
101-
102-
- Getting started.
103-
- Components.
104-
- State and vars.
105-
- Events.
106-
- Pages and routing.
107-
- Styling.
108-
- Database.
109-
- Assets.
110-
- Authentication.
111-
- Client storage.
112-
- API routes.
113-
- API reference.
114-
- Custom components.
115-
- Wrapping React.
116-
- Component library.
117-
- Recipes.
160+
### It points the assistant to docs for:
161+
162+
- Core app structure: getting started, components, state and vars, events, pages, and routing.
163+
- UI and styling: styling, assets, the component library, and recipes.
164+
- Backend features: database models, authentication, client storage, API routes, and API reference.
165+
- Advanced integrations: custom components and wrapped React components.
118166

119167
It also reminds the assistant to prefer current Reflex documentation over pre-trained knowledge when there is a conflict.
120168

121-
### setup-python-env
169+
170+
## Setup
122171

123172
The `setup-python-env` skill guides the assistant through setting up a Python environment for a Reflex app.
124173

125-
Use this skill when:
174+
### Use this skill when:
126175

127176
- Starting a new Reflex project.
128177
- Setting up a development environment.
129178
- There is no `.venv` directory.
130179
- Reflex imports fail because dependencies are missing.
131180

132-
The workflow checks for an existing `.venv`, prefers `uv` when available, falls back to `python3 -m venv`, verifies Python 3.10 or newer, upgrades `pip` when using the fallback path, and installs Reflex if it is not already installed.
133-
134-
For a new app, the expected flow is:
181+
### Preferred workflow:
135182

136183
```bash
137184
uv venv .venv
@@ -140,7 +187,7 @@ uv add reflex
140187
reflex init
141188
```
142189

143-
If `uv` is not available, the skill uses:
190+
If `uv` is not available, the skill falls back to:
144191

145192
```bash
146193
python3 -m venv .venv
@@ -150,41 +197,48 @@ pip install reflex
150197
reflex init
151198
```
152199

153-
### reflex-process-management
200+
The workflow checks for an existing `.venv`, verifies Python 3.10 or newer, and installs Reflex only when needed.
201+
202+
203+
## Process
154204

155205
The `reflex-process-management` skill teaches the assistant how to compile, run, reload, and debug Reflex apps.
156206

157-
Use this skill when:
207+
### Use this skill when:
158208

159209
- Testing that a Reflex app compiles.
160210
- Starting a local Reflex server.
161211
- Restarting a server after code changes.
162212
- Reading logs to diagnose app errors.
163213

164-
The skill recommends validating changes with:
214+
### Validation command:
165215

166216
```bash
167217
reflex compile --dry
168218
```
169219

170-
When the user asks the assistant to run a Reflex app, the skill starts the app in production mode and captures logs:
220+
### Run command:
171221

172222
```bash
173223
reflex run --env prod --single-port 2>&1 | tee reflex.log
174224
```
175225

176-
Production mode does not hot reload. To apply code changes, the assistant should stop the listening process for the app port and restart the server. The skill specifically uses `lsof` with `-sTCP:LISTEN` so the assistant targets the server process instead of browser connections:
226+
Production mode does not hot reload. To apply code changes, the assistant should stop the listening process for the app port and restart the server:
177227

178228
```bash
179229
lsof -i :<port> -sTCP:LISTEN -t
180230
kill -INT $(lsof -i :<port> -sTCP:LISTEN -t)
181231
```
182232

183-
If the server does not stop cleanly, the assistant can escalate to `SIGTERM` and then restart the app.
233+
Using `-sTCP:LISTEN` helps the assistant target the server process instead of browser connections.
234+
235+
`````
184236

185237
## Recommended Workflow
186238

187-
### Starting a New Reflex Project
239+
`````md tabs
240+
241+
## New App
188242

189243
1. Install Reflex Agent Skills in your assistant.
190244
2. Ask the assistant to create or initialize a Reflex app.
@@ -193,20 +247,24 @@ If the server does not stop cleanly, the assistant can escalate to `SIGTERM` and
193247
5. As the app is built, the assistant should use `reflex-docs` for current framework guidance.
194248
6. Before handing the app back, the assistant should use `reflex-process-management` to compile or run the project.
195249

196-
### Working on an Existing App
250+
251+
## Existing
197252

198253
1. Open your Reflex project in an agent-enabled editor.
199254
2. Ask for the feature, bug fix, or refactor you want.
200255
3. The assistant should load `reflex-docs` when it sees Reflex code.
201256
4. For local verification, the assistant should compile the app with `reflex compile --dry` or run it with the process-management workflow.
202257

203-
### Debugging a Running App
258+
259+
## Debugging
204260

205261
1. Ask the assistant to inspect the error.
206262
2. The assistant should read `reflex.log` if the app was started through the process-management workflow.
207263
3. The assistant should identify the failing import, component, event handler, route, or state update.
208264
4. After applying a fix, the assistant should restart the app if it is running in production mode.
209265

266+
`````
267+
210268
## Keeping Skills Updated
211269

212270
Because Reflex evolves quickly, update the skill pack regularly.
@@ -222,7 +280,9 @@ Then copy the updated skill folders back into your assistant's skills directory
222280

223281
## Troubleshooting
224282

225-
### The Assistant Does Not Load the Skills
283+
`````md tabs
284+
285+
## Loading
226286

227287
Check that:
228288

@@ -231,11 +291,13 @@ Check that:
231291
- Each skill folder contains a `SKILL.md` file.
232292
- The assistant was restarted or refreshed after installation if required.
233293

234-
### The Assistant Gives Outdated Reflex Advice
294+
295+
## Outdated Advice
235296

236297
Ask the assistant to use the Reflex docs skill, or pair the skill pack with the Reflex MCP integration for structured access to current docs and component information.
237298

238-
### Reflex Commands Fail
299+
300+
## Commands
239301

240302
Ask the assistant to follow the `setup-python-env` skill again and verify:
241303

@@ -244,10 +306,13 @@ Ask the assistant to follow the `setup-python-env` skill again and verify:
244306
- Reflex is installed in the active environment.
245307
- The command is being run from the project root.
246308

247-
### A Running App Does Not Reflect Code Changes
309+
310+
## App Updates
248311

249312
If the app was started with `--env prod`, it will not hot reload. Restart the server with the `reflex-process-management` workflow.
250313

314+
`````
315+
251316
## Contributing
252317

253318
Each skill lives in `skills/<name>/` and contains a `SKILL.md` manifest. To contribute new guidance, update or add a skill in the [reflex-dev/agent-skills](https://github.com/reflex-dev/agent-skills) repository and follow the [Agent Skills spec](https://agentskills.io/) for the skill format.

0 commit comments

Comments
 (0)