generate_test_data

A command for creating structured test data from a feature, module, fields, or existing test cases. It can produce normal, invalid, boundary, and unusual examples in formats such as JSON, CSV, tables, or code.

In plain words
What is it for?
Use it for form testing, API payloads, and data-driven tests, such as generating inputs for registration, login, or user-creation features.
Why use it?
It reduces the manual work of inventing test inputs and helps cover validation rules and less common cases.

Command for Claude Code

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 commands/anhtester/claude-testing-kit/generate_test_data
Clone the repo
git clone --depth 1 https://github.com/anhtester/claude-testing-kit

Made for: Claude Code.

Per session 30 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,977 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 $0.00030 $0.02977
Opus 5 $0.00015 $0.01489
Sonnet 5 $0.00006 $0.00595
Haiku 4.5 $0.00003 $0.00298

Measured 2d ago against content hash 23193cfea6e2, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

generate_test_data 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 2d 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.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

.claude/commands/generate_test_data.md · 268 lines

How it starts

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

/generate_test_data — Sinh Test Data Có Cấu Trúc

User cung cấp feature/module hoặc test cases cần sinh data. AI phân tích fields, constraints, sinh bộ data đầy đủ (positive, negative, boundary, edge cases) với format sẵn sàng sử dụng.

BẮT BUỘC (MANDATORY): Trước khi bắt đầu, PHẢI nạp và đọc kỹ:

  • Skill: .claude/skills/skills-test-data-generator/SKILL.md — Quy tắc sinh data
  • Rule: .claude/rules/automation_rules.md — Section Test Data

Input cần từ User

Input Bắt buộc Mô tả
Feature / Module VD: "Form đăng ký", "API Create User", "Trang Login"
Fields cần data ⚠️ Nên có Danh sách fields + constraints. Nếu không có → AI tự phân tích từ DOM/Spec
URL trang / Swagger spec Nếu có → AI inspect DOM/Spec để lấy validation rules chính xác
Test cases Nếu đã có test cases → AI sinh data match từng TC
Output format json (mặc định), csv, markdown table, code (TypeScript/Java/Python)
Ngôn ngữ data Tiếng Việt / Tiếng Anh (mặc định: theo context)

Các bước thực hiện

Bước 1: Phân tích Fields & Constraints

  1. Xác định nguồn thông tin:

    Nguồn Cách lấy Ưu tiên
    User cung cấp trực tiếp Đọc từ input ⭐ Cao nhất
    DOM thực tế (UI form) browser_navigatebrowser_snapshot → phân tích input fields ⭐ Cao
    Swagger/OpenAPI spec WebFetch → parse schema + constraints ⭐ Cao
    Test cases đã có Đọc test steps → trích xuất fields Trung bình
    Đoán từ tên module Dựa trên kinh nghiệm domain ⭐ Thấp nhất
  2. Với mỗi field, xác định:

    Attribute Ví dụ
    Tên field email, password, name, phone
    Kiểu dữ liệu string, number, boolean, date, file, enum
    Required? Bắt buộc hay tùy chọn
    Validation rules min/maxLength, pattern/regex, format (email, phone), unique
    Giá trị mặc định Nếu có
    Enum values VD: status = ["AVAILABLE", "UNAVAILABLE"]
    Quan hệ phụ thuộc VD: password_confirm phải khớp password

Read the full file on GitHub · 268 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. 2d ago First seen · 268 lines · 30 tokens per session scan A 23193cfea6e2

Subscribe to this mod's changes

generate_test_data is a command published in the GitHub repository anhtester/claude-testing-kit (49 stars, last pushed 24d ago), licensed MIT. It adds 30 tokens to every session and 2,977 once invoked, about $0.0002 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.