qa-test-data-engineering

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

A guide for creating large sets of test data and safely removing identifying details from production data. It covers data factories, database scripts, APIs, and privacy requirements such as GDPR.

In plain words
What is it for?
Use it to generate users, orders, and other test records in bulk, design test-data factories, and anonymise sensitive production data.
Why use it?
It replaces slow, one-by-one test-data preparation with repeatable approaches. It also explains how to use realistic data without exposing personal information.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the qa-test-skills plugin — 49 skills 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/kokxi/qa-test-skills/qa-test-data-engineering
Any agent
npx skills add Kokxi/qa-test-skills --skill qa-test-data-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-test-data-engineering

README.md
[![agentmods](https://agentmods.dev/badge/skills/kokxi/qa-test-skills/qa-test-data-engineering.svg)](https://agentmods.dev/skills/kokxi/qa-test-skills/qa-test-data-engineering)
Your own site
<a href="https://agentmods.dev/skills/kokxi/qa-test-skills/qa-test-data-engineering"><img src="https://agentmods.dev/badge/skills/kokxi/qa-test-skills/qa-test-data-engineering.svg" alt="Measured on agentmods" height="20"></a>
Per session 129 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,403 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. 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.00129 $0.02403
Opus 5 $0.00064 $0.01202
Sonnet 5 $0.00026 $0.00481
Haiku 4.5 $0.00013 $0.00240

Measured yesterday against content hash 47435c8d3f6f, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

qa-test-data-engineering scanned grade A with 1 finding 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 yesterday.

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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

response = requests.post(
skills/qa-test-data-engineering/SKILL.md · 279 lines

How it starts

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

测试数据工程

核心原则

测试数据是测试的基础,好的数据管理让测试可重复、可追溯。

数据构造方法

手动构造

适用场景:
├─ 少量数据
├─ 复杂业务数据
├─ 一次性数据
└─ 调试用途

方法:
├─ 数据库直接插入
├─ 管理后台创建
├─ 接口调用创建
└─ 脚本批量创建

数据工厂

适用场景:
├─ 批量数据
├─ 标准化数据
├─ 重复性数据
└─ 自动化测试

工具:
├─ Faker(Python/JS)
├─ Mockaroo(在线)
├─ Factory Bot(Ruby)
└─ 自建工厂类

数据库脚本

-- 示例:用户数据构造
INSERT INTO users (username, email, phone, status, created_at)
VALUES 
    ('testuser001', '[email protected]', '13800000001', 'active', NOW()),
    ('testuser002', '[email protected]', '13800000002', 'active', NOW()),
    ('testuser003', '[email protected]', '13800000003', 'inactive', NOW());

API构造

# 示例:通过API构造订单数据
def create_test_order(user_id, product_id, quantity=1):
    response = requests.post(
        f"{BASE_URL}/orders",
        json={
            "user_id": user_id,
            "product_id": product_id,
            "quantity": quantity
        },
        headers={"Authorization": f"Bearer {token}"}
    )
    return response.json()["order_id"]

数据脱敏

📌 本节与 qa-test-env-data「数据脱敏」内容同步,修改时请同步更新两处。qa-test-env-data 为简化版,完整版见此处。

脱敏规则

个人信息:
├─ 手机号:138****1234
├─ 身份证:110***********1234
├─ 邮箱:test****@example.com
├─ 姓名:*三
├─ 地址:北京市***
└─ 银行卡:6222****1234

业务数据:
├─ 金额:保留整数位,小数随机
├─ 订单号:保留格式,数字随机
├─ 时间:保留格式,时间随机
└─ 关联ID:保持关联关系

脱敏方法

├─ 替换法:用*替换部分字符
│   └─ 示例:138****1234
│
├─ 加密法:用加密算法处理
│   └─ 示例:AES加密后存储
│
├─ 截断法:只保留部分字符
│   └─ 示例:北京市***
│
├─ 随机法:用随机值替换
│   └─ 示例:姓名随机生成
│
└─ 哈希法:用哈希值替换
    └─ 示例:SHA256哈希

脱敏实现

# 示例:Python脱敏函数
import hashlib
import random

def mask_phone(phone):
    """手机号脱敏:138****1234"""
    return phone[:3] + "****" + phone[-4:]

def mask_id_card(id_card):
    """身份证脱敏:110***********1234"""
    return id_card[:3] + "*" * 10 + id_card[-4:]

def mask_name(name):
    """姓名脱敏:*三"""
    return "*" + name[-1]

def mask_email(email):
    """邮箱脱敏:test****@example.com"""
    local, domain = email.split("@")
    return local[:4] + "****@" + domain

Read the full file on GitHub · 279 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. yesterday Changed 47435c8d3f6f
  2. 6d ago First seen · 279 lines · 129 tokens per session scan A 0b31330e9abe

Subscribe to this mod's changes

qa-test-data-engineering is a skill published in the GitHub repository Kokxi/qa-test-skills (24 stars, last pushed 4d ago), licensed MIT. It adds 129 tokens to every session and 2,403 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.