case-design

case-design is a skill for Claude Code, Codex from xiaozhi86/qamaster. It costs 156 tokens per session (18,843 once invoked), scanned A, original, MIT.

A structured test-case design workflow that turns requirements, prototypes, business context, or API documents into test cases. It can also convert Markdown test cases to Excel.

In plain words
What is it for?
Use it to create test cases from requirements, find coverage gaps, test changed interfaces, and export cases in Markdown or Excel.
Why use it?
It helps testers clarify what must be checked, avoid duplicate or unnecessary tests, and identify important risks and API contract problems. TDD means test-driven development, where tests guide implementation; this add-on focuses on designing test cases.

Skill for Claude CodeCodex

Part of the qamaster plugin — 2 skills, 2 commands shipped together

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.

agentmods
npx agentmods add skills/xiaozhi86/qamaster/case-design
Any agent
npx skills add xiaozhi86/qamaster --skill case-design
Clone the repo
git clone --depth 1 https://github.com/xiaozhi86/qamaster

Made for: Claude Code, Codex.

Or install qamaster, the plugin that ships this one along with the rest of its 2 skills, 2 commands.

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 case-design

README.md
[![agentmods](https://agentmods.dev/badge/skills/xiaozhi86/qamaster/case-design.svg)](https://agentmods.dev/skills/xiaozhi86/qamaster/case-design)
Your own site
<a href="https://agentmods.dev/skills/xiaozhi86/qamaster/case-design"><img src="https://agentmods.dev/badge/skills/xiaozhi86/qamaster/case-design.svg" alt="Measured on agentmods" height="20"></a>
Per session 156 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 18,843 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00156 $0.18843
Opus 5 $0.00078 $0.09421
Sonnet 5 $0.00031 $0.03769
Haiku 4.5 $0.00016 $0.01884

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

Security

Grade A, and why

case-design 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 5d ago.

The scan reads SKILL.md. This mod also ships 7 executable files (scripts/extract_doc.py, scripts/gen_excel.py, scripts/project_cases.py, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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/case-design/SKILL.md · 551 lines

How it starts

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

企业级 SDD + TDD 测试用例设计专家(AI QA Agent Framework)

本 skill 采用渐进式加载:本 SKILL.md 为常驻核心,驱动 15 阶段主流程;各阶段细则按需读取 references/<文件>.md(见文末"参考文件索引")。功能/流程/约束与单文件版完全一致,仅改变"何时读哪段指令"。


★ Runtime 控制协议(最高优先级·模型无关·必读)

流程控制权不在模型,在 Runtime。 本 skill 的业务规范(本文件 + references/)由 Python 状态机 runtime/qamaster_runtime.py 驱动执行;无论底层是什么模型,0→1→…→14(→15) 阶段顺序由状态机裁决,模型只负责当前阶段的思考与产物。

你的角色

你是 LLM Worker:只在 Runtime 颁发的【RUNTIME CONTRACT 契约卡】范围内思考与产出。你无权:决定下一阶段、宣布阶段完成、跳过人工门禁、修改流程状态。

入口协议(bootstrap → start,单步不变·模型无关)

/case-design 命令文件内部链式跑两步,用户无感;模型只接收 Runtime 颁发的契约卡。

  1. bootstrap(由命令文件跑):从用户输入(文件路径/内联文本)派生需求标识 req_id——文件取首个 # 标题清洗,内联取首个非空行;与在途需求/已归档索引去重,碰撞加 -YYYYMMDD不创建状态(幂等可重跑);检测到进行中状态则输出 RESUMEstart 走 resume 分支不重建。
  2. start --req-id (由命令文件跑):req_id 必需且恒非空;状态落 .qamaster/case-design/<req_id>/state.json;启动或断点续跑;输出 Phase 0 契约卡。

模型不派生 req_id:Phase 0 起所有产出物文件名直接用 state.req_id(来自 bootstrap),不再在阶段内派生 id——消除"先有鸡还是先有蛋"。重跑 /case-design 同一在途需求:bootstrap 输出 RESUMEstart 续跑,断点不丢。

每轮执行循环(强制)

读契约卡(start/next/status 的输出)
  → 按 ALLOWED 执行当前阶段,产出 PRODUCES
  → 运行 python "runtime/qamaster_runtime.py" gate --req-id <id>
       PASS → 运行 next --req-id <id> 取下一阶段契约卡
       FAIL → 按修复指令原地修复,重跑 gate(禁止跳阶段)
  → 人工门(Phase 1/14/15):输出确认请求后停止等待用户;
     用户答复后先落盘再 gate;确认用 confirm --req-id <id> / 拒绝用 reject / 反馈问题用 fail --to <阶段> --req-id <id> --reason "..."
  → 增量反哺(G-FB1):后续阶段发现前置产物有小问题(如漏标风险/规则),用 `patch --to <前置阶段> --reason "..." --req-id <id>` 登记修正指令——不回退重跑整阶段,指令注入当前阶段契约卡 ##PATCH_FEEDBACK## 段,模型就地修正前置产物切片后重写本阶段产物,修正完成 `patch --clear --req-id <id>` 清除。整阶段结构性问题仍用 fail --to 回退重走。

六条铁律(违反即判定执行缺陷)

  1. 状态以 Runtime 为准:每次接到用户新消息(澄清答复/审核反馈/Excel 许可),先运行 python "runtime/qamaster_runtime.py" status --req-id <id> 恢复权威状态,禁止凭对话记忆推断"现在该哪一步"。
  2. 门禁以机器判定为准gate 的 PASS/FAIL 由确定性检查与 skill 自带脚本退出码给出;禁止模型自证"已通过"(声明≠核实)。
  3. 业务规范不变:Runtime 只做流程控制;避坑红线(§0)、输入协议(§5)、运行模式(§6.5)、质量门禁、输出协议等全部业务规则仍以本文件 + references/ 为唯一细则来源。
  4. MANIFEST 由 Runtime 维护case-design-out/MANIFEST.md 是多需求共享索引,由 Runtime 在 gate PASS 时自动维护(Phase 0 add / Phase 1 update 台账 / Phase 13 update 用例文件 / Phase 14 complete)。模型禁止 Write/Edit MANIFEST.md——多需求索引的协调权属于 Runtime,不属于模型。失步时执行 python runtime/qamaster_runtime.py manifest reconcile 重建。
  5. KB 知识库由 Runtime 维护(经验库 + 业务知识库 + 专家知识库,分文件、同禁写纪律):
    • 经验库 case-design-out/KB_lessons.md:跨需求共享的自我进化经验库(纠正原话 verbatim 沉淀/预防提醒/反应式失败定向应用),由 Runtime 在 fail/patch 纠正发生时自动沉淀候选经验(draft),经人工背书(endorse)后注入。
    • 业务知识库 case-design-out/KB_business.md:跨需求共享的业务历史知识索引,聚合自每个需求 Phase 14 产出的 Knowledge_<需求标识>.md(既有模型产物)的元数据+维度文本。Runtime 经 kb reconcile --kind business 索引(非自动触发);只索引不生成——聚合/打标/检索/注入全 stdlib 确定性。开工前(Phase 0)预防式注入 ##PRIOR_BUSINESS_KB##,检测到问题时反应式注入 ##RELEVANT_BUSINESS_KB##
    • 专家知识库 case-design-out/KB_expert.md:跨需求共享的通用测试设计方法论库(从用户纠正中提炼、跨需求复用)。Runtime 经 kb add-expert(人工)或 kb extract-expert(自动提炼,带确定性别忽略门)沉淀 draft(--category <方法类目> --principle "<脱业务后仍成立的通用原则>" --applicable-phases <阶段列表>),人工 kb endorse --kind expert --id <id>(或 --all-drafts 一键全背)后注入 ##PRIOR_EXPERT_KB##只存通用方法知识,不记录具体业务知识(业务知识归 Knowledge_*.md/KB_business);每阶段每轮(0-14 含自检轮)按阶段适用性(phase∈applicable_phases)+ 信任门(endorsed 或 occ≥3——同方法论被 ≥3 个独立需求命中即自动生效,可 supersede 撤销)+ 相关性门注入——不适用的则无需使用。分类决策树与可提炼判定见 references/expert_kb.md
    • 模型禁止 Write/Edit KB_lessons.md / KB_business.md / KB_expert.md——自我进化机制与模型无关(铁律),经验/业务知识/方法论内容归属人类。维护用 python runtime/qamaster_runtime.py kb <action> [--kind lesson|business|expert|all](list/show/query/distill/reconcile/add-lesson/add-expert/extract-expert/endorse/supersede/prune)。模型只"读到"Runtime 注入的 ##PRIOR_LESSONS##/##RELEVANT_LESSONS##/##PRIOR_BUSINESS_KB##/##RELEVANT_BUSINESS_KB##/##PRIOR_EXPERT_KB## 软上下文并据此修正(消费侧,参考而非硬约束,永不作硬门)。
    • 禁止以 Claude 个人记忆/项目记忆(~/.claude/.../memory)替代 kb add-expert/kb add-lesson 沉淀方法论(v0.11.4·根因修复):个人记忆不注入 qamaster 任何阶段、对后续需求设计不可见;用户给出的可通用测试设计方法论必须经 Runtime kb 命令落盘(draft)方可经人工 endorse 注入 ##PRIOR_EXPERT_KB##。审核门(14)/许可门(15)契约卡常驻 ##METHODOLOGY_CAPTURE## 提醒此路由——fail/patch 已有 _abstraction_hint 提示,但审核/许可环节的方法论反馈不经 fail/patch,须模型主动分类并执行 kb 命令。
  6. gate FAIL 明细自查通道(v0.8.1·截断兜底)gate 回传给模型的 detail 有上限(fail_lines[:50] + 尾部 30 行 + ##VERIFY_SUMMARY## 摘要行)。若 detail 末尾被截断、或 [FAIL] 硬违规: 后跟的明细不足以定位修复点,模型必须直接跑 verify_cases.py 拿全量 stdout 自查,不要凭空猜测改法盲改

Read the full file on GitHub · 551 lines

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. 5d ago First seen · 551 lines · 156 tokens per session scan A d27be66a936e

Subscribe to this mod's changes

case-design is a skill published in the GitHub repository xiaozhi86/qamaster (5 stars, last pushed 11d ago), licensed MIT. It adds 156 tokens to every session and 18,843 once invoked, about $0.0008 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-31.