Skip to content

Commit 8ce91e2

Browse files
committed
docs(cli): sync bundled sandchest skill with root skill updates
1 parent 7cd3943 commit 8ce91e2

2 files changed

Lines changed: 51 additions & 5 deletions

File tree

packages/cli/skills/sandchest/SKILL.md

Lines changed: 42 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,36 @@ Rule of thumb: if it runs code or installs dependencies, sandbox it.
3636

3737
## 2. Setup Recipe
3838

39+
If the user wants a single command run in a fresh sandbox, prefer `sandbox_run_project` first:
40+
41+
```text
42+
sandbox_run_project({
43+
command: "bun run lint",
44+
local_path: "/path/to/project"
45+
})
46+
```
47+
48+
Use the manual setup below when you need reuse, forking, patch workflows, or fine-grained control.
49+
3950
1. Create a sandbox with `sandbox_create`.
40-
2. Choose an image using [references/image-selection.md](references/image-selection.md).
51+
2. Prefer the matching official image when the runtime is obvious:
52+
- `sandchest://ubuntu-22.04/bun` for Bun repos
53+
- `sandchest://ubuntu-22.04/node-22` for Node.js, npm, pnpm, and yarn repos
54+
- `sandchest://ubuntu-22.04/python-3.12` for Python repos
55+
- `sandchest://ubuntu-22.04/go-1.22` for Go repos
56+
- `sandchest://ubuntu-22.04/base` only when you need custom setup or do not know the runtime yet
4157
3. Load code with `sandbox_git_clone` for public git repos, or `sandbox_upload_dir` for local code.
42-
4. Install dependencies with `sandbox_session_create` plus `sandbox_session_exec`.
58+
4. Install dependencies with `sandbox_session_create` plus `sandbox_session_exec`, defaulting to `/tmp/work`.
4359
5. Fork after setup so you have a clean checkpoint before experiments.
4460

61+
Example Bun setup:
62+
63+
```text
64+
sandbox_session_create({ sandbox_id, shell: "/bin/bash" })
65+
sandbox_session_exec({ cmd: "curl -fsSL https://bun.sh/install | bash" })
66+
sandbox_session_exec({ cmd: "export PATH=\"/root/.bun/bin:$PATH\" && cd /tmp/work && bun install" })
67+
```
68+
4569
If you uploaded local code and you want diff workflows, initialize a baseline repo first:
4670

4771
```text
@@ -84,9 +108,10 @@ If a patch is too large or the repo is not initialized, fall back to directory d
84108
| Image | Use for |
85109
|-------|---------|
86110
| `sandchest://ubuntu-22.04/base` | General Linux work and custom setup |
87-
| `sandchest://ubuntu-22.04/node-22` | Node.js, Bun, TypeScript, frontend repos |
88-
| `sandchest://ubuntu-22.04/python-3.12` | Python projects |
89-
| `sandchest://ubuntu-24.04/base` | Newer Ubuntu userland |
111+
| `sandchest://ubuntu-22.04/node-22` | Node.js, npm, pnpm, yarn, frontend, CLIs |
112+
| `sandchest://ubuntu-22.04/bun` | Bun workspaces and Bun-first repos |
113+
| `sandchest://ubuntu-22.04/python-3.12` | Python apps and tooling |
114+
| `sandchest://ubuntu-22.04/go-1.22` | Go projects |
90115

91116
See [references/image-selection.md](references/image-selection.md) for the full guide.
92117

@@ -100,6 +125,12 @@ sandbox_exec({ cmd: "git clone https://user:TOKEN@github.com/org/repo" })
100125

101126
Correct:
102127

128+
```text
129+
sandbox_run_project({ command: "npm test", repo_url: "https://github.com/org/repo" })
130+
```
131+
132+
Also correct when you need manual control:
133+
103134
```text
104135
sandbox_git_clone({ url: "https://github.com/org/repo" })
105136
```
@@ -113,6 +144,12 @@ sandbox_exec({ cmd: "rm -rf dist && npm run build:esm" })
113144

114145
Correct:
115146

147+
```text
148+
sandbox_run_project({ command: "npm run build", local_path: "/path/to/project" })
149+
```
150+
151+
Or for reusable setup:
152+
116153
```text
117154
create sandbox
118155
clone or upload code

packages/cli/skills/sandchest/references/troubleshooting.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Common causes:
1717
- Large test or build step
1818

1919
Fixes:
20+
- Prefer `sandbox_run_project` for one-shot "new sandbox + run command" tasks so setup, install, and execution are handled together.
2021
- Increase the timeout on the command or helper.
2122
- Set non-interactive env vars where appropriate.
2223
- Use `GIT_TERMINAL_PROMPT=0` style protections for git workflows.
@@ -33,10 +34,18 @@ Fixes:
3334
## Upload Too Large
3435

3536
Fixes:
37+
- Prefer `sandbox_run_project` in `source: "auto"` mode for a one-shot task. It can fall back from upload to clone automatically when a public origin is available.
3638
- Prefer `sandbox_git_clone` for public repos.
3739
- Narrow the upload scope.
3840
- Exclude generated directories and dependency folders.
3941

42+
## Writable Paths
43+
44+
Fixes:
45+
- Default to `/tmp/work` for MCP uploads, clones, exec, and sessions.
46+
- Use `/tmp` or `/var/tmp` for scratch space.
47+
- Only use `/work` when you know the target image mounts it read-write.
48+
4049
## Directory Upload Failed On Extraction
4150

4251
Bulk upload is not transactional. Partial files may remain.

0 commit comments

Comments
 (0)