An intelligent build helper for OpenHarmony components that automates target identification and compilation.

Install

mkdir -p .claude/skills/hb-build && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/11704" && unzip -o skill.zip -d .claude/skills/hb-build && rm skill.zip

Installs to .claude/skills/hb-build

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

智能编译 ability_runtime 组件,通过检测修改的文件自动确定编译目标。支持多目标一起编译、自动重试判断、智能错误分析。触发关键词:"编译"、"构建"、"compile"、"build"、"make"、"make file"。
119 charsno explicit “when” trigger
Intermediate

Key capabilities

  • Automatically detect modified files to determine compilation targets
  • Compile specific `ability_runtime` services by SO name or full path
  • Compile multiple services together in one command
  • Perform full repository compilation for `ability_runtime`
  • Support fast compilation and automatic retry on failure
  • Analyze compilation errors and provide intelligent feedback

How it works

The skill detects modified files in the `ability_runtime` repository, infers compilation targets, and executes `hb build` commands. It supports automatic retries and error analysis.

Inputs & outputs

You give it
Modified files in `ability_runtime` or specified compilation targets
You get back
Compiled `ability_runtime` components or services

When to use hb-build

  • Build ability_runtime components
  • Compile specific services
  • Run incremental builds
  • Analyze compilation errors

About this skill

hb-build - Ability Runtime 智能编译工具

自动检测修改的文件并智能编译 ability_runtime 组件,支持多目标编译和自动重试。

快速开始

自动检测并编译(推荐)

python3 scripts/helper.py

编译特定服务

# SO 名称(推荐)
python3 scripts/helper.py --target libupms      # UriPermissionManager
python3 scripts/helper.py --target abilityms    # AbilityManagerService
python3 scripts/helper.py --target appms        # AppManagerService

# 完整路径
python3 scripts/helper.py --target \
  //foundation/ability/ability_runtime/services/uripermmgr:libupms

编译多个服务

python3 scripts/helper.py --target libupms abilityms appms

整仓编译

python3 scripts/helper.py --target full

工作流程

1. 切换到项目根目录(包含 build.py)
2. 检测修改文件 → git status --short
3. 过滤无关文件 → 排除 .claude/, build/, out/, *.md 等
4. 推断编译目标 → 统计每个服务的修改文件数
5. 智能决策 →
   • 目标数量 > 5 → 使用整仓编译
   • 目标数量 > 1 → 一起编译多个目标
   • 目标数量 = 1 → 编译单个目标
6. 执行编译 → hb build ability_runtime -i --build-target <TARGET>
7. 处理结果 → 成功或失败(支持智能重试)

参数概览

参数说明默认值
--target编译目标(支持多个)auto
--type编译类型(-i 功能代码 / -t 测试套)-i
--fast启用快速编译(--fast-rebuildfalse
--max-retries最大重试次数3
--auto-retry启用自动重试模式false

支持的编译目标

  • abilityms - AbilityManagerService (services/abilitymgr)
  • appms - AppManagerService (services/appmgr)
  • libupms - UriPermissionManager (services/uripermmgr)
  • dataobsms - DataObserverManager (services/dataobsmgr)
  • quickfixmgr - QuickFix Manager (services/quickfixmgr)
  • auto - 自动检测修改文件并推断编译目标
  • full - 编译整个 ability_runtime 组件

自动忽略的文件

以下文件和目录不会被检测为需要编译的修改:

  • .claude/, .hvigor/, build/, out/, .git/
  • services/dialog_ui/ams_system_dialog/.hvigor/
  • local.properties
  • *.md 文档文件

使用要求

必须满足的条件

  • 必须在 ability_runtime Git 仓库中运行
  • 项目根目录必须包含 build.py 文件
  • hb 命令必须在 PATH 中可用

已知的限制

  • 全仓编译(--target full)耗时较长(10-30 分钟)
  • 首次编译需要下载依赖包
  • ccache 未安装时会禁用编译缓存

详细文档

核心脚本

外部资源

When not to use it

  • When not working within the `ability_runtime` Git repository
  • When the project root does not contain `build.py`
  • When `hb` command is not available in PATH

Prerequisites

python3hb command in PATH

Limitations

  • Full repository compilation (`--target full`) can take 10-30 minutes
  • First compilation requires downloading dependency packages
  • Compilation caching is disabled if `ccache` is not installed

How it compares

This skill automates the compilation process for `ability_runtime` by intelligently detecting changes and managing build targets, unlike manually specifying each component for compilation.

Compared to similar skills

hb-build side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
hb-build (this skill)04moReviewIntermediate
turborepo612moReviewIntermediate
bazel-build-optimization142moNo flagsAdvanced
ml-pipeline-workflow95moNo flagsAdvanced

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

turborepo

vercel

Turborepo monorepo build system guidance. Triggers on: turbo.json, task pipelines, dependsOn, caching, remote cache, the "turbo" CLI, --filter, --affected, CI optimization, environment variables, internal packages, monorepo structure/best practices, and boundaries. Use when user: configures tasks/workflows/pipelines, creates packages, sets up monorepo, shares code between apps, runs changed/affected packages, debugs cache, or has apps/packages directories.

61191

bazel-build-optimization

wshobson

Optimize Bazel builds for large-scale monorepos. Use when configuring Bazel, implementing remote execution, or optimizing build performance for enterprise codebases.

14116

ml-pipeline-workflow

wshobson

Build end-to-end MLOps pipelines from data preparation through model training, validation, and production deployment. Use when creating ML pipelines, implementing MLOps practices, or automating model training and deployment workflows.

995

linkerd-patterns

wshobson

Implement Linkerd service mesh patterns for lightweight, security-focused service mesh deployments. Use when setting up Linkerd, configuring traffic policies, or implementing zero-trust networking with minimal overhead.

672

deployment-pipeline-design

wshobson

Design multi-stage CI/CD pipelines with approval gates, security checks, and deployment orchestration. Use when architecting deployment workflows, setting up continuous delivery, or implementing GitOps practices.

670

glab

NikiforovAll

Expert guidance for using the GitLab CLI (glab) to manage GitLab issues, merge requests, CI/CD pipelines, repositories, and other GitLab operations from the command line. Use this skill when the user needs to interact with GitLab resources or perform GitLab workflows.

664

Search skills

Search the agent skills registry