Create Sandbox
Use this skill to create repeatable Codex/Claude Docker sandbox scripts from
the bundled Docker scripts in src/. Keep SKILL.md focused
on the workflow; load detailed rules from references/ only when needed.
When To Use
Use this skill when the user asks to:
- Create, update, repair, or run a Codex/Claude agent sandbox container.
- Build a project-local
.runtime/build_codex_sandbox.sh script.
- Configure sandbox mounts for a repo, models, SSH files, data, GPUs, or extra
directories, and configure its Docker-in-Docker daemon.
- Configure or explain post-create custom skills/hooks bootstrap.
- Validate sandbox services such as SSH server, Docker-in-Docker readiness, and
mounted workspace paths.
Do not use this skill when:
- The task is general Docker advice unrelated to Codex/Claude sandbox behavior.
- The user asks to delete or reset unrelated containers.
- The request requires running Docker but the user has not explicitly asked to
run it.
Workflow
- Read the user's request and identify whether this is a skill update,
project-local script generation, sandbox repair, or run/validation task.
- Read
STATE.md; for a new run, reset it from
references/template/STATE.template.md.
- Load only the relevant reference files listed below.
- Mark the current step
in_progress in STATE.md.
- For project-local script generation, sandbox repair, or sandbox run tasks,
ask the required storage and mount questions defined in
references/rules/mounts.md before writing or running anything unless the
user's request already provides explicit answers. Do not silently create a
blank configurable script just because answers are missing.
- If the user explicitly asks to proceed without answering the mount
questions, create only a configurable script with empty optional mounts and
clear fail-fast behavior for missing
WORKSPACE_DIR, as defined in
references/rules/mounts.md.
- Validate every confirmed non-empty host path before writing or running a
script.
- If updating this skill, edit bundled files in
src/,
references/, and this SKILL.md as needed.
- If creating a sandbox for another project, create or update only that
project's
.runtime/build_codex_sandbox.sh, based on
src/build_and_exec.sh.
- Ensure the target project's
.gitignore contains .runtime/.
- Validate changed shell scripts with
bash -n; make generated scripts
executable with chmod +x.
- Mark the step
completed, blocked, or skipped in STATE.md with
evidence.
References
- Read
references/rules/lifecycle.md before changing build/run/post-create
behavior or explaining which work happens before vs. after container create.
- Read
references/rules/mounts.md before asking mount questions, validating
paths, preparing SSH files, or handling Docker-in-Docker data/extra mounts.
- Read
references/rules/runtime-mount-permissions.md when Docker bind mounts
fail or when host paths are under /home/NFS.
- Read
references/rules/env.md before changing image/container defaults,
agent package bootstrap settings, or runtime file placement.
- Read
references/rules/service-tests.md before changing validation behavior.
- Read
references/rules/filetree.md before adding, moving, or removing files
in this skill directory.
- Read
references/rules/state-rules.md when updating STATE.md.
- Read
references/tools.md when the user asks about installed tools, common
utilities, Dockerfile package choices, or network/debug tooling.
- Use
src/Dockerfile as the canonical Docker build definition.
- Use
src/build_and_exec.sh as the canonical executable template for
generated project-local scripts.
- Use
src/after_create_container.sh for post-create bootstrap
in the running container.
- Use
src/test_service.sh for post-start service checks.
Environment
Follow references/rules/env.md for image/container defaults, runtime paths,
agent package settings, and Docker execution boundaries. Do not run Docker
unless the user explicitly requests it.
Rules
State Rules
Keep STATE.md as per-run working state. Reset it from
references/template/STATE.template.md for new executions, and do not claim a
workflow step is complete unless STATE.md was updated with concrete evidence.
Read references/rules/state-rules.md for status values and update rules.
Reference Rules
- Keep
SKILL.md focused on trigger conditions and core workflow.
- Put detailed sandbox lifecycle, mount, SSH, environment, and validation rules
in
references/rules/.
- Put deterministic executable tooling in
src/.
- Load only the reference files needed for the current request.
Output
Final responses should include:
- What changed or what was investigated.
- Script path or skill file path when relevant.
- Validation commands and results.
- Whether Docker was executed.
- Any blocker or remaining risk.
1---2name: create-sandbox3description: Use when the user asks to create, set up, build, update, repair, validate, or run an agent sandbox Docker environment for Codex and Claude. Trigger on requests such as "建立 sandbox", "建立 codex sandbox", "create a sandbox", "create a codex sandbox", "幫我開 sandbox", "make a sandbox for Codex", "make a sandbox for Claude", sandbox mounts, sandbox SSH, Docker-in-Docker, custom skills/hooks bootstrap, or project-specific sandbox setup such as Pretrieval. Create or update a project-local `.runtime/build_codex_sandbox.sh` script from this skill's bundled `src/` files. Do not execute Docker commands unless the user explicitly asks.4---56# Create Sandbox78Use this skill to create repeatable Codex/Claude Docker sandbox scripts from9the bundled Docker scripts in `src/`. Keep `SKILL.md` focused10on the workflow; load detailed rules from `references/` only when needed.1112## When To Use1314Use this skill when the user asks to:1516- Create, update, repair, or run a Codex/Claude agent sandbox container.17- Build a project-local `.runtime/build_codex_sandbox.sh` script.18- Configure sandbox mounts for a repo, models, SSH files, data, GPUs, or extra19 directories, and configure its Docker-in-Docker daemon.20- Configure or explain post-create custom skills/hooks bootstrap.21- Validate sandbox services such as SSH server, Docker-in-Docker readiness, and22 mounted workspace paths.2324Do not use this skill when:2526- The task is general Docker advice unrelated to Codex/Claude sandbox behavior.27- The user asks to delete or reset unrelated containers.28- The request requires running Docker but the user has not explicitly asked to29 run it.3031## Workflow32331. Read the user's request and identify whether this is a skill update,34 project-local script generation, sandbox repair, or run/validation task.352. Read `STATE.md`; for a new run, reset it from36 `references/template/STATE.template.md`.373. Load only the relevant reference files listed below.384. Mark the current step `in_progress` in `STATE.md`.395. For project-local script generation, sandbox repair, or sandbox run tasks,40 ask the required storage and mount questions defined in41 `references/rules/mounts.md` before writing or running anything unless the42 user's request already provides explicit answers. Do not silently create a43 blank configurable script just because answers are missing.446. If the user explicitly asks to proceed without answering the mount45 questions, create only a configurable script with empty optional mounts and46 clear fail-fast behavior for missing `WORKSPACE_DIR`, as defined in47 `references/rules/mounts.md`.488. Validate every confirmed non-empty host path before writing or running a49 script.509. If updating this skill, edit bundled files in `src/`,51 `references/`, and this `SKILL.md` as needed.5210. If creating a sandbox for another project, create or update only that53 project's `.runtime/build_codex_sandbox.sh`, based on54 `src/build_and_exec.sh`.5511. Ensure the target project's `.gitignore` contains `.runtime/`.5612. Validate changed shell scripts with `bash -n`; make generated scripts57 executable with `chmod +x`.5813. Mark the step `completed`, `blocked`, or `skipped` in `STATE.md` with59 evidence.6061## References6263- Read `references/rules/lifecycle.md` before changing build/run/post-create64 behavior or explaining which work happens before vs. after container create.65- Read `references/rules/mounts.md` before asking mount questions, validating66 paths, preparing SSH files, or handling Docker-in-Docker data/extra mounts.67- Read `references/rules/runtime-mount-permissions.md` when Docker bind mounts68 fail or when host paths are under `/home`/NFS.69- Read `references/rules/env.md` before changing image/container defaults,70 agent package bootstrap settings, or runtime file placement.71- Read `references/rules/service-tests.md` before changing validation behavior.72- Read `references/rules/filetree.md` before adding, moving, or removing files73 in this skill directory.74- Read `references/rules/state-rules.md` when updating `STATE.md`.75- Read `references/tools.md` when the user asks about installed tools, common76 utilities, Dockerfile package choices, or network/debug tooling.77- Use `src/Dockerfile` as the canonical Docker build definition.78- Use `src/build_and_exec.sh` as the canonical executable template for79 generated project-local scripts.80- Use `src/after_create_container.sh` for post-create bootstrap81 in the running container.82- Use `src/test_service.sh` for post-start service checks.8384## Environment8586Follow `references/rules/env.md` for image/container defaults, runtime paths,87agent package settings, and Docker execution boundaries. Do not run Docker88unless the user explicitly requests it.8990## Rules9192### State Rules9394Keep `STATE.md` as per-run working state. Reset it from95`references/template/STATE.template.md` for new executions, and do not claim a96workflow step is complete unless `STATE.md` was updated with concrete evidence.97Read `references/rules/state-rules.md` for status values and update rules.9899### Reference Rules100101- Keep `SKILL.md` focused on trigger conditions and core workflow.102- Put detailed sandbox lifecycle, mount, SSH, environment, and validation rules103 in `references/rules/`.104- Put deterministic executable tooling in `src/`.105- Load only the reference files needed for the current request.106107## Output108109Final responses should include:110111- What changed or what was investigated.112- Script path or skill file path when relevant.113- Validation commands and results.114- Whether Docker was executed.115- Any blocker or remaining risk.