skills/ohos-test-arkruntime-interop-testing/SKILL.md
Guide for adding and maintaining ArkTS <-> JS/TS interoperability tests in ArkCompiler. 触发场景:在 plugins/ets/tests/interop_js/tests/ 目录下创建新的 ArkTS 与 JS/TS 互操作(Interop)测试用例、调试/维护已有 Interop 测试、编写 C++ 运行器(GTest runner)或声明文件(.d.ets)时。
npx skillsauth add openharmonyinsight/openharmony-skills ohos-test-arkruntime-interop-testingInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill provides a structured workflow and templates for creating comprehensive interop tests between ArkTS (ETS) and JavaScript/TypeScript.
Interop tests typically involve three layers:
A typical test case directory (e.g., plugins/ets/tests/interop_js/tests/my_test/) should contain:
CMakeLists.txt: Build configuration.arktsconfig.in.json: ArkTS compiler configuration with dependencies.my_test.cpp: C++ GTest runner.my_test.ets: ArkTS test logic.my_test.ts or my_test.js: JS/TS side of interop.my_test.d.ets: (Optional) Declaration file for JS/TS exports.Create a new unique directory in plugins/ets/tests/interop_js/tests/.
Write your JS/TS code in a .ts or .js file.
Use assets/interop_js.ts.template as a starting point.
If your JS/TS code exports functions/classes, create a .d.ets file to declare them for ArkTS.
Template: assets/interop_decl.d.ets.template.
Write the test logic in ArkTS. This logic should return true on success.
Template: assets/interop_test.ets.template.
.d.ets declaration.
Template: assets/arktsconfig.in.json.template.panda_ets_interop_js_gtest macro.
Template: assets/CMakeLists.txt.template.Inherit from EtsInteropTest and use CallEtsFunction to trigger your test.
Template: assets/test_runner.cpp.template.
CMakeLists.txt and directory name are unique to avoid collisions.boolean from ETS or throwing exceptions that C++ can catch.bash code-format.sh format-changed after adding new files.ohos-dev-arkruntime-interop-development for architectural details.CMakeLists.txt in interop_js/tests/ automatically includes subdirectories via SUBDIRLIST.testing
--- name: ohos-req-value-decision description: Use after review meeting to record decision and route to next step. Triggers: 评审决策纪要, 评审结论回流, value decision, 评审接纳, 评审不接纳, 评审退回, 下次重新上会. Do NOT use for feature baseline (ohos-req-feature-baseline), review gate checks (ohos-req-review-gate), or IR generation (ohos-req-feature-to-ir). metadata: author: openharmony scope: common stage: requirements capability: value-decision version: 0.3.0 status: draft tags: - sdd - requirements
development
Use when converting an OpenHarmony requirement document, spec, or design proposal into an OpenHarmony review slide deck (需求评审 / 需求变更评审 / 设计评审 PPTX) — produces the fixed OpenHarmony-branded review-deck structure (OH logo on every page) with architecture/flow diagrams and field tables. Triggers on "需求评审PPT", "需求变更评审", "把需求文档转成评审PPT", "spec转评审PPT", "requirement/spec to review deck". NOT for arbitrary or generic slide decks unrelated to OpenHarmony requirement/design review.
testing
Use when performing the Phase 0 Step 0.5 Review Ready Gate on a 04-feature.md, especially when the user says "evaluate gate", "review readiness", "feature ready?", "should we generate IR", or when the ohos-req-intake-orchestration main session needs a structured Ready / Conditional Ready / Not Ready judgment instead of doing the check inline. Reads 01-04, runs seven fixed checks plus a conditional-items check, and returns a machine-readable JSON summary plus a human-readable table that the main session can route on. Do NOT use for feature baseline generation (ohos-req-feature-baseline), value decision recording (ohos-req-value-decision), or IR generation (ohos-req-feature-to-ir).
testing
--- name: ohos-req-requirement-intake description: Use when importing an OHOS requirement into Phase 0.1, especially for 01-requirement.md, requirement intake, background, user value, scenarios, scope, FR/NFR, affected modules, or priority. Triggers: 需求导入, 01-requirement, 需求基线, RR单号. Do NOT use for feasibility analysis (ohos-req-feasibility-analysis), architecture decision (ohos-req-arch-decision), or feature baseline (ohos-req-feature-baseline). metadata: author: openharmony scope: common