huawei-cloud-skill-tester

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Huawei Cloud Skill Tester — Three-Track Eight-Phase E2E Testing Pipeline

Huawei Cloud Skill Tester — 三轨八阶段端到端测试流水线

Independent, repeatable Huawei Cloud Skill testing framework. Does not depend on skill-creator; can test any existing Huawei Cloud Skill. Focuses on real-environment functional testing and multi-skill orchestration scenarios.

独立、可重复的华为云Skill测试框架。不依赖Skill创建者,可测试任何已有的华为云Skill。 聚焦真实环境功能测试多Skill编排场景

Overview

概述

This Skill provides a three-track, eight-phase standardized testing pipeline (three-tier layout × 8 phase total: Phase 0~6 执行 + Phase 7 终报告):
TierPhasesGoal
Tier 1: Single-Skill Unit TestingPhase 0~4Verify each skill item by item: installation, feature extraction, technical research, test case generation, execution
Tier 2: Integration TestingPhase 5~6Multi-skill orchestration scenario derivation + end-to-end real-environment flow verification
Tier 3: Final ReportPhase 7Consolidated report merging all phase outputs
本Skill提供一套三轨八阶段的标准化测试流水线 (三级架构 × 共8个阶段:阶段0~6执行 + 阶段7最终报告):
层级阶段目标
层级1:单Skill单元测试阶段0~4逐项验证每个Skill:安装、功能提取、技术调研、测试用例生成、执行
层级2:集成测试阶段5~6多Skill编排场景推导 + 端到端真实环境流程验证
层级3:最终报告阶段7合并所有阶段输出的汇总报告

Core Design Principles

核心设计原则

  1. Chain Verification — Before each Phase, check that the previous phase's JSON exists; if missing, refuse to execute
  2. Agent-proof — Write operations require user confirmation for each item; automatic gate bypassing is not allowed
  3. Three-Track Layering — Clear gates between Tiers; Tier 1 must be completed before entering Tier 2
  4. Batch Repeatable — Supports
    --skills "skill-a,skill-b"
    or
    --all-installed
  5. Fallback Strategy — When only 1 skill, Phase 5/6 automatically downgrade to single-skill lifecycle testing. Sibling auto-scan is ON by default (Phase 5/6 自动从被测 skill 同目录找其他 huawei-cloud-* skill 做编排组合测试). Use
    --no-siblings
    to opt-out.
  6. Standardized JSON Output — All phases output in a unified schema; Phase 7 merges into a single report
  7. Real-Environment First — All Tier 2 orchestrations execute against real Huawei Cloud; no mocks or simulations
  1. 链式验证 — 每个阶段执行前检查前一阶段的JSON是否存在;若缺失则拒绝执行
  2. 防Agent自动绕过 — 写入操作需逐项获得用户确认,不允许自动跳过验证门限
  3. 三轨分层 — 各层级间有明确的验证门限;必须完成层级1才能进入层级2
  4. 批量可重复 — 支持
    --skills "skill-a,skill-b"
    --all-installed
    参数
  5. 降级策略 — 仅测试1个Skill时,阶段5/6自动降级为单Skill生命周期测试。默认开启同级Skill自动扫描(阶段5/6自动从被测Skill同目录下查找其他huawei-cloud-* Skill进行编排组合测试)。使用
    --no-siblings
    参数可关闭该功能。
  6. 标准化JSON输出 — 所有阶段均以统一Schema输出;阶段7将所有输出合并为一份报告
  7. 真实环境优先 — 层级2的所有编排均在真实华为云环境执行;不使用模拟或桩对象

Data Flow Diagram

数据流图

User Input (--skills or --all-installed)
    ├── Tier 1 ──── Iterate over each skill ────
    │   Phase 0 → 1 → 2 → 3 → 4
    │   (phase-N-summary.json chain validation)
    ├── Tier 2 ──── Integration ────
    │   Phase 5 (orchestration scenario derivation + real-environment execution)
    │   Phase 6 (e2e full-flow: create→query→update→delete lifecycle)
    │   Only 1 skill → Downgrade single-skill closed loop
    └── Tier 3 ──── Final ────
        Phase 7 (merge phase-0~6 JSON into consolidated report)

用户输入 (--skills 或 --all-installed)
    ├── 层级1 ──── 遍历每个Skill ────
    │   阶段0 → 1 → 2 → 3 → 4
    │   (phase-N-summary.json 链式验证)
    ├── 层级2 ──── 集成测试 ────
    │   阶段5 (编排场景推导 + 真实环境执行)
    │   阶段6 (端到端全流程:创建→查询→更新→删除生命周期)
    │   仅1个Skill → 降级为单Skill闭环测试
    └── 层级3 ──── 最终报告 ────
        阶段7 (合并阶段0~6的JSON为汇总报告)

Prerequisites

前置条件

  1. hcloud CLI installed and authenticated (for Tier 2 CLI mode testing) — Reference: https://support.huaweicloud.com/qs-hcli/hcli_02_003.html
  2. Python 3.8+ +
    huaweicloudsdk
    packages (for SDK mode testing) — SDK Reference: https://console.huaweicloud.com/apiexplorer/#/sdkcenter
  3. Huawei Cloud AK/SK — 自动扫描所有以
    HUAWEI
    /
    HW
    /
    HWC
    开头的环境变量(键名含 AK/SK 标记的键值对)。If missing, the framework emits the env-var setup template to stderr and exits 77. NEVER ask the user to type AK/SK in chat; user must set env vars in their shell profile out-of-band and re-run.(完整协议见
    references/agent-protocol.md
  4. Target Skill must be under
    $SKILL_INSTALL_DIR/
    (auto-detected:
    ~/.agents/skills/
    ~/.hermes/skills/
    → default) or a user-specified path
  5. jq command (all JSON processing depends on it)
  6. API Reference: https://console.huaweicloud.com/apiexplorer/#/openapi

  1. 已安装并认证hcloud CLI(用于层级2的CLI模式测试)—— 参考文档:https://support.huaweicloud.com/qs-hcli/hcli_02_003.html
  2. Python 3.8+ +
    huaweicloudsdk
    包(用于SDK模式测试)—— SDK参考文档:https://console.huaweicloud.com/apiexplorer/#/sdkcenter
  3. 华为云AK/SK — 自动扫描所有以
    HUAWEI
    /
    HW
    /
    HWC
    开头且键名包含AK/SK标识的环境变量键值对。若缺失,框架会向stderr输出环境变量配置模板并以状态码77退出。绝对禁止在对话中要求用户输入AK/SK;用户必须在其shell配置文件中带外设置环境变量后重新运行。(完整协议见
    references/agent-protocol.md
  4. 目标Skill必须位于
    $SKILL_INSTALL_DIR/
    下(自动检测路径:
    ~/.agents/skills/
    ~/.hermes/skills/
    → 默认路径),或用户指定的路径中
  5. jq命令(所有JSON处理均依赖该命令)
  6. API参考文档https://console.huaweicloud.com/apiexplorer/#/openapi

Workflow — Three-Track Eight-Phase

工作流程 — 三轨八阶段

Tier 1: Single-Skill Unit Testing
   Phase 0: Installation Verification (install/uninstall/reinstall)
   Phase 1: Feature Extraction (metadata + commands + resource types + doc checks)
   Phase 2: Technical Research (CLI→SDK→API three-level availability)
   Phase 3: Test Case Generation (functional TC-F + boundary + negative + API TC-A)
   Phase 4: Real-Environment Execution (read-only automatic + write ops require confirmation)

Tier 2: Integration Testing — Real-Environment Orchestration
   Phase 5: Multi-Skill Orchestration (conflict scan / scenario derivation / self-check)
   Phase 6: End-to-End Flow (resource lifecycle: create→query→update→delete)

Tier 3: Final Report
   Phase 7: Consolidated Report (merge phase-0~6 JSON, verdict + issues + reasons)
各 Phase 的完整实现规范(步骤、判定标准、JSON 字段)见
references/phase-details.md

层级1:单Skill单元测试
   阶段0:安装验证(安装/卸载/重新安装)
   阶段1:功能提取(元数据 + 命令 + 资源类型 + 文档检查)
   阶段2:技术调研(CLI→SDK→API三级可用性)
   阶段3:测试用例生成(功能用例TC-F + 边界用例 + 负向用例 + API用例TC-A)
   阶段4:真实环境执行(自动执行只读用例 + 写入操作需用户确认)

层级2:集成测试 — 真实环境编排
   阶段5:多Skill编排(冲突扫描 / 场景推导 / 自检)
   阶段6:端到端流程(资源生命周期:创建→查询→更新→删除)

层级3:最终报告
   阶段7:汇总报告(合并阶段0~6的JSON,包含判定结果 + 问题 + 原因)
各阶段的完整实现规范(步骤、判定标准、JSON字段)见
references/phase-details.md

Phases at a Glance

阶段概览

Phase名称核心要点判定
0安装验证目录完整性(SKILL.md + references/ + iam-policies.md 硬性, scripts/ 软性兼容纯 CLI skill); install/uninstall/reinstall(同路径/符号链接防护)目录四件套 + 生命周期
1功能提取metadata/triggers/commands/capabilities/resource_types + doc_checks(引用一致性、禁用文件 .bak/.template)命令与触发词非空
2技术调研CLI→SDK→API 三级可用性; 纯本地工具自动标记 not_applicable按可用性计数
3用例生成正向 + 边界(limit=1) + 负向(未知参数)用例; 占位符替换(/path/to、./xxx、{region}); 模板/交互命令过滤用例数 > 0
4执行自动执行 + 输出质量判定(rc=0 空输出→warn); 负向用例报错质量; 文档缺口分析(doc_gap_issues); 依赖缺失标注pass/fail/warn/skip
5编排多 skill: 触发词冲突扫描 + 数据流候选; 单 skill: 降级自检(内部歧义 + 写操作排序)conflict scan
6全流程多 skill: 场景派生; 单 skill: 降级完整功能闭环(create→query→update→delete)scenario steps
7报告合并 phase-0~6; verdict + pass_rate + issues_found + 各 phase reason; test-report.json/md汇总判定
详细步骤、链式验证规则、JSON schema 见
references/phase-details.md
references/output-schema-spec.md

阶段名称核心要点判定
0安装验证目录完整性(SKILL.md + references/ + iam-policies.md为硬性要求,scripts/为软性兼容纯CLI Skill); 安装/卸载/重新安装(同路径/符号链接防护)目录四件套 + 生命周期验证通过
1功能提取metadata/triggers/commands/capabilities/resource_types + 文档检查(引用一致性、禁用文件.bak/.template)命令与触发词非空
2技术调研CLI→SDK→API三级可用性; 纯本地工具自动标记not_applicable按可用性计数统计
3用例生成正向 + 边界(limit=1) + 负向(未知参数)用例; 占位符替换(/path/to、./xxx、{region}); 模板/交互命令过滤用例数 > 0
4执行自动执行 + 输出质量判定(rc=0但空输出→警告); 负向用例报错质量; 文档缺口分析(doc_gap_issues); 依赖缺失标注pass/fail/warn/skip
5编排多Skill: 触发词冲突扫描 + 数据流候选; 单Skill: 降级自检(内部歧义 + 写操作排序)完成冲突扫描
6全流程多Skill: 场景派生; 单Skill: 降级为完整功能闭环(create→query→update→delete)完成场景步骤执行
7报告合并阶段0~6结果; verdict + pass_rate + issues_found + 各阶段原因; 生成test-report.json/md汇总判定完成
详细步骤、链式验证规则、JSON schema见
references/phase-details.md
references/output-schema-spec.md

KooCLI Command Format Standard

KooCLI命令格式规范

This testing framework uses
bash
scripts as the primary execution mode, not direct
hcloud
CLI commands. However, when executing test cases, the framework constructs
hcloud
CLI commands in the following format:
bash
hcloud <Service> <Operation> --cli-region={region} [--param1=value1 ...]
Format Rules:
RuleDescription
Service nameFollows KooCLI Services (uppercase: ECS, VPC, OBS; title case: CloudPond, IAMAccessAnalyzer)
Operation namePascalCase (e.g., ListServersDetails, ListBuckets)
RegionAlways include
--cli-region={region}
parameter
ParametersUse
--param=value
syntax
Read-only limitAlways append
--limit=1
for exploratory queries
For OBS service, the framework uses
hcloud obs
(obsutil) subsystem:
bash
hcloud obs <command> [args...] [options...]

本测试框架以bash脚本为主要执行方式,而非直接调用hcloud CLI命令。但在执行测试用例时,框架会按以下格式构造hcloud CLI命令:
bash
hcloud <Service> <Operation> --cli-region={region} [--param1=value1 ...]
格式规则:
规则描述
服务名称遵循KooCLI服务命名(大写:ECS、VPC、OBS;首字母大写:CloudPond、IAMAccessAnalyzer)
操作名称PascalCase格式(例如:ListServersDetails、ListBuckets)
区域必须包含
--cli-region={region}
参数
参数使用
--param=value
语法
只读限制探索性查询必须追加
--limit=1
对于OBS服务,框架使用
hcloud obs
(obsutil)子系统:
bash
hcloud obs <command> [args...] [options...]

Core Commands

核心命令

Full Pipeline Run

完整流水线运行

bash
undefined
bash
undefined

Specify skills

指定单个Skill

bash scripts/run-test-pipeline.sh --skills "huawei-cloud-bss-voucher-manage"
bash scripts/run-test-pipeline.sh --skills "huawei-cloud-bss-voucher-manage"

Specify multiple skills (comma-separated)

指定多个Skill(逗号分隔)

bash scripts/run-test-pipeline.sh --skills "huawei-cloud-bss-voucher-manage, huawei-cloud-ecs-manage"
bash scripts/run-test-pipeline.sh --skills "huawei-cloud-bss-voucher-manage, huawei-cloud-ecs-manage"

Scan all installed

扫描所有已安装的Skill

bash scripts/run-test-pipeline.sh --all-installed
bash scripts/run-test-pipeline.sh --all-installed

Start from a specific phase (recovery scenarios only)

从指定阶段开始运行(仅用于恢复场景)

bash scripts/run-test-pipeline.sh --skills "bss-voucher" --phase 4
bash scripts/run-test-pipeline.sh --skills "bss-voucher" --phase 4

Fresh mode

全新模式运行

bash scripts/run-test-pipeline.sh --skills "bss-voucher" --fresh
undefined
bash scripts/run-test-pipeline.sh --skills "bss-voucher" --fresh
undefined

Single Phase Run (Debug)

单个阶段运行(调试用)

bash
bash scripts/tier1/phase-0-install-check.sh --skill "huawei-cloud-bss-voucher-manage"
bash scripts/tier1/phase-1-skill-analysis.sh --skill "huawei-cloud-bss-voucher-manage"
bash scripts/tier2/phase-5-orchestration.sh --skills "skill-a, skill-b"
bash scripts/tier3/phase-7-final-report.sh --skills "skill-a, skill-b"
bash
bash scripts/tier1/phase-0-install-check.sh --skill "huawei-cloud-bss-voucher-manage"
bash scripts/tier1/phase-1-skill-analysis.sh --skill "huawei-cloud-bss-voucher-manage"
bash scripts/tier2/phase-5-orchestration.sh --skills "skill-a, skill-b"
bash scripts/tier3/phase-7-final-report.sh --skills "skill-a, skill-b"

Run Multi-Skill Orchestration

运行多Skill编排测试

bash
undefined
bash
undefined

Derive and execute orchestration scenarios for 3 skills

为3个Skill推导并执行编排场景

bash scripts/tier2/phase-5-orchestration.sh --skills "ecs-manage, vpc-manage, eip-manage"
bash scripts/tier2/phase-5-orchestration.sh --skills "ecs-manage, vpc-manage, eip-manage"

Run E2E lifecycle test for a single skill

为单个Skill运行端到端生命周期测试

bash scripts/tier2/phase-6-full-flow.sh --skill "huawei-cloud-rds-intelligent-service"

---
bash scripts/tier2/phase-6-full-flow.sh --skill "huawei-cloud-rds-intelligent-service"

---

Parameters

参数说明

ParameterRequiredDescriptionExample
--skills
Mutually exclusiveComma-separated skill names or directory names
"bss-voucher-manage, ecs-manage"
--all-installed
Mutually exclusiveScan all
huawei-cloud-*
under
$SKILL_INSTALL_DIR/huawei-cloud/
--phase
NoStart from a specific Phase (defaults to resume from missing phase)
--phase 0
--fresh
NoArchive (move, not delete) existing
phase-*.json
to
phases/archive/<timestamp>/
and start from scratch. History is preserved; nothing is deleted.
--output
NoReport output directory (default: reports/)
--output ./test-reports
--skill-path
NoSkill directory path. When set,
find_skill_path
searches only here (no install-dir fallback)
--skill-path ./skills
--no-siblings
NoPhase 5/6 自动扫描同目录其他 huawei-cloud-* skill(默认: 开启扫描)
--no-siblings
--sibling-limit <N>
No兄弟 skill 数量上限(默认 5;
0
= 等同
--no-siblings
--sibling-limit 3
参数必填性描述示例
--skills
与--all-installed互斥逗号分隔的Skill名称或目录名称
"bss-voucher-manage, ecs-manage"
--all-installed
与--skills互斥扫描
$SKILL_INSTALL_DIR/huawei-cloud/
下所有huawei-cloud-* Skill
--phase
从指定阶段开始运行(默认从缺失的阶段恢复)
--phase 0
--fresh
将现有
phase-*.json
归档(移动而非删除)到
phases/archive/<timestamp>/
并从头开始运行。历史记录会被保留;不会删除任何内容。
--output
报告输出目录(默认:reports/)
--output ./test-reports
--skill-path
Skill目录路径。设置后,
find_skill_path
仅在此路径下查找(不使用默认安装目录回退)
--skill-path ./skills
--no-siblings
阶段5/6自动扫描同目录下其他huawei-cloud-* Skill(默认:开启扫描)
--sibling-limit <N>
同级Skill数量上限(默认5;
0
等同于
--no-siblings
--sibling-limit 3

Environment Variables (Advanced)

环境变量(高级配置)

VariableDefaultPurpose
SKILL_INSTALL_DIR
auto-detect:
~/.agents/skills
~/.hermes/skills
~/.agents/skills
Where skills are installed by the agent runtime
SKILL_PATH_HERMES
alias of
SKILL_INSTALL_DIR
Legacy name, kept for back-compat
SKILL_INSTALL_CMD
hermes skills
Command for remote skill install/uninstall. Set to
""
to skip real install.
ALLOW_WRITES
0
When
1
, Phase 4/6 write cases actually execute against the live API (default is skip)
HUAWEI_REGION
cn-north-4
Huawei Cloud region
HUAWEI_ACCESS_KEY
/
HUAWEI_SECRET_KEY
Required for Phase 4/6 SDK/CLI execution; any
HUAWEI*
/
HW*
/
HWC*
prefixed AK/SK env var is also accepted

变量默认值用途
SKILL_INSTALL_DIR
自动检测:
~/.agents/skills
~/.hermes/skills
~/.agents/skills
Agent运行时安装Skill的目录
SKILL_PATH_HERMES
SKILL_INSTALL_DIR
的别名
遗留命名,为兼容旧版本保留
SKILL_INSTALL_CMD
hermes skills
远程Skill安装/卸载命令。设置为空字符串可跳过真实安装操作。
ALLOW_WRITES
0
设为
1
时,阶段4/6的写入用例会真实调用API执行(默认跳过)
HUAWEI_REGION
cn-north-4
华为云区域
HUAWEI_ACCESS_KEY
/
HUAWEI_SECRET_KEY
阶段4/6的SDK/CLI执行必填;任何以
HUAWEI*
/
HW*
/
HWC*
为前缀的AK/SK环境变量均会被识别

References

参考文档

核心文档(必读)

核心文档(必读)

  • references/architecture.md
    — Three-track eight-phase architecture diagram (Mermaid)
  • references/output-schema-spec.md
    — Complete JSON field specification for each phase (including Phase 7 final report schema)
  • references/phase-transition-rules.md
    — Phase transition / fallback / skip rules
  • references/acceptance-criteria.md
    — Quality gates + 17-item report acceptance checklist
  • references/verification-method.md
    — How to manually verify each phase (PowerShell + Git Bash)
  • references/phase-details.md
    — 各 Phase 完整实现规范(步骤、判定标准、JSON 字段)
  • references/agent-protocol.md
    — 凭证请求协议(AK/SK 缺失时的完整处理流程)
  • references/architecture.md
    — 三轨八阶段架构图(Mermaid格式)
  • references/output-schema-spec.md
    — 各阶段完整JSON字段规范(含阶段7最终报告Schema)
  • references/phase-transition-rules.md
    — 阶段转换/降级/跳过规则
  • references/acceptance-criteria.md
    — 质量门限 + 17项报告验收检查清单
  • references/verification-method.md
    — 手动验证各阶段的方法(PowerShell + Git Bash)
  • references/phase-details.md
    — 各阶段完整实现规范(步骤、判定标准、JSON字段)
  • references/agent-protocol.md
    — 凭证请求协议(AK/SK缺失时的完整处理流程)

配套参考

配套参考

  • references/cli-installation-guide.md
    — How to install and configure hcloud CLI (prerequisite for Phase 2/4)
  • references/iam-policies.md
    — Minimum IAM permissions required to run the tester
  • references/cli-installation-guide.md
    — hcloud CLI安装与配置指南(阶段2/4的前置条件)
  • references/iam-policies.md
    — 运行测试器所需的最小IAM权限

模板(JSON Schema)

模板(JSON Schema)

  • templates/phase-report-schema.json
    — JSON Schema for
    phase-N-summary.json
    (N=0..6)
  • templates/test-case-schema.json
    — JSON Schema for individual test cases (
    TC-F-*
    /
    TC-A-*
    /
    OF-*
    /
    FF-*
    )
  • templates/scenario-template.json
    — Reference example for Phase 6 multi-skill scenario derivation

  • templates/phase-report-schema.json
    phase-N-summary.json
    的JSON Schema(N=0..6)
  • templates/test-case-schema.json
    — 单个测试用例的JSON Schema(
    TC-F-*
    /
    TC-A-*
    /
    OF-*
    /
    FF-*
  • templates/scenario-template.json
    — 阶段6多Skill场景推导的参考示例

Output Format

输出格式

All test artifacts go to a sibling directory of the tested skill, named
<skill-name>-test-files/
. This keeps the skill source dir clean and preserves run history for diff/regression.
skills/
├── huawei-cloud-rds-query/                  ← skill source (untouched)
└── huawei-cloud-rds-query-test-files/       ← test artifacts (created on first run, kept across runs)
    ├── phases/
    │   ├── phase-0-summary.json
    │   ├── phase-1-summary.json
    │   ├── ...
    │   └── phase-7-summary.json
    └── reports/
        ├── report-20260724-152309/          ← one subdir per run (timestamped)
        │   ├── test-report.json
        │   └── test-report.md
        ├── report-20260725-090000/
        │   ├── test-report.json
        │   └── test-report.md
        └── ...
  • Phase 0~6 output
    phase-N-summary.json
    to
    <skill-name>-test-files/phases/
  • Phase 7 merges them into
    <skill-name>-test-files/reports/report-<timestamp>/test-report.{json,md}
  • Test artifacts are preserved across runs (no auto-cleanup, ever).
    --fresh
    does NOT delete — it archives old
    phases/*.json
    to
    phases/archive/<timestamp>/
    so the chain check resets while history stays intact.
    reports/
    is always kept.
  • The test-installed copy of the skill in
    $SKILL_INSTALL_DIR/
    is still uninstalled on exit, so the next run sees a clean install state.
See
references/output-schema-spec.md
for the JSON schema. Phase 5 and 6 additionally output scenario execution logs with real CLI/SDK responses for auditability.
所有测试产物均会被保存到被测Skill的同级目录,目录名为
<skill-name>-test-files/
。这样可保持Skill源码目录干净,并保留运行历史用于差异对比/回归测试。
skills/
├── huawei-cloud-rds-query/                  ← Skill源码目录(未被修改)
└── huawei-cloud-rds-query-test-files/       ← 测试产物目录(首次运行时创建,跨运行保留)
    ├── phases/
    │   ├── phase-0-summary.json
    │   ├── phase-1-summary.json
    │   ├── ...
    │   └── phase-7-summary.json
    └── reports/
        ├── report-20260724-152309/          ← 每次运行对应一个子目录(带时间戳)
        │   ├── test-report.json
        │   └── test-report.md
        ├── report-20260725-090000/
        │   ├── test-report.json
        │   └── test-report.md
        └── ...
  • 阶段0~6
    phase-N-summary.json
    输出到
    <skill-name>-test-files/phases/
  • 阶段7将所有阶段输出合并到
    <skill-name>-test-files/reports/report-<timestamp>/test-report.{json,md}
  • 测试产物会被跨运行保留(永远不会自动清理)。
    --fresh
    参数不会删除旧产物——它会将旧的
    phases/*.json
    归档到
    phases/archive/<timestamp>/
    ,这样链式验证会重置但历史记录仍会保留。
    reports/
    目录会一直被保留。
  • 测试安装的Skill副本在退出时仍会被卸载,因此下次运行会处于干净的安装状态。
各阶段JSON Schema详见
references/output-schema-spec.md
。阶段5和6还会输出包含真实CLI/SDK响应的场景执行日志,以便审计。

Best Practices

最佳实践

  • Complete Tier 1 before entering Tier 2 to ensure skills are individually functional before orchestration
  • Confirm write operations one by one in Phase 4 and Phase 5/6; do not batch-confirm to avoid misoperations
  • With only 1 skill, Phase 5/6 automatically downgrade to single-skill closed loop; no need to manually skip
  • When using
    --fresh
    to reset and rerun, confirm there are no uncleaned test resources
  • Review orchestration scenarios before execution to ensure resource dependency order is correct
  • 进入层级2前先完成层级1,确保单个Skill功能正常后再进行编排测试
  • 在阶段4和阶段5/6中逐项确认写入操作,不要批量确认以避免误操作
  • 仅测试1个Skill时,阶段5/6会自动降级为单Skill闭环测试,无需手动跳过
  • 使用
    --fresh
    参数重置并重新运行时,确认没有未清理的测试资源
  • 执行前查看编排场景,确保资源依赖顺序正确

Notes

注意事项

  • Three-track eight-phase strictly follows sequential order; chain verification prevents skipping
  • API endpoints are strictly prohibited from being inferred; only obtain from SDK
    _http_info
    or API Explorer
  • Credentials are read from environment variables; hardcoding is prohibited
  • If AK/SK is missing, the framework emits the env-var setup template to stderr and exits 77. The Agent MUST output that template to the user verbatim and instruct them to set env vars out-of-band (in their shell / PowerShell $PROFILE). The Agent MUST NEVER ask the user to type or paste AK/SK in chat. Strictly prohibited from silently skipping any step that requires credentials.(完整协议见
    references/agent-protocol.md
  • Resources created during testing must be tracked; if any are left behind, output manual cleanup instructions
  • Orchestration scenarios are auto-derived; user should review and confirm before execution
  • Write operations in orchestration scenarios require per-step user confirmation
  • 三轨八阶段严格遵循顺序执行;链式验证会阻止跳过任何阶段
  • 严禁推断API端点;仅能从SDK的
    _http_info
    或API Explorer获取
  • 凭证从环境变量读取;严禁硬编码
  • 若AK/SK缺失,框架会向stderr输出环境变量配置模板并以状态码77退出。Agent必须将该模板原样输出给用户,并指导用户在其shell/PowerShell $PROFILE中带外设置环境变量,然后重新运行。绝对禁止在对话中要求用户输入或粘贴AK/SK。严禁静默跳过任何需要凭证的步骤。(完整协议见
    references/agent-protocol.md
  • 测试期间创建的资源必须被跟踪;若有残留,需输出手动清理说明
  • 编排场景为自动推导;用户应在执行前查看并确认
  • 编排场景中的写入操作需逐项获得用户确认

Edge Cases

边缘场景处理

ScenarioHandling
Skill directory does not existReport error and terminate, output available skill list
AK/SK environment variables not setFramework emits the env-var setup template (with
export HUAWEI_ACCESS_KEY=<your-access-key>
/
$env:HUAWEI_ACCESS_KEY=<your-access-key>
placeholder snippets) to stderr and exits 77. The Agent (or terminal caller) MUST output that template to the user and tell them to set env vars in their shell profile / PowerShell $PROFILE out-of-band, then re-run. Never ask the user to type or paste AK/SK in chat. Strictly prohibited from silently skipping.
User specifies skill name but not installed in Hermes
--fresh
performs directory-level detection; if not found, report error with guidance
Some Phase JSON files deletedChain detection → Restart from the deleted Phase
Network interruption during Phase 4 executionAlready executed case results are not lost; on rerun, skip passed cases (via
--phase
flag)
User hits Ctrl+C mid-executionAlready output phase JSON is valid; next time
--resume
will recover from the current phase
Only 1 skill under testPhase 5 →
downgraded_self_check
(single-skill trigger ambiguity scan); Phase 6 →
downgraded_single_skill_flow
(real execution)
User unsatisfied with derived orchestration scenariosManually edit the derived scenario or skip it; Phase 5 derivation is metadata-only, not executed
Phase 4 write op with no
ALLOW_WRITES=1
Skipped with
status=skip
, no resource_changes recorded
Phase 4 hits missing business params (e.g. coupon_id)Marked
status=warn
, surfaces as
manual_test_items
in the report; user must supply real data and retry
Cross-skill data flow mismatchLogged in Phase 5 as
data_flow_tests
candidate; not auto-executed
Orphaned resources detected after E2E flowListed in
phase-6-summary.json
under
cleanup.manual_required
with concrete cleanup commands
场景处理方式
Skill目录不存在报告错误并终止,输出可用Skill列表
AK/SK环境变量未设置框架向stderr输出环境变量配置模板(包含
export HUAWEI_ACCESS_KEY=<your-access-key>
/
$env:HUAWEI_ACCESS_KEY=<your-access-key>
占位符片段)并以状态码77退出。Agent(或终端调用者)必须将该模板输出给用户,并告知用户在其shell配置文件/PowerShell $PROFILE中带外设置环境变量,然后重新运行。绝对禁止在对话中要求用户输入或粘贴AK/SK。严禁静默跳过。
用户指定Skill名称但未在Hermes中安装
--fresh
参数会执行目录级检测;若未找到,会报告错误并给出指导
部分阶段JSON文件被删除链式检测→从缺失的阶段重新开始运行
阶段4执行期间网络中断已执行的用例结果不会丢失;重新运行时可通过
--phase
参数跳过已通过的用例
用户在执行期间按Ctrl+C已输出的阶段JSON仍然有效;下次运行
--resume
会从当前阶段恢复
仅测试1个Skill阶段5→
downgraded_self_check
(单Skill触发歧义扫描);阶段6→
downgraded_single_skill_flow
(真实环境执行)
用户对推导的编排场景不满意可手动编辑推导的场景或跳过;阶段5仅进行元数据推导,不会执行
阶段4的写入操作未设置
ALLOW_WRITES=1
会被标记为
status=skip
,不会记录resource_changes
阶段4遇到缺失的业务参数(例如coupon_id)会被标记为
status=warn
,并在报告中作为
manual_test_items
呈现;用户必须提供真实数据并重试
跨Skill数据流不匹配在阶段5中被记录为
data_flow_tests
候选;不会自动执行
端到端流程后检测到孤立资源
phase-6-summary.json
cleanup.manual_required
中列出,并提供具体的清理命令

Agent Protocol — Credential Request

Agent协议 — 凭证请求

When Phase 4 or Phase 6 needs to call live Huawei Cloud APIs but cannot find credentials in the environment, the framework does not silently skip. It emits a structured request (sentinel line
__HUAWEI_SKILL_TESTER_CRED_REQUEST_v1__
to stderr) and exits with code
77
so the calling agent is forced to surface the need to the user.
核心规则(MUST follow):
  1. 检测到 exit 77 或 sentinel → 暂停流水线,不得跳过 Phase 5/7
  2. 将 stderr 中的 env-var 设置模板原样输出给用户,引导用户在 shell profile / PowerShell $PROFILE 中带外配置(占位符
    <your-access-key-id>
    /
    <your-secret-access-key>
    )
  3. 禁止在对话中索要 AK/SK 明文(ask_user / read -p / 剪贴板回传 / 读取 ~/.hcloud/config.json 等路径)
  4. 用户带外设置后,重跑失败 phase;用户拒绝则明确标记"live phases skipped — no credentials",不得标记 pass
完整协议(6 步响应流程、直接终端模式、示例行为)见
references/agent-protocol.md
当阶段4或阶段6需要调用华为云真实API但无法在环境中找到凭证时,框架不会静默跳过。它会向stderr输出结构化请求(标记行
__HUAWEI_SKILL_TESTER_CRED_REQUEST_v1__
)并以状态码
77
退出,以便调用Agent必须向用户提示凭证需求。
核心规则(必须遵守):
  1. 检测到退出码77或标记行→暂停流水线,不得跳过阶段5/7
  2. 将stderr中的环境变量配置模板原样输出给用户,引导用户在shell配置文件/PowerShell $PROFILE中带外配置(占位符
    <your-access-key-id>
    /
    <your-secret-access-key>
  3. 禁止在对话中索要AK/SK明文(ask_user/read -p/剪贴板回传/读取~/.hcloud/config.json等路径)
  4. 用户带外设置后,重新运行失败的阶段;用户拒绝则明确标记"live phases skipped — no credentials",不得标记为pass
完整协议(6步响应流程、直接终端模式、示例行为)见
references/agent-protocol.md

Design Principles

设计原则

  • Chain Verification — Each Phase checks the previous phase's JSON to prevent skipping
  • Agent-proof — Write operations must be confirmed by the user; fake confirmations are not allowed
  • Data-Driven — All phases output in JSON format; Phase 7 merges
  • Batch Repeatable — The same set of skills can be tested repeatedly; --fresh resets
  • Real-Environment First — All orchestrations and E2E flows execute against real Huawei Cloud; no mocks
  • Degrade Without Losing Value — Single skill does not run empty orchestration phases; degrades to meaningful single-skill lifecycle tests
  • Resource Safety — Resources created during testing must be tracked; if any remain, output clear manual cleanup instructions
  • Credentials Mandatory — If AK/SK is missing, the framework emits the env-var setup template to stderr and exits 77. The Agent MUST output that template to the user and instruct them to set env vars out-of-band. The Agent MUST NEVER ask the user to type or paste AK/SK in chat. Strictly prohibited from silently skipping any step that requires credentials.
  • 链式验证 — 每个阶段检查前一阶段的JSON以防止跳过
  • 防Agent自动绕过 — 写入操作必须获得用户确认,不允许虚假确认
  • 数据驱动 — 所有阶段均以JSON格式输出;阶段7进行合并
  • 批量可重复 — 同一组Skill可重复测试;--fresh参数可重置
  • 真实环境优先 — 所有编排和端到端流程均在真实华为云环境执行;不使用模拟
  • 降级仍有价值 — 单Skill不会运行空的编排阶段;会降级为有意义的单Skill生命周期测试
  • 资源安全 — 测试期间创建的资源必须被跟踪;若有残留,需输出清晰的手动清理说明
  • 凭证必填 — 若AK/SK缺失,框架会向stderr输出环境变量配置模板并以状态码77退出。Agent必须将该模板输出给用户,并指导用户带外设置环境变量。绝对禁止在对话中要求用户输入或粘贴AK/SK。严禁静默跳过任何需要凭证的步骤。