ohos-app-scaffold
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseOHOS App Scaffold
OHOS 应用脚手架
Create only the project skeleton from the Empty Ability template, then stop. Use the
CLI for project creation instead of manually copying a template. This
skill is a project-initialization skill, not an app-development skill. Building,
feature implementation, UI design, tests, and device validation belong to
after the project is created.
devecocliohos-app-dev仅基于 Empty Ability 模板创建项目骨架,然后停止。使用 CLI 创建项目,而不是手动复制模板。本 skill 是项目初始化 skill,而非应用开发 skill。构建、功能实现、UI 设计、测试和设备验证应在项目创建后交由 完成。
devecocliohos-app-devScope gate
范围判定
Before acting, separate the request into two possible intents:
- Scaffolding intent: create a new OHOS/HarmonyOS project, specify its app name, bundle name, project path, or API level. Handle this with this skill.
- Development intent: implement a todo list, login screen, database, networking,
custom UI, business logic, tests, or any other feature. Do not handle this with
this skill. Stop after scaffolding and ask whether the user wants to continue with
, or with
ohos-app-devfor privilege preflight when the requested APIs or permissions may requireohos-system-app-dev, an elevated APL, ACL/provisioning, or a Full SDK system API.hos_system_app
If a request contains both intents, perform only the scaffolding intent. Do not infer
permission to implement the requested feature merely because the user named the app
after that feature (for example, ).
TodoListPrereqs: Node.js and npm, the DevEco CLI installed by the hackathon setup and on PATH, and an available DevEco Studio toolchain (,hvigor,ohpm, etc.). Verify withhdc.devecocli -V
在执行前,将请求区分为两种可能的意图:
- 脚手架意图: 创建新的 OHOS/HarmonyOS 项目,并指定其应用名称、bundle 名称、项目路径或 API 级别。使用此 skill 处理。
- 开发意图: 实现待办事项列表、登录界面、数据库、网络、自定义 UI、业务逻辑、测试或任何其他功能。不要使用此 skill 处理。完成脚手架后停止,并询问用户是否希望继续使用 ;如果请求的 API 或权限可能需要
ohos-app-dev、提升的 APL、ACL/provisioning 或 Full SDK 系统 API,则改用hos_system_app进行权限预检。ohos-system-app-dev
如果请求同时包含这两种意图,仅执行脚手架意图。不要仅仅因为用户以某个功能命名应用,就推断用户允许实现该功能(例如 )。
TodoList前置条件: 具备 Node.js 和 npm、由 hackathon setup 安装且位于 PATH 中的 DevEco CLI,以及可用的 DevEco Studio 工具链(、hvigor、ohpm等)。使用hdc进行验证。devecocli -V
Windows toolchain selection
Windows 工具链选择
Require the caller's to contain the preferred DevEco Studio Node directory first,
followed by the npm global bin directory and the DevEco toolchain directories. Do not
hard-code, probe, or modify installation paths in this skill. Verify the resolved tools:
PATHpowershell
Get-Command node, npm, devecocli
node --version; npm --version; devecocli -VDo not mix executables from different Node installations. If the resolved , ,
or is not the intended DevEco environment, stop and report the PATH issue.
nodenpmdevecocli要求调用方的 PATH 首先包含首选的 DevEco Studio Node 目录,其次是 npm 全局 bin 目录和 DevEco 工具链目录。在此 skill 中,不要硬编码、探测或修改安装路径。验证解析到的工具:
powershell
Get-Command node, npm, devecocli
node --version; npm --version; devecocli -V不要混用来自不同 Node 安装的可执行文件。如果解析到的 、 或 并非预期的 DevEco 环境,则停止执行并报告 PATH 问题。
nodenpmdevecocliScaffold
脚手架
DevEco CLI creates a HarmonyOS application from the Empty Ability template. Provide the
project values as explicit options so the command is non-interactive:
devecocli create --project-path <project-dir> --app-name <AppName> --bundle-name <com.example.app> [--api-level <level>]Options:
- — project directory; defaults to
--project-path <project-dir>../<app-name> - — application name.
--app-name <AppName> - — bundle name; defaults to
--bundle-name <com.example.app>.com.example.<app-name> - — optional API level; it is auto-detected from the SDK when omitted, and the minimum supported value is 17.
--api-level <level>
The project path must be an explicit directory path and must not be . When the
current directory is the intended destination, pass its absolute path or its named
relative directory path (for example, rather than ).
../my-app.The DevEco CLI interface documents the Empty Ability template only; do not assume a Native C++
template or unsupported / flags.
--template--sdkDevEco CLI 基于 Empty Ability 模板创建 HarmonyOS 应用。通过显式选项提供项目参数,以确保命令以非交互方式运行:
devecocli create --project-path <project-dir> --app-name <AppName> --bundle-name <com.example.app> [--api-level <level>]选项:
- — 项目目录;默认为
--project-path <project-dir>。./<app-name> - — 应用名称。
--app-name <AppName> - — bundle 名称;默认为
--bundle-name <com.example.app>。com.example.<app-name> - — 可选的 API 级别;省略时自动从 SDK 检测,最低支持值为 17。
--api-level <level>
项目路径必须是显式的目录路径,且不能为 。当当前目录就是目标目录时,请传入其绝对路径或具名的相对目录路径(例如使用 ,而不是 )。
../my-app.DevEco CLI 接口仅记录了 Empty Ability 模板;不要假设存在 Native C++ 模板,也不要使用不受支持的 / 标志。
--template--sdkMandatory stop after scaffolding
脚手架完成后必须停止
After succeeds:
devecocli create- Report the generated project path, app name, bundle name, and API level.
- Confirm that only the CLI-generated scaffold was created.
- Stop. Do not open, rewrite, or enhance or any other generated source file.
Index.ets - Do not add feature code, resources, dependencies, tests, documentation, or configuration unrelated to the generated scaffold.
- Do not run , lint, run, install, or UI validation as part of this skill.
devecocli build
If the user also requested feature implementation, explicitly state that scaffolding is
complete and ask to continue with ; do not silently continue in the same step.
For a standalone app whose APIs or permissions may require privileged identity, ask to
continue with for privilege preflight instead.
ohos-app-devohos-system-app-devFor a separately requested development step, use for the inner loop
(lint → build → run → logs → UI). Use only when the user requests
Conductor-based orchestration. ArkTS strict-mode rules and app architecture guidance
live in (, ).
ohos-app-devconductor-devohos-app-devreferences/arkts-strict.mdreferences/architecture.md执行 成功后:
devecocli create- 报告生成的项目路径、应用名称、bundle 名称和 API 级别。
- 确认仅创建了 CLI 生成的脚手架。
- 停止。不要打开、重写或增强 或任何其他生成的源文件。
Index.ets - 不要添加功能代码、资源、依赖项、测试、文档或与生成的脚手架无关的配置。
- 在此 skill 的执行范围内,不要运行 、lint、run、install 或 UI 验证。
devecocli build
如果用户还要求实现功能,请明确说明脚手架已完成,并询问是否继续使用 ;不要在同一步中擅自继续。对于 API 或权限可能需要特权身份的应用,请改为询问是否继续使用 进行权限预检。
ohos-app-devohos-system-app-dev如果用户单独请求开发步骤,请使用 执行内部开发流程(lint → build → run → logs → UI)。仅当用户请求基于 Conductor 的编排时,才使用 。ArkTS 严格模式规则和应用架构指导位于 (、)。
ohos-app-devconductor-devohos-app-devreferences/arkts-strict.mdreferences/architecture.mdOut of scope
不在范围内
- Ordinary inner-loop work on an existing project → .
ohos-app-dev - Standalone apps that may require , elevated APL, ACL/provisioning, or a Full SDK system API →
hos_system_app.ohos-system-app-dev - System / persistent bundles (systemui, launcher, OHOS source-tree builds) → .
ohos-system-dev
- 对现有项目执行常规内部开发流程 → 。
ohos-app-dev - 可能需要 、提升的 APL、ACL/provisioning 或 Full SDK 系统 API 的独立应用 →
hos_system_app。ohos-system-app-dev - 系统/持久化 bundle(systemui、launcher、OHOS 源码树构建)→ 。
ohos-system-dev