ohos-app-dev

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

OpenHarmony App Dev

OpenHarmony 应用开发

Inner-loop skill for working on an existing OpenHarmony / HarmonyOS app. Every toolchain and device action goes through the
devecocli
CLI
. The CLI delegates to the DevEco toolchain (
hvigor
,
ohpm
,
hdc
, and the HarmonyOS lint tools). Use only commands documented by
devecocli help
; do not assume unsupported flags or subcommands.
For ArkUI source design and
.ets
implementation, consume the handoff from
hmos-arkui-develop-skill
. For architecture and state-boundary decisions, consume
hmos-arkui-mvvm-pattern
. For uncertain API signatures or API-level support, use
hmos-arkts-knowledge-retriever
. For an explicit V1/V2 migration, consume the recorded inventory and migration plan before verification. This skill remains the canonical executor for lint, build, device, runtime, logs, and UI evidence.
用于处理现有 OpenHarmony / HarmonyOS 应用的内部循环 skill。所有 工具链和设备操作都通过
devecocli
CLI
执行。该 CLI 委托给 DevEco 工具链(
hvigor
、
ohpm
、
hdc
和 HarmonyOS lint 工具)。仅使用
devecocli help
中记录的命令;不要假设存在不受支持的标志或子命令。
对于 ArkUI 源码设计和
.ets
实现,读取
hmos-arkui-develop-skill
的交接内容。对于架构和状态边界决策,读取
hmos-arkui-mvvm-pattern
。对于不确定的 API 签名或 API 级别支持情况,使用
hmos-arkts-knowledge-retriever
。如需明确的 V1/V2 迁移,请先读取 记录好的清单和迁移计划,再进行验证。本 skill 仍是执行 lint、构建、设备、 运行时、日志和 UI 证据收集的标准执行器。

Efficiency Defaults

效率默认值

  • Use the smallest inner loop that matches the Track. For a local or logic change, stop at lint/build; do not launch a device unless runtime behavior is in scope.
  • For a UI Track, take one initial screenshot and one approved interaction pass. Do not repeat build/run/layout/screenshot after an unchanged successful pass.
  • Prefer
    devecocli build --modules <module> --build-mode debug
    for module-scoped source changes, then
    devecocli run --skip-build --device <serial> --module <module>
    . Use
    --hotreload-apply
    only when the project has a valid
    .hvigor
    hot-reload file and the user path does not need a fresh install. File-level recompilation remains controlled by Hvigor's dependency graph; never promise that an arbitrary edit compiles in isolation.
  • Never print an unfiltered
    devecocli log
    result. Capture it through
    compact_command.py
    or filter immediately with
    rg "TypeError|JS_ERROR|Fatal|ERROR"
    .
  • Never pass raw
    devecocli docs search
    output into the conversation. Use
    devecocli_docs_bridge.py
    , which fixes
    --format json --limit 3
    , removes long fields, and marks short non-English snippets for local model translation. Do not discard a relevant Chinese result solely because its source language is Chinese.
  • The bridge's
    translation_queue
    is intermediate input to the local model; only translated English
    ready_context
    may be reused as later context.
  • Keep full command output in
    artifacts/logs/
    ; show only the marker, exit code, first actionable error, and artifact path in the conversation.
  • Use the
    devecocli
    installation and DevEco Studio toolchain resolved by the workflow environment. Do not overwrite the caller's PATH or mix executables from unrelated Node installations.
Prereqs: Node.js and npm,
devecocli
installed by the hackathon setup and on PATH, and an available DevEco Studio toolchain (
hvigor
,
ohpm
,
hdc
, etc.). Check with
devecocli -V
.
  • 使用与 Track 匹配的最短内部循环。对于本地或逻辑 更改,止步于 lint/构建;除非运行时行为在范围内,否则不要启动设备。
  • 对于 UI Track,截取一张初始屏幕截图并执行一轮经批准的交互验证。 在一次成功且未发生变化的验证后,不要重复执行构建、运行、布局分析或屏幕截图。
  • 对于模块范围内的源码更改,优先使用
    devecocli build --modules <module> --build-mode debug
    ,然后使用
    devecocli run --skip-build --device <serial> --module <module>
    。仅当 项目拥有有效的
    .hvigor
    hot-reload 文件且用户路径不需要全新安装时,才使用
    --hotreload-apply
    。文件级重新编译仍由 Hvigor 的依赖关系图控制;绝不能承诺 任意编辑都能单独编译。
  • 绝不打印未经过滤的
    devecocli log
    结果。通过
    compact_command.py
    捕获,或立即使用
    rg "TypeError|JS_ERROR|Fatal|ERROR"
    过滤。
  • 绝不将原始
    devecocli docs search
    输出传入对话。请使用
    devecocli_docs_bridge.py
    ,它会修正
    --format json --limit 3
    、移除过长字段, 并将简短的非英语片段标记为需要由本地模型翻译。 不要仅因结果源语言为中文就丢弃相关的中文结果。
  • 该 bridge 的
    translation_queue
    是供本地模型处理的中间输入;只有经过翻译的 英文
    ready_context
    可在后续上下文中复用。
  • 将完整命令输出保存在
    artifacts/logs/
    中;在对话中仅展示标记、退出码、 首个可操作错误和 artifact 路径。
  • 使用工作流环境所解析到的
    devecocli
    安装和 DevEco Studio 工具链。 不要覆盖调用方的 PATH,也不要混用来自无关 Node 安装的可执行文件。
前置条件: Node.js 和 npm、由 hackathon setup 安装且位于 PATH 中的
devecocli
, 以及可用的 DevEco Studio 工具链(
hvigor
、
ohpm
、
hdc
等)。使用
devecocli -V
检查。

Windows toolchain selection

Windows 工具链选择

Require the caller's
PATH
to put the DevEco Studio Node directory first, followed by the npm global bin directory and DevEco toolchain directories. Do not hard-code, probe, or modify installation paths in this skill. Verify the resolved tools:
powershell
Get-Command node, npm, devecocli
node --version; npm --version; devecocli -V
Do not mix executables from different Node installations. If the resolved tools are not the intended DevEco environment, stop and report the PATH issue.
要求调用方的
PATH
将 DevEco Studio Node 目录置于首位,随后是 npm 全局 bin 目录和 DevEco 工具链目录。此 skill 不得硬编码、探测或修改安装路径。验证解析到的工具:
powershell
Get-Command node, npm, devecocli
node --version; npm --version; devecocli -V
不要混用来自不同 Node 安装的可执行文件。如果解析到的工具并非预期的 DevEco 环境, 则停止操作并报告 PATH 问题。

Verified CLI Reference

已验证的 CLI 参考

Windows runner

Windows 运行器

Use
devecocli build
as the default build command. Do not invoke
hvigorw assembleHap
directly unless the user explicitly requests lower-level Hvigor diagnostics. Put the DevEco Studio Node directory first on
PATH
before invoking the CLI:
C:\Program Files\Huawei\DevEco Studio\tools\node
.
Run
devecocli build
with a bounded timeout. Treat a non-zero CLI exit code or
BUILD FAILED
,
ERROR
, or
Script Error
as an immediate build failure. On timeout, record
DEVECOCLI_BUILD_TIMEOUT
; do not kill unrelated Node, Java, or Hvigor processes.
After each build command, report
DEVECOCLI_BUILD_EXIT_CODE=<code>
. Build completion requires exit code
0
and successful build output.
These commands and flags were verified against the installed
devecocli
CLI. Do not repeatedly call
--help
for them. Run help only when the CLI version changes or a needed command/argument is not listed here.
PurposeCommand
Version
devecocli -V
Lint
devecocli check lint --format json <project-root>
Build
devecocli build
Devices
devecocli device list --format json
(use the device name if the serial is redacted)
Device details
devecocli device view
Install and launch
devecocli run --skip-build --module <module> --device <serial>
UI layout
devecocli ui layout --device <device-name>
UI screenshot`devecocli ui screenshot --device <device-name> --path <directory
UI click
devecocli ui click --device <device-name> <x> <y>
UI text
devecocli ui text --device <device-name> <text> [x] [y]
Logs
devecocli log
If
devecocli check lint
or
devecocli build
returns a Windows
spawn EINVAL
, record the DevEco CLI/toolchain blocker and stop that verification step.
For
devecocli ui text
, whitespace-containing input may be rejected by some CLI versions; use a single token or explicit coordinates and record the issue in
conductor/learning.md
. Do not switch to raw
hdc
without confirmation.
使用
devecocli build
作为默认构建命令。除非用户明确要求更底层的 Hvigor 诊断,否则不要直接调用
hvigorw assembleHap
。调用 CLI 前,将 DevEco Studio Node 目录 放在
PATH
首位:
C:\Program Files\Huawei\DevEco Studio\tools\node
。
使用有界超时运行
devecocli build
。CLI 返回非零退出码,或出现
BUILD FAILED
、
ERROR
或
Script Error
时,立即视为构建失败。超时时,记录
DEVECOCLI_BUILD_TIMEOUT
;不要终止无关的 Node、Java 或 Hvigor 进程。
每次构建命令后,报告
DEVECOCLI_BUILD_EXIT_CODE=<code>
。构建完成要求退出码为
0
且构建输出成功。
以下命令和标志已针对已安装的
devecocli
CLI 进行验证。 不要反复为它们调用
--help
。仅当 CLI 版本发生变化,或所需命令/参数未在此处 列出时才运行帮助。
用途命令
版本
devecocli -V
Lint
devecocli check lint --format json <project-root>
构建
devecocli build
设备
devecocli device list --format json
(序列号被脱敏时使用设备名称)
设备详情
devecocli device view
安装并启动
devecocli run --skip-build --module <module> --device <serial>
UI 布局
devecocli ui layout --device <device-name>
UI 截图`devecocli ui screenshot --device <device-name> --path <directory
UI 点击
devecocli ui click --device <device-name> <x> <y>
UI 文本
devecocli ui text --device <device-name> <text> [x] [y]
日志
devecocli log
如果
devecocli check lint
或
devecocli build
返回 Windows
spawn EINVAL
, 请记录 DevEco CLI/工具链阻塞问题,并停止该验证步骤。
对于
devecocli ui text
,某些 CLI 版本可能会拒绝包含空白的输入;请使用单个词元或 显式坐标,并将问题记录到
conductor/learning.md
。未经确认,不要切换为直接使用原始
hdc
。

When to use

何时使用

Trigger on: "build the app", "deploy / run it on device", "lint these files", "grab the logs", "take a screenshot", "tap this button", "why is it crashing on launch", or a verification request from a Conductor Track. Project scaffolding, standalone system-app privilege/signing work, and system-bundle development are outside this skill's scope.
触发条件:“构建应用”、“部署 / 在设备上运行”、“对这些文件执行 lint”、“获取 日志”、“截取屏幕截图”、“点击此按钮”、“为什么启动时崩溃”,或来自 Conductor Track 的 验证请求。项目脚手架、独立的系统应用权限/签名工作以及系统 bundle 开发均不在此 skill 的范围内。

Directives

指令

  1. CLI-first. Use
    devecocli
    for build, install, launch, lint, logs, and UI operations. Use the verified CLI references above instead of repeatedly probing
    --help
    .
  2. Lint timing. For non-UI changes or an explicit lint request, run
    devecocli check lint --format json
    after editing and resolve errors; use its automatic-fix option only after reviewing the proposed changes. For UI changes executed under Conductor, the first post-implementation action is the build-to-device checkpoint; run lint after the user approves the current UI and before final verification or commit. Resolve errors; justify warnings. If lint or build fails, update the project's
    conductor/learning.md
    before retrying and display the updated Lessons Learned. If the project is not Conductor-managed, use
    artifacts/logs/learning.md
    as the fallback log; create it with a
    # Learning Log
    heading when needed. A non-zero exit or explicit
    BUILD FAILED
    result ends the current command and the current verification step. Capture the first actionable cause, update and display the learning log, then return a concise failure report. Do not wait after the launcher has exited, continue to device/UI validation, or retry implicitly. A retry requires a separately announced recovery step and must not happen for a missing launcher or command-not-found error. 3. Build completion is a two-part check. A build is successful only when the DevEco build result is successful and
    devecocli
    returns exit code
    0
    . Always print or capture
    DEVECOCLI_BUILD_EXIT_CODE=<code>
    after the command. If the exit code is non-zero, the build is failed and the workflow must return the failure immediately. Do not start device validation while the command is still running after the success marker. A persistent Hvigor daemon alone is normal.
  3. Build-to-device gate. After a successful build, always run
    devecocli device list
    before deployment.
    devecocli run
    accepts a device serial or name. If the serial contains
    [IP_ADDRESS]
    or another redaction placeholder, use the displayed device name instead. If no device is listed, do not stop at a generic "blocked" report: this is commonly a first-time-emulator issue (no virtual device created yet, or its system image was never downloaded) rather than a CLI problem — see
    references/troubleshooting.md
    and hand the Device Manager steps to the user as an explicit manual step, then wait. If multiple devices are listed, ask the user to select one and never silently choose one. A
    Connected
    row is only discovery evidence, not an install readiness check. Keep the real serial in a shell variable instead of copying a redacted address from displayed output:
    $serial = (hdc list targets | Where-Object { $_ -match ':\\d+$' } | Select-Object -First 1).Trim()
    . Run
    hdc -t $serial shell echo hdc-ready
    . If that command fails, run
    hdc kill -r
    ,
    hdc tconn $serial
    , and the shell check again. Stop if the shell check still fails; do not attempt install or launch.
  4. No destructive device operations without confirmation. Treat uninstalling apps, modifying device data, and deleting emulators as destructive.
  5. UI inspection. Use
    devecocli ui layout
    and
    devecocli ui screenshot
    . Use the documented
    devecocli ui click
    ,
    doubleclick
    ,
    longclick
    ,
    swipe
    ,
    fling
    ,
    dircfling
    , and
    drag
    commands for interaction.
  6. Implementation handoff. Before verification, read the changed files and any Conductor handoff/API-evidence artifacts. Confirm the target module, SDK/API level, state-management version, expected user paths, and known risks. Do not infer missing acceptance criteria from the source code.
  7. ArkUI diagnosis. If lint/build fails on an ArkUI API, import, callback type, state decorator, rendering rule, or API-level issue, classify the first actionable error and use
    hmos-arkts-knowledge-retriever
    or the ArkUI references before proposing a fix. Do not mechanically replace
    @ohos.*
    with
    @kit.*
    ; verify the current SDK and project convention first.
  8. State-management migration. If the handoff declares a migration, read the migration inventory and target version before verification. Check for unresolved V1 decorators, invalid V1/V2 mixing, incomplete parent/child event flow, missing V2 initialization, and unsupported APIs. If the handoff does not declare a migration, do not suggest V1-to-V2 conversion as an incidental cleanup.
  1. CLI 优先。 使用
    devecocli
    完成构建、安装、启动、lint、日志和 UI 操作。 使用上述已验证的 CLI 参考,不要反复探测
    --help
    。
  2. Lint 时机。 对于非 UI 更改或明确的 lint 请求,在编辑后运行
    devecocli check lint --format json
    并解决错误;只有在审查过建议的更改后, 才能使用其自动修复选项。对于在 Conductor 下执行的 UI 更改,实现后的第一项操作 是构建到设备检查点;在用户批准当前 UI 后、最终验证或提交之前运行 lint。 解决错误;为警告说明理由。如果 lint 或构建失败,请在重试前更新项目的
    conductor/learning.md
    ,并展示更新后的 Lessons Learned。 如果项目不由 Conductor 管理,则使用
    artifacts/logs/learning.md
    作为回退日志; 需要时创建带有
    # Learning Log
    标题的文件。 非零退出或明确的
    BUILD FAILED
    结果将终止当前命令和当前验证步骤。 捕获首个可操作原因,更新并展示学习日志,然后返回简洁的失败报告。 启动器退出后不要继续等待,不要继续执行设备/UI 验证,也不要隐式重试。 重试需要单独宣布恢复步骤,并且缺少启动器或出现 command-not-found 错误时不得重试。 3. 构建完成需要双重检查。 只有 DevEco 构建结果成功且
    devecocli
    返回退出码
    0
    时, 构建才算成功。命令后始终打印或捕获
    DEVECOCLI_BUILD_EXIT_CODE=<code>
    。如果退出码非零, 则构建失败,工作流必须立即返回失败信息。如果命令在显示成功标记后仍在运行, 不要启动设备验证。持续运行的 Hvigor daemon 本身属于正常现象。
  3. 构建到设备门禁。 构建成功后,部署前始终运行
    devecocli device list
    。
    devecocli run
    接受设备序列号或名称。如果序列号包含
    [IP_ADDRESS]
    或其他脱敏占位符, 请改用显示的设备名称。如果没有列出设备,不要仅返回笼统的“受阻”报告:这通常是 首次使用模拟器的问题(尚未创建虚拟设备,或从未下载其系统镜像),而不是 CLI 问题—— 参见
    references/troubleshooting.md
    , 将 Device Manager 步骤作为明确的手动步骤交给用户,然后等待。如果列出多个设备, 请让用户选择一个,绝不能静默选择。
    Connected
    行仅是发现设备的证据,并不代表已具备安装条件。 将真实序列号保存在 shell 变量中,而不是从显示的输出里复制已脱敏的地址:
    $serial = (hdc list targets | Where-Object { $_ -match ':\d+$' } | Select-Object -First 1).Trim()
    。 运行
    hdc -t $serial shell echo hdc-ready
    。如果该命令失败,运行
    hdc kill -r
    、
    hdc tconn $serial
    ,然后再次执行 shell 检查。如果 shell 检查仍然失败则停止; 不要尝试安装或启动。
  4. 未经确认,不得执行破坏性设备操作。 将卸载应用、 修改设备数据和删除模拟器视为破坏性操作。
  5. UI 检查。 使用
    devecocli ui layout
    和
    devecocli ui screenshot
    。 对于交互操作,使用已记录的
    devecocli ui click
    、
    doubleclick
    、
    longclick
    、
    swipe
    、
    fling
    、
    dircfling
    和
    drag
    命令。
  6. 实现交接。 验证前,读取变更文件和所有 Conductor 交接/API 证据 artifacts。 确认目标模块、SDK/API 级别、状态管理版本、预期用户路径和已知风险。 不要从源代码推断缺失的验收标准。
  7. ArkUI 诊断。 如果 lint/构建因 ArkUI API、导入、回调类型、状态装饰器、 渲染规则或 API 级别问题而失败,请对首个可操作错误进行分类,并在提出修复方案前使用
    hmos-arkts-knowledge-retriever
    或 ArkUI references。 不要机械地将
    @ohos.*
    替换为
    @kit.*
    ;先验证当前 SDK 和项目约定。
  8. 状态管理迁移。 如果交接声明了迁移,请在验证前读取迁移清单和目标版本。 检查未解决的 V1 装饰器、无效的 V1/V2 混用、不完整的父子事件流、缺失的 V2 初始化 和不受支持的 API。如果交接未声明迁移, 不要将 V1 到 V2 的转换作为附带清理工作提出。

Inner-loop workflow

内部循环工作流

For a UI track running under Conductor:
  1. Edit sources after the written work plan is approved.
  2. Build —
    devecocli build
    . Treat the build as complete only after the command exit check and successful build output. On failure, stop, capture the failing phase and first actionable error, update the applicable learning log, display the lesson, fix the cause, then rerun the failed build-to-device checkpoint.
  3. Device gate — run
    devecocli device list
    after build success. Stop if there is no target; resolve multiple targets explicitly and select the target serial.
  4. Install and launch —
    devecocli run --skip-build --module <module> --device <serial>
    . If HDC reports
    connect-key
    or
    Not match target founded
    , run
    hdc kill -r
    , reconnect with
    hdc tconn $serial
    , verify
    hdc list targets
    , then rerun the shell readiness check. Retry deployment only after the shell check passes.
  5. Observe and pause — capture the first screenshot, then use the interactive
    question
    tool to ask for UI approval and automated interaction consent. Record interaction consent immediately with
    record_test_consent.py
    , before lint or any tap/type action. If the UI is rejected, return to Edit and repeat steps 2-5. If the question tool cannot render, use a Markdown table only after the tool call fails or is dismissed.
  6. Lint after UI approval —
    devecocli check lint --format json <project-root>
    .
  7. Regression observe
    • Logs:
      devecocli log
      for HiLog output or crash logs.
    • Screenshot:
      devecocli ui screenshot
      .
    • Layout:
      devecocli ui layout
      .
    • Drive: use the
      devecocli ui
      interaction commands listed above.
    • Record: report each planned user path as pass, fail, or blocked and attach its screenshot/log evidence. A successful launch alone is not UI-path validation.
    • Migration paths: when applicable, report simple state updates, nested-object updates, parent/child communication, list mutations, persistence restore, and animation behavior separately.
对于在 Conductor 下运行的 UI Track:
  1. 编辑 — 在书面工作计划获批后编辑源码。
  2. 构建 —
    devecocli build
    。仅在命令退出检查和成功构建输出后, 才视为完成。 失败时,停止,捕获失败阶段和首个可操作错误,更新适用的 learning log, 展示经验教训,修复原因,然后重新运行失败的构建到设备检查点。
  3. 设备门禁 — 构建成功后运行
    devecocli device list
    。如果没有目标设备则停止; 明确解决多目标设备问题并选择目标序列号。
  4. 安装并启动 —
    devecocli run --skip-build --module <module> --device <serial>
    。 如果 HDC 报告
    connect-key
    或
    Not match target founded
    ,运行
    hdc kill -r
    、 通过
    hdc tconn $serial
    重新连接,验证
    hdc list targets
    ,然后重新运行 shell 就绪检查。 只有 shell 检查通过后才能重试部署。
  5. 观察并暂停 — 截取第一张屏幕截图,然后使用交互式
    question
    工具请求 UI 批准和自动化交互同意。必须立即使用
    record_test_consent.py
    记录交互同意,且要在 lint 或任何点击/输入操作之前完成。如果 UI 被拒绝, 返回编辑阶段并重复步骤 2-5。如果 question 工具无法渲染,只有在工具调用失败或被关闭后, 才使用 Markdown 表格。
  6. UI 批准后执行 Lint —
    devecocli check lint --format json <project-root>
    。
  7. 回归观察
    • 日志: 使用
      devecocli log
      获取 HiLog 输出或崩溃日志。
    • 屏幕截图:
      devecocli ui screenshot
      。
    • 布局:
      devecocli ui layout
      。
    • 操作: 使用上述列出的
      devecocli ui
      交互命令。
    • 记录: 将每个规划的用户路径报告为通过、失败或受阻,并附上对应的 屏幕截图/日志证据。仅成功启动并不能证明 UI 路径已通过验证。
    • 迁移路径: 适用时,分别报告简单状态更新、嵌套对象更新、父子通信、 列表变更、持久化恢复和动画行为。

Recipes

配方

Quick rebuild & reinstall

快速重新构建并重新安装

devecocli check lint --format json <project-root>
→
devecocli build
plus exit-code verification →
devecocli device list
→
devecocli run --skip-build
→
devecocli log
.
devecocli check lint --format json <project-root>
→
devecocli build
及退出码验证 →
devecocli device list
→
devecocli run --skip-build
→
devecocli log
。

Windows build-process verification

Windows 构建进程验证

Run
devecocli build
and report
DEVECOCLI_BUILD_EXIT_CODE=0
together with successful build output. Never report the Track complete from an exit code alone.
运行
devecocli build
,并结合成功构建输出报告
DEVECOCLI_BUILD_EXIT_CODE=0
。 绝不能仅凭退出码就报告 Track 完成。

Diagnose a runtime crash

诊断运行时崩溃

devecocli build
→
devecocli run --skip-build
to reproduce →
devecocli log
to inspect HiLog and crash output.
devecocli build
→
devecocli run --skip-build
复现问题 →
devecocli log
检查 HiLog 和崩溃输出。

UI validation against a design

针对设计稿的 UI 验证

devecocli ui layout --device <device-name>
→
devecocli ui screenshot --device <device-name> --path artifacts/snapshots/<task_id>.png
→ read & compare. Read
build-profile.json5
for the target API level (table below) — some components render differently across levels.
devecocli ui layout --device <device-name>
→
devecocli ui screenshot --device <device-name> --path artifacts/snapshots/<task_id>.png
→ 读取并对比。读取
build-profile.json5
以获取目标 API 级别(见下表)——某些组件在不同级别下的渲染方式不同。

UI validation against acceptance paths

针对验收路径的 UI 验证

For each UI Track, obtain the initial state, actions, expected result, and evidence path from the implementation handoff. Execute the smallest meaningful regression path after launch. Include empty, loading, error, and persistence states when they are in scope.
For a non-UI track, use the shorter sequence: Edit -> Lint -> Build -> Device gate when applicable -> Run/Tests -> Logs.
对于每个 UI Track,从实现交接中获取初始状态、操作、预期结果和证据路径。 启动后执行最小但有意义的回归路径。在范围内时,应包括空状态、加载状态、错误状态和持久化状态。
对于非 UI Track,使用更短的序列:编辑 -> Lint -> 构建 -> 适用时进行设备门禁 -> 运行/测试 -> 日志。

API or ArkUI diagnostic failure

API 或 ArkUI 诊断失败

When a compiler or lint failure concerns an API or ArkUI rule:
  1. Stop at the first actionable error.
  2. Check the local ArkUI references.
  3. Call
    hmos-arkts-knowledge-retriever
    if the signature, import, or version is unclear.
  4. Record the evidence and first fix attempt in the applicable learning log.
  5. Let the implementation skill apply the source change, then rerun this skill's gates.
当编译器或 lint 失败涉及 API 或 ArkUI 规则时:
  1. 在首个可操作错误处停止。
  2. 检查本地 ArkUI references。
  3. 如果签名、导入或版本不明确,调用
    hmos-arkts-knowledge-retriever
    。
  4. 将证据和首次修复尝试记录到适用的 learning log。
  5. 由实现 skill 应用源码更改,然后重新运行此 skill 的各项门禁。

State-management migration validation

状态管理迁移验证

For a V1/V2 migration, use the migration matrix to drive verification. At minimum, check decorator coverage, state refresh, parent-to-child updates, child-to-parent events, list insert/delete/update behavior, application-level state, and persistence after relaunch when those capabilities are in scope. A successful compile does not prove semantic equivalence.
对于 V1/V2 迁移,使用迁移矩阵驱动验证。至少应检查装饰器覆盖范围、状态刷新、 父到子更新、子到父事件、列表插入/删除/更新行为、应用级状态,以及在相关能力范围内 重新启动后的持久化表现。成功编译并不能证明语义等价。

Dependency change

依赖项更改

Edit
oh-package.json5
→
devecocli build
(run
ohpm install
when needed).
编辑
oh-package.json5
→
devecocli build
(必要时运行
ohpm install
)。

Common raw-device ops (no dedicated command)

常见的原始设备操作(无专用命令)

  • List targets:
    hdc list targets -v
  • For operations not exposed by DevEco CLI, ask for confirmation before using the underlying DevEco toolchain command. Do not invent an equivalent
    devecocli
    subcommand.
  • 列出目标:
    hdc list targets -v
  • 对于 DevEco CLI 未提供的操作,使用底层 DevEco 工具链命令前必须先请求确认。 不要虚构等效的
    devecocli
    子命令。

SDK / API level reference

SDK / API 级别参考

Read
build-profile.json5
for
compatibleSdkVersion
/
targetSdkVersion
.
读取
build-profile.json5
以获取
compatibleSdkVersion
/
targetSdkVersion
。

Out of scope

不在范围内

  • Scaffolding or templating a fresh project.
  • System/persistent bundle development and OHOS source-tree builds.
  • Product discovery, Track planning, and architecture decisions owned by Conductor or the architecture specialist.
  • 新项目的脚手架搭建或模板生成。
  • 系统/持久化 bundle 开发和 OHOS 源码树构建。
  • 由 Conductor 或架构专家负责的产品发现、Track 规划和架构决策。

References

References

App-engineering knowledge for ArkTS / ArkUI work — this skill is the canonical home; the other skills point here rather than restating it:
  • references/arkts-strict.md
    — ArkTS strict-mode rules the compiler /
    devecocli check lint --format json
    enforce.
  • references/architecture.md
    — Clean-Architecture layering for ArkTS apps (Domain / Data / Presentation).
  • references/troubleshooting.md
    — common
    devecocli
    build / SDK failures and fixes.
  • references/arkui-validation.md
    — ArkUI handoff, diagnostic routing, and UI-path verification guidance.
  • references/state-migration-validation.md
    — V1/V2 migration preflight and behavioral regression matrix.
用于 ArkTS / ArkUI 工作的 App 工程知识——本 skill 是标准归属; 其他 skill 均指向这里,而不在此重复:
  • references/arkts-strict.md
    — 编译器/
    devecocli check lint --format json
    强制执行的 ArkTS 严格模式规则。
  • references/architecture.md
    — ArkTS 应用的 Clean-Architecture 分层(Domain / Data / Presentation)。
  • references/troubleshooting.md
    — 常见的
    devecocli
    构建/SDK 失败及修复方法。
  • references/arkui-validation.md
    — ArkUI 交接、 诊断路由和 UI 路径验证指南。
  • references/state-migration-validation.md
    — V1/V2 迁移预检和行为回归矩阵。