agentleFS
facebookfacebook/hermes/.claude/skills/regenerate-sandbox/SKILL.md

regenerate-sandbox

Skill11k starsChanged 7 months agoMITView on GitHub

Guide for regenerating the Hermes sandbox, the C files in API/hermes_sandbox/external that wasm2c produces from a wasm build of the VM, and for changing HermesSandboxRuntime.cpp, the JSI runtime on top of it. Use when the user asks to regenerate or update the sandbox, re-run wasm2c or emscripten for it, or update the sandbox C files; after a bytecode version bump, a change to the C ABI in API/hermes_abi, or a VM fix the sandbox should get; or when adding or changing JSI methods in the sandbox runtime.

We split this skill into the rules it gives an agent

9 rules. About 0 are common, 6 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    If this checkout has a facebook/ directory, also read .claude/skills/facebook/regenerate-sandbox-meta/SKILL.md, which covers the internal …

    line 33
  2. Distinctive:

    Read the one that matches the step you are on:

    line 49
  3. Distinctive:

    Before changing the ABI or the mirror: references/abi.md

    line 51
  4. Very specific:

    When adding or changing a JSI method in HermesSandboxRuntime.cpp: references/jsi.md

    line 58
  5. Distinctive:

    When something fails: references/troubleshooting.md

    line 60
  6. Distinctive:

    Check the imports and exports of both modules before running wasm2c.

    line 69
  7. Very specific:

    Run wasm2c for dbg and opt, then run verify_generated.py.

    line 70
  8. Distinctive:

    Run the API tests with the debug and the release build of the host, and with UBSan.

    line 73
  9. Distinctive:

    Update the README if the tools, flags or steps changed.

    line 75

≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Regenerating the Hermes sandbox

The sandbox runs the Hermes VM inside wasm, translated to C, so that bugs in the VM cannot reach host memory. Its pieces:

  • The module. hermesSandboxImpl (API/hermes_sandbox/CMakeLists.txt) links hermes_sandbox_impl.cpp, the C ABI (API/hermes_abi, mainly hermes_vtable.cpp) and the VM into a standalone wasm module with Emscripten. wasm2c turns it into external/hermes_sandbox_impl_dbg_compiled* and external/hermes_sandbox_impl_opt_compiled*. The wasm-rt files in external/ are the wasm2c runtime.
  • The host. HermesSandboxRuntime.cpp implements jsi::Runtime by calling the ABI vtable that the module exports (get_hermes_abi_vtable), through a hand-written mirror, SANDBOX_CONTEXT_VTABLE_FUNCTIONS. It also implements the module's imports.
  • The generated C is checked in. Nothing rebuilds it, so a change to the VM, the ABI or the bytecode format reaches the sandbox only when someone regenerates it. The debug build of the host compiles the dbg files and the release build the opt files.

If this checkout has a facebook/ directory, also read .claude/skills/facebook/regenerate-sandbox-meta/SKILL.md, which covers the internal build, test and submission steps.

When to regenerate

  • The bytecode version changes. The sandbox only accepts bytecode of the version it was built with.
  • The C ABI changes: hermes_abi.h or hermes_vtable.cpp.
  • A VM fix or feature should reach the sandbox.
  • Emscripten or wasm2c is upgraded.

Changes to HermesSandboxRuntime.cpp alone do not need a regeneration.

References

Read the one that matches the step you are on:

  • Before changing the ABI or the mirror: references/abi.md
  • To set up the tools and build the wasm modules and the C: references/building.md
  • To check the output before committing it: references/checks.md, which uses verify_generated.py
  • To test the result: references/testing.md
  • When adding or changing a JSI method in HermesSandboxRuntime.cpp: references/jsi.md
  • When something fails: references/troubleshooting.md

Checklist

  1. Make the source changes: the VM, the ABI and the host runtime. The mirror changes go in the same commit as the regenerated C (see references/abi.md).
  2. Build the host compilers and both wasm modules with the commands in API/hermes_sandbox/README.md, with the pinned tool versions.
  3. Check the imports and exports of both modules before running wasm2c.
  4. Run wasm2c for dbg and opt, then run verify_generated.py.
  5. Rebuild from clean build directories and check that the output is the same, byte for byte.
  6. Run the API tests with the debug and the release build of the host, and with UBSan.
  7. Update the README if the tools, flags or steps changed.
  8. Afterwards, update this skill with anything that went differently.

Download now (ZIP)

Trending

Quiet since June.about the whole repository

Dec 2025: 2 mentionsJan 2026: 0 mentionsFeb 2026: 0 mentionsMar 2026: 2 mentionsApr 2026: 0 mentionsMay 2026: 0 mentionsJun 2026: 1 mentionJul 2026: 0 mentionsAug 2026: 0 mentionsSep 2026: 0 mentionsOct 2026: 0 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the facebook/hermes repository that our weekly crawl found. There is no adoption data for this file yet.

Who's talking about facebook/hermes

The biggest 5 of 43 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 43

Talked about on GitHub, Stack Overflow, Hacker News, Bluesky and the web (43 times).

On GitHub · 27

22 more on GitHub

On Stack Overflow · 9

4 more on Stack Overflow

On Bluesky · 2

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

Reviews can't be read right now.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.