跳到主内容
智客 ZICQ

技能库 智客分类:Agent 工作流 sandbox-migrate-to-next

Sandbox Migrate To Next

将 Cloudflare Sandbox 应用程序从稳定的 @cloudflare/ sandbox 移动到 @cloudflare/ sandbox@next(SDK 1.0预览) 。 预览中的应用程序使用 sandbox- next .

41902 安装量

官方网址:skills.sh

技能介绍

先看中文介绍;官方 description 原文单独保留,不改写 SKILL.md。

做什么

将 Cloudflare Sandbox 应用程序从稳定的 @cloudflare/ sandbox 移动到 @cloudflare/ sandbox@next(SDK 1.0预览) 。 预览中的应用程序使用 sandbox- next .

何时用

官方 description 未单独写出 Use when。按规范,代理会在用户任务与这段 description 的关键词匹配时激活本技能。

代理如何加载

按 Agent Skills 渐进披露:启动时只加载 name 与 description(约 100 token);任务匹配后才读入整份 SKILL.md 正文;scripts/、references/、assets/ 仅在需要时再读。 本文件正文结构:Migrate stable → Sandbox SDK 1.0 preview (`@next`)、Workflow、Hard rules、Replacement map、Audit、Clarify (ask when needed)。 其中含规范建议的小节:分步指令。

文件分析

文件分析:这是一份仅含 SKILL.md 的指令型技能,代理激活后整份正文进入上下文。

官方 description(原文)

Migrate Cloudflare Sandbox apps from stable @cloudflare/sandbox to @cloudflare/sandbox@next (SDK 1.0 preview). Use sandbox-next for apps already on the preview.

Migrate stable → Sandbox SDK 1.0 preview (`@next`)WorkflowHard rulesReplacement mapAuditClarify (ask when needed)UpgradePackage and imagePython: cloudflare/sandbox:next-pythonCode by areaDeploy cutoverValidate

来源分类:skills.sh agent-skill

SKILL.md 与 Agent 调用

官方规范 ↗
name
sandbox-migrate-to-next
description
Migrate Cloudflare Sandbox apps from stable @cloudflare/sandbox to @cloudflare/sandbox@next (SDK 1.0 preview). Use sandbox-next for apps already on the preview.
  1. 发现技能客户端向 Agent 提供名称与描述目录。
  2. 匹配与调用用户指定或任务匹配后,载入 SKILL.md 指令。
  3. 按需加载按步骤读取参考文档、使用脚本与素材。

具体调用语法与可用工具以目标 Agent 客户端为准。 查看调用机制说明 ↗

安装这个技能

Skills CLI ↗

先选择目标 Agent 和安装范围,保留技能包的附属文件,安装后检查客户端能否发现该技能。

交给 Agent 安装

复制安装指令给支持 Agent Skills 的代理,确认其中的目标目录与客户端匹配。

把 Agent Skill「sandbox-migrate-to-next」安装到我的项目:SKILL.md 原文与官方 description 见 https://zicq.com/zh/skills/skl-f56455c9e6c81c1f-Sandbox-Migrate-To-Next.html
请存为 .cursor/skills/sandbox-migrate-to-next/SKILL.md 或 .claude/skills/sandbox-migrate-to-next/SKILL.md,frontmatter 的 name 与 description 保持原样,不要改写。

GitHub 完整包 ↗

终端安装 · Skills CLI

需要 Node.js 与 npx。先查看仓库技能列表,确认实际名称。

npx skills add 'https://github.com/cloudflare/skills' --list

npx skills add 'https://github.com/cloudflare/skills' --skill 'sandbox-migrate-to-next'

CLI 会交互选择目标 Agent,默认安装到项目;用户级安装使用 -g。先通过查看命令核对仓库内容,再用 npx skills list 检查已安装技能。

阅读排版
--- name: sandbox-migrate-to-next description: Migrate Cloudflare Sandbox apps from stable @cloudflare/sandbox to @cloudflare/sandbox@next (SDK 1.0 preview). Use sandbox-next for apps already on the preview. --- # Migrate stable → Sandbox SDK 1.0 preview (`@next`) **Perform** the port. Follow the steps in order. Depth lives in docs—fetch the linked page when a step needs detail. Human guide: [Migrate](https://developers.cloudflare.com/sandbox/1-0-preview/migrate/) · [1.0 preview](https://developers.cloudflare.com/sandbox/1-0-preview/) **New projects** should start on `@next` (**`sandbox-next`**), not this skill. **Day-to-day stable work** → **`sandbox-stable`**. Deprecated-API cleanup **without** moving to `@next` → [2026 deprecation guide](https://developers.cloudflare.com/sandbox/guides/2026-deprecation/) first if needed. Existing apps should migrate **when you can**, so you are ready when 1.0 becomes the stable release. Do **not** force production cutover without the user agreeing. **Prefer installed `@next` types and the migrate doc over memory.** ## Workflow 1. **Review** hard rules and the replacement map 2. **Audit** the codebase; list hits and target shapes 3. **Clarify** with the user (cutover, bridge, Python image, unclear sites) 4. **Upgrade** package, image, and code 5. **Validate** Stop after any step that needs a user decision. ## Hard rules - Worker package and container image must be the **same** `@next` line. - Production cutover uses **immediate** container rollout. Stable and `@next` control protocols are incompatible both ways; gradual rollout leaves a broken mixed window. In-flight container work can stop. - After cutover, `await sandbox.exec(...)` means process **started**, not command **finished**. - Argv is as-is (no implicit shell). Shell syntax needs an explicit shell binary. - Process handles have **no stdin** → terminals for interactive input. - Observation `timeout` / `AbortSignal` cancel the **wait only**, not the process. - No single retry loop for every error. - Do not invent APIs (`gitCheckout` on core, process stdin, string-exec completion helper). - Self-deployed bridge stays on **stable** (not part of the preview line yet). ## Replacement map | Stable | `@next` | | ------ | ------- | | `SANDBOX_TRANSPORT` / `transport` / `setTransport` | Remove — RPC only | | `await sandbox.exec("cmd")` → buffered result | `await sandbox.exec(argv)` → handle, then `output` / waits | | `execStream` / `startProcess` | Same handle: `logs`, `waitFor*`, `kill` | | Default / named sessions | Gone — `cwd`/`env` per launch, or one shell script | | `sandbox.terminal(request)` / session terminal | `createTerminal` + `terminal.connect(request)` | | xterm `sessionId` | `terminalId` | | Interpreter methods on `Sandbox` | `withInterpreter` → `sandbox.interpreter.*` | | `gitCheckout` | argv `git` via `exec` | | String kill signals | Numeric only | | Files, mounts, backups, ports, tunnels, `proxyToSandbox` | Mostly unchanged (ignore session/transport bits on stable pages) | Depth: [Migrate](https://developers.cloudflare.com/sandbox/1-0-preview/migrate/) · after port, day-to-day → **`sandbox-next`** ## Audit ```sh rg 'SANDBOX_TRANSPORT|transport:|setTransport|enableDefaultSession|createSession|getSession|deleteSession|execStream\(|startProcess\(|killProcess\(|sandbox\.terminal\(|sessionId|gitCheckout\(|SandboxTransport|ExecutionSession' ``` Also: string `exec(`, `cd` then a later `exec`, bare `createCodeContext` / `runCode` on `Sandbox`. ## Clarify (ask when needed) - OK to cut production with `--containers-rollout=immediate` (live processes/terminals/streams may stop)? - Self-deployed bridge? Leave on stable. - Python interpreter → **`-python`** image variant? - Call sites not covered by the map? ## Upgrade ### Package and image ```sh npm install @cloudflare/sandbox@next ``` ```dockerfile FROM cloudflare/sandbox:next # Python: cloudflare/sandbox:next-python ``` Same prerelease tag on Worker and image when not on floating `next`. ### Code by area Apply replacements from the map. For each area, implement from the doc—not from stable habits: | Area | Doc | | ---- | --- | | Commands / handles / waits | [Processes](https://developers.cloudflare.com/sandbox/1-0-preview/processes/) · [Processes API](https://developers.cloudflare.com/sandbox/1-0-preview/api/processes/) | | `cwd` / `env` / secrets | [Environment](https://developers.cloudflare.com/sandbox/1-0-preview/environment/) · [Outbound traffic](https://developers.cloudflare.com/sandbox/guides/outbound-traffic/) | | Drop sessions | [Migrate](https://developers.cloudflare.com/sandbox/1-0-preview/migrate/) · [Lifecycle](https://developers.cloudflare.com/sandbox/1-0-preview/lifecycle/) | | Terminals | [Terminals](https://developers.cloudflare.com/sandbox/1-0-preview/terminals/) | | Interpreter | [Interpreter](https://developers.cloudflare.com/sandbox/1-0-preview/interpreter/) | | Errors | [Errors](https://developers.cloudflare.com/sandbox/1-0-preview/errors/) | | Durable job across requests | [Process execution — lifetime / durability](https://developers.cloudflare.com/sandbox/1-0-preview/processes/) | **Commands (shape):** ```ts // Before (stable) const result = await sandbox.exec("npm test"); // After (@next) const process = await sandbox.exec(["/bin/bash", "-lc", "npm test"]); const result = await process.output({ encoding: "utf8" }); ``` ```ts const server = await sandbox.exec(["/bin/bash", "-lc", "npm run dev"], { cwd: "/workspace/app", }); await server.waitForPort(3000, { timeout: 60_000 }); await server.kill(); // numeric; default 15 ``` **Terminals (shape):** ```ts const terminal = await sandbox.createTerminal({ command: ["bash"], cwd: "/workspace" }); const t = await sandbox.getTerminal(terminal.id); if (!t) return new Response("terminal gone", { status: 410 }); return t.connect(request, { cursor, cols, rows }); ``` **Interpreter (shape):** ```ts import { Sandbox as BaseSandbox } from "@cloudflare/sandbox"; import { withInterpreter } from "@cloudflare/sandbox/interpreter"; export class Sandbox extends BaseSandbox { interpreter = withInterpreter(this); } ``` **Git (shape):** ```ts const clone = await sandbox.exec( ["git", "clone", "--depth", "1", "--", repoUrl, "/workspace/repo"], { cwd: "/workspace" }, ); const result = await clone.output({ encoding: "utf8" }); ``` Delete transport settings entirely. Remove session APIs. Isolate users with **separate sandbox IDs**. ### Deploy cutover Staging/branch first. Production is **one** deploy of matching Worker + image: ```sh npx wrangler deploy --containers-rollout=immediate ``` Leave `rollout_active_grace_period` at default `0` (or set `0` if raised). After cutover, pre-deploy process/terminal IDs are invalid. Details: [Migrate](https://developers.cloudflare.com/sandbox/1-0-preview/migrate/) · [Container rollouts](https://developers.cloudflare.com/containers/platform-details/rollouts/) ## Validate 1. Lockfile + Dockerfile on the same `@next` line 2. Typecheck against `@next` 3. Smoke argv `exec` + `output({ encoding: "utf8" })` 4. Smoke long process / terminal / interpreter if used 5. Errors distinguished: unavailable / interrupted-RPC / stale / local wait 6. No live secrets in sandbox env 7. Grep again for removed APIs 8. Production used `--containers-rollout=immediate` Then day-to-day work uses **`sandbox-next`**. ## Red flags — stop and fix - Mixing `@next` Worker with stable image (or reverse) - Gradual container rollout for this cutover - Treating `await exec` as command completion - Assuming `cd` / exports persist across `exec` calls - One retry wrapper for every error - Inventing `gitCheckout`, process stdin, or undocumented APIs - Keeping pre-cutover process/terminal IDs after deploy - Forcing production cutover without user agreement - Putting live secrets in `setEnvVars` / launch `env`

相关技能

Agent 工作流

Skill Creator

创造有效技能指南。 当用户想创造出新的技能(或更新现有的技能),以专业知识,工作流程,或工具集成来扩展克洛德的能力时,应该使用这种技能.

Agent 工作流

Clawdhub

使用ClawdHub CLI搜索,安装,更新并发布从taladhub.com的代理技能. 需要获取苍蝇上的新技能时使用,将安装的技能同步到最新版本或特定版本,或者发布 npm-instainddhub CLI 的新/更新的技能文件夹.

Agent 工作流

Agent Team Orchestration

管弦乐团多代理团队,任务设定周期,交接协议,审查工作流程. 使用时间: (1)建立2+特派员队伍,具有不同专业,(2)确定任务路线和生命周期(收录框_ spec_建设_审查_完成),(3)在特派员之间制定交接协议,(4)建立审查和质量关口,(5)管理特派员之间的交流和文物共享.

Agent 工作流

Superpowers

Spec-first,TDD,子代理驱动的软件开发工作流程. 当:(1)构建任何新功能或应用——触发脑暴_计划_子代理执行回路,(2)调试出一个bug或测试失败——触发系统性的根起过程,(3)用户说"让我们构建","帮助我计划","我想添加X",或"这个被打破",(4)完成一个功…