skills/openharmony-download/SKILL.md
Interactive OpenHarmony source code download with mirror selection (GitCode/Gitee/GitHub), environment checking, branch selection, and real-time progress. Use when user requests:"下载 OpenHarmony", "download OpenHarmony", "下载源码", "获取源码", "拉取代码", "clone openharmony", or "repo init".
npx skillsauth add openharmonyinsight/openharmony-skills openharmony-downloadInstall 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.
OpenHarmony 源码下载 Skill - 对话式信息收集 + 环境检查 + 前台实时下载。
AskUserQuestion({
questions: [{
header: "镜像源",
question: "请选择 OpenHarmony 镜像源",
options: [
{ label: "GitCode", description: "推荐国内用户,速度最快" },
{ label: "Gitee", description: "国内用户" },
{ label: "GitHub", description: "国际用户" }
],
multiSelect: false
}]
})
镜像源选择后,使用 Bash 工具逐项检查环境:
Bash({ command: "bash scripts/check_env.sh git", description: "Check git installation" })
Bash({ command: "bash scripts/check_env.sh git-lfs", description: "Check git-lfs installation" })
Bash({ command: "bash scripts/check_env.sh python3", description: "Check python3 installation" })
Bash({ command: "bash scripts/check_env.sh curl", description: "Check curl installation" })
Bash({ command: "bash scripts/check_env.sh repo", description: "Check repo installation" })
Bash({ command: "bash scripts/check_env.sh git-config", description: "Check git configuration" })
Bash({ command: "bash scripts/check_env.sh disk-space", description: "Check available disk space" })
检查失败时:显示错误 + 提供安装命令 + 等待用户修复 + 重新检查
常用安装命令:
sudo apt-get install git (Ubuntu/Debian)sudo apt-get install git-lfs && git lfs installgit config --global user.name "Your Name" && git config --global user.email "[email protected]"AskUserQuestion({
questions: [{
header: "分支",
question: "请选择 OpenHarmony 分支",
options: [
{ label: "master", description: "主分支(最新开发代码)" },
{ label: "OpenHarmony-5.1.0-Release", description: "5.1.0 版本" },
{ label: "OpenHarmony-5.0.3-Release", description: "5.0.3 版本" },
{ label: "OpenHarmony-5.0.2-Release", description: "5.0.2 版本" },
{ label: "OpenHarmony-5.0.1-Release", description: "5.0.1 版本" },
{ label: "OpenHarmony-4.1-Release", description: "4.1 版本" },
{ label: "自定义分支", description: "输入自定义分支名" }
],
multiSelect: false
}]
})
AskUserQuestion({
questions: [{
header: "目录",
question: "请选择下载目录",
options: [
{ label: "默认位置", description: "~/OpenHarmony/[branch]/" },
{ label: "自定义路径", description: "指定其他位置" }
],
multiSelect: false
}]
})
显示配置摘要,使用 AskUserQuestion 确认是否开始:
// 显示配置摘要
Claude: 好的,准备下载 OpenHarmony 源码:
配置摘要:
- 镜像源: ${MIRROR}
- 分支: ${BRANCH}
- 目录: ${DOWNLOAD_DIR}
- 并行任务: CPU核心数/4(自动计算)
下载将在前台运行,进度实时显示。
这将需要 30 分钟到数小时。
AskUserQuestion({
questions: [{
header: "确认",
question: "是否开始下载?",
options: [
{ label: "开始下载", description: "立即开始下载 OpenHarmony 源码" },
{ label: "返回重新配置", description: "返回步骤1,重新选择配置" }
],
multiSelect: false
}]
})
如果选择"开始下载":
使用 Bash 工具执行下载脚本,传入用户选择的镜像源、分支和目录参数:
Bash({
command: `bash scripts/download_openharmony.sh -m ${MIRROR} -b ${BRANCH} ${CUSTOM_DIR ? `-d ${CUSTOM_DIR}` : ''}`,
description: `Download OpenHarmony ${BRANCH} from ${MIRROR}`
})
下载将在前台运行,进度实时显示。
如果选择"返回重新配置": 返回步骤1,重新选择镜像源、分支、目录。
必需参数:
-m MIRROR 镜像源(gitcode|gitee|github)
-b BRANCH 分支名
可选参数:
-d DIR 下载目录(绝对路径)
-j JOBS 并行任务数(默认: CPU核心数/4)
用法: check_env.sh <check_type>
检查类型: git | git-lfs | python3 | curl | repo | git-config | disk-space | all
自动验证下载完整性(下载脚本自动调用):
✓ 验证通过!OpenHarmony 源码完整。
后续步骤:
1. 配置编译环境
2. 全量编译代码: ./build.sh --ccache --product-name rk3568
✗ 验证发现问题
建议:
1. 同步缺失仓库: repo sync -c
2. 拉取 LFS 文件: repo forall -c 'git lfs pull'
3. 检查网络连接
development
Run local code quality checks covering a subset of OpenHarmony gate CI (copyright, CodeArts C/C++) plus additional local checks (pylint/flake8, shellcheck/bashate, gn format). Use before committing to reduce gate failures. Triggers on: /oh-precommit-codecheck, "门禁检查", "门禁预检", "检查代码", "run codecheck", "check code quality", "lint my code", "代码检查", or after completing code implementation. WHEN to use: before git commit, before creating PR, after modifying C/C++/Python/Shell/GN files, when gate CI fails with codecheck defects, or when you want to preview what gate will flag.
development
OpenHarmony PR full lifecycle workflow. Five modes: - Commit: standardized commit with DCO sign-off and Issue linking - Create PR: commit + push to fork + create Issue + create PR on upstream - Fix Codecheck: fetch gate CI codecheck defects from a PR and auto-fix them - Review PR: fetch a PR's changes to local for code review - Fix Review: fetch unresolved review comments from a PR and auto-fix them Triggers on: /oh-pr-workflow, "提交代码", "创建PR", "提个PR", "commit", "修复告警", "修复门禁", "修复codecheck", "fix codecheck", "review pr", "review这个pr", "看下这个pr", "检视pr", "修复review", "修复检视意见", "fix review", or a GitCode PR URL with fix/review intent.
testing
分析 HM Desktop PRD 文档,提取需求信息、验证完整性、检查章节顺序(需求来源→需求背景→需求价值分析→竞品分析→需求描述)、检查 KEP 定义、检测需求冲突并生成结构化分析报告。适用于用户请求:(1) 分析或审查 PRD 文档, (2) 从需求中提取 KEP 列表, (3) 检查 PRD 完整性或一致性, (4) 将需求映射到模块架构, (5) 验证 PRD 格式合规性, (6) 验证竞品分析章节完整性。关键词:PRD分析, requirement extraction, KEP验证, completeness check, chapter order validation, 竞品分析检查, analyze PRD, 需求提取, 完整性检查, 章节顺序验证
development
基于 PRD 文档自动生成鸿蒙系统设计文档,包括架构设计文档和功能设计文档。生成前会分析 OpenHarmony 存量代码结构,确保与现有架构兼容。架构设计文档第2章必须为竞品方案分析,位于需求背景之后。适用于用户请求:(1) 生成架构设计文档, (2) 生成功能设计文档, (3) 从 PRD 生成设计文档, (4) 创建系统架构设计, (5) 编写功能规格说明, (6) 分析 OH 代码结构。关键词:architecture design, functional design, design doc, 竞品方案分析, OpenHarmony code analysis, 架构设计, 功能设计, 设计文档生成, OH代码分析, analyze codebase, competitor analysis