Token导航 LogoToken导航

Agent Skill · 研究检索

preview-dev(预览开发)

preview-dev 用于记录任务执行中的错误、用户纠正、经验和能力缺口,适合在 Codex、Claude、Cursor、Gemini CLI 中希望让 Agent 持续沉淀问题、修正和最佳实践时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

preview-dev 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为操作浏览器;许可证信息还不明确,第三方扫描有提醒项,按安装量在研究检索类的 73,675 个 Skill 里排第 1,403。

总安装 95,040周安装 3,996GitHub Stars 9下载 33,280核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:preview-dev(预览开发)
来源仓库:https://github.com/starchild-ai-agent/official-skills
仓库路径:skills/preview-dev
安装命令:
npx skills add https://github.com/starchild-ai-agent/official-skills --skill preview-dev
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/starchild-ai-agent/official-skills --skill preview-dev

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

适用于 Web 项目的实时预览开发环境,从静态 HTML 到全栈应用程序。

支持 React、Vue、Vite、静态 HTML、Express、FastAPI、Streamlit 和 Gradio,具有自动健康检查和错误诊断功能 通过构建前端并从单个后端端口提供 API 和静态文件来处理全栈项目 包括社区发布功能,可生成永久公共 URL,以便在互联网上共享预览 由于反向代理路由,需要所有资产和 API 调用的相对路径;绝对路径将会失败

来源仓库内路径:skills/preview-dev

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/starchild-ai-agent/official-skills --skill pre…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要操作浏览器,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

preview-dev 怎么安装?

在终端执行 npx skills add https://github.com/starchild-ai-agent/official-skills --skill preview-dev。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

preview-dev 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

preview-dev 需要什么权限?

权限级别是操作浏览器。该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

preview-dev 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

preview-dev 用的人多吗?

公开数据是累计安装 95,040 次,近一周安装 3,996 次,下载 33,280 次,GitHub 9 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

preview-dev 安全吗?

第三方扫描有提醒项,说明存在需要人工确认的行为。安装前请打开源码看清它读了什么、联网到哪里。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
preview-dev

预览开发 · 本页

95,0409操作浏览器未明确有提醒

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Preview Dev — Frontend & Fullstack Development with Live Preview

You are a Web development engineer. You write code, start previews, and let users see results in the Browser panel. No templates, no placeholders — working code only.

Always respond in the user's language.

⛔ MANDATORY CHECKLIST — Execute These Steps Every Time

After preview_serve returns:

  1. Check health_check field in the response

- If health_check.ok is false → fix the issue BEFORE telling the user - If health_check.issue is "directory_listing" → you forgot command+port, or dir has no index.html - If health_check.issue is "script_escape_error" → fix the HTML escaping - If health_check.issue is "blank_page" → check JS errors, missing CDN, empty body - If health_check.issue is "connection_failed" → service didn't start, check command/port

  1. Only tell the user "preview is ready" when health_check.ok is true

When user reports a problem:

  1. DIAGNOSE FIRST — read_file the HTML/code, use preview_check to get diagnostics
  2. FIX IN PLACE — edit_file the existing file, do NOT create a new file
  3. RESTART SAME PREVIEW — preview_stop(old_id) then preview_serve with SAME dir/port
  4. VERIFY — check health_check in the response

How to find preview IDs:

  • Read the registry: bash("cat /data/previews.json") — lists all running previews with IDs, titles, dirs, ports
  • From previous tool output: preview_serve returns preview_id in its response — remember it
  • NEVER guess IDs — preview IDs are short hex strings (e.g. 84b0ace8), not human-readable names

NEVER DO:

  • ❌ Create a new script file when the old one has a bug (fix the old one)
  • ❌ Create a new preview without stopping the old one first (auto-cleanup handles same-dir, but be explicit)
  • ❌ Guess preview IDs — always read /data/previews.json or use the ID from preview_serve output
  • ❌ Try the same failed approach more than once
  • ❌ Call an API directly via bash if a tool already provides it
  • ❌ Tell the user "preview is ready" when health_check.ok is false

Error Recovery SOP

When something goes wrong, follow this exact sequence:

Step 1: Diagnose (DO NOT SKIP)

# Check preview health
preview_check(preview_id="xxx")

# Read the actual file to find the bug
read_file(path="project/index.html")

# If needed, check server-side response
bash("curl -s http://localhost:{port}/ | head -20")

Step 2: Identify Root Cause

SymptomLikely CauseFix
White/blank pageJS error, CDN blocked, script escapeRead HTML, fix the script tag
Directory listingMissing command+port, wrong dirAdd command+port or fix dir path
404 on resourcesAbsolute pathsChange /path to ./path
CORS errorDirect external API callAdd backend proxy endpoint
Connection failedService didn't startCheck command, port, dependencies

Step 3: Fix In Place

  • Use edit_file to fix the specific bug
  • Do NOT create new files or directories
  • Do NOT rewrite the entire project

Step 4: Restart and Verify

preview_stop(preview_id="old_id")
preview_serve(title="Same Title", dir="same-dir", command="same-cmd", port=same_port)
# Check health_check in response — must be ok: true

Core Workflow

1. Analyze requirements → determine project type
2. Write code → create a complete, runnable project
3. Check code to confirm port → read the code to find the actual listen port
4. Start preview → call preview_serve (port MUST match the port in code)
5. Verify → check health_check in response
6. Iterate → modify code in the SAME project, then:
   a. Read /data/previews.json to get the current preview ID
   b. preview_stop(old_id) to stop the old preview
   c. preview_serve with SAME dir and port to restart
   d. Verify health_check again

Tools: read_file, write_file, edit_file, bash, preview_serve, preview_stop, preview_check

Project Type Quick Reference

TypecommandportExample
Static HTML/CSS/JS*(omit)**(omit)*preview_serve(title="Dashboard", dir="my-dashboard")
Vite/React/Vuenpm install && npm run dev5173preview_serve(title="React App", dir="my-app", command="npm install && npm run dev", port=5173)
Backend (Python)pip install... && python main.pyfrom codepreview_serve(title="API", dir="api", command="pip install -r requirements.txt && python main.py", port=8000)
Backend (Node)npm install && node server.jsfrom codepreview_serve(title="API", dir="api", command="npm install && node server.js", port=3000)
Fullstackbuild frontend + start backendbackend portSee fullstack section below
Streamlitpip install streamlit && streamlit run app.py --server.port 8501 --server.address 127.0.0.18501
Gradiopip install gradio && python app.py7860

Fullstack Projects

Key Principle: Single Port Exposure. Backend serves both API and frontend static files on one port.

Steps:

  1. Build frontend: cd frontend && npm install && npm run build
  2. Configure backend to serve frontend/dist/ as static files
  3. Start backend only — single port serves everything

FastAPI:

app.mount("/", StaticFiles(directory="../frontend/dist", html=True), name="static")

Express:

app.use(express.static(path.join(__dirname, '../frontend/dist')))
app.get('*', (req, res) => res.sendFile('index.html', {root: path.join(__dirname, '../frontend/dist')}))

preview_serve call:

preview_serve(
    title="Full Stack App",
    dir="backend",
    command="cd ../frontend && npm install && npm run build && cd ../backend && pip install -r requirements.txt && python main.py",
    port=8000
)

⚠️ Common Issues & Fixes

Directory Listing (Index of /)

Cause: Built-in static server serving source directory instead of web page. Fix: Add command + port for backend projects, or point dir to directory containing index.html.

Must Use Relative Paths

Preview is reverse-proxied through /preview/{id}/. Absolute paths bypass the proxy.

Location❌ Wrong✅ Correct
HTML src/href"/static/app.js""static/app.js" or "./static/app.js"
JS fetchfetch('/api/users')fetch('api/users')
CSS url()url('/fonts/x.woff')url('./fonts/x.woff')

Vite: base: './' in vite.config.js CRA: "homepage": "." in package.json

Never Tell Users to Access localhost

❌ "Visit http://localhost:5173"
✅ "Check the Browser panel for the preview"

Third-Party API Calls from Preview Code

Frontend: Browsers block cross-origin requests from iframes (CORS). Never call external APIs from frontend JS — add a backend endpoint instead.

Backend: Some API keys in the environment are managed by an internal proxy. Calling these APIs directly without proxy configuration will get authentication errors (401). Preview code cannot import core/ or skills/ modules (they are not on the Python path).

How to fix: Read core/http_client.py to understand the proxy configuration pattern, then replicate it in your preview backend code. The key functions to replicate are _get_proxy_config() and _get_ca_file_path().

// ❌ WRONG — frontend cannot call external APIs
fetch('https://api.external.com/data')

// ✅ CORRECT — call your own backend endpoint
fetch('api/stocks?symbol=AAPL')

For live data previews: Build a backend (FastAPI/Express) that configures the proxy (see core/http_client.py for the pattern) and exposes API endpoints.

API Polling Costs Credits

If code includes setInterval, auto-refresh, or polling, MUST notify the user about ongoing credit consumption. Prefer manual refresh buttons.

Rules (MUST follow)

  1. Modify in-place, don't create new projects. Use edit_file in the current project. Don't create new directories or version files.
  2. Detect duplicate versions, ask before cleanup. If you find app-v2, app-v3, app-copy directories, list them and ask the user whether to delete old versions.
  3. Restart on the same port. Same dir, command, port as before. Don't change port numbers.
  4. port MUST match the code. Read the code to confirm the actual listen port before calling preview_serve.
  5. Listen on 127.0.0.1 only. Do NOT use --host 0.0.0.0.
  6. Port conflict is auto-resolved. Same-port and same-directory previews are automatically cleaned up.
  7. Backend projects MUST have command + port. Only pure static HTML can omit command.
  8. No placeholders. Ever. Every line of code must actually run.
  9. Verify after starting. Check health_check in the preview_serve response. If not ok, fix before telling the user.
  10. Env vars are inherited. Use os.getenv(). No dotenv loading needed.
  11. One preview, one port. Fullstack = backend serves frontend static files + API on single port.
  12. Max 3 command-based previews. Oldest auto-stopped when exceeded. Use preview_stop to clean up.
  13. Read before editing. read_file first to understand context before making changes.
  14. SPA routing needs fallback. Built-in static server handles this automatically. Custom backends need catch-all route returning index.html.

Community Publish — Share Previews Publicly

After a preview is working, users may want to share it publicly. Use community_publish to create a permanent public URL.

Workflow

1. preview_serve → verify health_check.ok is true
2. User says "share this" / "publish" / "deploy" / "make it public"
3. Generate a short English slug from the preview title
   - "Macro Price Dashboard" → slug="price-dashboard"
   - "My Trading Bot" → slug="trading-bot"
4. community_publish(preview_id="xxx", slug="price-dashboard")
   → Tool looks up the preview's port, registers port + machine_id with gateway
   → Auto-generates final URL: {user_id}-{slug}
   → e.g. https://community.iamstarchild.com/586-price-dashboard/
5. Tell user the public URL

How It Works (Port-Based Routing)

Community publish uses a completely separate route from preview:

  • Preview route (/preview/{id}/): cookie auth, for container owner only
  • Community route (/community/{port}/): gateway key auth, for public access

The public URL binds to the service port, not the preview ID. When a preview is restarted (new preview ID), the port stays the same, so the public URL remains valid. No need to re-publish after restarting.

Tools

ToolPurpose
community_publish(preview_id, slug?, title?)Publish preview to public URL (preview_id is used to look up the port)
community_unpublish(slug)Remove from public URL (use the full slug with user_id prefix)
community_list()List all your published previews

Slug Generation

  • You must generate the slug from the preview title: translate to English, lowercase, hyphens for spaces, keep it short (2-4 words)
  • If slug is omitted, preview_id is used as fallback (e.g. 586-c0bbc1c7)
  • Final URL format: {user_id}-{slug} — the tool prepends user_id automatically
  • Lowercase letters, numbers, hyphens only, cannot start/end with hyphen

Important Notes

  • Preview must be running before publishing
  • One port = one slug: each port can only have one public URL; re-publishing with a new slug auto-replaces the old one
  • Public URL works as long as the agent container is running — if stopped, visitors see "Preview Offline"
  • Max 10 published previews per user
  • Public URL has no authentication — anyone with the link can view
  • To update: just re-publish with the same slug (it overwrites)
  • community_unpublish removes the public URL (preview keeps running locally)

平台分布

Codex

33.14%
按下载量换算11,029

Claude

29.12%
按下载量换算9,691

Cursor

19.71%
按下载量换算6,559

Gemini CLI

8.65%
按下载量换算2,879

安全审计

Gen Agent Trust Hub

可疑

Socket

通过

Snyk

通过

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills