qa-ai-context-engineering

qa-ai-context-engineering is a skill for Claude Code from Kokxi/qa-test-skills. It costs 181 tokens per session (2,949 once invoked), scanned A, original, MIT.

A method for packaging business, feature, technical, risk, and output information into structured context for an AI test-writing task. It fills gaps from supplied requirements or URLs and marks missing information.

In plain words
What is it for?
Use it after analysing requirements, scenarios, boundaries, and risks, before asking AI to generate test cases.
Why use it?
AI-generated tests are only as useful as the information they receive. A structured context helps the AI understand what to test and how the results should be formatted.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the qa-test-skills plugin — 49 skills shipped together

Good fit Use it after analysing requirements, scenarios, boundaries, and risks, before asking AI to generate test cases.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/kokxi/qa-test-skills/qa-ai-context-engineering
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add Kokxi/qa-test-skills --skill qa-ai-context-engineering
Clone the repo
git clone --depth 1 https://github.com/Kokxi/qa-test-skills

Made for: Claude Code.

Or install qa-test-skills, the plugin that ships this one along with the rest of its 49 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for qa-ai-context-engineering

README.md
[![agentmods](https://agentmods.dev/badge/skills/kokxi/qa-test-skills/qa-ai-context-engineering/github.svg)](https://agentmods.dev/skills/kokxi/qa-test-skills/qa-ai-context-engineering)
Your own site
<a href="https://agentmods.dev/skills/kokxi/qa-test-skills/qa-ai-context-engineering"><img src="https://agentmods.dev/badge/skills/kokxi/qa-test-skills/qa-ai-context-engineering/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for qa-ai-context-engineering

Your own site · 80×15
<a href="https://agentmods.dev/skills/kokxi/qa-test-skills/qa-ai-context-engineering"><img src="https://agentmods.dev/badge/skills/kokxi/qa-test-skills/qa-ai-context-engineering.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 181 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,949 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00181 $0.02949
Opus 5 $0.00090 $0.01474
Sonnet 5 $0.00036 $0.00590
Haiku 4.5 $0.00018 $0.00295

Measured 4d ago against content hash 77c21b6a1787, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

qa-ai-context-engineering scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/qa-ai-context-engineering/SKILL.md · 231 lines

How it starts

The opening of the file, as written. The whole thing — 231 lines — stays where its author put it; the contents beside it link to each section on GitHub.

⚠️ 本技能会读取用户上传的需求文件或 fetch 用户提供的 URL 以补充上下文。 请勿在需求文件中粘贴真实生产数据、客户信息或财务凭证;处理前应脱敏/掩码。 本技能仅在 workspace/ 输出上下文包文件,不持久化、不外传、不跨会话复用。

AI 上下文工程

核心原则

你是一位资深测试架构师,擅长为AI构建高质量的测试上下文。 不是给更多信息,而是给对的信息结构。 本技能将需求解构、场景树、边界清单等分析结果打包为结构化上下文包,传递给qa-ai-prompt-strategy。

输出模板格式和字段说明参见 references/output-template.md

上下文金字塔(必须按此顺序构建)

第1层:业务目标与用户角色(必须)

【业务背景】
- 业务目标:这个功能要解决什么问题?
- 目标用户:谁在用?有几个角色?
- 核心价值:用户能得到什么?

【用户角色】
- 角色A:[名称] - [核心诉求]
- 角色B:[名称] - [核心诉求]

第2层:功能描述与约束条件(必须)

【功能边界】
- 功能名称:
- 核心流程:[主路径描述]
- 输入:[用户输入什么]
- 输出:[系统返回什么]
- 约束条件:[业务规则、限制条件]

【非功能需求】
- 性能要求:
- 安全要求:
- 兼容性要求:

第3层:技术细节与历史缺陷(按需)

【技术架构】
- 技术栈:
- 关键接口:
- 数据流向:
- 依赖服务:

【历史缺陷模式】
- 同类型功能曾出现过的Bug:
- 高风险区域:

第4层:输出格式与质量要求(必须)

【输出要求】
- 格式:表格/列表/思维导图
- 字段:用例编号、标题、前置条件、步骤、预期结果、优先级、风险等级
- 深度要求:覆盖正常/异常/边界/并发/安全

工作流程

当用户请求生成测试用例时:

  1. 识别输入类型

    • 直接描述 -> 提取关键信息
    • 上传文件 -> 读取并解析
    • URL链接 -> 获取并分析
  2. 构建上下文包

    • 检查用户提供了哪些信息
    • 识别缺失的关键信息
    • 用问题补全或做出合理假设
  3. 输出结构化上下文

    • 按金字塔格式组织
    • 标注信息来源(用户提供/推断/假设)

上下文类型速查表

场景类型 金字塔层数 关键侧重 典型耗时
日常测试 第1层+第2层+第4层 功能边界+输出格式 快速构建
紧急测试 第1层+第4层 业务目标+输出格式,依赖假设快速产出 最简构建
完整测试 4层全建 全量信息+历史缺陷+技术细节 全面构建
复测回归 第1层+第3层+第4层 历史缺陷模式+输出格式 针对性构建

输出示例

用户说"帮我测试用户登录" -> 上下文金字塔从第1层开始构建:

  • 第1层:业务目标(验证用户身份)+ 用户角色(普通用户/管理员)
  • 第2层:功能边界(用户名+密码登录)+ 约束(密码错误3次锁定)
  • 第3层按需补充,第4层指定输出格式

用户上传PRD但信息零散 -> 按金字塔结构组织零散需求,标注信息来源[用户提供]/[推断]/[假设]

上下文窗口适配策略

不同模型上下文窗口差异大,上下文包需按窗口裁剪:

模型 上下文窗口 上下文包策略
DeepSeek 64K-128K 完整金字塔直投,保留全部 4 层
通义千问 32K-100K+ 中等窗口:保留第1/2/4层必填,第3层(技术细节/历史缺陷)按需截断
文心一言 8K-32K 小窗口:压缩为"业务目标+功能边界+输出格式"三要素,历史缺陷合并为 TOP5 摘要
豆包 32K-128K 完整直投,但长文本注意截断风险,核心约束放包尾
Kimi 128K-200K 大窗口:可带完整历史缺陷与全部技术细节,无需裁剪

窗口超限降级策略

1. 超窗检测:估算上下文包 token(中文约 1 字 ≈ 1-1.5 token),超过模型窗口 80% 触发裁剪
2. 裁剪顺序:先裁第3层(技术细节/历史缺陷)→ 再压缩第2层(功能描述去重)→ 保留第1层和第4层
3. 历史缺陷降级:完整列表 → TOP10 → TOP5 摘要(只留"缺陷模式+规避方法")
4. 分批注入:超窗时按"第1层+第4层"先注入,第2/3层在提示词中引用"详见上下文包附件"

Read the full file on GitHub · 231 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago Changed · +4 lines 77c21b6a1787
  2. 10d ago First seen · 227 lines · 181 tokens per session scan A 4ca93747f919

Subscribe to this mod's changes

qa-ai-context-engineering is a skill published in the GitHub repository Kokxi/qa-test-skills (24 stars, last pushed 7d ago), licensed MIT. It adds 181 tokens to every session and 2,949 once invoked, about $0.0009 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

cli-eval

Create and run evaluation suites, watch live benchmark progress, view scorecards, compare model performance, and integrate eval runs with CI workflows from the CLI.

diegosouzapw/OmniRoute · 34 tokens

agent-harness-fault-injection

Use when an agent workflow needs deterministic recovery evidence for sandbox, MCP/tool, worker, checkpoint, memory, or orchestration failures.

sickn33/agentic-awesome-skills · 34 tokens

model-merging

Merge multiple fine-tuned models using mergekit to combine capabilities without retraining. Use when creating specialized models by blending domain-specific expertise (math + coding + chat), improving performance beyond single models, or experimenting rapidly with model variants. Covers SLERP, TIES-Merging, DARE, Task…

davila7/claude-code-templates · 73 tokens

darwinian-evolver

Evolve prompts/regex/SQL/code with Imbue's evolution loop.

NousResearch/hermes-agent · 22 tokens

validate

Validate Semantica pipelines, extraction quality, graph schemas, and ontology consistency. Returns structured error/warning checklists. Uses PipelineValidator, PipelineBuilder.validatepipeline(), GraphValidator, and OntologyValidator. Sub-commands: pipeline, step, dependencies, extraction, graph, ontology, performance.

semantica-agi/semantica · 0 tokens

launching-evals

Run, monitor, analyze, and debug LLM evaluations via nemo-evaluator-launcher. Covers running evaluations, checking status and live progress, debugging failed runs, exporting artifacts and logs, and analyzing results. ALWAYS triggers on mentions of running evaluations, checking progress, debugging failed evals…

NVIDIA/Model-Optimizer · 115 tokens