Agent Skillsreflex-dev/xy › reflex-process-management

reflex-process-management

GitHub

管理 Reflex 应用的编译、运行、重载及日志调试。支持生产模式启动、进程查找与重启,以及通过日志排查错误,适用于测试、部署和维护 Reflex 应用。

.agents/skills/reflex-process-management/SKILL.md reflex-dev/xy

Trigger Scenarios

用户需要编译或测试 Reflex 应用 用户要求启动或运行 Reflex 服务器 用户希望重载或重启正在运行的 Reflex 应用 用户报告应用错误并需要排查日志

Install

npx skills add reflex-dev/xy --skill reflex-process-management -g -y
More Options

Non-standard path

npx skills add https://github.com/reflex-dev/xy/tree/main/.agents/skills/reflex-process-management -g -y

Use without installing

npx skills use reflex-dev/xy@reflex-process-management

指定 Agent (Claude Code)

npx skills add reflex-dev/xy --skill reflex-process-management -a claude-code -g -y

安装 repo 全部 skill

npx skills add reflex-dev/xy --all -g -y

预览 repo 内 skill

npx skills add reflex-dev/xy --list

SKILL.md

Frontmatter
{
    "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 app 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:

reflex compile --dry

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:

reflex run --env prod --single-port 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 app port

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

Step 2: Find the app process

Using the port from Step 1, locate the listening process (not browser connections):

lsof -i :<port> -sTCP:LISTEN -t

The -sTCP:LISTEN flag is critical — it filters to only the server process that is listening on the port, excluding browser or client connections. Without it, you may kill the user's browser.

If lsof is not available, use:

ss -tlnp | grep :<port>

Or:

fuser <port>/tcp

Step 3: Send an interrupt signal

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

kill -INT $(lsof -i :<port> -sTCP:LISTEN -t)

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

kill -TERM $(lsof -i :<port> -sTCP:LISTEN -t)

Step 4: Restart the server

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

> reflex.log
reflex run --env prod --single-port 2>&1 | tee reflex.log

Investigating Errors

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

Version History

  • eb37670 Current 2026-08-02 21:48

Same Skill Collection

.agents/skills/reflex-docs/SKILL.md
.agents/skills/setup-python-env/SKILL.md
.agents/skills/codspeed-optimize/SKILL.md
.agents/skills/codspeed-setup-harness/SKILL.md

Metadata

Files
0
Version
eb37670
Hash
978e13d2
Indexed
2026-08-02 21:48

Главная - Вики-сайт
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-03 02:20
浙ICP备14020137号-1 $Гость$