arkui-api-design_skill

This skill guides designing ArkUI API following OpenHarmony guidelines, synchronizing static and dynamic interfaces, and validating resources and typings.
  • Python

0

GitHub Stars

2

Bundled Files

2 months ago

Catalog Refreshed

4 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstrat where the catalogue uses aiagentskills.

npx veilstrat add skill openharmonyinsight/openharmony-skills --skill arkui-api-design

  • README.md21.4 KB
  • SKILL.md26.4 KB

Overview

This skill provides hands-on guidance for designing, reviewing, and maintaining ArkUI component APIs that follow OpenHarmony TypeScript/JavaScript coding guidelines. It enforces synchronization between static (.static.d.ets) and dynamic (.d.ts) interfaces, resource typing rules, JSDOC requirements, and SDK build/verification steps. Use it to produce consistent, versioned, and testable ArkUI API changes.

How this skill works

The skill inspects proposed API changes and checks required updates across static API files (interface/sdk-js/api/arkui/component/*.static.d.ets) and dynamic Attribute interfaces (@internal/component/ets/*.d.ts). It validates naming, types, Resource type usage boundaries (API 13+), undefined/null semantics, unit defaults (vp), JSDOC constraints, and cross-component impact. Finally, it outlines SDK build and verification commands to confirm the changes appear in generated outputs.

When to use it

  • Design a new ArkUI component property or method
  • Add or modify a Modifier/Attribute method in dynamic API
  • Review or audit ArkUI API changes for OpenHarmony compliance
  • Deprecate an existing API and produce migration guidance
  • Write or update JSDOC for ArkUI public APIs

Best practices

  • Always update both static (.static.d.ets) and dynamic (@internal/*.d.ts) definitions together and keep signatures synchronized
  • Follow camelCase for properties/methods and PascalCase for types; include @since tags with static/dynamic suffix
  • Support Resource types only for themeable properties; use ResourceStr only for NEW APIs (API 13+)
  • Document undefined vs null behavior explicitly in JSDOC and declare valid ranges, units (vp), and clamping rules
  • Use chainable return types correctly: this for static declarations, concrete Attribute type for dynamic methods
  • Run the SDK build and verify generated files under out/ohos-sdk/interfaces/sdk-js/api after changes

Example use cases

  • Add a themeable fontSize property: update Text.static.d.ets and Text.d.ts, document units, ranges, and ResourceStr use for API 13+
  • Deprecate a property: mark @deprecated in both static and dynamic files and provide migration notes and @obsoleted version
  • Introduce a boolean runtime flag: keep it runtime-only (no Resource support) and document undefined/null handling
  • Review API signatures in a PR: confirm return types, @since tags, JSDOC constraints, and cross-component compatibility

FAQ

Only when the property is intended to be configured via resource files (themes, i18n). For NEW APIs (API 13+) prefer ResourceStr; preserve existing signatures for older APIs.

What are the exact files I must modify for a property change?

Static: interface/sdk-js/api/arkui/component/<component>.static.d.ets. Dynamic: interface/sdk-js/api/@internal/component/ets/<component>.d.ts. Modifier class definitions live under interface/sdk-js/api/arkui/*Modifier.d.ts.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational