sandbox-migrate-to-next

Migrates Cloudflare Sandbox apps from stable @cloudflare/sandbox to the Sandbox SDK 1.0 preview.

Updated Oct 15, 2019
One-click install
npx skills add https://github.com/kkkaoru/dotfiles --skill sandbox-migrate-to-next-kkkaoru
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sandbox-migrate-to-next
Source: https://github.com/kkkaoru/dotfiles/tree/main/.agents/skills-stroage/sandbox-migrate-to-next
Command: npx skills add https://github.com/kkkaoru/dotfiles --skill sandbox-migrate-to-next-kkkaoru

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @cloudflare/sandbox.

What problem does it solve? Porting a Cloudflare Sandbox app from the stable @cloudflare/sandbox package to the @next Sandbox SDK 1.0 preview involves breaking API changes—removed sessions, transport settings, and buffered exec results—that are easy to get wrong and can break production deployments. ## Core Features & Use Cases - Structured Migration Workflow: Guides the port through audit, clarification, upgrade, and validation phases with a stable-to-@next replacement map covering exec handles, terminals, interpreters, and git operations. - Hard Rules and Red Flags: Enforces critical constraints such as matching Worker package and container image versions, immediate container rollout for cutover, and argv-based exec without implicit shells. - Use Case: A team running a production Worker on stable @cloudflare/sandbox wants to adopt Sandbox SDK 1.0 preview; the skill audits their codebase for removed APIs, rewrites call sites to the new process-handle model, and validates the cutover deploy. ## Quick Start Migrate my Cloudflare Worker project from stable @cloudflare/sandbox to @cloudflare/sandbox@next and update the container image and code accordingly.

Frequently Asked Questions about sandbox-migrate-to-next

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I migrate from stable @cloudflare/sandbox to Sandbox SDK 1.0 preview?

Install @cloudflare/sandbox@next, switch the container image to cloudflare/sandbox:next, and rewrite code using the replacement map: exec returns a process handle instead of a buffered result, sessions are removed in favor of per-launch cwd/env, and terminals use createTerminal plus connect.

What replaced sandbox.exec in the Cloudflare Sandbox 1.0 preview?

sandbox.exec now takes an argv array and returns a process handle immediately; process start no longer means command completion. Use handle.output(), waitFor* methods, logs, and kill with numeric signals to manage execution.

Can I use gradual container rollout when migrating to @next?

No. Stable and @next control protocols are incompatible both ways, so gradual rollout leaves a broken mixed window. Production cutover requires a single deploy with wrangler --containers-rollout=immediate, and pre-deploy process and terminal IDs become invalid.

Does Sandbox SDK 1.0 preview still support sessions and gitCheckout?

No. Default and named sessions are removed; pass cwd and env per launch or use a shell script. gitCheckout is gone too—run git through argv-based exec, such as cloning with ["git", "clone", ...].

When should I not use this migration skill?

Do not use it for day-to-day work on stable (use sandbox-stable), for brand-new @next projects (use sandbox-next), or for deprecated-API cleanup that stays on stable. Self-deployed bridges should also remain on stable since they are not part of the preview line.