huawei-cloud-skill-creator
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseHuawei 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 -style env var is FORBIDDEN).
HUAWEI_ACCESS_KEY - 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 with literal credential strings passed via the CLI's
hcloud configure set/cli-<ak-flag>parameters or any equivalent in-band secret-entry form.cli-<sk-flag> - ONLY use to check credential status — non-interactive, read-only, no secrets echoed.
hcloud configure list
- 严禁读取、回显或打印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 listCheck the output for a valid profile (AK/SK, or temporary security credentials / agency-assumed role).
If no valid profile exists, STOP here.
-
Obtain credentials from Huawei Cloud Console → 身份与访问管理 (IAM) → 我的凭证 → 新增访问密钥.
-
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):bashhcloud configure # interactive; prompts for AK/SK in the user's terminal -
After the user confirms they have configured env vars (or run), re-run
hcloud configure. If the profile is valid → resume Phase 1. If still missing → terminate, do not proceed.hcloud configure list
Reuse the active CLI profile for all subsequentandhcloudcalls. Do not print or hardcode secrets. Do not replace this gate withhuaweicloudsdk,obsutil configwith literal arguments, SDK credentials constructors filled with literal strings (for example, the SDK'shcloud configure setbuilt from string literals rather than env vars), or any other in-session secret-entry flow.BasicCredentials
bash
hcloud configure list检查输出中是否存在有效的配置文件(AK/SK,或临时安全凭证/委托角色)。
如果不存在有效配置文件,请立即停止。
-
从华为云控制台 → 身份与访问管理 (IAM) → 我的凭证 → 新增访问密钥 获取凭证。
-
向用户输出以下可直接复制粘贴的环境变量设置代码块(请在本次会话外填充真实值,切勿在聊天中填写)。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不得使用字面值调用此命令):bashhcloud configure # 交互式操作;在用户终端中提示输入AK/SK -
用户确认已配置环境变量(或执行了)后,重新运行
hcloud configure。如果配置文件有效→继续阶段1。如果仍缺失→终止流程,不得继续。hcloud configure list
所有后续和hcloud调用均复用当前CLI配置文件。不得打印或硬编码机密信息。不得使用huaweicloudsdk、带字面参数的obsutil config、填充字面字符串的SDK凭证构造函数(例如,使用字符串字面量而非环境变量构建SDK的hcloud configure set)或任何其他会话内机密输入流程替代此关卡。BasicCredentials
Credential Source Priority
凭证来源优先级
When invoking commands later (Phase 2/4/5), the skill accepts credentials in this priority order:
| Priority | Source | Notes |
|---|---|---|
| 1 | Environment variables | Auto-scan all variables prefixed with |
| 2 | | Active CLI profile — preferred for hcloud calls |
| 3 | IAM agency / temporary credentials | AK/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 | 环境变量 | 自动扫描所有以 |
| 2 | | 当前CLI配置文件——优先用于hcloud调用 |
| 3 | IAM委托/临时凭证 | AK/SK + SecurityToken(编程访问) |
如果阶段4/5测试开始时以上来源均不可用,请提示用户通过会话外渠道配置并重新运行前置检查。如果仍不可用,终止流程——严禁跳过需要凭证的步骤。
Prerequisites
前置条件
- 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
- Authentication verified via the Pre-check above (
- Python 3.8+ with packages available — SDK Reference: https://console.huaweicloud.com/apiexplorer/#/sdkcenter
huaweicloudsdk - Node.js + npx available
- Huawei Cloud AK/SK — Auto-scan all environment variables prefixed /
HUAWEI/HWmatchingHWC/ACCESS_KEY/_AK/SECRET_KEY. Hardcoding AK/SK in scripts, docs, or command lines is forbidden._SK - API Reference: https://console.huaweicloud.com/apiexplorer/#/openapi
- 已安装并认证hcloud CLI — 参考文档:https://support.huaweicloud.com/qs-hcli/hcli_02_003.html
- 已通过上述前置检查验证认证状态()。
hcloud configure list
- 已通过上述前置检查验证认证状态(
- Python 3.8+ 且已安装包 — SDK参考文档:https://console.huaweicloud.com/apiexplorer/#/sdkcenter
huaweicloudsdk - 已安装Node.js + npx
- 华为云AK/SK — 自动扫描所有以/
HUAWEI/HW开头、匹配HWC/ACCESS_KEY/_AK/SECRET_KEY的环境变量。严禁在脚本、文档或命令行中硬编码AK/SK。_SK - 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:
- Target Service — Which Huawei Cloud service? (ECS, VPC, OBS, RDS, BSS, etc.)
- Feature Scope — What should the Skill do? (Query, Diagnose, Deploy, Monitor, Manage)
- Execution Mode — Prefer CLI / SDK / API?
- CLI Operations — Which operations are involved? (List, Show, Create, Delete, Update)
- 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: — User-confirmed requirements description
phase-1-summary.json目标: 通过逐问对话明确用户需求。
- 一次提出一个问题,等待用户回复
- 覆盖以下维度:
- 目标服务 — 针对华为云哪项服务?(ECS、VPC、OBS、RDS、BSS等)
- 功能范围 — Skill需要实现什么功能?(查询、诊断、部署、监控、管理)
- 执行模式 — 偏好CLI / SDK / API?
- CLI操作 — 涉及哪些操作?(List、Show、Create、Delete、Update)
- 触发场景 — Agent会在何时调用此Skill?(日常巡检、故障排查、自动扩缩容)
- 每提问5次或覆盖所有维度后→展示需求总结表格→等待用户确认
- 🛑 获得用户明确确认前,不得进入阶段2
输出: — 用户确认后的需求描述
phase-1-summary.jsonPhase 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:
| Priority | Research Method | Verification Command | Success Criteria |
|---|---|---|---|
| 1st | CLI — hcloud command | | Command exists and parameters are valid |
| 2nd | SDK — huaweicloudsdk | | SDK package installed and class importable |
| 3rd | API — Only from the following two sources | See rules below | Endpoint 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 Source | Method |
|---|---|
① SDK source | |
| ② 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 → Mark ⛔, do not infer
_http_info
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确认的每个功能点,按以下顺序调研可用性:
| 优先级 | 调研方式 | 验证命令 | 成功标准 |
|---|---|---|---|
| 1 | CLI — hcloud命令 | | 命令存在且参数有效 |
| 2 | SDK — huaweicloudsdk | | SDK包已安装且类可导入 |
| 3 | API — 仅可从以下两个来源获取 | 见下方规则 | 端点来自可信来源,不得推断 |
核心规则:API端点取证(禁止猜测)
API端点仅允许来自以下两个来源。严禁通过命名模式推断:
| 可信来源 | 方式 |
|---|---|
① SDK源码中的 | |
| ② 华为云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
undefinedMethod 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端点)
_http_infogrep "_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:
-
Name the Skill — Useand make the frontmatter
huawei-cloud-{product}-{function}match the directory name.name -
Language — Generate SKILL.md in English by default. Chinese documentation may be added inas supplementary. The main SKILL.md must use English for frontmatter description, section titles, command examples, and all explanatory content.
references/ -
Frontmatter — Include,
namewith a feature summary and trigger conditions, and no more than fivedescription. Do not generate atagsfield.version -
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 -
SKILL.md content generation rules:
Execution Mode Command Format in SKILL.md CLI hcloud <Service> <Operation> --cli-region={region} [--params]SDK Python script example ( )python3 -c "..."API curl command + user-provided endpoint (mark as user-provided) Unavailable Mark , do not generate specific commandsrequires manual verification -
Required sections in SKILL.md:
Section Severity Description YAML Frontmatter Critical +namewith feature summary and trigger conditions +description; notagsversionOverview High Feature overview, architecture, applicable scenarios Prerequisites High CLI version, authentication configuration, IAM permissions Workflow High Skill workflow steps Core Commands High Command examples grouped by function Parameter Confirmation High User-configurable parameter table Reference Documents Critical Links to documents under references/KooCLI Command Format Standard Low Required when CLI is involved; service, operation, region, and parameter syntax -
Generate Mermaid data flow diagram →.
references/dataflow-diagram.md -
Generate IAM policies →using least privilege.
references/iam-policies.md -
Record API references — Keep verified API paths in. If a generated Skill needs reusable API documentation, add a reference file under
phase-2-summary.jsonusing an allowed kebab-case filename.references/ -
Package limits — Total file content size ≤ 40 MB, total files ≤ 30, and SKILL.md ≤ 500 lines. Split oversized SKILL.md content into.
references/ -
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. Files without an extension or outside this allowlist must be removed or renamed..svg -
Change scope — A pull request must change only one Skill directory. Useto validate the PR diff when a base ref is available.
BASE_REF=<base-ref> bash scripts/validate-skill.sh {skill-path}
🛑 Strictly prohibited from generating hallucinated URIs / fabricated API paths. Feature points not verified in Phase 2 must not have specific commands written.
Output: — List of generated files and structure validation results
phase-3-summary.json依赖: 已完成阶段2技术调研(存在phase-2-summary.json)
根据阶段2结论生成Skill文件:
-
命名Skill — 使用格式,确保前端元数据
huawei-cloud-{product}-{function}与目录名称一致。name -
语言 — 默认生成英文SKILL.md。中文文档可作为补充添加到目录中。主SKILL.md的前端元数据描述、章节标题、命令示例及所有说明内容必须使用英文。
references/ -
前端元数据 — 包含、带功能摘要和触发条件的
name,以及不超过5个description。不得生成tags字段。version -
创建目录结构: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 -
SKILL.md内容生成规则:
执行模式 SKILL.md中的命令格式 CLI hcloud <Service> <Operation> --cli-region={region} [--params]SDK Python脚本示例 ( )python3 -c "..."API curl命令 + 用户提供的端点(标记为用户提供) 不可用 标记 ,不得生成具体命令requires manual verification -
SKILL.md必填章节:
章节 重要程度 描述 YAML前端元数据 关键 + 带功能摘要和触发条件的name+description;无tagsversion概述 高 功能概述、架构、适用场景 前置条件 高 CLI版本、认证配置、IAM权限 工作流 高 Skill工作流步骤 核心命令 高 按功能分组的命令示例 参数确认 高 用户可配置参数表 参考文档 关键 目录下文档的链接references/KooCLI命令格式规范 低 使用CLI时必填;服务、操作、区域和参数语法 -
生成Mermaid数据流图 →。
references/dataflow-diagram.md -
生成IAM策略 →,遵循最小权限原则。
references/iam-policies.md -
记录API参考 — 将已验证的API路径保留在中。如果生成的Skill需要可复用的API文档,在
phase-2-summary.json目录下添加参考文件,使用允许的短横线分隔命名法。references/ -
包限制 — 总文件内容大小≤40 MB,总文件数≤30,SKILL.md≤500行。将过大的SKILL.md内容拆分到目录中。
references/ -
文件扩展名白名单 — 每个文件必须使用以下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 -
变更范围 — 一个Pull Request只能修改一个Skill目录。当存在基准引用时,使用验证PR差异。
BASE_REF=<base-ref> bash scripts/validate-skill.sh {skill-path}
🛑 严禁生成虚构URI/伪造API路径。阶段2未验证的功能点不得编写具体命令。
输出: — 生成文件列表及结构验证结果
phase-3-summary.jsonPhase 4: Test Preparation
阶段4:测试准备
Dependency: Phase 3 document generation completed (phase-3-summary.json exists)
-
Generate test cases — Split test cases based on Phase 2/3 feature points
Case Type Coverage Requirement Example CLI cases One case per hcloud command hcloud ECS ListServers --cli-region=cn-north-4 --limit=1SDK cases One case per SDK call list_sub_customer_coupons(limit=1)API cases One case per user-provided endpoint curl -X GET {endpoint} -
Save test cases as JSON →
templates/test-vars.jsonjson{ "test_cases": [ {"id": "TC-01", "name": "...", "command": "...", "expected": "..."}, ... ] } -
Show all test cases to the user for confirmation
-
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
-
-
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: — Test case list + per-case execution results
phase-4-summary.json依赖: 已完成阶段3文档生成(存在phase-3-summary.json)
-
生成测试用例 — 根据阶段2/3的功能点拆分测试用例
用例类型 覆盖要求 示例 CLI用例 每个hcloud命令对应一个用例 hcloud ECS ListServers --cli-region=cn-north-4 --limit=1SDK用例 每个SDK调用对应一个用例 list_sub_customer_coupons(limit=1)API用例 每个用户提供的端点对应一个用例 curl -X GET {endpoint} -
将测试用例保存为JSON →
templates/test-vars.jsonjson{ "test_cases": [ {"id": "TC-01", "name": "...", "command": "...", "expected": "..."}, ... ] } -
向用户展示所有测试用例并确认
-
执行测试:
-
从环境变量读取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)前,必须提示用户并等待确认
-
-
测试验证流程:
每个用例 → 尝试CLI执行 ├── ✅ 成功 → 记录PASS └── ❌ 失败 → 检查语法问题 ├── ✅ 语法问题 → 修复后重试 └── ❌ 非语法问题 → 降级到SDK ├── ✅ 成功 → 记录PASS(SDK) └── ❌ 失败 → 降级到API(用户提供的端点) ├── ✅ 成功 → 记录PASS(API) └── ❌ 失败 → 记录FAIL ⛔ 需要手动验证
输出: — 测试用例列表 + 每个用例的执行结果
phase-4-summary.jsonPhase 5: Detailed Testing
阶段5:详细测试
Dependency: Phase 4 test preparation completed (phase-4-summary.json exists)
-
Full regression: Execute all test cases generated in Phase 4
-
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
-
Management-type Skills:
- If CRUD operations are involved → End-to-end full testing
- If query-only → Output query results to test report
-
Report generation:
- Test results aggregated by case
- Detailed record of resource changes
- Detailed error information for failed cases
Output: — Detailed test results + resource operation records
phase-5-summary.json依赖: 已完成阶段4测试准备(存在phase-4-summary.json)
-
全量回归: 执行阶段4生成的所有测试用例
-
资源生命周期测试(适用于涉及资源创建/修改/删除的Skill):
- 创建资源 → 验证创建成功(查询确认)
- 运行时查询 → 验证资源状态正确
- 删除资源 → 验证资源已释放
- 测试报告输出已创建/修改/删除资源的信息
- 每一步操作前都需提示用户并等待确认
-
管理类Skill:
- 如果涉及CRUD操作 → 端到端全量测试
- 如果仅为查询类 → 将查询结果输出到测试报告
-
生成报告:
- 按用例汇总测试结果
- 详细记录资源变更情况
- 详细记录失败用例的错误信息
输出: — 详细测试结果 + 资源操作记录
phase-5-summary.jsonPhase 6: Resource Cleanup and Compliance Check
阶段6:资源清理与合规检查
Dependency: Phase 5 detailed testing completed (phase-5-summary.json exists)
-
Resource Cleanup:
- Check whether all resources created in Phase 5 have been released
- Unreleased resources → Prompt user and attempt cleanup
- Record cleanup results
-
Huawei Cloud Skill Specification Compliance Check (against 华为云Skill检查规范):
Check Item Level Verification Method SKILL.md exists Critical File existence check Skill directory under skills/ Low Path format: skills/{category}/{subcategory}/{skill-name}/ Skill package naming convention High Directory name matches huawei-cloud-{product}-{function} One PR submits only one Skill Critical git diff checks that PR changes only affect a single Skill directory YAML Frontmatter exists Critical grep '^---$'name field exists Critical Frontmatter name field exists and matches directory name description field exists Critical Frontmatter description field exists and contains feature summary + trigger words description includes trigger words Medium Accept ,Triggers include:, or equivalent trigger conditionsUse whenShould not contain version field Low No field in frontmatterversionOverview section High Match orOverview概述Prerequisites section High Match orPrerequisites前置条件Workflow section High Match orWorkflow工作流Core Commands section High Match orCore Commands核心命令Parameter Confirmation section High Match orParameter Confirmation参数确认Reference Documents section Critical Match ,Reference Documents, orReferences参考文档KooCLI Command Format Standard section Low Required when CLI is involved; match the English or Chinese heading references/cli-installation-guide.md High Required when CLI is involved, file existence references/iam-policies.md Critical File existence references/verification-method.md Medium Recommended file existence references/acceptance-criteria.md Low Recommended file existence Reference document kebab-case naming Low File names under references/ are all lowercase kebab-case Credential hardcoding Critical grep for credential hardcoding patterns and CLI credential config Cross-Skill direct calls Critical grep other Skill names CLI write operations require confirmation Low Check whether user confirmation is prompted Service name requirement Medium Every concrete hcloud service matches a KooCLI Service name and starts with uppercase/title case, such as ,ECS, orCloudPondIAMAccessAnalyzerOperation name PascalCase Medium Every concrete operation name uses PascalCase Includes --cli-regionMedium Every concrete CLI command includes the region parameter Total skill size ≤ 40 MB Medium Sum all file content sizes under the Skill directory Total file count ≤ 30 Medium Count SKILL.md and every file in all subdirectories SKILL.md line count ≤ 500 Medium Split excess content into references/File extensions in allowlist Medium Reject extensionless files and extensions outside the 46-type allowlist - Security Audit:
Have the Agent orchestrate the five-tool audit described in. Do not invoke another named Skill or call scripts from another Skill directory directly.references/security-audit-guide.mdThe gate combines skillcheck, markdownlint-cli2, cisco-ai-skill-scanner, the Huawei Cloud specification check, and gitleaks. It must explicitly cover these Critical specification checks:Check Required coverage Secret leak detection AK/SK hardcoding, , and report-output maskinghcloud configure setVulnerability pattern detection Known command injection, reverse shell, dangerous function, and prompt injection patterns Dependency security detection Known unsafe dependency versions via ,pip audit, or an equivalent toolsafety checkInsecure configuration detection Insecure 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 -
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
-
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 6All phases complete → Creation done. Missing phases → Restart from the missing phase. -
Clean up phase summary files: After completeness check passes, delete allfiles under the skill directory
phase-*-summary.jsonbash# 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: — Final creation report + compliance check results + security audit conclusion
phase-6-summary.json依赖: 已完成阶段5详细测试(存在phase-5-summary.json)
-
资源清理:
- 检查阶段5创建的所有资源是否已释放
- 未释放资源 → 提示用户并尝试清理
- 记录清理结果
-
华为云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或CloudPondIAMAccessAnalyzer操作名称PascalCase格式 中 每个具体操作名称使用PascalCase格式 包含 --cli-region中 每个具体CLI命令包含区域参数 Skill总大小≤40 MB 中 汇总Skill目录下所有文件内容大小 总文件数≤30 中 统计SKILL.md及所有子目录中的文件数 SKILL.md行数≤500 中 将超出内容拆分到 references/文件扩展名在白名单内 中 拒绝无扩展名或不在46种白名单内的扩展名 - 安全审计:
由Agent协调中描述的五工具审计。不得直接调用其他命名Skill或其他Skill目录中的脚本。references/security-audit-guide.md该关卡结合skillcheck、markdownlint-cli2、cisco-ai-skill-scanner、华为云规范检查和gitleaks。必须明确覆盖以下关键规范检查:检查项 要求覆盖范围 机密泄露检测 AK/SK硬编码、 及报告输出掩码hcloud configure set漏洞模式检测 已知命令注入、反向Shell、危险函数和提示注入模式 依赖安全检测 通过 、pip audit或等效工具检测已知不安全依赖版本safety check不安全配置检测 不安全协议、弱密码和不安全默认值 ERROR或CRITICAL级别的问题必须修复并重新审计。仅WARNING级别的结果需用户明确接受。在中记录报告路径、 verdict、发现的问题及已接受的警告。phase-6-summary.json -
最终报告:
- 合并阶段1-6的阶段总结
- 包含安全审计报告(skill-gate-report)的关键结论
- 输出完整创建报告
- 标记所有未完成项
-
最终六阶段完整性检查:
检查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重新开始所有阶段完成→创建完成。缺失阶段→从缺失阶段重新开始。 -
清理阶段总结文件: 完整性检查通过后,删除Skill目录下所有文件
phase-*-summary.jsonbash# 最终完整性检查通过后执行 # 安全检查:确保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.jsonKooCLI Command Format Standard
KooCLI命令格式规范
bash
hcloud <Service> <Operation> --cli-region=<region> [--key=value ...]| Feature | Description | Example |
|---|---|---|
| Service name | Exact KooCLI Service name beginning with uppercase/title case | |
| Operation name | PascalCase | |
| Region parameter | | |
| Simple parameter | | |
| Indexed parameter | | |
bash
hcloud <Service> <Operation> --cli-region=<region> [--key=value ...]| 特性 | 描述 | 示例 |
|---|---|---|
| 服务名称 | 精确的KooCLI服务名称,以大写/标题大小写开头 | |
| 操作名称 | PascalCase格式 | |
| 区域参数 | | |
| 简单参数 | | |
| 索引参数 | | |
Core Commands
核心命令
| Command | Purpose |
|---|---|
| Phase 3/6: Structure and Huawei Cloud specification validation |
| Phase 4/5: Functional testing |
| 命令 | 用途 |
|---|---|
| 阶段3/6:结构与华为云规范验证 |
| 阶段4/5:功能测试 |
Parameter Confirmation
参数确认
| Parameter | Required | Description | Example |
|---|---|---|---|
| Yes | Target Skill directory path | e.g., huawei-cloud-ecs-manage |
| No | Huawei Cloud region | |
| No | Execution mode (cli/sdk/api) | |
| 参数 | 必填 | 描述 | 示例 |
|---|---|---|---|
| 是 | 目标Skill目录路径 | 例如:huawei-cloud-ecs-manage |
| 否 | 华为云区域 | |
| 否 | 执行模式(cli/sdk/api) | |
Edge Cases
边缘场景
| Scenario | Handling |
|---|---|
| User skips questions and says "start" directly | Remind: requirements analysis must be completed first, start from Phase 1 questions |
| AK/SK environment variables not set | Re-run the Pre-check above. Output the env-var setup template ( |
| Target service not supported by hcloud CLI | Phase 2 fallback to SDK → Read SDK source _http_info → If still not found, mark ⛔ |
| SDK package does not exist | Check package name variants, if still not found, inform user, do not infer API |
| User is unsure of API endpoint | Mark ⛔ 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_path | Mark ⛔, 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 fails | Analyze error cause (permissions/quota/parameters) → Fix and retry |
| Resource release fails | Retry 3 times, if still failing, inform user to clean up manually |
| User refuses resource lifecycle testing | Inform user: resource lifecycle testing is a required step and cannot be skipped; if user still refuses, terminate process |
| Phase 6 finds missing phases | Restart from the missing phase until all 6 phases are complete |
| SDK has method but actual API path unknown | Read SDK source |
| BSS service SDK initialization fails (GlobalCredentials) | BSS is global and must use |
| list_sub_customer_coupons query returns 400 | BSS limit parameter maximum is 100, not the default 200 |
| Phase 6 security audit FAIL | Fix issues from the audit report, then have the Agent rerun the audit until it passes |
| skill-scanner false positive | Use |
| gitleaks false positive | Add to |
| 场景 | 处理方式 |
|---|---|
| 用户跳过问题直接说“开始” | 提醒:必须先完成需求分析,从阶段1的问题开始 |
| AK/SK环境变量未设置 | 重新运行上述前置检查。输出环境变量设置模板( |
| 目标服务不被hcloud CLI支持 | 阶段2降级到SDK → 读取SDK源码 |
| SDK包不存在 | 检查包名称变体,若仍未找到,告知用户,不得推断API |
| 用户不确定API端点 | 标记⛔ 需要手动验证,不得伪造端点。如果SDK有对应方法,读取 |
SDK有方法但 | 标记⛔,该API在SDK中不存在,不得推断 |
| 尝试通过路径模式推断API(例如,从coupons推断claim-vouchers) | ❌ 严禁操作。该端点不存在 |
| 资源创建测试失败 | 分析错误原因(权限/配额/参数)→ 修复后重试 |
| 资源释放失败 | 重试3次,若仍失败,告知用户手动清理 |
| 用户拒绝资源生命周期测试 | 告知用户:资源生命周期测试是必填步骤,不可跳过;如果用户仍拒绝,终止流程 |
| 阶段6发现缺失阶段 | 从缺失阶段重新开始,直到所有6个阶段完成 |
| SDK有方法但实际API路径未知 | 读取SDK源码 |
| BSS服务SDK初始化失败(GlobalCredentials) | BSS是全局服务,必须使用 |
| list_sub_customer_coupons查询返回400 | BSS的limit参数最大值为100,而非默认的200 |
| 阶段6安全审计失败 | 修复审计报告中的问题,然后由Agent重新运行审计直到通过 |
| skill-scanner误报 | 使用 |
| gitleaks误报 | 添加到 |
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检查规范》检查
undefinedundefinedFunctional 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 fallbackbash
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 , 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.
references/security-audit-guide.md由Agent协调中列出的工具,将发现的问题收集到阶段6报告中,修复所有ERROR/CRITICAL级问题,重复此过程直到关卡通过。不得直接调用其他Skill的脚本。
references/security-audit-guide.mdReference Documents
参考文档
- — CLI installation and configuration
references/cli-installation-guide.md - — Least-privilege IAM policies
references/iam-policies.md - — Verification method details
references/verification-method.md - — Mermaid data flow diagram
references/dataflow-diagram.md - — Acceptance criteria
references/acceptance-criteria.md - — Command quick reference
references/related-commands.md - — Phase 6 five-tool security audit and remediation guide
references/security-audit-guide.md
- — CLI安装与配置
references/cli-installation-guide.md - — 最小权限IAM策略
references/iam-policies.md - — 验证方法详情
references/verification-method.md - — Mermaid数据流图
references/dataflow-diagram.md - — 验收标准
references/acceptance-criteria.md - — 命令速查
references/related-commands.md - — 阶段6五工具安全审计与修复指南
references/security-audit-guide.md
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 to get real API paths; strictly prohibited from inferring
_http_info - 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获取真实API路径;严禁推断
_http_info - 阶段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 or Huawei Cloud API Explorer; strictly prohibited from inferring via naming patterns
_http_info - 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 with literal values
hcloud configure set - If AK/SK is not set after running the Pre-check, output the env-var setup template (/
export HUAWEI_ACCESS_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 credentialsexport HUAWEI_SECRET_KEY=... - 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源码或华为云API Explorer;严禁通过命名模式推断
_http_info - 前置检查是硬性关卡。凭证(AK/SK)来自环境变量或当前CLI配置文件——严禁读取、回显、硬编码或通过带字面值的输入
hcloud configure set - 如果运行前置检查后AK/SK未设置,输出环境变量设置模板(/
export HUAWEI_ACCESS_KEY=...)让用户在会话外填充。严禁要求用户在聊天中粘贴AK/SK。如果用户未配置,终止流程。严禁跳过任何需要凭证的步骤export HUAWEI_SECRET_KEY=... - 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 or Huawei Cloud API Explorer; strictly prohibited from guessing via naming patterns
_http_info - 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=...) 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 skippingexport HUAWEI_SECRET_KEY=... - Least Privilege — iam-policies.md provides least-privilege policy JSON
- 六阶段严格流水线 — 阶段链式依赖,不可跳过
- 阶段2禁止API推断 — API端点仅来自SDK源码或华为云API Explorer;严禁通过命名模式猜测
_http_info - 阶段3基于事实生成 — 根据阶段2结论生成CLI命令/SDK脚本/API端点;无端点则标记⛔
- 阶段4/5真实执行 — 每个命令必须实际执行并验证;失败则降级或标记
- 阶段6双重检查 — 资源清理 + 规范合规 + 六阶段完整性
- 凭证安全 — 无AK/SK硬编码,从环境变量读取,写入操作需用户确认
- 凭证强制要求 — 如果AK/SK缺失,输出环境变量设置模板(/
export HUAWEI_ACCESS_KEY=...)让用户在会话外填充。严禁要求用户在聊天中粘贴AK/SK。如果用户未配置,终止流程。严禁跳过export HUAWEI_SECRET_KEY=...