Skip to content
Merged
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
17 changes: 7 additions & 10 deletions .claude-plugin/marketplace.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,15 @@
},
"plugins": [
{
"name": "reflex-docs",
"description": "Reflex framework documentation — components, state, events, styling, database, and more",
"name": "reflex",
"description": "Skills for the Reflex web framework — docs, environment setup, and process management",
"source": "./",
"strict": false,
"skills": ["./skills/reflex-docs"]
},
{
"name": "setup-python-env",
"description": "Set up a Python virtual environment and install Reflex for new projects",
"source": "./",
"strict": false,
"skills": ["./skills/setup-python-env"]
"skills": [
"./skills/reflex-docs",
"./skills/setup-python-env",
"./skills/reflex-process-management"
]
}
]
}
6 changes: 6 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,9 @@ reflex init
```

Then proceed with the user's request.

## Managing a Reflex Process

When you need to compile, run, or reload a Reflex application, follow the [reflex-process-management](skills/reflex-process-management/SKILL.md) skill.

Follow the skill for compiling, running, reloading, and investigating errors in a Reflex app.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Install using the [plugin marketplace](https://code.claude.com/docs/en/discover-

```
/plugin marketplace add reflex-dev/agent-skills
/plugin install reflex-docs@reflex-agent-skills
/plugin install reflex@reflex-agent-skills
```

### Cursor
Expand Down Expand Up @@ -41,10 +41,11 @@ Clone this repo and copy the skill folders into the appropriate directory for yo

Skills are contextual and auto-loaded based on your conversation.

| Skill | Description |
| ---------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
| [reflex-docs](skills/reflex-docs/SKILL.md) | Framework documentation covering components, state management, events, styling, database, routing, authentication, and more |
| [setup-python-env](skills/setup-python-env/SKILL.md) | Set up a Python virtual environment and install Reflex for new projects |
| Skill | Description |
| ---------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
| [reflex-docs](skills/reflex-docs/SKILL.md) | Framework documentation covering components, state management, events, styling, database, routing, authentication, and more |
| [setup-python-env](skills/setup-python-env/SKILL.md) | Set up a Python virtual environment and install Reflex for new projects |
| [reflex-process-management](skills/reflex-process-management/SKILL.md) | Compile, run, reload, and debug a Reflex application process |

## MCP Servers

Expand Down
91 changes: 91 additions & 0 deletions skills/reflex-process-management/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
---
name: reflex-process-management
description: >
Manage Reflex application processes: compile to test, run the server in production mode,
reload a running app by finding and restarting the backend process, and manage logs for
debugging. Use when the user wants to test, run, restart, or reload a Reflex app,
when troubleshooting a running Reflex server, or when investigating errors.
---

# Reflex Process Management

This skill covers how to compile, run, and reload a Reflex application.

## Compiling (Testing the App)

To verify the app compiles without errors, run:

```bash
reflex compile --dry-run
```

This checks for syntax errors, import issues, and component problems without starting the server. Use this as a quick validation step after making changes.

## Running the Server

When instructed to run the Reflex server, always use production mode and redirect output to a log file:

```bash
reflex run --env prod 2>&1 | tee reflex.log
```

This command starts a long-running server process that **does not support hot reload** in production mode. Code changes will not be picked up automatically — you must stop and restart the server to apply changes (see **Reloading a Running App** below).

Using `2>&1 | tee reflex.log` captures both stdout and stderr to `reflex.log` while still printing to the terminal.

> **Important:** Always use `--env prod` unless the user explicitly requests development mode.

## Reloading a Running App

To reload the app without manually stopping and restarting from the terminal, follow these steps:

### Step 1: Determine the backend port

Read `reflex.log` to find the port the backend is listening on. Look for a line like `Backend running at: http://0.0.0.0:<port>`. Do not assume the port is 8000.

### Step 2: Find the backend process

Using the port from Step 1, locate the process:

```bash
lsof -i :<port> -t
```

If `lsof` is not available, use:

```bash
ss -tlnp | grep :<port>
```

Or:

```bash
fuser <port>/tcp
```

### Step 3: Send an interrupt signal

Send `SIGINT` (equivalent to Ctrl+C) to gracefully stop the process:

```bash
kill -INT $(lsof -i :<port> -t)
```

If the process doesn't stop, escalate to `SIGTERM`:

```bash
kill -TERM $(lsof -i :<port> -t)
```

### Step 4: Restart the server

Once the old process has exited, truncate the old log and start the server again:

```bash
> reflex.log
reflex run --env prod 2>&1 | tee reflex.log
```

## Investigating Errors

When the user reports an error, read `reflex.log` to find and diagnose the issue.
Loading