huawei-cloud-skill-creator

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Huawei Cloud Skill Creator v2

Huawei Cloud Skill Creator v2

Six-Phase Strict Pipeline — Each phase depends on the previous phase's output and cannot be skipped. If any phase is missing, restart from the missing phase.
六阶段严格流水线 — 每个阶段依赖前一阶段的输出,不可跳过。若任何阶段缺失,从缺失阶段重新开始。

Overview

概述

The Huawei Cloud Skill Creator v2 is based on a six-phase strict pipeline: starting with Socratic Q&A requirements analysis, followed by technical research (CLI→SDK→API three-level fallback), document generation, test preparation, detailed testing, resource cleanup and compliance check, ultimately generating a complete skill package that conforms to the Huawei Cloud Skill Specification.
Huawei Cloud Skill Creator v2基于六阶段严格流水线构建:从苏格拉底式问答需求分析开始,依次进行技术调研(CLI→SDK→API三级降级)、文档生成、测试准备、详细测试、资源清理与合规检查,最终生成符合《华为云Skill检查规范》的完整Skill包。

Pre-check: Huawei Cloud Credentials Required

前置检查:需具备华为云凭证

Mandatory gate. This pre-check MUST pass before invoking any hcloud / huaweicloudsdk command — including Phase 2 research, Phase 4/5 testing, and Phase 6 validation. If no valid credential profile is detected, STOP and obtain credentials out-of-band.
强制关卡。在调用任何hcloud / huaweicloudsdk命令之前,必须通过此前置检查——包括阶段2调研、阶段4/5测试以及阶段6验证。如果未检测到有效的凭证配置文件,请立即停止并通过会话外渠道获取凭证。

Security Rules

安全规则

  • NEVER read, echo, or print AK/SK values (e.g., printing the value of an
    HUAWEI_ACCESS_KEY
    -style env var is FORBIDDEN).
  • NEVER read or cat the on-disk credential files for hcloud, obsutil, the SDK, or any other secret-storing location. Treat all such files as confidential; the names of those files (used by their owners) are documented in
    references/cli-installation-guide.md
    .
  • NEVER ask the user to input AK/SK directly in the conversation or command line.
  • NEVER invoke
    hcloud configure set
    with literal credential strings passed via the CLI's
    cli-<ak-flag>
    /
    cli-<sk-flag>
    parameters or any equivalent in-band secret-entry form.
  • ONLY use
    hcloud configure list
    to check credential status — non-interactive, read-only, no secrets echoed.
  • 严禁读取、回显或打印AK/SK值(例如,打印
    HUAWEI_ACCESS_KEY
    类环境变量的值是禁止操作)。
  • 严禁读取或查看hcloud、obsutil、SDK或任何其他存储机密的磁盘凭证文件。将所有此类文件视为机密;其文件名(由用户使用)记录在
    references/cli-installation-guide.md
    中。
  • 严禁要求用户在对话或命令行中直接输入AK/SK。
  • 严禁通过CLI的
    cli-<ak-flag>
    /
    cli-<sk-flag>
    参数或任何等效的会话内机密输入形式,使用字面凭证字符串调用
    hcloud configure set
  • 仅可使用
    hcloud configure list
    检查凭证状态——该操作是非交互式、只读的,不会回显机密信息。

Verification Steps

验证步骤

bash
hcloud configure list
Check the output for a valid profile (AK/SK, or temporary security credentials / agency-assumed role).
If no valid profile exists, STOP here.
  1. Obtain credentials from Huawei Cloud Console → 身份与访问管理 (IAM) → 我的凭证 → 新增访问密钥.
  2. Output the following copy-paste ready env-var setup block to the user (fill in real values outside of this session, never in chat). The Agent must NEVER ask the user to type the AK/SK value in the conversation — only emit the template below:
    bash
    # Set Huawei Cloud AK/SK in your shell profile, then reload or 'source' it.
    export HUAWEI_ACCESS_KEY="<your-access-key-id>"
    export HUAWEI_SECRET_KEY="<your-secret-access-key>"
    export HUAWEI_REGION="cn-north-4"
    Optional alternative — only as an interactive out-of-band step (Agent must NOT invoke this with literal values):
    bash
    hcloud configure    # interactive; prompts for AK/SK in the user's terminal
  3. After the user confirms they have configured env vars (or run
    hcloud configure
    ), re-run
    hcloud configure list
    . If the profile is valid → resume Phase 1. If still missing → terminate, do not proceed.
Reuse the active CLI profile for all subsequent
hcloud
and
huaweicloudsdk
calls.
Do not print or hardcode secrets. Do not replace this gate with
obsutil config
,
hcloud configure set
with literal arguments, SDK credentials constructors filled with literal strings (for example, the SDK's
BasicCredentials
built from string literals rather than env vars), or any other in-session secret-entry flow.
bash
hcloud configure list
检查输出中是否存在有效的配置文件(AK/SK,或临时安全凭证/委托角色)。
如果不存在有效配置文件,请立即停止
  1. 华为云控制台 → 身份与访问管理 (IAM) → 我的凭证 → 新增访问密钥 获取凭证。
  2. 向用户输出以下可直接复制粘贴的环境变量设置代码块(请在本次会话外填充真实值,切勿在聊天中填写)。Agent严禁要求用户在对话中输入AK/SK值,仅需输出以下模板:
    bash
    # 在你的Shell配置文件中设置华为云AK/SK,然后重新加载或执行'source'命令。
    export HUAWEI_ACCESS_KEY="<your-access-key-id>"
    export HUAWEI_SECRET_KEY="<your-secret-access-key>"
    export HUAWEI_REGION="cn-north-4"
    可选替代方案——仅作为会话外的交互式步骤(Agent不得使用字面值调用此命令):
    bash
    hcloud configure    # 交互式操作;在用户终端中提示输入AK/SK
  3. 用户确认已配置环境变量(或执行了
    hcloud configure
    )后,重新运行
    hcloud configure list
    。如果配置文件有效→继续阶段1。如果仍缺失→终止流程,不得继续。
所有后续
hcloud
huaweicloudsdk
调用均复用当前CLI配置文件
。不得打印或硬编码机密信息。不得使用
obsutil config
、带字面参数的
hcloud configure set
、填充字面字符串的SDK凭证构造函数(例如,使用字符串字面量而非环境变量构建SDK的
BasicCredentials
)或任何其他会话内机密输入流程替代此关卡。

Credential Source Priority

凭证来源优先级

When invoking commands later (Phase 2/4/5), the skill accepts credentials in this priority order:
PrioritySourceNotes
1Environment variablesAuto-scan all variables prefixed with
HUAWEI
/
HW
/
HWC
containing
ACCESS_KEY
/
_AK
/
SECRET_KEY
/
_SK
2
hcloud configure
profile
Active CLI profile — preferred for hcloud calls
3IAM agency / temporary credentialsAK/SK + SecurityToken (programmatic access)
If none of the above are available when Phase 4/5 testing starts, prompt the user once to configure them out-of-band and re-run the pre-check. If still unavailable, terminate the process — strictly prohibited from skipping credential-required steps.
后续调用命令时(阶段2/4/5),Skill按以下优先级接受凭证:
优先级来源说明
1环境变量自动扫描所有以
HUAWEI
/
HW
/
HWC
开头、包含
ACCESS_KEY
/
_AK
/
SECRET_KEY
/
_SK
的变量
2
hcloud configure
配置文件
当前CLI配置文件——优先用于hcloud调用
3IAM委托/临时凭证AK/SK + SecurityToken(编程访问)
如果阶段4/5测试开始时以上来源均不可用,请提示用户通过会话外渠道配置并重新运行前置检查。如果仍不可用,终止流程——严禁跳过需要凭证的步骤。

Prerequisites

前置条件

  1. hcloud CLI installed and authenticated — Reference: https://support.huaweicloud.com/qs-hcli/hcli_02_003.html
    • Authentication verified via the Pre-check above (
      hcloud configure list
      ).
  2. Python 3.8+ with
    huaweicloudsdk
    packages available — SDK Reference: https://console.huaweicloud.com/apiexplorer/#/sdkcenter
  3. Node.js + npx available
  4. Huawei Cloud AK/SK — Auto-scan all environment variables prefixed
    HUAWEI
    /
    HW
    /
    HWC
    matching
    ACCESS_KEY
    /
    _AK
    /
    SECRET_KEY
    /
    _SK
    . Hardcoding AK/SK in scripts, docs, or command lines is forbidden.
  5. API Reference: https://console.huaweicloud.com/apiexplorer/#/openapi
  1. 已安装并认证hcloud CLI — 参考文档:https://support.huaweicloud.com/qs-hcli/hcli_02_003.html
    • 已通过上述前置检查验证认证状态(
      hcloud configure list
      )。
  2. Python 3.8+ 且已安装
    huaweicloudsdk
    包 — SDK参考文档:https://console.huaweicloud.com/apiexplorer/#/sdkcenter
  3. 已安装Node.js + npx
  4. 华为云AK/SK — 自动扫描所有以
    HUAWEI
    /
    HW
    /
    HWC
    开头、匹配
    ACCESS_KEY
    /
    _AK
    /
    SECRET_KEY
    /
    _SK
    的环境变量。严禁在脚本、文档或命令行中硬编码AK/SK。
  5. API参考文档https://console.huaweicloud.com/apiexplorer/#/openapi

Workflow — Six-Phase Strict Pipeline

工作流——六阶段严格流水线

Phase 1 (Q&A) → Phase 2 (Tech Research) → Phase 3 (Generate MD)
    → Phase 4 (Test Prep) → Phase 5 (Detailed Testing) → Phase 6 (Cleanup & Report)
Strict Rules:
  • Each phase must output a phase summary (phase-N-summary)
  • Before starting each phase, must verify that the previous phase's summary file exists
  • After all 6 phases are completed, perform a final check for any missing phases. If any are missing, restart from the missing phase
  • Skipping any phase is strictly prohibited
  • The Pre-check: Huawei Cloud Credentials Required gate must have passed before any Phase 2 research or Phase 4/5 execution begins
阶段1(问答)→ 阶段2(技术调研)→ 阶段3(生成MD文档)
    → 阶段4(测试准备)→ 阶段5(详细测试)→ 阶段6(清理与报告)
严格规则:
  • 每个阶段必须输出阶段总结文件(phase-N-summary)
  • 开始每个阶段前,必须验证前一阶段的总结文件是否存在
  • 完成所有6个阶段后,执行最终检查确认是否有缺失阶段。若有缺失,从缺失阶段重新开始
  • 严禁跳过任何阶段
  • 在开始阶段2调研或阶段4/5执行之前,必须通过前置检查:需具备华为云凭证关卡

Phase 1: Requirements Analysis (Socratic Q&A)

阶段1:需求分析(苏格拉底式问答)

Goal: Clarify user requirements through question-by-question dialogue.
  • Ask one question at a time, wait for the user's response
  • Cover the following dimensions:
    1. Target Service — Which Huawei Cloud service? (ECS, VPC, OBS, RDS, BSS, etc.)
    2. Feature Scope — What should the Skill do? (Query, Diagnose, Deploy, Monitor, Manage)
    3. Execution Mode — Prefer CLI / SDK / API?
    4. CLI Operations — Which operations are involved? (List, Show, Create, Delete, Update)
    5. Trigger Scenarios — When would an Agent invoke this? (Daily inspection, troubleshooting, auto-scaling)
  • After every 5 questions or covering all dimensions → Display requirements summary table → Wait for user confirmation
  • 🛑 Do NOT proceed to Phase 2 until the user has explicitly confirmed
Output:
phase-1-summary.json
— User-confirmed requirements description
目标: 通过逐问对话明确用户需求。
  • 一次提出一个问题,等待用户回复
  • 覆盖以下维度:
    1. 目标服务 — 针对华为云哪项服务?(ECS、VPC、OBS、RDS、BSS等)
    2. 功能范围 — Skill需要实现什么功能?(查询、诊断、部署、监控、管理)
    3. 执行模式 — 偏好CLI / SDK / API?
    4. CLI操作 — 涉及哪些操作?(List、Show、Create、Delete、Update)
    5. 触发场景 — Agent会在何时调用此Skill?(日常巡检、故障排查、自动扩缩容)
  • 每提问5次或覆盖所有维度后→展示需求总结表格→等待用户确认
  • 🛑 获得用户明确确认前,不得进入阶段2
输出:
phase-1-summary.json
— 用户确认后的需求描述

Phase 2: Technical Research (CLI→SDK→API Three-Level Fallback)

阶段2:技术调研(CLI→SDK→API三级降级)

Dependency: Phase 1 requirements analysis completed (phase-1-summary.json exists)
For each feature point confirmed in Phase 1, research availability in the following order:
PriorityResearch MethodVerification CommandSuccess Criteria
1stCLI — hcloud command
hcloud <Service> <Operation> --cli-region=cn-north-4 --help
Command exists and parameters are valid
2ndSDK — huaweicloudsdk
python3 -c "from huaweicloudsdk{service}.v2 import ..."
SDK package installed and class importable
3rdAPIOnly from the following two sourcesSee rules belowEndpoint from a trusted source, not inferred
Core Rule: API Endpoint Forensics (No Guessing)
API endpoints are only allowed from the following two sources. Strictly prohibited from inferring through naming patterns:
Trusted SourceMethod
SDK source
_http_info
resource_path
grep -A8 "_http_info" {service}_client.py
→ Read
resource_path
value
Huawei Cloud API Explorer (api-explorer.huaweicloud.com)User searches and confirms on that website
❌ Strictly prohibited actions:
  • Inferring new endpoints based on other API path patterns (e.g., inferring claim-vouchers endpoint from coupons endpoint)
  • Constructing URIs yourself based on documentation descriptions
  • Using "common naming patterns" to guess API paths
  • If the SDK is available but the corresponding function has no method in
    _http_info
    → Mark ⛔, do not infer
Execution Rules:
Research feature point N
  ├── CLI available → Record as CLI mode, record specific command
  ├── CLI unavailable → Check SDK
  │    ├── SDK available → Record as SDK mode
  │    │    ├── Read all _http_info methods from SDK source to obtain real REST paths
  │    │    │    grep "resource_path" <sdk_path>/{service}_client.py
  │    │    └── Feature point's corresponding method has _http_info in SDK → Record real API endpoint
  │    │         Feature point's corresponding method has no _http_info in SDK → Mark ⛔, do not infer
  │    ├── SDK unavailable → Ask user to confirm endpoint from API Explorer
  │    │    ├── User finds endpoint from API Explorer → Record as API mode, note the source
  │    │    ├── User provides endpoint (other source) → Record as API mode, mark ⚠ user-provided
  │    │    └── User cannot provide → Mark ⛔
  │    └── SDK partially available (some methods missing and no corresponding _http_info) → Mark missing features as ⛔
  └── Generate feature point research result (including execution mode + real API path if available)
🛑 Agent is strictly forbidden from guessing/fabricating API paths on its own. If neither the SDK source nor API Explorer has the endpoint, mark it ⛔ — it doesn't exist.
Tips for finding SDK client source paths:
bash
undefined
依赖: 已完成阶段1需求分析(存在phase-1-summary.json)
针对阶段1确认的每个功能点,按以下顺序调研可用性:
优先级调研方式验证命令成功标准
1CLI — hcloud命令
hcloud <Service> <Operation> --cli-region=cn-north-4 --help
命令存在且参数有效
2SDK — huaweicloudsdk
python3 -c "from huaweicloudsdk{service}.v2 import ..."
SDK包已安装且类可导入
3API仅可从以下两个来源获取见下方规则端点来自可信来源,不得推断
核心规则:API端点取证(禁止猜测)
API端点仅允许来自以下两个来源。严禁通过命名模式推断
可信来源方式
SDK源码中的
_http_info
resource_path
grep -A8 "_http_info" {service}_client.py
→ 读取
resource_path
华为云API Explorer (api-explorer.huaweicloud.com)用户在该网站搜索并确认
❌ 严禁操作:
  • 根据其他API路径模式推断新端点(例如,从coupons端点推断claim-vouchers端点)
  • 根据文档描述自行构造URI
  • 使用“通用命名模式”猜测API路径
  • 如果SDK可用但对应函数在
    _http_info
    中无方法→标记⛔,不得推断
执行规则:
调研功能点N
  ├── CLI可用 → 记录为CLI模式,记录具体命令
  ├── CLI不可用 → 检查SDK
  │    ├── SDK可用 → 记录为SDK模式
  │    │    ├── 从SDK源码读取所有`_http_info`方法以获取真实REST路径
  │    │    │    grep "resource_path" <sdk_path>/{service}_client.py
  │    │    └── 功能点对应的方法在SDK中有`_http_info` → 记录真实API端点
  │    │         功能点对应的方法在SDK中无`_http_info` → 标记⛔,不得推断
  │    ├── SDK不可用 → 请用户从API Explorer确认端点
  │    │    ├── 用户从API Explorer找到端点 → 记录为API模式,注明来源
  │    │    ├── 用户提供端点(其他来源) → 记录为API模式,标记⚠ 用户提供
  │    │    └── 用户无法提供 → 标记⛔
  │    └── SDK部分可用(部分方法缺失且无对应`_http_info`) → 将缺失功能标记为⛔
  └── 生成功能点调研结果(包含执行模式+可用时的真实API路径)
🛑 Agent严禁自行猜测/伪造API路径。如果SDK源码和API Explorer均无该端点,标记为⛔——该端点不存在。
查找SDK客户端源码路径的技巧:
bash
undefined

Method 1: Find package installation path

方法1:查找包安装路径

python3 -c "import huaweicloudsdk{service}.v2 as m; import os; print(os.path.dirname(m.file))"
python3 -c "import huaweicloudsdk{service}.v2 as m; import os; print(os.path.dirname(m.file))"

Method 2: Find all _http_info methods (show all API endpoints)

方法2:查找所有
_http_info
方法(显示所有API端点)

grep "_http_info" <path>/{service}_client.py
grep "_http_info" <path>/{service}_client.py

Method 3: View API path for a specific method

方法3:查看特定方法的API路径

grep -A8 "_{method}_http_info" <path>/{service}_client.py
grep -A8 "_{method}_http_info" <path>/{service}_client.py

The "resource_path" key in output is the real REST endpoint

输出中的"resource_path"键即为真实REST端点


**Output:** `phase-2-summary.json` — Execution mode (CLI/SDK/API/⛔) and corresponding command/code/API path for each feature point

**输出:** `phase-2-summary.json` — 每个功能点的执行模式(CLI/SDK/API/⛔)及对应的命令/代码/API路径

Phase 3: Document Generation

阶段3:文档生成

Dependency: Phase 2 technical research completed (phase-2-summary.json exists)
Generate Skill files based on Phase 2 conclusions:
  1. Name the Skill — Use
    huawei-cloud-{product}-{function}
    and make the frontmatter
    name
    match the directory name.
  2. Language — Generate SKILL.md in English by default. Chinese documentation may be added in
    references/
    as supplementary. The main SKILL.md must use English for frontmatter description, section titles, command examples, and all explanatory content.
  3. Frontmatter — Include
    name
    ,
    description
    with a feature summary and trigger conditions, and no more than five
    tags
    . Do not generate a
    version
    field.
  4. Create directory structure:
    text
    skills/{skill-name}/
    ├── SKILL.md
    ├── references/
    │   ├── iam-policies.md              (Required)
    │   ├── cli-installation-guide.md    (Required when CLI is used)
    │   ├── verification-method.md       (Recommended)
    │   ├── dataflow-diagram.md          (Recommended)
    │   └── acceptance-criteria.md       (Recommended)
    ├── scripts/
    │   └── test-cli-commands.sh
    └── templates/
        └── test-vars.json
  5. SKILL.md content generation rules:
    Execution ModeCommand Format in SKILL.md
    CLI
    hcloud <Service> <Operation> --cli-region={region} [--params]
    SDKPython script example (
    python3 -c "..."
    )
    APIcurl command + user-provided endpoint (mark as user-provided)
    UnavailableMark
    requires manual verification
    , do not generate specific commands
  6. Required sections in SKILL.md:
    SectionSeverityDescription
    YAML FrontmatterCritical
    name
    +
    description
    with feature summary and trigger conditions +
    tags
    ; no
    version
    OverviewHighFeature overview, architecture, applicable scenarios
    PrerequisitesHighCLI version, authentication configuration, IAM permissions
    WorkflowHighSkill workflow steps
    Core CommandsHighCommand examples grouped by function
    Parameter ConfirmationHighUser-configurable parameter table
    Reference DocumentsCriticalLinks to documents under
    references/
    KooCLI Command Format StandardLowRequired when CLI is involved; service, operation, region, and parameter syntax
  7. Generate Mermaid data flow diagram
    references/dataflow-diagram.md
    .
  8. Generate IAM policies
    references/iam-policies.md
    using least privilege.
  9. Record API references — Keep verified API paths in
    phase-2-summary.json
    . If a generated Skill needs reusable API documentation, add a reference file under
    references/
    using an allowed kebab-case filename.
  10. Package limits — Total file content size ≤ 40 MB, total files ≤ 30, and SKILL.md ≤ 500 lines. Split oversized SKILL.md content into
    references/
    .
  11. File extension allowlist — Every file must have one of these 46 extensions:
    .md
    ,
    .mdx
    ,
    .txt
    ,
    .json
    ,
    .json5
    ,
    .yaml
    ,
    .yml
    ,
    .toml
    ,
    .js
    ,
    .cjs
    ,
    .mjs
    ,
    .ts
    ,
    .tsx
    ,
    .jsx
    ,
    .py
    ,
    .sh
    ,
    .ps1
    ,
    .psm1
    ,
    .psd1
    ,
    .r
    ,
    .rb
    ,
    .go
    ,
    .rs
    ,
    .swift
    ,
    .kt
    ,
    .java
    ,
    .cs
    ,
    .cpp
    ,
    .c
    ,
    .h
    ,
    .hpp
    ,
    .sql
    ,
    .csv
    ,
    .tsv
    ,
    .ini
    ,
    .cfg
    ,
    .conf
    ,
    .env
    ,
    .properties
    ,
    .dat
    ,
    .xml
    ,
    .html
    ,
    .css
    ,
    .scss
    ,
    .sass
    ,
    .svg
    . Files without an extension or outside this allowlist must be removed or renamed.
  12. Change scope — A pull request must change only one Skill directory. Use
    BASE_REF=<base-ref> bash scripts/validate-skill.sh {skill-path}
    to validate the PR diff when a base ref is available.
🛑 Strictly prohibited from generating hallucinated URIs / fabricated API paths. Feature points not verified in Phase 2 must not have specific commands written.
Output:
phase-3-summary.json
— List of generated files and structure validation results
依赖: 已完成阶段2技术调研(存在phase-2-summary.json)
根据阶段2结论生成Skill文件:
  1. 命名Skill — 使用
    huawei-cloud-{product}-{function}
    格式,确保前端元数据
    name
    与目录名称一致。
  2. 语言 — 默认生成英文SKILL.md。中文文档可作为补充添加到
    references/
    目录中。主SKILL.md的前端元数据描述、章节标题、命令示例及所有说明内容必须使用英文。
  3. 前端元数据 — 包含
    name
    、带功能摘要和触发条件的
    description
    ,以及不超过5个
    tags
    。不得生成
    version
    字段。
  4. 创建目录结构:
    text
    skills/{skill-name}/
    ├── SKILL.md
    ├── references/
    │   ├── iam-policies.md              (必填)
    │   ├── cli-installation-guide.md    (使用CLI时必填)
    │   ├── verification-method.md       (推荐)
    │   ├── dataflow-diagram.md          (推荐)
    │   └── acceptance-criteria.md       (推荐)
    ├── scripts/
    │   └── test-cli-commands.sh
    └── templates/
        └── test-vars.json
  5. SKILL.md内容生成规则:
    执行模式SKILL.md中的命令格式
    CLI
    hcloud <Service> <Operation> --cli-region={region} [--params]
    SDKPython脚本示例 (
    python3 -c "..."
    )
    APIcurl命令 + 用户提供的端点(标记为用户提供)
    不可用标记
    requires manual verification
    ,不得生成具体命令
  6. SKILL.md必填章节:
    章节重要程度描述
    YAML前端元数据关键
    name
    + 带功能摘要和触发条件的
    description
    +
    tags
    ;无
    version
    概述功能概述、架构、适用场景
    前置条件CLI版本、认证配置、IAM权限
    工作流Skill工作流步骤
    核心命令按功能分组的命令示例
    参数确认用户可配置参数表
    参考文档关键
    references/
    目录下文档的链接
    KooCLI命令格式规范使用CLI时必填;服务、操作、区域和参数语法
  7. 生成Mermaid数据流图
    references/dataflow-diagram.md
  8. 生成IAM策略
    references/iam-policies.md
    ,遵循最小权限原则。
  9. 记录API参考 — 将已验证的API路径保留在
    phase-2-summary.json
    中。如果生成的Skill需要可复用的API文档,在
    references/
    目录下添加参考文件,使用允许的短横线分隔命名法。
  10. 包限制 — 总文件内容大小≤40 MB,总文件数≤30,SKILL.md≤500行。将过大的SKILL.md内容拆分到
    references/
    目录中。
  11. 文件扩展名白名单 — 每个文件必须使用以下46种扩展名之一:
    .md
    ,
    .mdx
    ,
    .txt
    ,
    .json
    ,
    .json5
    ,
    .yaml
    ,
    .yml
    ,
    .toml
    ,
    .js
    ,
    .cjs
    ,
    .mjs
    ,
    .ts
    ,
    .tsx
    ,
    .jsx
    ,
    .py
    ,
    .sh
    ,
    .ps1
    ,
    .psm1
    ,
    .psd1
    ,
    .r
    ,
    .rb
    ,
    .go
    ,
    .rs
    ,
    .swift
    ,
    .kt
    ,
    .java
    ,
    .cs
    ,
    .cpp
    ,
    .c
    ,
    .h
    ,
    .hpp
    ,
    .sql
    ,
    .csv
    ,
    .tsv
    ,
    .ini
    ,
    .cfg
    ,
    .conf
    ,
    .env
    ,
    .properties
    ,
    .dat
    ,
    .xml
    ,
    .html
    ,
    .css
    ,
    .scss
    ,
    .sass
    ,
    .svg
    。 无扩展名或不在白名单内的文件必须删除或重命名。
  12. 变更范围 — 一个Pull Request只能修改一个Skill目录。当存在基准引用时,使用
    BASE_REF=<base-ref> bash scripts/validate-skill.sh {skill-path}
    验证PR差异。
🛑 严禁生成虚构URI/伪造API路径。阶段2未验证的功能点不得编写具体命令。
输出:
phase-3-summary.json
— 生成文件列表及结构验证结果

Phase 4: Test Preparation

阶段4:测试准备

Dependency: Phase 3 document generation completed (phase-3-summary.json exists)
  1. Generate test cases — Split test cases based on Phase 2/3 feature points
    Case TypeCoverage RequirementExample
    CLI casesOne case per hcloud command
    hcloud ECS ListServers --cli-region=cn-north-4 --limit=1
    SDK casesOne case per SDK call
    list_sub_customer_coupons(limit=1)
    API casesOne case per user-provided endpoint
    curl -X GET {endpoint}
  2. Save test cases as JSON
    templates/test-vars.json
    json
    {
      "test_cases": [
        {"id": "TC-01", "name": "...", "command": "...", "expected": "..."},
        ...
      ]
    }
  3. Show all test cases to the user for confirmation
  4. Run tests:
    • Read AK/SK from environment variables: 自动扫描所有以
      HUAWEI
      /
      HW
      /
      HWC
      开头的环境变量,匹配其中含
      ACCESS_KEY
      /
      _AK
      /
      SECRET_KEY
      /
      _SK
      的键值对
    • If no valid AK/SK env var or CLI profile is detected, output the env-var setup template below and STOP — never ask the user to type AK/SK in chat. The user fills in real values out-of-band and re-runs the Pre-check:
      bash
      export HUAWEI_ACCESS_KEY="<your-access-key-id>"
      export HUAWEI_SECRET_KEY="<your-secret-access-key>"
      export HUAWEI_REGION="cn-north-4"
      If the user cannot / will not provide env vars, terminate the process. Strictly prohibited from skipping credential-required steps.
    • Execute test cases one by one
    • Before executing mutating commands (Create/Update/Delete), must prompt the user and wait for confirmation
  5. Test verification flow:
    Each case → Try CLI execution
      ├── ✅ Success → Record PASS
      └── ❌ Failure → Check syntax issues
           ├── ✅ Syntax issue → Fix and retry
           └── ❌ Non-syntax issue → Fallback to SDK
                ├── ✅ Success → Record PASS (SDK)
                └── ❌ Failure → Fallback to API (user-provided endpoint)
                     ├── ✅ Success → Record PASS (API)
                     └── ❌ Failure → Record FAIL ⛔ requires manual verification
Output:
phase-4-summary.json
— Test case list + per-case execution results
依赖: 已完成阶段3文档生成(存在phase-3-summary.json)
  1. 生成测试用例 — 根据阶段2/3的功能点拆分测试用例
    用例类型覆盖要求示例
    CLI用例每个hcloud命令对应一个用例
    hcloud ECS ListServers --cli-region=cn-north-4 --limit=1
    SDK用例每个SDK调用对应一个用例
    list_sub_customer_coupons(limit=1)
    API用例每个用户提供的端点对应一个用例
    curl -X GET {endpoint}
  2. 将测试用例保存为JSON
    templates/test-vars.json
    json
    {
      "test_cases": [
        {"id": "TC-01", "name": "...", "command": "...", "expected": "..."},
        ...
      ]
    }
  3. 向用户展示所有测试用例并确认
  4. 执行测试:
    • 从环境变量读取AK/SK:自动扫描所有以
      HUAWEI
      /
      HW
      /
      HWC
      开头的环境变量,匹配其中含
      ACCESS_KEY
      /
      _AK
      /
      SECRET_KEY
      /
      _SK
      的键值对
    • 如果未检测到有效的AK/SK环境变量或CLI配置文件,输出以下环境变量设置模板并停止——切勿要求用户在聊天中输入AK/SK。用户需在会话外填充真实值并重新运行前置检查:
      bash
      export HUAWEI_ACCESS_KEY="<your-access-key-id>"
      export HUAWEI_SECRET_KEY="<your-secret-access-key>"
      export HUAWEI_REGION="cn-north-4"
      如果用户无法/不愿提供环境变量,终止流程。严禁跳过需要凭证的步骤。
    • 逐个执行测试用例
    • 执行变更类命令(Create/Update/Delete)前,必须提示用户并等待确认
  5. 测试验证流程:
    每个用例 → 尝试CLI执行
      ├── ✅ 成功 → 记录PASS
      └── ❌ 失败 → 检查语法问题
           ├── ✅ 语法问题 → 修复后重试
           └── ❌ 非语法问题 → 降级到SDK
                ├── ✅ 成功 → 记录PASS(SDK)
                └── ❌ 失败 → 降级到API(用户提供的端点)
                     ├── ✅ 成功 → 记录PASS(API)
                     └── ❌ 失败 → 记录FAIL ⛔ 需要手动验证
输出:
phase-4-summary.json
— 测试用例列表 + 每个用例的执行结果

Phase 5: Detailed Testing

阶段5:详细测试

Dependency: Phase 4 test preparation completed (phase-4-summary.json exists)
  1. Full regression: Execute all test cases generated in Phase 4
  2. Resource lifecycle testing (applicable to Skills involving resource creation/modification/deletion):
    • Create resource → Verify creation succeeded (query to confirm)
    • Runtime query → Verify resource status is correct
    • Destroy resource → Verify resource release
    • Test report outputs information on created/modified/deleted resources
    • Prompt the user and wait for confirmation before each step
  3. Management-type Skills:
    • If CRUD operations are involved → End-to-end full testing
    • If query-only → Output query results to test report
  4. Report generation:
    • Test results aggregated by case
    • Detailed record of resource changes
    • Detailed error information for failed cases
Output:
phase-5-summary.json
— Detailed test results + resource operation records
依赖: 已完成阶段4测试准备(存在phase-4-summary.json)
  1. 全量回归: 执行阶段4生成的所有测试用例
  2. 资源生命周期测试(适用于涉及资源创建/修改/删除的Skill):
    • 创建资源 → 验证创建成功(查询确认)
    • 运行时查询 → 验证资源状态正确
    • 删除资源 → 验证资源已释放
    • 测试报告输出已创建/修改/删除资源的信息
    • 每一步操作前都需提示用户并等待确认
  3. 管理类Skill:
    • 如果涉及CRUD操作 → 端到端全量测试
    • 如果仅为查询类 → 将查询结果输出到测试报告
  4. 生成报告:
    • 按用例汇总测试结果
    • 详细记录资源变更情况
    • 详细记录失败用例的错误信息
输出:
phase-5-summary.json
— 详细测试结果 + 资源操作记录

Phase 6: Resource Cleanup and Compliance Check

阶段6:资源清理与合规检查

Dependency: Phase 5 detailed testing completed (phase-5-summary.json exists)
  1. Resource Cleanup:
    • Check whether all resources created in Phase 5 have been released
    • Unreleased resources → Prompt user and attempt cleanup
    • Record cleanup results
  2. Huawei Cloud Skill Specification Compliance Check (against 华为云Skill检查规范):
    Check ItemLevelVerification Method
    SKILL.md existsCriticalFile existence check
    Skill directory under skills/LowPath format: skills/{category}/{subcategory}/{skill-name}/
    Skill package naming conventionHighDirectory name matches huawei-cloud-{product}-{function}
    One PR submits only one SkillCriticalgit diff checks that PR changes only affect a single Skill directory
    YAML Frontmatter existsCritical
    grep '^---$'
    name field existsCriticalFrontmatter name field exists and matches directory name
    description field existsCriticalFrontmatter description field exists and contains feature summary + trigger words
    description includes trigger wordsMediumAccept
    Triggers include:
    ,
    Use when
    , or equivalent trigger conditions
    Should not contain version fieldLowNo
    version
    field in frontmatter
    Overview sectionHighMatch
    Overview
    or
    概述
    Prerequisites sectionHighMatch
    Prerequisites
    or
    前置条件
    Workflow sectionHighMatch
    Workflow
    or
    工作流
    Core Commands sectionHighMatch
    Core Commands
    or
    核心命令
    Parameter Confirmation sectionHighMatch
    Parameter Confirmation
    or
    参数确认
    Reference Documents sectionCriticalMatch
    Reference Documents
    ,
    References
    , or
    参考文档
    KooCLI Command Format Standard sectionLowRequired when CLI is involved; match the English or Chinese heading
    references/cli-installation-guide.mdHighRequired when CLI is involved, file existence
    references/iam-policies.mdCriticalFile existence
    references/verification-method.mdMediumRecommended file existence
    references/acceptance-criteria.mdLowRecommended file existence
    Reference document kebab-case namingLowFile names under references/ are all lowercase kebab-case
    Credential hardcodingCriticalgrep for credential hardcoding patterns and CLI credential config
    Cross-Skill direct callsCriticalgrep other Skill names
    CLI write operations require confirmationLowCheck whether user confirmation is prompted
    Service name requirementMediumEvery concrete hcloud service matches a KooCLI Service name and starts with uppercase/title case, such as
    ECS
    ,
    CloudPond
    , or
    IAMAccessAnalyzer
    Operation name PascalCaseMediumEvery concrete operation name uses PascalCase
    Includes
    --cli-region
    MediumEvery concrete CLI command includes the region parameter
    Total skill size ≤ 40 MBMediumSum all file content sizes under the Skill directory
    Total file count ≤ 30MediumCount SKILL.md and every file in all subdirectories
    SKILL.md line count ≤ 500MediumSplit excess content into
    references/
    File extensions in allowlistMediumReject extensionless files and extensions outside the 46-type allowlist
    1. Security Audit:
    Have the Agent orchestrate the five-tool audit described in
    references/security-audit-guide.md
    . Do not invoke another named Skill or call scripts from another Skill directory directly.
    The gate combines skillcheck, markdownlint-cli2, cisco-ai-skill-scanner, the Huawei Cloud specification check, and gitleaks. It must explicitly cover these Critical specification checks:
    CheckRequired coverage
    Secret leak detectionAK/SK hardcoding,
    hcloud configure set
    , and report-output masking
    Vulnerability pattern detectionKnown command injection, reverse shell, dangerous function, and prompt injection patterns
    Dependency security detectionKnown unsafe dependency versions via
    pip audit
    ,
    safety check
    , or an equivalent tool
    Insecure configuration detectionInsecure protocols, weak passwords, and unsafe defaults
    ERROR or CRITICAL findings must be fixed and re-audited. WARNING-only results require explicit user acceptance. Record the report path, verdict, findings, and accepted warnings in
    phase-6-summary.json
    .
  3. Final report:
    • Merge Phase 1-6 phase summaries
    • Include key conclusions from the security audit report (skill-gate-report)
    • Output complete creation report
    • Mark all incomplete items
  4. Final six-phase completeness check:
    Check phase-1-summary.json exists → If missing, restart from Phase 1
    Check phase-2-summary.json exists → If missing, restart from Phase 2
    Check phase-3-summary.json exists → If missing, restart from Phase 3
    Check phase-4-summary.json exists → If missing, restart from Phase 4
    Check phase-5-summary.json exists → If missing, restart from Phase 5
    Check phase-6-summary.json exists → If missing, restart from Phase 6
    All phases complete → Creation done. Missing phases → Restart from the missing phase.
  5. Clean up phase summary files: After completeness check passes, delete all
    phase-*-summary.json
    files under the skill directory
    bash
     # Execute after final completeness check passes
     # Safety check: ensure skill-path is a legitimate directory under the expected path
     [ -d "{skill-path}" ] && [ -f "{skill-path}/SKILL.md" ] && rm -f {skill-path}/phase-*.json
     echo "✅ phase-1~6-summary.json cleanup complete"
    Note: Only perform cleanup after the completeness check fully passes. If there are missing phases, do not clean up; restart from the missing phase.
Output:
phase-6-summary.json
— Final creation report + compliance check results + security audit conclusion
依赖: 已完成阶段5详细测试(存在phase-5-summary.json)
  1. 资源清理:
    • 检查阶段5创建的所有资源是否已释放
    • 未释放资源 → 提示用户并尝试清理
    • 记录清理结果
  2. 华为云Skill规范合规检查(对照《华为云Skill检查规范》):
    检查项级别验证方式
    SKILL.md存在关键文件存在性检查
    Skill目录位于skills/下路径格式:skills/{category}/{subcategory}/{skill-name}/
    Skill包命名规范目录名称匹配huawei-cloud-{product}-{function}
    一个PR仅提交一个Skill关键git diff检查PR仅影响单个Skill目录
    YAML前端元数据存在关键
    grep '^---$'
    name字段存在关键前端元数据name字段存在且与目录名称一致
    description字段存在关键前端元数据description字段存在且包含功能摘要 + 触发词
    description包含触发词接受
    Triggers include:
    Use when
    或等效触发条件
    不得包含version字段前端元数据中无
    version
    字段
    概述章节匹配
    Overview
    概述
    前置条件章节匹配
    Prerequisites
    前置条件
    工作流章节匹配
    Workflow
    工作流
    核心命令章节匹配
    Core Commands
    核心命令
    参数确认章节匹配
    Parameter Confirmation
    参数确认
    参考文档章节关键匹配
    Reference Documents
    References
    参考文档
    KooCLI命令格式规范章节使用CLI时必填;匹配英文或中文标题
    references/cli-installation-guide.md使用CLI时必填,文件存在性
    references/iam-policies.md关键文件存在性
    references/verification-method.md推荐文件存在性
    references/acceptance-criteria.md推荐文件存在性
    参考文档短横线分隔命名references/下的文件名均为小写短横线分隔格式
    凭证硬编码关键搜索凭证硬编码模式和CLI凭证配置
    跨Skill直接调用关键搜索其他Skill名称
    CLI写入操作需确认检查是否提示用户确认
    服务名称要求每个具体hcloud服务匹配KooCLI服务名称,且以大写/标题大小写开头,例如
    ECS
    CloudPond
    IAMAccessAnalyzer
    操作名称PascalCase格式每个具体操作名称使用PascalCase格式
    包含
    --cli-region
    每个具体CLI命令包含区域参数
    Skill总大小≤40 MB汇总Skill目录下所有文件内容大小
    总文件数≤30统计SKILL.md及所有子目录中的文件数
    SKILL.md行数≤500将超出内容拆分到
    references/
    文件扩展名在白名单内拒绝无扩展名或不在46种白名单内的扩展名
    1. 安全审计:
    由Agent协调
    references/security-audit-guide.md
    中描述的五工具审计。不得直接调用其他命名Skill或其他Skill目录中的脚本。
    该关卡结合skillcheck、markdownlint-cli2、cisco-ai-skill-scanner、华为云规范检查和gitleaks。必须明确覆盖以下关键规范检查:
    检查项要求覆盖范围
    机密泄露检测AK/SK硬编码、
    hcloud configure set
    及报告输出掩码
    漏洞模式检测已知命令注入、反向Shell、危险函数和提示注入模式
    依赖安全检测通过
    pip audit
    safety check
    或等效工具检测已知不安全依赖版本
    不安全配置检测不安全协议、弱密码和不安全默认值
    ERROR或CRITICAL级别的问题必须修复并重新审计。仅WARNING级别的结果需用户明确接受。在
    phase-6-summary.json
    中记录报告路径、 verdict、发现的问题及已接受的警告。
  3. 最终报告:
    • 合并阶段1-6的阶段总结
    • 包含安全审计报告(skill-gate-report)的关键结论
    • 输出完整创建报告
    • 标记所有未完成项
  4. 最终六阶段完整性检查:
    检查phase-1-summary.json是否存在 → 若缺失,从阶段1重新开始
    检查phase-2-summary.json是否存在 → 若缺失,从阶段2重新开始
    检查phase-3-summary.json是否存在 → 若缺失,从阶段3重新开始
    检查phase-4-summary.json是否存在 → 若缺失,从阶段4重新开始
    检查phase-5-summary.json是否存在 → 若缺失,从阶段5重新开始
    检查phase-6-summary.json是否存在 → 若缺失,从阶段6重新开始
    所有阶段完成→创建完成。缺失阶段→从缺失阶段重新开始。
  5. 清理阶段总结文件: 完整性检查通过后,删除Skill目录下所有
    phase-*-summary.json
    文件
    bash
     # 最终完整性检查通过后执行
     # 安全检查:确保skill-path是预期路径下的合法目录
     [ -d "{skill-path}" ] && [ -f "{skill-path}/SKILL.md" ] && rm -f {skill-path}/phase-*.json
     echo "✅ phase-1~6-summary.json 清理完成"
    注意: 仅在完整性检查完全通过后执行清理。若存在缺失阶段,请勿清理;从缺失阶段重新开始。
输出:
phase-6-summary.json
— 最终创建报告 + 合规检查结果 + 安全审计结论

KooCLI Command Format Standard

KooCLI命令格式规范

bash
hcloud <Service> <Operation> --cli-region=<region> [--key=value ...]
FeatureDescriptionExample
Service nameExact KooCLI Service name beginning with uppercase/title case
ECS
,
VPC
,
CloudPond
,
IAMAccessAnalyzer
Operation namePascalCase
ListServers
,
ShowServer
Region parameter
--cli-region=<value>
--cli-region=cn-north-4
Simple parameter
--key=value
--server_id=xxx
Indexed parameter
--key.1=value1
--servers.1.id=xxx
bash
hcloud <Service> <Operation> --cli-region=<region> [--key=value ...]
特性描述示例
服务名称精确的KooCLI服务名称,以大写/标题大小写开头
ECS
,
VPC
,
CloudPond
,
IAMAccessAnalyzer
操作名称PascalCase格式
ListServers
,
ShowServer
区域参数
--cli-region=<value>
--cli-region=cn-north-4
简单参数
--key=value
--server_id=xxx
索引参数
--key.1=value1
--servers.1.id=xxx

Core Commands

核心命令

CommandPurpose
bash scripts/validate-skill.sh {path}
Phase 3/6: Structure and Huawei Cloud specification validation
bash scripts/test-cli-commands.sh {path} --executor {cli|sdk|api}
Phase 4/5: Functional testing
命令用途
bash scripts/validate-skill.sh {path}
阶段3/6:结构与华为云规范验证
bash scripts/test-cli-commands.sh {path} --executor {cli|sdk|api}
阶段4/5:功能测试

Parameter Confirmation

参数确认

ParameterRequiredDescriptionExample
{skill-path}
YesTarget Skill directory pathe.g., huawei-cloud-ecs-manage
{region}
NoHuawei Cloud region
cn-north-4
{executor}
NoExecution mode (cli/sdk/api)
cli
参数必填描述示例
{skill-path}
目标Skill目录路径例如:huawei-cloud-ecs-manage
{region}
华为云区域
cn-north-4
{executor}
执行模式(cli/sdk/api)
cli

Edge Cases

边缘场景

ScenarioHandling
User skips questions and says "start" directlyRemind: requirements analysis must be completed first, start from Phase 1 questions
AK/SK environment variables not setRe-run the Pre-check above. Output the env-var setup template (
export HUAWEI_ACCESS_KEY=...
/
export HUAWEI_SECRET_KEY=...
) and let the user fill it out-of-band. NEVER ask the user to paste AK/SK into chat. If user does not configure, terminate process, strictly prohibited from skipping
Target service not supported by hcloud CLIPhase 2 fallback to SDK → Read SDK source _http_info → If still not found, mark ⛔
SDK package does not existCheck package name variants, if still not found, inform user, do not infer API
User is unsure of API endpointMark ⛔ requires manual verification, do not fabricate endpoints. If SDK has the method, read _http_info for the real path
SDK has method but _http_info has no resource_pathMark ⛔, this API does not exist in the SDK, do not infer
Attempting to infer API via path pattern (e.g., inferring claim-vouchers from coupons)❌ Strictly prohibited. It doesn't exist
Resource creation test failsAnalyze error cause (permissions/quota/parameters) → Fix and retry
Resource release failsRetry 3 times, if still failing, inform user to clean up manually
User refuses resource lifecycle testingInform user: resource lifecycle testing is a required step and cannot be skipped; if user still refuses, terminate process
Phase 6 finds missing phasesRestart from the missing phase until all 6 phases are complete
SDK has method but actual API path unknownRead SDK source
grep _http_info {service}_client.py
to get real path
BSS service SDK initialization fails (GlobalCredentials)BSS is global and must use
GlobalCredentials
with
with_endpoints
, not
BasicCredentials
with
with_region
list_sub_customer_coupons query returns 400BSS limit parameter maximum is 100, not the default 200
Phase 6 security audit FAILFix issues from the audit report, then have the Agent rerun the audit until it passes
skill-scanner false positiveUse
<!-- skill-scanner:ignore -->
comment annotation, or exclude in .secrets.baseline
gitleaks false positiveAdd to
.gitleaksignore
file
场景处理方式
用户跳过问题直接说“开始”提醒:必须先完成需求分析,从阶段1的问题开始
AK/SK环境变量未设置重新运行上述前置检查。输出环境变量设置模板(
export HUAWEI_ACCESS_KEY=...
/
export HUAWEI_SECRET_KEY=...
),让用户在会话外填充。严禁要求用户在聊天中粘贴AK/SK。如果用户未配置,终止流程,严禁跳过
目标服务不被hcloud CLI支持阶段2降级到SDK → 读取SDK源码
_http_info
→ 若仍未找到,标记⛔
SDK包不存在检查包名称变体,若仍未找到,告知用户,不得推断API
用户不确定API端点标记⛔ 需要手动验证,不得伪造端点。如果SDK有对应方法,读取
_http_info
获取真实路径
SDK有方法但
_http_info
中无resource_path
标记⛔,该API在SDK中不存在,不得推断
尝试通过路径模式推断API(例如,从coupons推断claim-vouchers)❌ 严禁操作。该端点不存在
资源创建测试失败分析错误原因(权限/配额/参数)→ 修复后重试
资源释放失败重试3次,若仍失败,告知用户手动清理
用户拒绝资源生命周期测试告知用户:资源生命周期测试是必填步骤,不可跳过;如果用户仍拒绝,终止流程
阶段6发现缺失阶段从缺失阶段重新开始,直到所有6个阶段完成
SDK有方法但实际API路径未知读取SDK源码
grep _http_info {service}_client.py
获取真实路径
BSS服务SDK初始化失败(GlobalCredentials)BSS是全局服务,必须使用
GlobalCredentials
+
with_endpoints
,不得使用
BasicCredentials
+
with_region
list_sub_customer_coupons查询返回400BSS的limit参数最大值为100,而非默认的200
阶段6安全审计失败修复审计报告中的问题,然后由Agent重新运行审计直到通过
skill-scanner误报使用
<!-- skill-scanner:ignore -->
注释标注,或在.secrets.baseline中排除
gitleaks误报添加到
.gitleaksignore
文件

Verification Method

验证方法

Specification Compliance Verification

规范合规验证

bash
bash scripts/validate-skill.sh {skill-path}
bash
bash scripts/validate-skill.sh {skill-path}

Check against 华为云Skill检查规范 item by item

逐项对照《华为云Skill检查规范》检查

undefined
undefined

Functional Testing

功能测试

bash
bash scripts/test-cli-commands.sh {skill-path} --executor cli   # CLI priority
bash scripts/test-cli-commands.sh {skill-path} --executor sdk   # SDK fallback
bash scripts/test-cli-commands.sh {skill-path} --executor api   # API fallback
bash
bash scripts/test-cli-commands.sh {skill-path} --executor cli   # CLI优先
bash scripts/test-cli-commands.sh {skill-path} --executor sdk   # SDK降级
bash scripts/test-cli-commands.sh {skill-path} --executor api   # API降级

Six-Phase Completeness Check

六阶段完整性检查

Final verification: Check whether phase-1-summary.json ~ phase-6-summary.json exist
All exist ✅ → Creation complete
Missing any ❌ → Restart from the missing phase
最终验证:检查phase-1-summary.json ~ phase-6-summary.json是否存在
全部存在 ✅ → 创建完成
缺失任何 ❌ → 从缺失阶段重新开始

Security Audit (Phase 6)

安全审计(阶段6)

Have the Agent orchestrate the tools listed in
references/security-audit-guide.md
, collect their findings into the Phase 6 report, fix every ERROR/CRITICAL issue, and repeat until the gate passes. Do not call another Skill's scripts directly.
由Agent协调
references/security-audit-guide.md
中列出的工具,将发现的问题收集到阶段6报告中,修复所有ERROR/CRITICAL级问题,重复此过程直到关卡通过。不得直接调用其他Skill的脚本。

Reference Documents

参考文档

  • references/cli-installation-guide.md
    — CLI installation and configuration
  • references/iam-policies.md
    — Least-privilege IAM policies
  • references/verification-method.md
    — Verification method details
  • references/dataflow-diagram.md
    — Mermaid data flow diagram
  • references/acceptance-criteria.md
    — Acceptance criteria
  • references/related-commands.md
    — Command quick reference
  • references/security-audit-guide.md
    — Phase 6 five-tool security audit and remediation guide
  • references/cli-installation-guide.md
    — CLI安装与配置
  • references/iam-policies.md
    — 最小权限IAM策略
  • references/verification-method.md
    — 验证方法详情
  • references/dataflow-diagram.md
    — Mermaid数据流图
  • references/acceptance-criteria.md
    — 验收标准
  • references/related-commands.md
    — 命令速查
  • references/security-audit-guide.md
    — 阶段6五工具安全审计与修复指南

Best Practices

最佳实践

  • During Phase 1 requirements analysis, try to cover all functional dimensions to avoid rework in later phases
  • In Phase 2 technical research, prioritize CLI, then SDK, and API last; do not use SDK when CLI is available
  • In Phase 2, read SDK
    _http_info
    to get real API paths; strictly prohibited from inferring
  • In Phase 4/5 testing, mutating operations (Create/Update/Delete) must be confirmed by the user before execution
  • If Phase 6 compliance check fails, fix the issues first, then re-verify; do not skip
  • 阶段1需求分析时,尽量覆盖所有功能维度,避免后续阶段返工
  • 阶段2技术调研时,优先使用CLI,其次是SDK,最后是API;CLI可用时不得使用SDK
  • 阶段2中,读取SDK
    _http_info
    获取真实API路径;严禁推断
  • 阶段4/5测试时,变更类操作(Create/Update/Delete)必须经用户确认后执行
  • 如果阶段6合规检查失败,先修复问题再重新验证;不得跳过

Notes

注意事项

  • Six-phase pipeline strictly follows sequential order; no phase may be skipped
  • API endpoints are only allowed from SDK source
    _http_info
    or Huawei Cloud API Explorer; strictly prohibited from inferring via naming patterns
  • Pre-check is a hard gate. Credentials (AK/SK) are sourced from environment variables or active CLI profile — never read, echoed, hardcoded, or entered through
    hcloud configure set
    with literal values
  • If AK/SK is not set after running the Pre-check, output the env-var setup template (
    export HUAWEI_ACCESS_KEY=...
    /
    export HUAWEI_SECRET_KEY=...
    ) for the user to fill out-of-band. NEVER ask the user to paste AK/SK into chat. If the user does not configure, terminate the process. Strictly prohibited from skipping any step that requires credentials
  • BSS service SDK must use GlobalCredentials + with_endpoints; BasicCredentials must not be used
  • Resources created during resource lifecycle testing must be cleaned up in Phase 6 to avoid leftovers
  • When the Phase 6 security audit fails, CRITICAL/ERROR level issues must be fixed and the Agent must rerun the audit
  • skill-scanner only detects known cloud API key formats; common passwords/Chinese keyword credentials require gitleaks supplementary detection
  • The skillPath in skills-lock.json is: skills/devtools/common/huawei-cloud-skill-creator/SKILL.md
  • 六阶段流水线严格遵循顺序;不得跳过任何阶段
  • API端点仅允许来自SDK源码
    _http_info
    或华为云API Explorer;严禁通过命名模式推断
  • 前置检查是硬性关卡。凭证(AK/SK)来自环境变量或当前CLI配置文件——严禁读取、回显、硬编码或通过带字面值的
    hcloud configure set
    输入
  • 如果运行前置检查后AK/SK未设置,输出环境变量设置模板(
    export HUAWEI_ACCESS_KEY=...
    /
    export HUAWEI_SECRET_KEY=...
    )让用户在会话外填充。严禁要求用户在聊天中粘贴AK/SK。如果用户未配置,终止流程。严禁跳过任何需要凭证的步骤
  • BSS服务SDK必须使用GlobalCredentials + with_endpoints;不得使用BasicCredentials
  • 资源生命周期测试中创建的资源必须在阶段6清理,避免遗留
  • 阶段6安全审计失败时,必须修复CRITICAL/ERROR级问题并由Agent重新运行审计
  • skill-scanner仅检测已知云API密钥格式;通用密码/中文关键词凭证需要gitleaks补充检测
  • skills-lock.json中的skillPath为:skills/devtools/common/huawei-cloud-skill-creator/SKILL.md

Design Principles

设计原则

  • Six-Phase Strict Pipeline — Phases are chain-dependent and cannot be skipped
  • Phase 2 No API Inference — API endpoints only from SDK source
    _http_info
    or Huawei Cloud API Explorer; strictly prohibited from guessing via naming patterns
  • Phase 3 Generate Based on Facts — CLI commands / SDK scripts / API endpoints generated per Phase 2 conclusions; no endpoint → mark ⛔
  • Phase 4/5 Real Execution — Every command must be actually executed and verified; if it fails, fallback or mark
  • Phase 6 Double Check — Resource cleanup + specification compliance + six-phase completeness
  • Credential Security — No hardcoded AK/SK, read from environment variables, write operations require user confirmation
  • Credentials Mandatory — If AK/SK is missing, output the env-var setup template (
    export HUAWEI_ACCESS_KEY=...
    /
    export HUAWEI_SECRET_KEY=...
    ) and let the user fill it out-of-band. Never ask the user to paste AK/SK into chat. If the user does not configure, terminate process. Strictly prohibited from skipping
  • Least Privilege — iam-policies.md provides least-privilege policy JSON
  • 六阶段严格流水线 — 阶段链式依赖,不可跳过
  • 阶段2禁止API推断 — API端点仅来自SDK源码
    _http_info
    或华为云API Explorer;严禁通过命名模式猜测
  • 阶段3基于事实生成 — 根据阶段2结论生成CLI命令/SDK脚本/API端点;无端点则标记⛔
  • 阶段4/5真实执行 — 每个命令必须实际执行并验证;失败则降级或标记
  • 阶段6双重检查 — 资源清理 + 规范合规 + 六阶段完整性
  • 凭证安全 — 无AK/SK硬编码,从环境变量读取,写入操作需用户确认
  • 凭证强制要求 — 如果AK/SK缺失,输出环境变量设置模板(
    export HUAWEI_ACCESS_KEY=...
    /
    export HUAWEI_SECRET_KEY=...
    )让用户在会话外填充。严禁要求用户在聊天中粘贴AK/SK。如果用户未配置,终止流程。严禁跳过