harmony-skills
v1.0.2
Published
HarmonyOS ArkTS 开发技能集合 — 复制、评分、录屏、截屏、分享等常用功能的代码模板
Downloads
472
Maintainers
Readme
HarmonyOS ArkTS 技能集合
HarmonyOS Next(纯血鸿蒙)ArkTS 开发的常用功能代码模板集合,包含 5 个即拿即用的技能:
| 技能 | 功能 | 核心 API |
|------|------|----------|
| 📋 add-copy-feature | 复制到剪贴板 | pasteboard |
| ⭐ add-harmonyos-app-rate | 应用评分(双策略降级) | commentManager + Want |
| 🎬 add-screen-recording | 屏幕录制 | AVScreenCaptureRecorder |
| 📸 capture-snapshot | 组件截屏 | getComponentSnapshot |
| 🔗 implement-share | 系统分享 | ShareController |
用法
一键安装(推荐)
npx harmony-skills这会将全部 5 个技能下载到你当前目录的 harmony-skills/ 文件夹中。
安装指定技能
npx harmony-skills capture-snapshot
npx harmony-skills add-copy-feature add-screen-recording查看可用技能
npx harmony-skills --list查看帮助
npx harmony-skills --help输出结构
运行命令后,当前目录下会生成:
harmony-skills/
├── add-copy-feature/
│ └── SKILL.md
├── add-harmonyos-app-rate/
│ └── SKILL.md
├── add-screen-recording/
│ ├── SKILL.md
│ └── references/
│ └── full-implementation.md
├── capture-snapshot/
│ └── SKILL.md
└── implement-share/
└── SKILL.md每个 SKILL.md 是完整的自包含文档,包含代码模板、使用步骤、注意事项。
在其他项目中使用这些代码
每个 SKILL.md 中的代码片段可以直接复制到你的 HarmonyOS 项目中使用。只需:
- 按
npx harmony-skills下载 - 打开对应技能的
SKILL.md - 按文档中的导入声明和代码模板复制到你的项目
手动下载
你也可以直接克隆仓库:
git clone https://gitee.com/itoak/harmony-skills.git或在浏览器中打开 Gitee 仓库 在线阅读。
