npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

cangjie-harmonyos-build

v1.0.0

Published

本项目用于辅助仓颉语言和鸿蒙应用开发,提供完整的 Skills 体系、文档检索和构建流程支持。

Readme

Cangjie & HarmonyOS 开发项目

本项目用于辅助仓颉语言和鸿蒙应用开发,提供完整的 Skills 体系、文档检索和构建流程支持。

项目介绍

本项目基于 OpenCode 框架,为仓颉语言和鸿蒙应用开发提供一套完整的 AI 辅助开发解决方案。主要特性包括:

  • Skills 体系: 涵盖仓颉语言基础、鸿蒙应用开发、文档检索、构建流程等完整技能链
  • L1 RAG 检索: 基于向量数据库(可选)和 BM25 混合检索,快速获取常用代码片段
  • L3 本地文档: 完整离线官方文档,包含 UI 开发、标准库、语法特性等
  • 自动构建: 鸿蒙应用自动化构建脚本,支持依赖安装、编译、打包等全流程
  • 问题沉淀: Evolution 机制自动记录构建问题,避免重复踩坑

项目结构

.
├── .opencode/
│   ├── skills/                         # Skills 目录
│   │   ├── base-skill/                 # 强制前置 Skill(项目生成入口)
│   │   ├── common-skill-l1/            # 仓颉基础技能
│   │   │   ├── array/                  # 数组操作
│   │   │   ├── string/                 # 字符串处理
│   │   │   ├── hashmap/                # HashMap 操作
│   │   │   ├── http_client/            # HTTP 客户端
│   │   │   ├── http_server/            # HTTP 服务端
│   │   │   ├── json/                   # JSON 编解码
│   │   │   ├── concurrency/            # 并发编程
│   │   │   └── ...                     # 更多基础技能
│   │   ├── common-skill-l2/            # L1→L3 混合检索 Skill
│   │   ├── cangjie-evolution/          # 仓颉项目问题沉淀
│   │   ├── harmonyos-build/            # 鸿蒙构建流程 Skill
│   │   ├── harmonyos-evolution/        # 鸿蒙项目问题沉淀
│   │   ├── harmonyos-l1-query/         # L1 RAG 检索 Skill
│   │   ├── harmonyos-l3-query/         # L3 本地文档搜索 Skill
│   │   ├── harmonyos-requirement-analysis/  # 需求分析 Skill
│   │   ├── harmonyos-stdx-dependency/  # stdx 依赖配置 Skill
│   │   └── cangjie-dev-harmonyos/      # 核心脚本与文档
│   │       ├── scripts/                # 构建脚本
│   │       │   ├── RAG_Lite            # RAG 知识库
│   │       │   ├── .env                # 参数配置
│   │       │   ├── ask_cangjie.py      # L1 查询脚本
│   │       │   ├── build.ps1           # 鸿蒙构建脚本
│   │       │   ├── cangjie_retriever.py# 检索脚本
│   │       │   ├── Database-Builder.py # 向量库构建脚本
│   │       │   ├── download_hm_docs.py # 官方文档下载脚本
│   │       │   ├── hm-docs.zip         # 官方文档压缩包
│   │       │   └── requirements.txt    # Python 依赖
│   │       └── Evolution.md            # 问题沉淀文档
│   └── script/                         # 其他工具脚本
├── outputs/                            # 生成的仓颉项目输出目录
└── AGENTS.md                           # OpenCode 项目规则配置

环境构建

前置要求

  1. OpenCode: 安装 OpenCode CLI 工具

    # macOS / Linux
    curl -fsSL https://opencode.ai/install | bash
       
    # Windows (推荐使用 WSL)
    # 或通过 npm 安装
    npm install -g opencode-ai

    详细安装教程请参阅 OpenCode 官方文档

  2. 仓颉开发环境: 安装仓颉 SDK (cjc 编译器、cjpm 包管理器)

    详细安装教程请参阅 仓颉官方文档

  3. 鸿蒙开发环境 (仅鸿蒙应用开发需要):

    • 安装 DevEco Studio
    • 安装 DevEco Studio Cangjie Plugin

    详细教程请参阅

    若无法下载 DevEco Studio Cangjie Plugin,请先到 HarmonyOS 仓颉语言开发者体验版招募官网 申请资格

  4. Python 环境:

    • Python 3.10+
    • pip 包管理器
  5. API KEY 获取:

    硅基流动 API KEY 获取

  6. 参数配置:

    编辑 .opencode/skills/cangjie-dev-harmonyos/scripts/.env:

    • DEVECO_HOME 后填入你自己的 DevEco Studio 安装根目录

      如:

      DEVECO_HOME=D:\Program Files\Huawei\DevEco Studio
    • DEVECO_SDK_HOME 后填入你自己的 DevEco Studio sdk 路径

      如:

      DEVECO_HOME=D:\Program Files\Huawei\DevEco Studio
    • SILICONFLOW_API_KEY 后填入你自己的 API KEY,格式: "sk-******"

      如:

      SILICONFLOW_API_KEY=sk-******

      若不配置,系统会自动跳过 L1 阶段,直接使用 L3 本地文档搜索。

    编辑 .opencode/skills/cangjie-dev-harmonyos/scripts/build.ps1:

    • $CangjieSdkRoot 后填入你自己的 cangjie-sdk 路径

      如:

      $CangjieSdkRoot = "C:\Users\{username}\.cangjie-sdk\6.0\cangjie"

安装步骤

  1. 初始化 OpenCode

    opencode
    # 在 OpenCode 中运行
    /init
  2. 安装 Python 依赖 (可选,启用 L1 RAG 功能)

    cd .opencode/skills/cangjie-dev-harmonyos/scripts
    pip install -r requirements.txt
  3. 初始化 L3 文档 (首次使用必须执行)

    cd .opencode/skills/cangjie-dev-harmonyos/scripts
    python ask_cangjie.py "test"

    此命令会自动解压 hm-docs.ziphm-docs/ 目录。

使用步骤

创建仓颉项目

在 OpenCode 中:

示例

创建一个仓颉计算器项目

OpenCode 会自动调用相关 skill 进行需求分析、项目构建、编译运行、生成文档

创建鸿蒙应用

首先需要使用 DevEco Studio 创建一个仓颉空项目([Cangjie] Empty Ability),然后将该项目(包含.opencode/、AGENTS.md)放到仓颉空项目的根目录下。在该根目录下打开 OpenCode :

示例

创建一个鸿蒙计算器应用

OpenCode 会自动调用相关 skill 进行需求分析、项目构建、编译运行