指导在 JSI Runtime 层新增方法与功能,并同步 Hermes 与 SynthTrace 支持。
该技能材料显示其本质是一个开源仓库中的提示/开发指导文档,不要求密钥、未声明远程端点,也未描述独立执行或数据外发能力。基于现有材料,整体风险较低,主要需留意其供应链元数据有限且维护活跃度未明。
材料明确标注无需密钥或环境变量,未见令牌申请、存储或上传机制,凭证泄露与滥用风险低。
未声明任何远程端点,内容为本地代码修改指南,未见将用户数据发送到外部服务的描述。
系统检查项为 prompt-only,README 仅提供应修改的源码文件与实现模式,未描述自行启动进程、执行脚本或调用系统命令。
材料未声明读写本地文件、数据库或其他资源的运行时能力;其作用是说明开发者应修改哪些仓库内文件,未体现过度授权。
来源指向 GitHub 上的开源仓库,源码原则上可审计,这显著降低风险;但许可证未声明、社区 star 为 0、维护状态未知,供应链信号不完整,需保留注意。
复制安装指令,让 AI 自动完成配置 · 推荐新手
请帮我安装 askskill 上的 "modify-jsi-features" 技能: 1. 下载 https://raw.githubusercontent.com/facebook/hermes/static_h/.claude/skills/modify-jsi-features/SKILL.md 2. 保存为 ~/.claude/skills/modify-jsi-features/SKILL.md 3. 装好后重载技能,告诉我可以用了
请指导我在 JSI Runtime 接口中新增一个方法,从接口声明、Hermes 实现到 SynthTrace replay 支持,列出需要修改的文件、代码结构和注意事项。
一份分步骤实现方案,说明需改动的核心文件、接口定义、实现细节和兼容性要点。
我想为现有 JSI 功能增加一个新特性,请告诉我应该如何在 JSI core、Hermes 实现和 SynthTrace 相关部分同步修改,并给出推荐的开发顺序。
一份按模块拆分的修改指南,帮助我有序完成核心层、运行时实现和回放支持的改动。
请根据在 JSI Runtime 中新增功能的标准流程,帮我检查是否遗漏了接口声明、Hermes 适配或 SynthTrace replay 支持,并整理一份核对清单。
一份覆盖接口层、实现层和回放支持的完整核对清单,用于自查改动是否齐全。
When adding new functionality (methods) to the JSI Runtime interface, you must modify a specific set of files across multiple layers. This skill describes each file, the patterns to follow, and important conventions.
JSI (JavaScript Interface) is an abstraction layer that allows C++ code to interact with JavaScript runtimes. The architecture consists of:
xplat/jsi/jsi/) — The abstract interface definitionsxplat/static_h/API/hermes/) — Hermes-specific implementationxplat/static_h/API/hermes/) — Recording and replay infrastructure for debuggingxplat/jsi/jsi/jsi.h — Add pure virtual method declaration to IRuntime interface AND override declaration in Runtime classxplat/jsi/jsi/jsi.cpp — Add default implementation (if providing one)xplat/jsi/jsi/jsi-inl.h — Add inline helper methods (if needed)xplat/jsi/jsi/decorator.h — Add method overrides to RuntimeDecorator and WithRuntimeDecoratorxplat/jsi/jsi/test/testlib.cpp — Add tests for the JSI APIxplat/static_h/API/hermes/hermes.cpp — Add Hermes-specific implementation in HermesRuntimeImplxplat/static_h/unittests/API/APITest.cpp — Add Hermes-specific testsxplat/static_h/API/hermes/SynthTrace.h — Add new Record typesxplat/static_h/API/hermes/SynthTrace.cpp — Implement Record serializationxplat/static_h/API/hermes/TracingRuntime.h — Declare tracing method overridesxplat/static_h/API/hermes/TracingRuntime.cpp — Implement tracing logicxplat/static_h/API/hermes/SynthTraceParser.cpp — Add parsing for new recordsxplat/static_h/API/hermes/TraceInterpreter.cpp — Add replay logicxplat/static_h/unittests/API/SynthTraceTest.cpp — Add replay testsxplat/static_h/unittests/API/SynthTraceSerializationTest.cpp — Add serialization testsxplat/static_h/unittests/API/SynthTraceParserTest.cpp — Add parser testsWhen adding new features (methods) to the JSI Runtime, you have two options:
Provide a default implementation in jsi::Runtime that works via JavaScript
calls. This allows all runtimes (JSC, V8, etc.) to work without modification.
// jsi.h - Add virtual method with default implementation
virtual void myNewMethod(const Object& obj, const Value& val);
// jsi.cpp - Implement default using JavaScript
void Runtime::myNewMethod(const Object& obj, const Value& val) {
auto myFn = global()
.getPropertyAsObject(*this, "Object")
.getPropertyAsFunction(*this, "myMethod");
myFn.call(*this, obj, val);
}
Make the method pure virtual, requiring all runtimes (JSCRuntime, V8Runtime, HermesRuntime) to implement it. Only use this when a JavaScript-based default is not possible.
jsi.h (JSI Core Interface)Add the pure virtual method declaration to the IRuntime interface, and the override declaration to the Runtime class:
// In IRuntime interface (around line 580)
class JSI_EXPORT IRuntime : public ICast {
// ... existing methods ...
/// Brief description of what the method does.
/// \param obj Description of the object parameter.
/// \param val Description of the value parameter.
/// \return Description of return value (if any).
virtual void myNewMethod(const Object& obj, const Value& val) = 0;
// For methods returning Value, use this pattern:
virtual Value myNewGetter(const Object& obj) = 0;
};
// In Runtime class (around line 730) - add override declarations
class JSI_EXPORT Runtime : public IRuntime {
// ... existing methods ...
…
无需交互式编辑器,程序化重排、拆分、删除或修订任意 Git 历史提交。
帮助开发者编写和审查符合 Hermes VM 垃圾回收安全规范的 C++ 代码
分析 hermesvm 在一段提交范围内的二进制体积变化与回归原因
Guide for adding a new IR instruction to the Hermes compiler. Use when the user asks to add, create, or define a new IR instruction (Inst/Instruction) in the Hermes intermediate representation. Covers all required files and the patterns for each.
快速修复代码格式、Lint与常见错误,帮助提交前顺利通过 CI 检查
用于运行 Flow 类型检查并定位修复 React 代码中的类型错误。