OpenHarmony React Native Performance
/install ohos-react-native-performance
\r \r
OpenHarmony React Native Performance Static Check Skills\r
\r Static-check rules and config for React Native for OpenHarmony, from the official performance-optimization doc. This skill is English-only to reduce token usage; Chinese content is available via links below.\r \r
When to Apply\r
\r Use this skill when:\r \r
- Writing or reviewing React Native for OpenHarmony (RNOH) application code or OpenHarmony project configuration\r
- Optimizing React Native page rendering, setState, or list performance\r
- Configuring bundle-harmony build, Hermes bytecode, or Release build\r
- Integrating or reviewing RNAbility lifecycle (onForeground/onBackground)\r
- Designing or implementing TurboModule (main vs worker thread)\r
- Preparing for performance analysis with Trace, React Marker, FCP, etc.\r \r
Rule Categories by Priority\r
\r
| Priority | Category | Impact | Prefix |\r
| -------- | ------------------- | -------- | ------------------------- |\r
| 1 | Render optimization | CRITICAL | rnoh-render- |\r
| 2 | Bundle & native | HIGH | rnoh-bundle-, rnoh-native- |\r
| 3 | Lifecycle & monitor | HIGH | rnoh-lifecycle- |\r
| 4 | TurboModule | MEDIUM | rnoh-turbo- |\r
| 5 | List & key | MEDIUM | rnoh-list- |\r
\r
Quick Reference\r
\r
1. Render optimization (CRITICAL)\r
\r
rnoh-render-avoid-same-state— Avoid setState when state unchanged to prevent extra renders\rrnoh-render-pure-memo— Use PureComponent or React.memo to avoid unnecessary re-renders\rrnoh-render-props-once— Create callbacks/prop objects once (constructor or outside component)\rrnoh-render-split-child— Split independent UI into child components\rrnoh-render-merge-setstate— Merge setState to avoid multiple commits and renders\rrnoh-render-state-not-mutate— Use new objects in setState; do not mutate existing state\rrnoh-render-batching— Keep React 18 Automatic Batching enabled (RNOH default concurrentRoot: true)\r \r
2. Bundle & native config (HIGH)\r
\r
rnoh-bundle-release— Use--dev=false --minify=truefor performance/production bundle\rrnoh-bundle-hbc— Prefer Hermes bytecode (hermesc) for production\rrnoh-native-release— Use Release build on native side; lower LOG_VERBOSITY_LEVEL when appropriate\rrnoh-native-bisheng— Optionally use BiSheng compiler (buildOption.nativeCompiler: "BiSheng")\r \r
3. Lifecycle & monitoring (HIGH)\r
\r
rnoh-lifecycle-foreground-background— Call onForeground/onBackground in onPageShow/onPageHide or onShown/onHidden\rrnoh-lifecycle-fcp— First-frame monitoring: use mount event or root onLayout to report FCP\r \r
4. TurboModule (MEDIUM)\r
\r
rnoh-turbo-worker— Run heavy TurboModules (JSON, crypto, image, network, I/O) on worker thread; avoid ImageLoader on worker\r \r
5. List & key (MEDIUM)\r
\r
rnoh-list-key— Provide stable keys for list items; avoid using index as key\r \r
How to Use\r
\r
- Static checks: Apply the rules above in code review or scripts (JS/TS and config).\r
- Details and examples: See the corresponding rule files under
rules/(e.g.rules/rnoh-render-pure-memo.md).\r - Full doc: Performance optimization (en).\r \r
Relation to general React Native skills\r
\r
- This skill focuses on OpenHarmony-specific React Native performance (RNAbility, bundle-harmony, HBC, TurboModule worker, Trace/React Marker).\r
- It complements vercel-react-native-skills and react-native-best-practices: list virtualization (FlashList), Pressable, expo-image, StyleSheet, etc. still apply; this skill adds OpenHarmony-side config and render-optimization details.\r
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install ohos-react-native-performance - 安装完成后,直接呼叫该 Skill 的名称或使用
/ohos-react-native-performance触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
OpenHarmony React Native Performance 是什么?
OpenHarmony React Native performance static checks and optimization. Based on ohos_react_native performance doc. Use when writing or reviewing React Native for OpenHarmony code, bundle-harmony, lifecycle, or TurboModule. Applies to RNAbility, Hermes bytecode, React render optimization. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 882 次。
如何安装 OpenHarmony React Native Performance?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install ohos-react-native-performance」即可一键安装,无需额外配置。
OpenHarmony React Native Performance 是免费的吗?
是的,OpenHarmony React Native Performance 完全免费(开源免费),可自由下载、安装和使用。
OpenHarmony React Native Performance 支持哪些平台?
OpenHarmony React Native Performance 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 OpenHarmony React Native Performance?
由 code-sunbo(@code-sunbo)开发并维护,当前版本 v1.0.0。