superwall-editor

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Superwall Paywall Editor

Superwall 付费墙编辑器

Paywalls are built in a browser editor that exposes its tools over an authenticated relay. This skill drives that relay from the CLI — the exact same surface the MCP gateway uses — so every tool you invoke runs inside the live browser session the user has open.
付费墙在浏览器编辑器中构建,该编辑器通过经过身份验证的中继公开其工具。本技能通过CLI驱动该中继——与MCP网关使用的界面完全相同——因此你调用的每个工具都会在用户打开的实时浏览器会话中运行。

When to use

使用场景

  • The user wants to build, edit, or review a Superwall paywall, onboarding, or web2app flow.
  • The user pastes a pairing code and asks you to take over editing.
  • The user asks "what tools can you run right now?" — discover them via the browser, not from memory.
  • 用户想要构建、编辑或审核Superwall付费墙、引导流程或web2app流程。
  • 用户粘贴配对代码并要求你接管编辑工作。
  • 用户询问“你现在可以运行哪些工具?”——通过浏览器发现它们,而非凭记忆。

Start here: attach, then discover

开始步骤:连接,然后发现

Never assume a tool name or signature from memory. The browser is the source of truth and its tool set changes across releases.
  1. Ask the user for the pairing code shown in the editor UI.
  2. Attach:
    scripts/sw-editor.sh attach <pairing-code>
  3. Discover what is available right now:
    scripts/sw-editor.sh tools
  4. Invoke tools:
    scripts/sw-editor.sh call <tool-name> --args '<json>'
Full CLI reference: references/cli.md.
永远不要凭记忆假设工具名称或签名。浏览器是事实来源,其工具集会随版本更新而变化。
  1. 向用户索要编辑器UI中显示的配对代码
  2. 连接:
    scripts/sw-editor.sh attach <pairing-code>
  3. 发现当前可用工具:
    scripts/sw-editor.sh tools
  4. 调用工具:
    scripts/sw-editor.sh call <tool-name> --args '<json>'
完整CLI参考:references/cli.md

How to build and edit

如何构建和编辑

  • Workflow, build order, and when to use which tool: references/workflow.md
  • Native
    sw-*
    elements (multiple-choice, indicator, drawer, picker, lottie, navigation): references/native-elements.md
  • Design standards, review checkpoints, typography, and conversion principles: references/design.md
  • 工作流、构建顺序以及何时使用何种工具:references/workflow.md
  • 原生
    sw-*
    元素(选择题、指示器、抽屉、选择器、lottie、导航):references/native-elements.md
  • 设计标准、审核检查点、排版和转化原则:references/design.md

Orchestration rules

编排规则

  • Always
    attach
    before anything else.
    tools
    ,
    call
    ,
    status
    ,
    release
    all require an attached session.
  • Before calling a tool you have not used this session, run
    tools
    to confirm it exists and to read the current parameter schema. Tools are defined in the browser bundle — an updated editor ships new or renamed tools without any change to this skill.
  • Use
    get_screenshot
    (if present in the tool list) every 2–3 modifications to verify. Don't fly blind.
  • Prefer semantic tools (
    update_styles
    ,
    set_text_content
    ,
    set_dynamic_value
    ,
    move_nodes
    ) over re-running
    write_html
    on existing structure. See
    references/workflow.md
    .
  • Prefer native
    sw-*
    elements over hand-rolled
    <div>
    recreations whenever the UI represents a semantic control. See
    references/native-elements.md
    .
  • When parsing CLI output, use
    jq
    — never Python. Example:
    sw-editor.sh call get_subtree --args '...' | jq -r '.content[0].text'
  • Release when the user is done:
    scripts/sw-editor.sh release
    .
  • 始终先执行
    attach
    操作。
    tools
    call
    status
    release
    都需要已连接的会话。
  • 在调用本次会话中未使用过的工具之前,运行
    tools
    以确认其存在并读取当前参数 schema。工具定义在浏览器包中——更新后的编辑器会发布新工具或重命名工具,而无需修改本技能。
  • 每进行2-3次修改后,使用
    get_screenshot
    (如果工具列表中存在)进行验证。不要盲目操作。
  • 优先使用语义化工具(
    update_styles
    set_text_content
    set_dynamic_value
    move_nodes
    ),而非对现有结构重新运行
    write_html
    。详见
    references/workflow.md
  • 只要UI代表语义化控件,优先使用原生
    sw-*
    元素,而非手动构建的
    <div>
    复制品。详见
    references/native-elements.md
  • 解析CLI输出时,使用
    jq
    ——绝不使用Python。示例:
    sw-editor.sh call get_subtree --args '...' | jq -r '.content[0].text'
  • 用户完成操作后释放会话:
    scripts/sw-editor.sh release

When things go wrong

故障排查

  • session_not_ready
    : the browser disconnected or reloaded. Ask the user to bring the editor tab back, then re-attach (the pairing code rotates — they'll need to read you the new one).
  • session_locked
    : another client is already attached. The user either attached from another MCP client, or a previous CLI attachment wasn't released. They can detach from the editor UI and you can retry.
  • unauthorized
    : the controller token is stale — re-attach with a fresh pairing code.
  • attach_failed: provide a valid current pairingCode
    : pairing codes expire after ~10 minutes and rotate on detach. Ask the user to show you the current one.
  • session_not_ready
    :浏览器断开连接或重新加载。请用户重新打开编辑器标签页,然后重新连接(配对代码会轮换——他们需要提供新的代码)。
  • session_locked
    :另一个客户端已连接。用户可能从其他MCP客户端连接过,或者之前的CLI连接未释放。他们可以从编辑器UI断开连接,然后你重试。
  • unauthorized
    :控制器令牌过期——使用新的配对代码重新连接。
  • attach_failed: provide a valid current pairingCode
    :配对代码约10分钟后过期,断开连接时会轮换。请用户提供当前显示的配对代码。