gc-safe-coding
Skill by facebook
Explains how to write and review GC-safe C++ code in the Hermes VM runtime. It is for engineers working on internal VM APIs rather than JSI code.
Install gc-safe-coding
Built from the published package, never by AI.
git clone --depth 1 https://github.com/facebook/hermes /tmp/hermes && mkdir -p ~/.claude/skills && cp -r /tmp/hermes/.claude/skills/gc-safe-coding ~/.claude/skills/gc-safe-codingRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/facebook/hermes /tmp/hermes && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/hermes/.claude/skills/gc-safe-coding ~/.gemini/antigravity-cli/skills/gc-safe-codingAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Skills can run scripts on your machine. Some need an API key: check the README.
About
This skill gives an AI assistant rules for writing and reviewing GC-safe C++ code in the Hermes VM runtime. It explains which GC safepoints exist, which raw pointers and PseudoHandles must be rooted before a safepoint, and how to use Locals with PinnedValue fields in place of the removed GCScope and makeHandle() APIs. It also covers checking CallResult values, when using a Handle is acceptable, and native backend rules about LocalsRAII and longjmp.
The skill applies to internal Hermes VM APIs, not to code that uses JSI. It names typical locations such as lib/VM/, include/hermes/VM/, API/hermes/, and API/napi/. It ends with a review checklist and a debugging tip for an identifier table assertion. The source is aimed at engineers who write or review Hermes runtime C++ code.
Written from the project's SKILL.md and checked against it.
What it can do
- GC safepoint rulesExplains which calls can trigger GC and why raw pointers must be rooted before them.
- Locals and PinnedValue rootingShows how to declare a Locals struct with PinnedValue fields and a LocalsRAII.
- Assignment patternsCovers assigning PinnedValue fields from PseudoHandles, HermesValues, and raw pointers.
- CallResult error handlingShows how to check for ExecutionStatus::EXCEPTION before using a result.
- Handle usage guidanceLists Handle uses that are fine and rules against returning Handles from local roots.
- Native backend rulesDescribes avoiding LocalsRAII across calls that can reach _sh_throw_current.
- Review checklistProvides an eight-item checklist for writing or reviewing GC-safe code.
- Debugging tipExplains a likely cause of a materializeLazyIdentifier assertion failure.
Try asking
- Review this Hermes VM function for unrooted pointers across GC safepoints.
- Rewrite this runtime helper to use Locals and PinnedValue instead of GCScope.
- Check this CallResult handling in my Hermes C++ code for exception safety.
Good to know
- Covers internal Hermes VM APIs only, not code that uses JSI.
- Describes GCScope and makeHandle() as no longer existing in the codebase.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: .claude/skills/gc-safe-coding/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
-
SKILL.md7 KB
Alternatives to gc-safe-coding
All alternatives →Runs a 7-stage workflow for auditing, cleaning up and reviewing GitHub repositories, plus competitor analysis. Written for developers who want a repo checked for secrets, junk files and documentation gaps.
Teaches an AI assistant to build, debug and explain Gradio web UIs and ML demos in Python. It covers the core API, components, event listeners, layouts and the MCP server option. Aimed at Python developers who work with Gradio.
Recommends menus, buttons, toolbars and disclosure controls for Apple platforms using Human Interface Guidelines conventions. Built for developers and designers making iOS, iPadOS, macOS or visionOS interfaces. Checks existing project design context before asking questions.
Creates production-ready FastAPI project structures with async patterns, dependency injection, and error handling. It is for developers starting new FastAPI applications or backend API projects.
Analyzes Android apps to find user workflows to expose as AppFunctions, so AI agents and system shortcuts can run them without opening the app UI. Generates Kotlin code and refines KDoc for Android developers.
Creates, edits, validates and runs Agent QA tests, suites and hooks through MCP or CLI. It keeps canonical IDs and schema contracts intact, for developers and QA teams using Agent QA.
Compare with openclaw-github-repo-commander, gradio or hig-components-menus
gc-safe-coding: common questions
What does the gc-safe-coding skill cover?
It covers rules for writing and reviewing GC-safe C++ code in the Hermes VM runtime, including rooting with Locals and PinnedValue and handling CallResult values.
Does this skill apply to JSI code?
No. The source says it is for internal Hermes VM APIs as opposed to code that uses JSI.
Which files does this skill typically apply to?
The source names lib/VM/, include/hermes/VM/, API/hermes/, and API/napi/ as typical locations.
How do I install gc-safe-coding?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is gc-safe-coding free?
The code is published under the MIT licence. The service it connects to may have its own pricing.
Is gc-safe-coding safe to use?
It scores 89 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to gc-safe-coding?
Similar skills: openclaw-github-repo-commander, gradio, hig-components-menus, fastapi-templates.
