qa-scenario-tree
将需求解构的结果系统化转化为主路径、备选路径、异常路径、业务规则四类测试场景。当业务流程复杂、涉及多个页面跳转或状态变化、需要确保关键路径和异常路径都有覆盖时,应当使用此技能。不要只测"正常流程"——场景树的核心价值是暴露那些"用户可能不会按你预期操作"的分支和异常路径。每个场景带唯一 ID(SC-{模块缩写}-{序号})并关联回需求 ID(REQ-)。 触发场景:构建场景、测试场景、场景树、场景设计、测试路径、场景覆盖、业务流程复杂需要系统化梳理时。 Use when the user asks about: building a test scenario tree — main path, alternate path, exception path, and data flow scenarios with traceable SC-/REQ- IDs. Skill: qa-scenario-tree Owner: kokxi Summary: 将需求解构的结果系统化转化为主路径、备选路径、异常路径、业务规则四类测试场景。当业务流程复杂、涉及多个页面跳转或状态变化、需要确保关键路径和异常路径都有覆盖时,应当使用此技能。不要只测"正常流程"——场景树的核心价值是暴露那些"用户可能不会按你预期操作"的分支和异常路径。每个场景带唯一 ID(SC-{模块缩写}-{序号})并关联回需求 ID(REQ-)。 触发场景:构建场景、测试场景、场景树、场景设计、测试路径、场景覆盖、业务流程复杂需要系统化梳理时。 Use when the user asks about: building a test scenario tree — main path, alternate path, exception path, and data flow scenarios with traceable S
Rank
62
Safety
84
Downloads
1.1k
Updated
Oct 11, 2026
Version
1.8.0
Source
CLAWHUB
About
What it does, and when to use it.
Capability contract not published. No trust telemetry is available yet. 1.1K downloads reported by the source. Last updated 10/11/2026.
Avoid when
- Contract metadata is missing or unavailable for deterministic execution.
Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing
Public facts
Every fact links back to the source it came from.
- Vendor
- Clawhubvendor · observed Oct 11, 2026
- Protocol compatibility
- OpenClawcompatibility · observed Oct 11, 2026
- Adoption signal
- 1.1K downloadsadoption · observed Oct 11, 2026
- Latest release
- 1.8.0release · observed Sep 29, 2026
- Handshake status
- UNKNOWNsecurity
Install and run
Setup complexity: low.
clawhub skill install s170jw3s1atcj5jwhqb4r7v7eh8912kp:qa-scenario-tree- Setup complexity is classified as HIGH. You must provision dedicated cloud infrastructure or an isolated VM. Do not run this directly on your local workstation.
- Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.
Contract: missing
curl -s "https://www.xpersona.co/api/v1/agents/clawhub-kokxi-qa-scenario-tree/snapshot"
Documentation
CLAWHUB
81,696 characters of source documentation, loaded on request.
Extracted files
5 files captured from the source.
SKILL.md
---
name: qa-scenario-tree
description: >-
将需求解构的结果系统化转化为主路径、备选路径、异常路径、业务规则四类测试场景。当业务流程复杂、涉及多个页面跳转或状态变化、需要确保关键路径和异常路径都有覆盖时,应当使用此技能。不要只测"正常流程"——场景树的核心价值是暴露那些"用户可能不会按你预期操作"的分支和异常路径。每个场景带唯一 ID(SC-{模块缩写}-{序号})并关联回需求 ID(REQ-)。
触发场景:构建场景、测试场景、场景树、场景设计、测试路径、场景覆盖、业务流程复杂需要系统化梳理时。 Use when the user asks about: building a test scenario tree — main path, alternate path, exception path, and data flow scenarios with traceable SC-/REQ- IDs.
license: MIT
allowed-tools: Read Grep Glob
metadata:
display-name: "Scenario Tree"
version: "1.8.0"
when-to-use: "用户说\"构建场景\"、\"测试场景\"、\"场景树\"、\"场景设计\"、\"测试路径\"、\"场景覆盖\"、完成需求解构后需要设计测试、业务流程复杂需要系统化梳理时"
related-skills: "{\"upstream\":[\"qa-req-deconstruction\"],\"downstream\":[\"qa-boundary-deep-dive\",\"qa-combination-strategy\",\"qa-state-transition\",\"qa-ai-context-engineering\",\"qa-ai-output-critique\",\"qa-domain-modeling\",\"qa-execution-observation\",\"qa-exploratory-testing\",\"qa-test-case-design\"]}"
references: "[\"assets/scenario-template.md\",\"references/scenario-types.md\"]"
input-format: "{\"required\":[{\"name\":\"需求解构表\",\"type\":\"object\",\"description\":\"来自qa-req-deconstruction的输出,包含需求ID、显性/隐性/衍生需求\"}],\"optional\":[{\"name\":\"风险评估\",\"type\":\"object\",\"description\":\"来自qa-risk-intuition的输出,包含高风险区域\"}]}"
output-format: "{\"traceability\":[\"每个场景带唯一ID:SC-{模块缩写}-{序号}(如 SC-LOGIN-001)\",\"关联需求ID:REQ-{需求模块缩写}-{序号}(REQ- 才是需求前缀,SC- 是场景前缀,TC_ 是用例前缀——三者不可混用)\"],\"structure\":[{\"scenario_tree\":\"场景树:按 主路径/分支路径/异常路径/数据流 四类组织,场景ID树内连续\"},{\"scenario_block\":\"单场景描述块:路径类型|关联需求|前置条件|触发条件|操作步骤|预期结果|数据变化|风险等级\"},\"数量:需求数 ×3(简单)/ ×5(中等)/ ×7(复杂);分支=需求×2、异常=需求×1.5、数据流=需求×0.5,非整数时向下取整\",\"本技能不产出 9 列用例表 —— 用例由 qa-test-case-design 分配 TC_ 编号并生成\",\"覆盖率:标注口径(基于现有需求解构表),禁止\\\"全覆盖/100%\\\"绝对化表述;未覆盖路径标注\\\"未覆盖+原因\\\"\"],\"happy_path\":\"主路径场景\",\"alternative_path\":\"分支路径场景\",\"exception_path\":\"异常路径场景\",\"data_flow\":\"数据流场景\"}"
error-recovery-guidance: "{\"on_failure\":\"场景树遗漏异常路径时回退到需求解构补充\",\"retry_behavior\":\"补全异常需求后重新构建场景树\"}"
categories: "[\"Development\",\"Requirements\"]"
depth-requirement: "{\"reference_value\":\"见正文「场景数量要求」表:以需求数为基准,简单=需求数×3 / 中等=×5 / 复杂=×7(绝对倍数)\",\"minimum\":\"四类路径(主路径/分支路径/异常路径/数据流)至少覆盖3类;未覆盖的类必须标注原因\"}"
---
> ⚠️ 本技能单独使用效果有限,建议配合完整技能集(12 步工作流)使用。安装:npx skills add Kokxi/qa-test-skills
> **⚠️ 安全警告**:本技能的示例可能涉及订单号、支付金额、截图、身份证、手机号等敏感数据。
> 实际使用时请勿粘贴真实生产数据、客户信息或财务凭证;测试前应脱敏/掩码处理。
> 本技能仅在 workspace/ 输出评估文件,不持久化、不外传、不跨会话复用。
# 场景树构建
## 核心原则
用树结构组织测试场景,确保覆盖完整、层次清晰。
**不要只测正常流程**——场景树的核心价值是暴露那些"用户可能不会按你预期操作"的分支和异常路径。
## 1. 四类路径速查
| 路径类型 | 覆盖目标 | 数量 | 最容易漏 |
|---------|---------|------|---------|
| **主路径** | 核心业务流程完整性 | 需求数 ×1 | 多角色主路径不同 |
| **分支路径** | 条件分支、用户选择 | 需求数 ×2 | 配置项组合、权限分支 |
| **异常路径** | 各类异常处理 | 需求数 ×1.5 | 第三方超时后的**恢复能力** |
| **数据流** | 数据 CRUD + 跨模块一致性 | 需求数 ×0.5 | 跨模块数据同步断链 |
> 非整数时**向下取整**(5 条需求 → 异常 7 条、数据流 2 条),不要为凑数造半条场景。
> 四类至少覆盖 3 类,未覆盖的类必须写明原因——四类全上的场景树在真实项目里很少。
## 2. 场景数量要求
**关键指标**:以需求数为基准,按项目复杂度放大。
| 复杂度 | 倍数 | 示例(需求 5 条) | 复杂度判断标准 |
|--------|----_meta.json
{
"ownerId": "kn71y9b23csfx0ykgm55d5m9x5891zt8",
"slug": "qa-scenario-tree",
"version": "1.8.0",
"publishedAt": 1790656086222
}references/scenario-types.md
# 四类场景详解与构建方法
> 本文是 `qa-scenario-tree` 的**方法详图**。需要展开某一类场景的完整覆盖清单、或按四步法逐类构建时读本文;
> 只想确认四类各占多少、重点看哪类时读 `SKILL.md` 的速查表即可。
## 编号规则
| 对象 | 格式 | 示例 |
|------|------|------|
| 场景 ID | `SC-{模块缩写}-{序号}` | `SC-LOGIN-001` |
| 需求 ID | `REQ-{需求模块缩写}-{序号}` | `REQ-AUTH-001` |
> `TC_` 是**用例** ID 前缀,由 `qa-test-case-design` 分配。本技能产出场景不产用例,
> 不要用 `TC_` 编场景号。`SC-` 与 `REQ-` 均为 `docs/standards.md` 已定义前缀。
---
## 1. 主路径场景(Happy Path)
**目标**:核心业务流程完整性。每个角色一条——多角色系统里各角色主路径不同。
```text
覆盖清单:
├─ 核心业务流程是否覆盖?
├─ 正常用户操作路径是否覆盖?
├─ 主要功能点是否覆盖?
└─ 每个角色是否各有一条主路径?(多租户/多权限系统)
```
**识别方法**:用户从开始到结束,最正常的操作路径是什么?
```text
1. 用户起点:用户从哪里开始?
2. 核心步骤:必须执行的步骤有哪些?
3. 用户终点:用户在哪里结束?
4. 成功标志:怎么算完成?
```
**示例(电商下单)**:
```text
用户浏览商品 → 加入购物车 → 选择地址 → 选择支付 → 确认支付 → 支付成功 → 生成订单
```
---
## 2. 分支路径场景(Alternative Path)
**目标**:条件分支与用户选择。**数量最多**(需求数 ×2),也是最容易漏的。
```text
覆盖清单:
├─ 不同用户角色是否覆盖? ← 最容易漏
├─ 不同业务规则是否覆盖?
├─ 不同配置选项是否覆盖?
├─ 不同数据状态是否覆盖?
└─ 不同环境条件是否覆盖?
```
**识别方法**:在主路径的每一步,有什么条件分支?
```text
1. 条件判断:if-else 条件是什么?
2. 用户选择:用户有哪些选择?
3. 状态分支:不同状态走不同路径?
4. 配置分支:不同配置走不同路径?
```
**示例(电商下单)**:
```text
- 选择地址:有地址 / 无地址 / 新增地址
- 选择支付:微信 / 支付宝 / 银行卡
- 使用优惠券:有 / 无 / 过期
```
> **典型遗漏**:配置项的组合。单个配置项都测了,"A 配置 + B 配置同时开启"没测 ——
> 这类交叉要交给 `qa-combination-strategy`。
---
## 3. 异常路径场景(Exception Path)
**目标**:各类异常处理。**数量取整后按需求数 ×1.5 向下取整**(如 5 条需求 → 7 条,不是 7.5 条)。
```text
覆盖清单:
├─ 输入异常:空值 / 超长 / 格式错误
├─ 状态异常:非法状态转换 ← 交给 qa-state-transition 深化
├─ 网络异常:断网 / 超时 / 延迟
├─ 依赖异常:第三方服务故障 ← 资损重灾区
├─ 并发异常:数据冲突 / 资源竞争
└─ 资源异常:内存不足 / 磁盘满
```
**识别方法**:在每个步骤,可能出什么问题?怎么恢复?
```text
1. 输入异常:用户输入错误
2. 系统异常:系统故障
3. 网络异常:网络问题
4. 依赖异常:第三方服务问题
5. 并发异常:并发操作问题
```
**示例(电商下单)**:
```text
- 加入购物车:库存不足
- 选择地址:地址不存在
- 支付:支付失败
- 支付:网络中断
```
> **别只测"报错了"**。异常路径必须验证**恢复能力**:报错后系统处于什么状态、
> 用户能不能重试、重试会不会产生重复副作用。资损场景(支付/退款)尤其如此。
---
## 4. 数据流场景(Data Flow)
**目标**:数据 CRUD + 跨模块一致性。数量最少(需求数 ×0.5),但**最容易被整个漏掉**。
```text
覆盖清单:
├─ 数据创建是否覆盖?
├─ 数据读取是否覆盖?
├─ 数据更新是否覆盖?
├─ 数据删除是否覆盖?
├─ 数据同步是否覆盖? ← 跨模块,最容易漏
└─ 数据一致性是否覆盖? ← 多个模块读写同一份数据
```
**识别方法**:数据在模块间怎么流转?在哪创建/更新/删除?
```text
1. 数据创建:在哪里创建数据?
2. 数据读取:在哪里读取数据?
3. 数据更新:在哪里更新数据?
4. 数据删除:在哪里删除数据?
5. 数据一致性:数据在各模块间是否一致?
```
**示例(电商下单)**:
```text
- 订单数据:创建订单 → 更新库存 → 生成支付单
- 用户数据:读取地址 → 使用优惠券 → 更新积分
```
> **一致性断链是真实事故来源**:下单成功但库存没扣(超卖)、
> 支付成功但订单还是待支付。这类问题在功能测试里看不出来,只有顺着数据流才查得到。
---
## 场景漂移与处理
场景树最常见的失控形态:
| 漂移类型 | 表现 | 处理方式 |
|---------|------|---------|
| **场景爆炸** | 分支路径衍生过多,树过于庞大 | 按优先级裁剪,只保留 P0-P1 分支;低优分支合并到父节点 |
| **路径遗漏** | 某条分支的关键场景被跳过 | 用需求解构表**逐一对照**,每条需求至少挂 1 个场景 |
| **深度失衡** | 某条分支挖很深,其他分支太浅 | 设定每条分支最大深度 = 主路径深度 ×1.5 |
| **层次混乱** | 主路径里混进了异常路径的节点 | 强制按四类重新归类,不允许混排 |
| **无关联需求** | 场景没挂到任何需求上 | 无需求来源的场景要么补需求关联,要么删除 |assets/scenario-template.md
# 场景树与场景描述模板
> 复制下面任一块板填写。四类场景的覆盖清单与构建方法见 [`scenario-types.md`](scenario-types.md)。
## A. 场景树骨架
```text
{功能模块名}
├─ 主路径(SC-{模块}-001 起)
│ ├─ SC-{模块}-001:{正常流程1}
│ └─ SC-{模块}-002:{正常流程2}
├─ 分支路径
│ ├─ SC-{模块}-003:{分支条件1}
│ ├─ SC-{模块}-004:{分支条件2}
│ └─ SC-{模块}-005:{配置组合 / 权限分支}
├─ 异常路径
│ ├─ SC-{模块}-006:{输入异常}
│ ├─ SC-{模块}-007:{依赖异常 + 恢复验证}
│ ├─ SC-{模块}-008:{并发冲突}
│ └─ SC-{模块}-009:{网络异常}
└─ 数据流
├─ SC-{模块}-010:{数据创建与关联}
└─ SC-{模块}-011:{跨模块一致性}
```
> 序号在**整棵树内连续**,不按类别分段 —— 便于按 `SC-{模块}-0xx` 直接查。
## B. 单场景描述块
```markdown
### SC-LOGIN-007 — 支付回调超时后的订单状态
- **路径类型**:异常路径
- **关联需求**:REQ-PAY-003(支付回调处理)
- **前置条件**:
- 订单处于"支付中"状态已 30 分钟
- 支付网关回调地址可达但本环境注入 3 秒延迟
- **触发条件**:用户点击"支付",网关响应超时
- **操作步骤**:
1. 发起支付,模拟网关 3 秒延迟
2. 等待超时返回
3. 查询订单状态
4. 手动补发一次回调
- **预期结果**:
- 超时后订单进入"支付中"而非直接判失败
- 补发回调后订单转为"已支付",**不产生二次扣款**
- 30 分钟后仍未收到回调的订单被自动关闭并释放库存
- **数据变化**:
- 订单:`支付中` → `已支付`
- 支付单:保持唯一,无重复记录
- 库存:超时释放后重新扣减,最终净扣减 1
- **风险等级**:高(资损)
```
## 填写要求
| 字段 | 要求 | 常见错误 |
|------|------|---------|
| 场景 ID | `SC-{模块缩写}-{序号}`,三位序号、树内连续 | 用 `TC_` 编场景号(那是用例前缀) |
| 关联需求 | `REQ-{需求模块缩写}-{序号}`,**必填** | 留空(场景树无法回溯到需求) |
| 路径类型 | 四选一:主路径 / 分支路径 / 异常路径 / 数据流 | 写"正常用例""异常用例" |
| 前置条件 | 环境 + 数据 + 状态 + 依赖可控性,具体到可复现 | 只写"环境正常" |
| 触发条件 | 用户操作或系统事件,单句 | 写"各种情况" |
| 操作步骤 | 一步一验证,含具体操作与等待时长 | 写"模拟超时" |
| 预期结果 | 可观测:状态、返回值、数据变化 | 写"正确处理" |
| 数据变化 | 逐个数据对象写清前后状态 | 留空(数据流场景的核心信息) |
| 风险等级 | 高(资损/越权/数据错误)/ 中(体验与稳定性)/ 低 | 全标高 |
## 交付前自检
- [ ] 四类路径都有场景;某一类确实不适用时写"不适用 + 原因"
- [ ] 每个场景 ID 唯一且连续,格式为 `SC-{模块}-{序号}`
- [ ] 每个场景关联到 `REQ-` 需求 ID,无孤儿场景
- [ ] 场景数达到数量要求(×3/×5/×7,按需求数 ×1.5 向下取整的维度已处理小数)
- [ ] 异常路径均验证了**恢复能力**(报错后状态、能否重试、重试有无重复副作用)
- [ ] 数据流场景逐个数据对象写了前后状态
- [ ] 无主路径/异常路径混排
- [ ] 覆盖率已标注口径,无"全覆盖/100%"绝对化表述skill-card.md
## Description: Turns decomposed requirements into traceable main, alternate, exception, and data-flow test scenarios. This skill is ready for commercial/non-commercial use. ## Publisher: [kokxi](https://clawhub.ai/user/kokxi) ### License/Terms of Use: MIT-0 ## Use Case: QA practitioners use this skill to turn a requirements breakdown into a scenario tree covering normal, alternate, exception, and data-flow paths, with each scenario linked to its requirement. ### Deployment Geography for Use: Global ## Known Risks and Mitigations: Risk: Scenario examples may expose customer, identity, payment, or production data. Mitigation: Use synthetic or masked data rather than real customer information or financial records. Risk: The optional command to install the broader skill set uses an unpinned package source. Mitigation: Review the source and use a pinned version or trusted release before installing. ## Reference(s): - [Scenario tree and description template](assets/scenario-template.md) - [Scenario types and construction guidance](references/scenario-types.md) - [ClawHub skill release](https://clawhub.ai/kokxi/skills/qa-scenario-tree) ## Skill Output: **Output Type(s):** [Markdown, Guidance] **Output Format:** [Markdown scenario tree and scenario descriptions] **Output Parameters:** [1D] **Other Properties Related to Output:** [Unique SC- IDs linked to REQ- IDs; notes uncovered paths and reasons; does not produce detailed test cases.] ## Skill Version(s): 1.8.0 (source: frontmatter, server release) ## Ethical Considerations: Users should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.
AionUi
Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!
activepieces
AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents
cherry-studio
AI productivity studio with smart chat, autonomous agents, and 300+ assistants.
CopilotKit
The Frontend for Agents & Generative UI. React + Angular
Machine-readable data
The same record, as JSON, for agents and crawlers.
{
"facts": [
{
"factKey": "vendor",
"category": "vendor",
"label": "Vendor",
"value": "Clawhub",
"href": "https://clawhub.ai/kokxi/skills/qa-scenario-tree",
"sourceUrl": "https://clawhub.ai/kokxi/skills/qa-scenario-tree",
"sourceType": "profile",
"confidence": "medium",
"observedAt": "2026-10-11T06:25:16.565Z",
"isPublic": true
},
{
"factKey": "protocols",
"category": "compatibility",
"label": "Protocol compatibility",
"value": "OpenClaw",
"href": "https://www.xpersona.co/api/v1/agents/clawhub-kokxi-qa-scenario-tree/contract",
"sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-kokxi-qa-scenario-tree/contract",
"sourceType": "contract",
"confidence": "medium",
"observedAt": "2026-10-11T06:25:16.565Z",
"isPublic": true
},
{
"factKey": "traction",
"category": "adoption",
"label": "Adoption signal",
"value": "1.1K downloads",
"href": "https://clawhub.ai/kokxi/qa-scenario-tree",
"sourceUrl": "https://clawhub.ai/kokxi/qa-scenario-tree",
"sourceType": "profile",
"confidence": "medium",
"observedAt": "2026-10-11T06:25:16.565Z",
"isPublic": true
},
{
"factKey": "latest_release",
"category": "release",
"label": "Latest release",
"value": "1.8.0",
"href": "https://clawhub.ai/kokxi/qa-scenario-tree",
"sourceUrl": "https://clawhub.ai/kokxi/qa-scenario-tree",
"sourceType": "release",
"confidence": "medium",
"observedAt": "2026-09-29T04:28:06.222Z",
"isPublic": true
},
{
"factKey": "handshake_status",
"category": "security",
"label": "Handshake status",
"value": "UNKNOWN",
"href": "https://www.xpersona.co/api/v1/agents/clawhub-kokxi-qa-scenario-tree/trust",
"sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-kokxi-qa-scenario-tree/trust",
"sourceType": "trust",
"confidence": "medium",
"observedAt": null,
"isPublic": true
}
],
"events": [
{
"eventType": "release",
"title": "Release 1.8.0",
"description": "## qa-scenario-tree v1.8.0 Changelog - Added: New reference files for scenario templates and types (`assets/scenario-template.md`, `references/scenario-types.md`) - Changed: Major rewrite and restructuring of SKILL.md - Clarified and standardized scenario/requirement ID formats (`SC-` and `REQ-`, no longer `TC_` in this skill) - Scenario tree output no longer includes 9-column test case table; that is now produced by the `qa-test-case-design` skill - Expanded guidance and traceability instructions for scenario construction, ID usage, and category coverage - Removed: Deprecated skill card markdown file (`skill-card.md`) - Documentation is now more concise, with better reference separation and self-check instructions for scenario trees",
"href": "https://clawhub.ai/kokxi/qa-scenario-tree",
"sourceUrl": "https://clawhub.ai/kokxi/qa-scenario-tree",
"sourceType": "release",
"confidence": "medium",
"observedAt": "2026-09-29T04:28:06.222Z",
"isPublic": true
}
]
}Record generated Oct 11, 2026.
