qa-state-transition

qa-state-transition is a skill for Claude Code from Kokxi/qa-test-skills. It costs 123 tokens per session (3,106 once invoked), scanned A, original, MIT.

A structured testing guide for software whose objects move between states, such as orders going from unpaid to paid to completed. TDD means test-driven development, but this skill specifically focuses on checking state changes.

In plain words
What is it for?
Use it to list states and allowed transitions, then design tests for normal flows, rejected actions, limits, failures, loops, and concurrent events.
Why use it?
It helps find invalid, boundary, recovery, and simultaneous state changes that individual endpoint tests can overlook.

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 to list states and allowed transitions, then design tests for normal flows, rejected actions, limits, failures, loops, and concurrent events.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/kokxi/qa-test-skills/qa-state-transition
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-state-transition
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-state-transition

README.md
[![agentmods](https://agentmods.dev/badge/skills/kokxi/qa-test-skills/qa-state-transition/github.svg)](https://agentmods.dev/skills/kokxi/qa-test-skills/qa-state-transition)
Your own site
<a href="https://agentmods.dev/skills/kokxi/qa-test-skills/qa-state-transition"><img src="https://agentmods.dev/badge/skills/kokxi/qa-test-skills/qa-state-transition/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-state-transition

Your own site · 80×15
<a href="https://agentmods.dev/skills/kokxi/qa-test-skills/qa-state-transition"><img src="https://agentmods.dev/badge/skills/kokxi/qa-test-skills/qa-state-transition.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 123 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,106 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.00123 $0.03106
Opus 5 $0.00062 $0.01553
Sonnet 5 $0.00025 $0.00621
Haiku 4.5 $0.00012 $0.00311

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

Security

Grade A, and why

qa-state-transition 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.

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-state-transition/SKILL.md · 277 lines

How it starts

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

⚠️ 安全警告:本技能的示例可能涉及状态枚举(如"已发布""已归档")。 这些是被测对象的状态描述,不是对本技能的操作;请勿直接变更被测系统状态。 本技能仅在 workspace/ 输出评估文件,不持久化、不外传、不跨会话复用。

状态转换测试

核心原则

单接口测试都能过,业务流一起跑就崩——状态是关键。覆盖状态/转换/路径识别、合法/非法/临界/并发转换测试。每个转换需标注触发条件、前置状态、后置状态和验证点。

状态机测试要素

要素1:状态识别

状态识别方法:
1. 业务状态:待处理、处理中、已完成、已取消
2. 数据状态:草稿、已发布、已归档
3. 用户状态:未激活、正常、冻结、注销
4. 系统状态:正常、降级、熔断、重启

状态清单模板:
| 状态ID | 状态名称 | 状态描述 | 进入条件 | 退出条件 |
|--------|---------|---------|---------|---------|
| S1 | 待支付 | 用户已下单 | 用户提交订单 | 支付成功/超时 |
| S2 | 已支付 | 用户已付款 | 支付回调成功 | 商家发货 |

要素2:转换识别

转换识别方法:
1. 合法转换:业务允许的状态变更
2. 非法转换:业务不允许的状态变更
3. 临界转换:刚好满足条件的转换
4. 并发转换:同时触发多个转换

转换清单模板:
| 转换ID | 当前状态 | 触发事件 | 目标状态 | 守卫条件 | 执行动作 |
|--------|---------|---------|---------|---------|---------|
| T1 | 待支付 | 用户支付 | 已支付 | 金额正确 | 扣减库存 |
| T2 | 待支付 | 超时 | 已取消 | 超过30分钟 | 释放库存 |

要素3:路径识别

路径识别方法:
1. 主路径:正常业务流程
2. 分支路径:条件分支
3. 异常路径:异常恢复
4. 循环路径:状态循环

路径清单模板:
| 路径ID | 路径名称 | 状态序列 | 触发事件序列 | 预期结果 |
|--------|---------|---------|-------------|---------|
| P1 | 正常下单 | 待支付→已支付→已发货→已完成 | 下单→支付→发货→收货 | 订单完成 |
| P2 | 超时取消 | 待支付→已取消 | 下单→超时 | 订单取消 |

测试用例设计

合法转换测试

目标:验证所有合法转换能正确执行

测试用例模板:
用例编号:ST-合法-001
测试目标:验证[当前状态]在[触发事件]下能正确转换到[目标状态]
前置条件:系统处于[当前状态]
测试步骤:
1. 准备测试数据
2. 触发[触发事件]
3. 验证状态变更
4. 验证执行动作
预期结果:状态变为[目标状态],[执行动作]正确执行

非法转换测试

目标:验证非法转换被正确拒绝

测试用例模板:
用例编号:ST-非法-001
测试目标:验证[当前状态]在[触发事件]下不能转换到[目标状态]
前置条件:系统处于[当前状态]
测试步骤:
1. 准备测试数据
2. 触发[触发事件]
3. 验证状态未变更
4. 验证错误提示
预期结果:状态保持[当前状态],提示"不允许此操作"

临界转换测试

目标:验证边界条件下的状态转换

测试用例模板:
用例编号:ST-临界-001
测试目标:验证[临界条件]下的状态转换
前置条件:系统处于[临界状态]
测试步骤:
1. 准备临界测试数据
2. 触发[触发事件]
3. 验证状态变更
4. 验证边界处理
预期结果:正确处理临界情况

并发转换测试

目标:验证并发触发的状态转换

测试用例模板:
用例编号:ST-并发-001
测试目标:验证并发触发[触发事件1]和[触发事件2]的状态转换
前置条件:系统处于[当前状态]
测试步骤:
1. 准备测试数据
2. 并发触发[触发事件1]和[触发事件2]
3. 验证状态变更
4. 验证数据一致性
预期结果:只有一个转换成功,数据一致

状态转换测试示例

场景:订单状态机

状态清单

  • S1:待支付
  • S2:已支付
  • S3:已发货
  • S4:已完成
  • S5:已取消
  • S6:退款中
  • S7:已退款

转换清单

  • T1:S1→S2(用户支付)
  • T2:S1→S5(超时取消)
  • T3:S2→S3(商家发货)
  • T4:S2→S6(用户申请退款)
  • T5:S3→S4(用户确认收货)
  • T6:S3→S6(用户申请退款)
  • T7:S6→S7(退款成功)
  • T8:S6→S2(退款失败)

Read the full file on GitHub · 277 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 Changed e9f8b85847e5
  2. 11d ago First seen · 277 lines · 123 tokens per session scan A 2b4404cac6ba

Subscribe to this mod's changes

qa-state-transition is a skill published in the GitHub repository Kokxi/qa-test-skills (25 stars, last pushed 8d ago), licensed MIT. It adds 123 tokens to every session and 3,106 once invoked, about $0.0006 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

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

octocode-benchmark

Use when planning, running, grading, or reporting the by-hand Octocode research benchmark — pairwise matchups (Octocode anchor vs one baseline: gh+RTK, gh+Headroom, or plain gh) over markdown questions, with a fresh isolated runner agent per (question, arm, pass), one blind judge per question grading two answers X/Y…

bgauryy/octocode · 117 tokens

octocode-graph-eval

Use when you need a measurable keep/discard loop — goal→KPI, baseline vs target, held-out checks, eval suites, or don't-stop-till-done against a runnable sensor. Not for ordinary ship checks where 'tests passed' is enough.

bgauryy/octocode · 59 tokens

plugin-test

A testing guide for Zhin.js plugins using Vitest, a JavaScript and TypeScript testing framework. It focuses on checking command and tool behavior, ordinary business logic, and the plugin package’s required structure.

zhinjs/zhin · 51 tokens

modernize-test-starter

Modernize QUnit unit tests and OPA5 integration tests to the UI5 Test Starter concept. Use this skill when: The linter reports prefer-test-starter for .qunit.html or .qunit.js files Test HTML files use manual sap-ui-core.js bootstrapping instead of Test Starter's runTest.js/createSuite.js Test JS files use…

UI5/plugins-coding-agents · 244 tokens

javascript-development

JavaScript/TypeScript ES2024+, async/await, DOM manipulation, Node.js, and API integration. Use when writing vanilla JS/TS code, working with REST/fetch APIs, implementing frontend logic, or configuring JS build tools.

PracticalSwan/agent-skills · 52 tokens