cloudflare-mining/cloudflare-datamining/sandbox-migrate-to-next
Claude Code and agent skill by cloudflare-mining/cloudflare-datamining
- community
- ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Checking that the SKILL.md file is still in the repository.
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.
Install
npx vskill@latest install cloudflare-mining/cloudflare-datamining/sandbox-migrate-to-nextSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as cloudflare/skills/sandbox-migrate-to-next.
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 · 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 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
- Review hard rules and the replacement map
- Audit the codebase; list hits and target shapes
- Clarify with the user (cutover, bridge, Python image, unclear sites)
- Upgrade package, image, and code
- Validate
Stop after any step that needs a user decision.
Hard rules
- Worker package and container image must be the same
@nextline. - Production cutover uses immediate container rollout. Stable and
@nextcontrol 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/AbortSignalcancel the wait only, not the process. - No single retry loop for every error.
- Do not invent APIs (
gitCheckouton 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 · after port, day-to-day → `sandbox-next`
Audit
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
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 · Processes API | |
cwd / env / secrets | Environment · Outbound traffic | |
| Drop sessions | Migrate · Lifecycle | |
| Terminals | Terminals | |
| Interpreter | Interpreter | |
| Errors | Errors | |
| Durable job across requests | Process execution — lifetime / durability |
Commands (shape):
Terminals (shape):
Interpreter (shape):
Git (shape):
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:
Leave rollout_active_grace_period at default 0 (or set 0 if raised). After cutover, pre-deploy process/terminal IDs are invalid. Details: Migrate · Container rollouts
Validate
- Lockfile + Dockerfile on the same
@nextline - Typecheck against
@next - Smoke argv
exec+output({ encoding: "utf8" }) - Smoke long process / terminal / interpreter if used
- Errors distinguished: unavailable / interrupted-RPC / stale / local wait
- No live secrets in sandbox env
- Grep again for removed APIs
- Production used
--containers-rollout=immediate
Then day-to-day work uses `sandbox-next`.
Red flags — stop and fix
- Mixing
@nextWorker with stable image (or reverse) - Gradual container rollout for this cutover
- Treating
await execas command completion - Assuming
cd/ exports persist acrossexeccalls - 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/ launchenv
Skill feedback
If the user reports that this skill gave incorrect or outdated guidance, or is missing information, read references/skill-feedback.md.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingdata/middlecache/v1/cloudflare-skills/skills/sandbox-migrate-to-next/SKILL.md
Popularity
- Repository stars
- 199
- Repository forks
- 26
- 7-day trend score
- 31
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Extension points
hookPre/post lifecycle hooks
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/cloudflare-mining/cloudflare-datamining/sandbox-migrate-to-next)