huawei-cloud-find-skills
此技能用于在华为云技能库中快速搜索、发现并安装所需技能。用户只需描述需求(如管理 ECS、操作 OBS),即可自动匹配关键词、分类与中英文别名,返回最相关的技能列表,并指导通过 npx 或 GitHub 完成安装。适用于开发者寻找云资源管理、运维、自动化等技能的常用入口,大幅减少手工检索和排查成本。
npx skills add https://github.com/huaweicloud/huaweicloud-skills --skill huawei-cloud-find-skillsBefore / After 效果对比
1 组在没有此技能之前,用户需要在文档或网页中手动浏览数百个技能,逐个阅读描述,猜测关键词,反复尝试安装命令,往往耗时较长且可能安装错误。对于不熟悉技能目录的开发者,找到真正需要的技能非常困难。
此技能能够根据用户意图自动匹配中英文关键词和分类,秒级返回相关技能列表,并给出清晰的安装步骤。用户无需翻阅大量文档,即可快速定位并安装所需技能,显著提升效率。
[!IMPORTANT] When the user wants to search, discover, or install a Huawei Cloud (华为云) agent skill:
- Search — use this skill (
huawei-cloud-find-skills) to find the relevant Skill.- Install — install the matched Skill (see Step 3).
- Execute — follow the installed Skill's instructions to fulfill the request.
This skill handles skill discovery and installation only — it does not perform Huawei Cloud resource management/query tasks itself; those are handled by the skills it installs.
Overview
This skill enables users to efficiently search, discover, and install Huawei Cloud skills.
Dependency: Python 3.6+ and network access to gitcode.com (API v5 for the skill
index), gitee.com (backup index), and github.com / raw.githubusercontent.com (for skill details). Quality telemetry is collected automatically via
skill-quality-cli (installed by scripts/ensure_cli.sh if absent) — no other CLI
or credential is required.
Privacy & Telemetry
透明披露: 本 skill 在搜索与安装过程中会产生以下对外遥测上报。均为匿名聚合数据(技能名/类目/服务等元信息), 不包含用户输入内容、凭证、云资源数据或个人身份信息。质量上报默认开启(opt-out): 如需关闭, 设置环境变量
export SKILL_QUALITY_REPORT=0即可整体关闭。
| 上报内容 | 触发点 | 目的地 | 是否含敏感数据 |
|---|---|---|---|
| 搜索 top-3 曝光计数 | scripts/search-skills.py(每次搜索) | skills-dataset.developer.huaweicloud.com install-count API | 否(仅技能名/类目/服务) |
| 安装计数 | Step 3.1 curl(每次安装前) | skills-dataset.developer.huaweicloud.com install-count API | 否(仅 skill_id,即 skills/<category>/<name>) |
| 质量上报 | skill-quality-cli run 包装执行 | quality 上报 APIG(测试环境) | 否(执行状态/耗时/技能名) |
- 默认开启 / 关闭方式: 以上三类上报默认开启(未设置该环境变量即会上报);如需关闭, 执行
export SKILL_QUALITY_REPORT=0(skill-quality-cli与search-skills.py均遵循该开关)。 - 上报均为 fire-and-forget,永不阻塞搜索/安装主流程。
Scenario Description
This skill enables users to:
- Search Skills: Find skills by keyword, category, or both (matched against name, description, and triggers)
- Browse Categories: Explore available skill categories via
-l/--list-categories(see Step 1.5) - View Skill Details: Fetch full SKILL.md content from GitHub for specific skills
- Install Skills: Guide users through skill installation via
npx skills add(GitCode default),npx skills add https://clawhub.ai/huaweicloudskill/skills/<skill-name>(ClawHub), or fallback GitHub method
Architecture: Dual-source fallback (local cache → GitCode API v5 → Gitee raw) → In-memory search → GitHub raw fetch for details → Install
Use Cases
- "Find a skill for managing ECS instances"
- "What Huawei Cloud skills are available for OBS?"
- "华为云有哪些 VPC 相关的 skill?"
- "Browse all available Huawei Cloud skills"
- "Install a skill for RDS management"
- "帮我找一个华为云网络相关的skill"
Prerequisites
- Python 3.6+ must be installed and available as
python(orpython3) inPATH - Network access to
gitcode.com(API v5 for index),gitee.com(backup index), andgithub.com/raw.githubusercontent.com(for skill details) skill-quality-cli— MANDATORY (Step 0.1): ensured bybash scripts/ensure_cli.sh(idempotent, skips if already present). MUST be triggered on EVERY execution of this skill before running any search/install command.- Upgrade: run
skill-quality-cli upgrade(stays up to date on each run; manual control available) - 质量上报: 每次搜索(Step 1)与安装(Step 3)命令都必须用
skill-quality-cli run --skill-name huawei-cloud-find-skills --包装执行, 保证每次执行都触发质量上报
- Upgrade: run
Step 0: Check Python Environment
MANDATORY: Before running any script command, verify Python is available.
⚠️ Mandatory: every
hcloudcommand in this skill MUST be wrapped withskill-quality-cli run --skill-name huawei-cloud-find-skills --— barehcloudcalls are strictly forbidden.
# Check Python availability
python --version # or: python3 --version
If the command fails or returns Python 2.x:
- Install Python 3: Download from python.org or use a package manager:
# macOS brew install python3 # Ubuntu/Debian sudo apt-get install python3 # Windows — download installer from python.org, check "Add Python to PATH" - Verify after install: Run
python --versionagain to confirm Python 3.6+ is available - If
pythonpoints to Python 2: Usepython3instead ofpythonin all commands below
Step 0.1: Ensure skill-quality-cli (MANDATORY)
MANDATORY: Before running any search/install command, ensure
skill-quality-cliis installed and available. This step MUST be triggered on EVERY execution of this skill, immediately after Step 0. It is at the same mandatory level as Step 0: Check Python Environment — do not skip it even if you believe the CLI is already present (ensure_cli.shis idempotent and exits silently when everything is ready).披露: 该 CLI 仅用于本 skill 的匿名质量遥测上报(执行状态/耗时, 见 Privacy & Telemetry); 安装位置
~/.local/bin, 不修改系统 服务或全局配置; 关闭方式见 Privacy & Telemetry。
# Ensure ~/.local/bin is on PATH (where skill-quality-cli is installed)
export PATH="$HOME/.local/bin:$PATH"
# Ensure skill-quality-cli is ready (idempotent: installs only if absent;
# also auto-links the CLI into a writable PATH dir so the bare command works)
bash scripts/ensure_cli.sh
# Verify availability
command -v skill-quality-cli && skill-quality-cli version
| Outcome | Behavior |
|---|---|
| CLI already installed & usable | Silent pass — script exits immediately |
| CLI missing | Installs the latest release into ~/.local/bin/ (prints skill-quality-cli vX.Y.Z 已就绪) |
| Install fails (no network / channel unavailable) | Prints a warning; never blocks the flow |
安装通道(务必先读,避免误判为技能缺陷)
scripts/ensure_cli.sh是唯一安装入口(官方模板,勿改):调用官网 latest 接口 (skills-dataset.developer.huaweicloud.com)取回 OBS 预签名包地址,校验sha256后安装到~/.local/bin/;官方同时提供linux-arm64/linux-x86_64/windows-x86_64包。- 通道不可用 / 校验失败时仅告警并退出码
0,不阻塞搜索与安装技能;评测/CI 应视为环境不满足。- 该 CLI 只承载匿名质量遥测:拿不到它时搜索与安装流程照常可用(上报自动跳过)。
- 失败自检与手动安装覆盖:
references/cli-installation-guide.md。
ensure_cli.sh会自动把skill-quality-cli软链到PATH中第一个可写目录 (如/usr/local/bin),因此skill-quality-cli通常可直接调用。若仍不可用 (没有任何可写的 PATH 目录),请在当前 shell 执行:export PATH="$HOME/.local/bin:$PATH"
Step 0.5: Check KooCLI Version (NON-BLOCKING)
OPTIONAL: A KooCLI (
hcloud) availability/version check that never blocks the flow. Skills installed later may depend on KooCLI; this step warns early, then always continues to Step 1 regardless of the outcome.
# Check KooCLI availability & version (non-blocking)
python scripts/check-koocli.py
→ scripts/check-koocli.py (Python — cross-platform)
| Outcome | Behavior |
|---|---|
hcloud installed and version OK (≥ 3.0.0) | Silent pass — no output |
hcloud installed but too old | Prints an upgrade reminder (hcloud update -y) |
hcloud not installed | Prints an install reminder (official KooCLI guide link) |
The script always exits
0— it is informational only and never interrupts search or installation.
Repository Info
INDEX_REPO=developer-skill/skills-group-contribution
INDEX_BRANCH=test-for-index
SKILLS_REPO=huaweicloud/huaweicloud-skills
SKILLS_BRANCH=master
RAW_BASE=https://raw.githubusercontent.com/$SKILLS_REPO/$SKILLS_BRANCH
Category Ownership & External Dependency
本技能是通用检索技能(skill discovery / install),不属于 OBS 或任何具体云服务技能。
- 索引中的类目归属应为
common/utility(即common下的通用/工具类目);不得出现在devtools/common/obs等具体服务类目下,也不得被obs服务类目聚合命中。 - 本仓库不含
index.json:类目由外部索引仓库developer-skill/skills-group-contribution(分支test-for-index,skills-index/index.json)的生成流程写入。→ 类目修正属外部依赖, 责任方:该索引仓库的维护方(本技能的类目元数据由其发布流程生成)。 - 本仓库一侧的处理:不在 frontmatter 追加
service字段(索引侧尚未确认支持该字段, 硬加只会制造第二处不一致),只在此处标注归属与依赖,交由索引侧一次性修正。 - 验收口径(索引侧执行):
-c devtools/common/obs的结果中不再出现huawei-cloud-find-skills, 而-c common(或-c common/utility)可以检索到它。
Index Source
The search script uses a dual-source fallback for resilient data loading:
1. Local cache (~/.cache/huawei-cloud-find-skills/, TTL 1h) — fastest, no network
2. GitCode API v5 (primary) — WAF rate-limited, no X-RateLimit headers
3. Gitee raw (backup) — independent IP/WAF, switched on 429
Primary source (GitCode API v5):
SKILLS_INDEX_URL=https://gitcode.com/api/v5/repos/developer-skill/skills-group-contribution/contents/skills-index/index.json?ref=test-for-index
SKILLS_CN_EN_MAP_URL=https://gitcode.com/api/v5/repos/developer-skill/skills-group-contribution/contents/skills-index/cn-en-map.json?ref=test-for-index
Backup source (Gitee raw):
BACKUP_INDEX_URL=https://gitee.com/csimon666/skills-group-contribution/raw/test-for-index/skills-index/index.json
BACKUP_MAP_URL=https://gitee.com/csimon666/skills-group-contribution/raw/test-for-index/skills-index/cn-en-map.json
On 429 (Too Many Requests), the script automatically retries with exponential backoff, then falls through to Gitee raw — a different IP/WAF unaffected by GitCode rate limits.
Core Workflow and Core Commands
Step 1: Search Skills
MANDATORY: The agent MUST execute the search script to search the skill index. Do NOT read the JSON file directly — always use the script.
Given keyword (from AI-understood user intent) and optional category, run the search script:
Category semantics (
-c/--category): the index stores every category as a two-level path (<top>/<sub>). A top-level value matches by prefix —-c <top>returns every<top>/*skill; a two-level path matches exactly —-c <top>/<sub>returns only that subcategory's skills. Do not conclude "this category has no skills" before checking-l(Step 1.5) to confirm the category name exists.
⚠️ MANDATORY (质量上报): 搜索命令必须用
skill-quality-cli run --skill-name huawei-cloud-find-skills --包装, 保证每次搜索都触发质量上报。严禁裸调python scripts/search-skills.py。
# PowerShell
skill-quality-cli run --skill-name huawei-cloud-find-skills -- python scripts/search-skills.py -k "<keyword>"
skill-quality-cli run --skill-name huawei-cloud-find-skills -- python scripts/search-skills.py -k "<keyword>" -c "<category>"
skill-quality-cli run --skill-name huawei-cloud-find-skills -- python scripts/search-skills.py -c "<category>"
# Bash
skill-quality-cli run --skill-name huawei-cloud-find-skills -- python scripts/search-skills.py -k "<keyword>"
skill-quality-cli run --skill-name huawei-cloud-find-skills -- python scripts/search-skills.py -k "<keyword>" -c "<category>"
skill-quality-cli run --skill-name huawei-cloud-find-skills -- python scripts/search-skills.py -c "<category>"
⚠️ 安全(命令注入防护):
keyword/category来自用户输入,严禁未转义直接拼接到 shell 命令字符串中。若输入包含$(),$(...), 反引号,;,|` 等 shell 元字符,在 Bash/PowerShell 双引号字符串中会触发命令注入。必须按以下方式调用,避免将外部输入拼入 shell 字符串:
- 首选(推荐): 用 Python
subprocess参数数组方式调用,不经 shell:subprocess.run([sys.executable, "scripts/search-skills.py", "-k", keyword, "-c", category]);- 必须在 shell 中执行时,用单引号包裹用户输入(
'<keyword>'),并先做转义(将输入中的'替换为'\'')或使用 shell 转义工具(shlex.quote);- 遇到包含
$(), 反引号,;,|等元字符的输入时,优先改为参数数组方式,或在展示给用户前对输入做脱敏处理。
→ scripts/search-skills.py (Python — cross-platform)
What the script does:
- Loads
index.jsonandcn-en-map.jsonat most once per process, cache first (~/.cache/huawei-cloud-find-skills/, TTL 1h), then GitCode API v5, then Gitee raw (auto-decodes base64 content) — the cache hit path makes zero network calls - Expands keywords via
cn-en-map.json(bidirectional CN↔EN, e.g., "ECS" → "ECS, 弹性云服务器, 云服务器") using a synonym index built once per process; English stop words / junk tokens (no,the,such,zzz,qqq) are dropped before expansion so they cannot substring-match the whole index - Scores each skill: name match +10, trigger match +8, description match +5, service match +3
- Sorts by score descending, outputs formatted results with matched keywords
- Convergence rule: with a keyword given, a skill is listed only if it actually hits at least one specific (non-generic) keyword — generic words (
huawei,cloud,skill, …) alone never pull results in; a keyword with no searchable term returnsNo resultsinstead of degrading to a full-index browse (browse all is what-c <top-level>/-lare for) - Renders each result's full coverage: multi-service skills print
覆盖: <services>(from the indexservicesarray) plus the index capability type ([只读查询]/[管理]/[演练]/[通用]), so a skill whose primaryserviceis one product is not mistaken for that product only - Appends an
Other skills covering '<keyword>'group after the main ranking, listing coverage-only skills (indexservicescovers the product but the skill name does not) so they are not buried under product-specific skills - Runs at most one fallback re-search when the primary pass yields ≤1 result (English-token retry — noise tokens dropped first — else CJK compound split), reusing the already-parsed skill fields instead of reloading the index; the fallback applies the same specific-hit rule
- Reports only the top-3 results' skill names to the install-count API (
skills/<category>/<name>) as exposure impressions — fire-and-forget, never blocks or fails the search
Fallback iteration (if no results): 1) Switch CN↔EN keywords 2) Expand keywords 3) Remove category filter 4) Try synonyms 5) Browse categories with -l and list all skills under a category with -c <top-level>
The process should persist until the skill is found or its absence is confirmed. In the event of total failure, notify the user of the specific steps that were attempted.
Step 1.5: Browse Categories (optional, no keyword needed)
Print the category tree aggregated from index.json — one line per top-level category with its skill count plus the concrete two-level paths. Use it before filtering, or to explain "category not found" to the user.
skill-quality-cli run --skill-name huawei-cloud-find-skills -- python scripts/search-skills.py -l
skill-quality-cli run --skill-name huawei-cloud-find-skills -- python scripts/search-skills.py -l -c "<category>"
The output lists lines of the form <top> (N skill(s)) followed by <top>/<sub>(n), .... Pass a listed path to -c in Step 1 — either its top-level part (prefix match) or the full path (exact match).
Step 2: View Skill Details (optional)
Fetch the full SKILL.md content from GitHub for intent validation. Skip this step if the search results from Step 1 are sufficiently informative.
# URL pattern — use the skill's category, service, and name from index
DETAIL_UR
...
用户评价 (0)
发表评价
暂无评价
统计数据
用户评分
为此 Skill 评分