qa-ai-context-engineering
将前面所有分析步骤(需求解构、场景树、边界清单、风险评估等)打包成一个结构化的AI上下文包,确保AI在生成测试用例时拥有完整的业务上下文、功能上下文和技术上下文。当已经完成了需求分析、场景构建和深度设计,即将进入提示词生成阶段时,必须经过此步骤。上下文包的完整度直接决定了AI生成用例的质量——输入垃圾,输出也是垃圾。当上游分析缺失时,本技能会读取用户上传的需求文件或fetch用户提供的URL以补充上下文,并对原始描述做结构化解析后并入上下文包,但不会替代上游分析步骤——缺失项仍需标注并建议回退补充。 触发场景:上下文工程、构建上下文、上下文包、测试上下文、结构化上下文、上下文不够、已完成需求解构和场景构建需要打包上下文时。 Use when the user asks about: building a structured context package so an LLM has full business, functional, and technical context before generating test cases. Skill: qa-ai-context-engineering Owner: kokxi Summary: 将前面所有分析步骤(需求解构、场景树、边界清单、风险评估等)打包成一个结构化的AI上下文包,确保AI在生成测试用例时拥有完整的业务上下文、功能上下文和技术上下文。当已经完成了需求分析、场景构建和深度设计,即将进入提示词生成阶段时,必须经过此步骤。上下文包的完整度直接决定了AI生成用例的质量——输入垃圾,输出也是垃圾。当上游分析缺失时,本技能会读取用户上传的需求文件或fetch用户提供的URL以补充上下文,并对原始描述做结构化解析后并入上下文包,但不会替代上游分析步骤——缺失项仍需标注并建议回退补充。 触发场景:上下文工程、构建上下文、上下文包、测试上下文、结构化上下文、上下文不够、已完成需求解构和场景构建需要打包上下文时。 Use when the user asks about: building a structur
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-ai-context-engineering- 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-ai-context-engineering/snapshot"
Documentation
CLAWHUB
109,358 characters of source documentation, loaded on request.
Extracted files
5 files captured from the source.
SKILL.md
---
name: qa-ai-context-engineering
description: >-
将前面所有分析步骤(需求解构、场景树、边界清单、风险评估等)打包成一个结构化的AI上下文包,确保AI在生成测试用例时拥有完整的业务上下文、功能上下文和技术上下文。当已经完成了需求分析、场景构建和深度设计,即将进入提示词生成阶段时,必须经过此步骤。上下文包的完整度直接决定了AI生成用例的质量——输入垃圾,输出也是垃圾。当上游分析缺失时,本技能会读取用户上传的需求文件或fetch用户提供的URL以补充上下文,并对原始描述做结构化解析后并入上下文包,但不会替代上游分析步骤——缺失项仍需标注并建议回退补充。
触发场景:上下文工程、构建上下文、上下文包、测试上下文、结构化上下文、上下文不够、已完成需求解构和场景构建需要打包上下文时。 Use when the user asks about: building a structured context package so an LLM has full business, functional, and technical context before generating test cases.
license: MIT
allowed-tools: Read Grep Glob WebFetch
metadata:
display-name: "Ai Context Engineering"
version: "1.8.0"
when-to-use: "用户说\"上下文工程\"、\"构建上下文\"、\"上下文包\"、\"测试上下文\"、\"结构化上下文\"、\"上下文不够\"、已完成需求解构和场景构建需要打包上下文时"
related-skills: "{\"upstream\":[\"qa-req-deconstruction\",\"qa-scenario-tree\",\"qa-boundary-deep-dive\",\"qa-combination-strategy\",\"qa-state-transition\"],\"downstream\":[\"qa-ai-prompt-strategy\"]}"
references: "[\"references/window-adaptation.md\",\"assets/context-package.md\"]"
input-format: "{\"required\":[{\"name\":\"需求解构表\",\"type\":\"object\",\"description\":\"来自qa-req-deconstruction的需求解构结果\"},{\"name\":\"场景树\",\"type\":\"object\",\"description\":\"来自qa-scenario-tree的场景树结构\"}],\"optional\":[{\"name\":\"边界清单\",\"type\":\"object\",\"description\":\"来自qa-boundary-deep-dive的边界分析结果\"},{\"name\":\"组合矩阵\",\"type\":\"object\",\"description\":\"来自qa-combination-strategy的组合覆盖矩阵\"},{\"name\":\"状态转换图\",\"type\":\"object\",\"description\":\"来自qa-state-transition的状态转换分析\"},{\"name\":\"风险评估\",\"type\":\"object\",\"description\":\"来自qa-risk-intuition的风险评估结果\"}]}"
output-format: "{\"traceability\":[\"本技能只打包上下文、不产出新 ID;沿用上游需求ID:REQ-{需求模块缩写}-{序号}、场景ID:SC-{场景模块缩写}-{序号}、边界ID:BD-{模块缩写}-{序号}、风险ID:RISK-{模块缩写}-{风险类型}-{三位序号}、规则ID:RULE-{CAL|VAL|PERM|FLOW}-{序号}\"],\"structure\":[{\"context_package\":\"AI上下文包:四层金字塔(第1层业务目标与用户角色 / 第2层功能描述与约束条件 / 第3层技术细节与历史缺陷(按需)/ 第4层输出格式与质量要求)\"},\"来源标注:每条信息必须标 [用户提供] / [推断] / [假设];[假设] 项下游必须显式暴露或回上游确认\",\"第1层与第4层必填且永不裁剪;第3层按需,超窗时首个被裁\",\"第4层的 9 列输出格式引用 qa-test-case-design 的真源,本技能不自行定义或改动\",\"缺失的上游必须显式声明并给出回退建议,不得静默假设\",\"本技能不产出 9 列用例表 —— 只打包上下文,用例由下游 qa-ai-prompt-strategy 驱动生成\",\"覆盖率:标注口径(基于已有上游产出),禁止\\\"全覆盖/100%\\\"绝对化表述\"]}"
error-recovery-guidance: "{\"on_failure\":\"上下文包不完整时回退到上游分析步骤补充\",\"retry_behavior\":\"补充缺失的上游输入后重新打包上下文\"}"
categories: "[\"Development\",\"Testing\",\"AI\"]"
depth-requirement: "{\"reference_value\":\"按上游分析的丰富度决定包深度;四层全建为「完整测试」,可只建第1/2/4层为「日常/紧急测试」\",\"minimum\":\"至少包含需求解构表、场景树、边界清单 3 个核心上游输入;缺失项必须显式声明\"}"
---
> ⚠️ 本技能单独使用效果有限,建议配合完整技能集(12 步工作流)使用。安装:npx skills add Kokxi/qa-test-skills
# AI 上下文工程
## 核心原则
你是一位资深测试架构师,擅长为 AI 构建高质量的测试上下文。
**不是给更多信息,而是给对的信息结构。**
> **本技能最大的失败模式是"不标来源"**。下游 AI 无法区分"需求文档要求的"和"你编的",
> 于是把假设当事实写进用例——这类缺陷到最后都查不出是谁引入的。
> **每条信息都要标 `[用户提供]` / `[推断]` / `[假设]`。**
## 1. 上下文金字塔(必须按此顺序构建)
### 第 1 层 业务目标与用户角色(必填,永不裁剪)
```text
【业务背景】业务目标 / 目标用户 / 核心价值
【用户角色】角色A - 核心诉求;角色B - 核心诉求
```
> 业务目标丢了,AI 不知道测什么。**这一层是包的骨架,不可裁剪。**
### 第 2_meta.json
{
"ownerId": "kn71y9b23csfx0ykgm55d5m9x5891zt8",
"slug": "qa-ai-context-engineering",
"version": "1.8.0",
"publishedAt": 1790655899887
}references/window-adaptation.md
# 上下文窗口适配与完整包示例
> 本文是 `qa-ai-context-engineering` 的**适配参考**。目标模型上下文窗口不够、
> 或需要看完整上下文包长什么样时读本文。
> 上下文金字塔四层的定义见 `SKILL.md`,日常构建不必读本文。
---
## ⚠️ 窗口数据会过时
下表是**编写时的快照**,各家模型的窗口规格与 API 限制会变。用之前先核实当前值,
不要把这里的数字当作权威。**判断依据是"包大小 vs 目标模型窗口的比例",不是具体数字。**
| 模型 | 窗口(快照值) | 策略 |
|------|--------------|------|
| DeepSeek | 64K-128K | 完整金字塔直投,保留全部 4 层 |
| 通义千问 | 32K-100K+ | 保留第 1/2/4 层,第 3 层按需截断 |
| 文心一言 | 8K-32K | 压缩为"业务目标 + 功能边界 + 输出格式"三要素 |
| 豆包 | 32K-128K | 完整直投,核心约束放包尾 |
| Kimi | 128K-200K | 可带完整历史缺陷与全部技术细节,无需裁剪 |
**不确定目标模型时按小窗口(8K-32K)规划**——按最小窗口设计的包,
在任何更大的窗口里都不会被截断;反过来不会成立。
## 超窗降级策略
```text
1. 超窗检测:估算包 token(中文约 1 字 ≈ 1-1.5 token),
超过目标窗口 80% 即触发裁剪
2. 裁剪顺序:先裁第 3 层(技术细节/历史缺陷)
→ 再压缩第 2 层(功能描述去重)
→ 保留第 1 层(业务目标)与第 4 层(输出要求)
3. 历史缺陷降级:完整列表 → TOP10 → TOP5 摘要
(只留"缺陷模式 + 规避方法",不带复现步骤)
4. 分批注入:超窗时先注入"第 1 层 + 第 4 层",
第 2/3 层在提示词中引用"详见上下文包附件"
```
> **第 1 层和第 4 层永远不裁**。业务目标丢了 AI 不知道测什么,
> 输出要求丢了 AI 不知道交什么——这两层是包的骨架。
---
## 完整上下文包示例
```text
📦 AI上下文包(目标模型:DeepSeek,窗口 64K,预估 8.2K token)
第1层 业务目标与用户角色
├─ 业务目标:用户登录系统,验证身份并返回会话凭证
├─ 用户角色:普通用户(账号密码)、管理员(额外权限)、游客(限制访问)
└─ 核心指标:登录成功率、平均响应时间
第2层 功能描述与约束条件
├─ 功能边界:用户名+密码登录、验证码、密码找回、会话管理
├─ 业务规则:密码错误 3 次锁定 15 分钟;验证码 5 分钟有效
└─ 约束:支持 5000 并发登录;密码强度至少 8 位含数字字母
第3层 技术细节与历史缺陷(按需)
├─ 技术栈:Spring Boot + MySQL + Redis 会话
├─ 历史缺陷 TOP5:
│ 1. 密码错误锁定未区分用户(越权锁定)→ 按账号+IP 双维度
│ 2. 验证码并发可用多次 → 一次性校验 + 过期删除
│ 3. Token 未设过期时间 → 加 30 分钟滑动过期
│ 4. 登录接口无频控 → 加 5 次/分钟 IP 限流
│ 5. 会话固定攻击 → 登录成功后重新生成 SessionID
第4层 输出格式与质量要求
├─ 输出:9 列标准用例表(格式以 qa-test-case-design 的真源为准)
├─ 编号:TC_{模块缩写}_{功能缩写}_{三位序号}
├─ 深度:登录接口为中等复杂度,用例数 ≥ 10 条
└─ 质量:每条可执行可验证,覆盖率标注口径
```
## 信息来源标注(必做)
包内每条信息都要标来源,让下游知道哪些可以质疑:
| 标记 | 含义 | 下游怎么处理 |
|------|------|------------|
| `[用户提供]` | 来自需求文档或用户明确说明 | 可直接采信 |
| `[推断]` | 由已知信息合理推出 | 可采信,但应在产出中标注推断 |
| `[假设]` | 无依据,编造性补全 | **必须在产出中显式暴露**,或回上游确认 |
> **不标来源是上下文工程最大的失败**。下游 AI 无法区分"需求文档要求的"和"你编的",
> 于是把假设当成事实写进用例——这类缺陷到最后都查不出来是谁引入的。assets/context-package.md
# AI 上下文包模板
> 复制下面整块板填写。四层金字塔的定义见 `SKILL.md`,
> 超窗降级策略见 [`../references/window-adaptation.md`](../references/window-adaptation.md)。
## AI 上下文包
**目标模型**:[模型名] | **窗口**:[K] | **预估包大小**:[K] token
**上游输入齐备度**:[需求解构 ✓ / 场景树 ✓ / 边界清单 ✓ / 组合矩阵 ○ / 状态转换 ○ / 风险评估 ○]
**缺失项与建议**:[缺 X → 建议先补 qa-xxx,或本次按[假设]处理]
---
### 第 1 层 业务目标与用户角色(必填,永不裁剪)
```text
【业务背景】
- 业务目标:[这个功能要解决什么问题]
- 目标用户:[谁在用]
- 核心价值:[用户能得到什么]
【用户角色】
| 角色 | 核心诉求 | 权限边界 |
|------|---------|---------|
| [角色A] | [诉求] | [能做什么/不能做什么] |
| [角色B] | [诉求] | [ ] |
```
### 第 2 层 功能描述与约束条件(必填)
```text
【功能边界】
- 功能名称:
- 核心流程:[主路径,来源标签]
- 输入:[用户输入什么]
- 输出:[系统返回什么]
【业务规则】 ← 来自 qa-req-deconstruction 的 RULE- 清单
| 规则 ID | 触发条件 | 必须满足 | 来源 |
|---------|---------|---------|------|
| RULE-XXX-001 | [若X] | [则Y必须满足Z] | [用户提供] |
【非功能需求】
- 性能要求:[来源标签]
- 安全要求:[来源标签]
- 兼容性要求:[来源标签]
```
### 第 3 层 技术细节与历史缺陷(按需,超窗首个被裁)
```text
【技术架构】
- 技术栈:
- 关键接口:
- 数据流向:
- 依赖服务:
【历史缺陷模式】 ← 来自 qa-bug-root-cause-analysis / qa-risk-intuition
| 缺陷模式 | 根因 | 规避方法 | 来源 |
|---------|------|---------|------|
| [如 验证码并发可用多次] | [一次性校验缺失] | [一次性校验+过期删除] | [用户提供] |
```
### 第 4 层 输出格式与质量要求(必填,永不裁剪)
```text
【输出要求】
- 格式:9 列标准用例表
(格式唯一真源:qa-test-case-design/references/output-template-full.md)
- 列:用例编号|测试类型|功能模块|测试标题|用例级别|预置条件|测试步骤|预期结果|风险等级
- 编号:TC_{模块缩写}_{功能缩写}_{三位序号},不使用场景后缀
- 用例级别占比:P0≤20% / P1≤40% / P2≤30% / P3≤10%
- 深度要求:[本功能用例数下限,注明依据]
- 质量要求:每条可执行可验证;覆盖率必须标注口径
- 禁止:绝对化覆盖率表述("全覆盖"/"100%")
```
### 来源标注汇总(必做)
| 标记 | 条数 | 说明 |
|------|------|------|
| `[用户提供]` | [n] | 来自需求文档或用户明确说明 |
| `[推断]` | [n] | 由已知信息合理推出 |
| `[假设]` | [n] | 无依据补全,**下游必须显式暴露或回上游确认** |
## 填写要求
| 项 | 要求 | 常见错误 |
|----|------|---------|
| 信息来源 | 每条信息标 `[用户提供]`/`[推断]`/`[假设]` | 不标——下游无法区分需求与编造 |
| 第 1/4 层 | 必填且不裁剪 | 超窗时被一起裁掉 |
| 上游齐备度 | 显式列出已收到哪些上游产出 | 缺了不声明,直接假设 |
| 缺失项 | 缺失的上游 + 建议回退的技能 | 静默假设 |
| 业务规则 | 引用 `RULE-` ID,不重写 | 另起一套规则编号 |
| 输出格式 | 引用 `qa-test-case-design` 真源 | 自行复述或改动列 |
| 窗口预留 | 标注目标模型与窗口;不确定按 8K-32K 规划 | 不标注,撞上窗口被静默截断 |
## 交付前自检
- [ ] 四层齐备(第 3 层可按需,但缺失需说明)
- [ ] **每条信息都标了来源**,无未标注内容
- [ ] `[假设]` 项已列出,且明确要求下游暴露或回上游确认
- [ ] 上游缺失项已显式声明 + 给出回退建议
- [ ] 业务规则引用 `RULE-` ID
- [ ] 第 4 层引用 `qa-test-case-design` 的格式真源,未自行改动列
- [ ] 标注了目标模型与窗口;包大小估算 < 窗口 80%
- [ ] 已知的历史缺陷模式已带入(有的话)skill-card.md
## Description: Packages QA requirements, scenarios, boundaries, and risks into a structured, source-labeled AI context package for downstream test-case generation. 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 and developers use this skill to consolidate upstream testing analysis into a four-layer context package before prompting an AI to generate test cases. It flags missing inputs and distinguishes supplied facts, inferences, and assumptions. ### Deployment Geography for Use: Global ## Known Risks and Mitigations: Risk: Unverified assumptions or missing upstream inputs could distort later test cases. Mitigation: Label each item as supplied, inferred, or assumed; disclose missing inputs and confirm assumptions before downstream use. Risk: An optional command to install the broader skill set runs third-party code. Mitigation: Treat installation as optional and verify the package source and version before running it. Risk: Uploaded requirements or fetched URLs may expose unrelated information. Mitigation: Provide only files or URLs relevant to the QA context package. ## Reference(s): - [Context package template](artifact/assets/context-package.md) - [Context window adaptation](artifact/references/window-adaptation.md) - [ClawHub release page](https://clawhub.ai/kokxi/skills/qa-ai-context-engineering) ## Skill Output: **Output Type(s):** [Text, Markdown] **Output Format:** [Structured four-layer AI context package with source labels] **Output Parameters:** [1D] **Other Properties Related to Output:** [Reports missing upstream inputs and fallback guidance; does not generate test cases.] ## Skill Version(s): 1.8.0 (source: skill frontmatter and ClawHub 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-ai-context-engineering",
"sourceUrl": "https://clawhub.ai/kokxi/skills/qa-ai-context-engineering",
"sourceType": "profile",
"confidence": "medium",
"observedAt": "2026-10-11T09:36:05.152Z",
"isPublic": true
},
{
"factKey": "protocols",
"category": "compatibility",
"label": "Protocol compatibility",
"value": "OpenClaw",
"href": "https://www.xpersona.co/api/v1/agents/clawhub-kokxi-qa-ai-context-engineering/contract",
"sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-kokxi-qa-ai-context-engineering/contract",
"sourceType": "contract",
"confidence": "medium",
"observedAt": "2026-10-11T09:36:05.152Z",
"isPublic": true
},
{
"factKey": "traction",
"category": "adoption",
"label": "Adoption signal",
"value": "1.1K downloads",
"href": "https://clawhub.ai/kokxi/qa-ai-context-engineering",
"sourceUrl": "https://clawhub.ai/kokxi/qa-ai-context-engineering",
"sourceType": "profile",
"confidence": "medium",
"observedAt": "2026-10-11T09:36:05.152Z",
"isPublic": true
},
{
"factKey": "latest_release",
"category": "release",
"label": "Latest release",
"value": "1.8.0",
"href": "https://clawhub.ai/kokxi/qa-ai-context-engineering",
"sourceUrl": "https://clawhub.ai/kokxi/qa-ai-context-engineering",
"sourceType": "release",
"confidence": "medium",
"observedAt": "2026-09-29T04:24:59.887Z",
"isPublic": true
},
{
"factKey": "handshake_status",
"category": "security",
"label": "Handshake status",
"value": "UNKNOWN",
"href": "https://www.xpersona.co/api/v1/agents/clawhub-kokxi-qa-ai-context-engineering/trust",
"sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-kokxi-qa-ai-context-engineering/trust",
"sourceType": "trust",
"confidence": "medium",
"observedAt": null,
"isPublic": true
}
],
"events": [
{
"eventType": "release",
"title": "Release 1.8.0",
"description": "**Major update: Structure, references, and output format revised for transparency and modularity.** - Switched output references from a removed template (output-template.md) to new resources: window-adaptation.md and context-package.md. - Updated context package structure: now mandates explicit source tagging for every item as [用户提供] / [推断] / [假设]. - Clarified output: skill only packages context and never outputs test cases; mandates never to silently assume missing upstream input. - Adjusted output format and traceability details; all input and missing areas must be clearly declared, including fallback guidance. - Deprecated and removed outdated documentation files; improved guidance for context window adaptation and information origin marking.",
"href": "https://clawhub.ai/kokxi/qa-ai-context-engineering",
"sourceUrl": "https://clawhub.ai/kokxi/qa-ai-context-engineering",
"sourceType": "release",
"confidence": "medium",
"observedAt": "2026-09-29T04:24:59.887Z",
"isPublic": true
}
]
}Record generated Oct 11, 2026.
