catalyst-slate

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

How It Works

工作原理

  1. Check if Slate is activated — Use MCP: call
    CatalystbyZoho_List_All_Slate_Apps
    with the project ID.
    • If it returns apps or an empty list → Slate is activated. Proceed.
    • If it returns an error or "not found" → Slate needs a one-time activation. Tell the user:
      "Please open the Catalyst console, go to your project → Slate (left sidebar) → click Start Exploring. This is a one-time step that takes 5 seconds. Let me know when done and I'll continue." Wait for confirmation, then proceed.
    • Never fall back to Web Client (legacy) because Slate isn't activated yet. Web Client is deprecated — Slate is always the right choice for frontend hosting. The one-time activation is not a reason to change the approach.
    If Slate was not selected during
    catalyst init
    , run
    catalyst slate:create --name <name> --framework <framework> --default
    immediately after init. This command updates
    catalyst.json
    and prompts for the source directory automatically — it is faster than manual setup and should be the default recommendation.
  2. Check if Slate app exists — If no app exists yet, run
    catalyst slate:create --name <name> --framework <framework> -ni
    to scaffold one. If Slate was not selected during
    catalyst init
    , run this immediately after init.
  3. Load
    references/slate-basics.md
    — for framework setup,
    slate-config.toml
    format, and baseUrl configuration.
  4. Cross-domain calls — If the query involves calling functions from a Slate app, apply the full URL +
    generateAuthToken()
    + CORS whitelist pattern.
    ⚠️ Migrating from basic client hosting? Relative paths like
    /server/fn/execute
    that worked in basic client silently break on Slate — Slate is served from
    *.onslate.com
    while functions are on
    *.catalystserverless.com
    . Every function call must become an absolute URL. Find and replace all relative
    /server/...
    paths with the full
    https://<project>.catalystserverless.com/server/...
    URL and add
    generateAuthToken()
    headers.
  5. Deploy
    catalyst deploy slate <name> -ni
    deploys to the current environment. Preview URLs are available after the build completes.
  1. 检查Slate是否已激活 — 使用MCP:调用
    CatalystbyZoho_List_All_Slate_Apps
    并传入项目ID。
    • 如果返回应用列表或空列表 → Slate已激活,继续操作。
    • 如果返回错误或“未找到” → Slate需要一次性激活。告知用户:
      “请打开Catalyst控制台,进入您的项目→Slate(左侧边栏)→点击开始探索。这是仅需5秒的一次性操作。完成后请告知我,我会继续协助您。” 等待用户确认后再继续。
    • 切勿因Slate未激活而退回到Web Client(旧版)。Web Client已被弃用——Slate始终是前端托管的正确选择。一次性激活并非更换方案的理由。
    如果在
    catalyst init
    期间未选择Slate,请在初始化后立即运行
    catalyst slate:create --name <name> --framework <framework> --default
    。此命令会更新
    catalyst.json
    并自动提示输入源目录——比手动设置更快,应作为默认推荐方案。
  2. 检查Slate应用是否存在 — 如果尚未创建应用,运行
    catalyst slate:create --name <name> --framework <framework> -ni
    来搭建一个。如果在
    catalyst init
    期间未选择Slate,请在初始化后立即运行此命令。
  3. 加载
    references/slate-basics.md
    — 用于框架设置、
    slate-config.toml
    格式配置以及baseUrl配置。
  4. 跨域调用 — 如果查询涉及从Slate应用调用函数,请应用完整URL +
    generateAuthToken()
    + CORS白名单模式。
    ⚠️ 从基础客户端托管迁移? 在基础客户端中可用的相对路径(如
    /server/fn/execute
    )在Slate上会静默失效——Slate托管在
    *.onslate.com
    ,而函数托管在
    *.catalystserverless.com
    。所有函数调用必须改为绝对URL。将所有相对
    /server/...
    路径替换为完整的
    https://<project>.catalystserverless.com/server/...
    URL,并添加
    generateAuthToken()
    请求头。
  5. 部署
    catalyst deploy slate <name> -ni
    会部署到当前环境。构建完成后即可获取预览URL。

Triggers

触发条件

Use this skill for: "Slate", "frontend hosting",
catalyst slate
,
slate-config.toml
, "deploy React app", "Slate framework",
slate:create
,
slate deploy
, "frontend on Catalyst", "Slate vs Vercel", "cross-domain Slate to function", "Slate baseUrl", "Next.js on Catalyst", or "static frontend on Catalyst".
当涉及以下内容时使用此技能:"Slate"、"frontend hosting"、
catalyst slate
slate-config.toml
、"deploy React app"、"Slate framework"、
slate:create
slate deploy
、"frontend on Catalyst"、"Slate vs Vercel"、"cross-domain Slate to function"、"Slate baseUrl"、"Next.js on Catalyst"或"static frontend on Catalyst"。

References

参考资料

ReferenceLoad when the query is about…
references/slate-basics.md
Framework setup,
slate-config.toml
gotchas, baseUrl config, CORS for Slate→function calls, Git deploy, CLI commands
参考资料当查询涉及以下内容时加载…
references/slate-basics.md
框架设置、
slate-config.toml
常见问题、baseUrl配置、Slate→函数调用的CORS配置、Git部署、CLI命令