Token导航 LogoToken导航

Agent Skill · 待分类

test-data-generation(测试数据生成)

用于辅助数据整理、表格处理、CSV/Excel 分析、指标计算和图表准备。它适合让 Agent 清洗字段、汇总数据、发现异常、生成统计口径或把分析结果转成可读说明。使用时需要确认数据来源、字段含义和时间范围,避免把样本数据当全量事实;涉及敏感数据、导出文件或批量写回时,应先确认权限和脱敏边界。

test-data-generation 是待分类类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为只读;许可证为 MIT,第三方扫描已通过,按安装量在待分类类的 11,209 个 Skill 里排第 7,383。

总安装 367周安装 15GitHub Stars 21下载 118核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:test-data-generation(测试数据生成)
来源仓库:https://github.com/thapaliyabikendra/ai-artifacts
仓库路径:skills/test-data-generation
安装命令:
npx skills add https://github.com/thapaliyabikendra/ai-artifacts --skill test-data-generation
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/thapaliyabikendra/ai-artifacts --skill test-data-generation

这个 Skill 是做什么的

这个 Skill 的分类还没最终确定,用法以来源仓库的说明为准。

用于辅助数据整理、表格处理、CSV/Excel 分析和指标计算。适合清洗字段、汇总数据、发现异常或生成统计口径。需确认数据来源、字段含义和时间范围后再操作。涉及敏感数据或批量写回时应先确认权限和脱敏边界。test-data-generation 属于待分类类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/test-data-generation

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/thapaliyabikendra/ai-artifacts --skill test-da…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它标注为只读,先用只读任务试一次,确认行为符合预期再扩大使用范围。

常见问题

6 条

test-data-generation 怎么安装?

在终端执行 npx skills add https://github.com/thapaliyabikendra/ai-artifacts --skill test-data-generat…。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

test-data-generation 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

test-data-generation 需要什么权限?

权限级别是只读。该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

test-data-generation 是免费的吗?

来源标注的许可证是 MIT。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

test-data-generation 用的人多吗?

公开数据是累计安装 367 次,近一周安装 15 次,下载 118 次,GitHub 21 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

test-data-generation 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 3 个目录同时收录,说明这个 Skill 流传比较广。
  • 许可证明确为 MIT,商用和分发边界好判断。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理待分类类任务、又不想每次都手写提示词的人。
  • 需要许可证清楚、并且有第三方扫描结果的团队项目。

不太适合

  • 需要厂商级技术支持和 SLA 的生产系统。

待分类类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
infsh-cli

infsh CLI · Codex、Claude

4,374,576382权限未标注未明确未收录
ai-video-generation

AI 视频生成 · Codex、Claude

4,313,376382调用外部服务未明确有提醒
lark-openapi-explorer

云雀 OpenAPI 浏览器 · Codex、Claude

2,064,1209,011需要联网未明确有提醒
lark-workflow-standup-report

Lark 工作流程站立报告 · Codex、Claude

2,041,6328,978需要联网未明确通过
use-my-browser

使用我的浏览器 · Codex、Claude

1,848,49140操作浏览器未明确未通过
test-data-generation

测试数据生成 · 本页

36721只读MIT通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Test Data Generation

Generate realistic test data using Bogus, test builders, and ABP data seeders.

When to Use

  • Creating realistic fake data for tests
  • Building complex object graphs for testing
  • Seeding test databases
  • Generating development data
  • Creating deterministic test fixtures

Bogus Faker Setup

Installation

<PackageReference Include="Bogus" Version="35.*" />

Basic Faker Configuration

using Bogus;

public static class FakeDataGenerators
{
    // Set seed for reproducible tests
    public static int Seed { get; set; } = 12345;

    static FakeDataGenerators()
    {
        Randomizer.Seed = new Random(Seed);
    }

    public static Faker<Patient> PatientFaker => new Faker<Patient>()
        .RuleFor(p => p.Id, f => Guid.NewGuid())
        .RuleFor(p => p.FirstName, f => f.Name.FirstName())
        .RuleFor(p => p.LastName, f => f.Name.LastName())
        .RuleFor(p => p.Email, (f, p) => f.Internet.Email(p.FirstName, p.LastName))
        .RuleFor(p => p.Phone, f => f.Phone.PhoneNumber("###-###-####"))
        .RuleFor(p => p.DateOfBirth, f => f.Date.Past(80, DateTime.Today.AddYears(-18)))
        .RuleFor(p => p.Address, f => f.Address.FullAddress())
        .RuleFor(p => p.Status, f => f.PickRandom<PatientStatus>());

    public static Faker<Doctor> DoctorFaker => new Faker<Doctor>()
        .RuleFor(d => d.Id, f => Guid.NewGuid())
        .RuleFor(d => d.Name, f => $"Dr. {f.Name.FullName()}")
        .RuleFor(d => d.Specialization, f => f.PickRandom(
            "Cardiology", "Neurology", "Pediatrics", "Orthopedics"))
        .RuleFor(d => d.LicenseNumber, f => f.Random.AlphaNumeric(10).ToUpper())
        .RuleFor(d => d.YearsOfExperience, f => f.Random.Int(1, 40));

    public static Faker<Appointment> AppointmentFaker => new Faker<Appointment>()
        .RuleFor(a => a.Id, f => Guid.NewGuid())
        .RuleFor(a => a.DateTime, f => f.Date.Future(30))
        .RuleFor(a => a.Duration, f => TimeSpan.FromMinutes(f.PickRandom(15, 30, 45, 60)))
        .RuleFor(a => a.Notes, f => f.Lorem.Sentence())
        .RuleFor(a => a.Status, f => f.PickRandom<AppointmentStatus>());
}

Advanced Bogus Patterns

public static class AdvancedFakers
{
    // Faker with relationships
    public static Faker<Appointment> AppointmentWithRelationsFaker(
        Guid? patientId = null,
        Guid? doctorId = null)
    {
        return new Faker<Appointment>()
            .RuleFor(a => a.Id, f => Guid.NewGuid())
            .RuleFor(a => a.PatientId, f => patientId ?? Guid.NewGuid())
            .RuleFor(a => a.DoctorId, f => doctorId ?? Guid.NewGuid())
            .RuleFor(a => a.DateTime, f => f.Date.Future(30))
            .RuleFor(a => a.Status, AppointmentStatus.Scheduled);
    }

    // Faker with conditional rules
    public static Faker<Patient> PatientFakerWithScenario(PatientScenario scenario)
    {
        var faker = new Faker<Patient>()
            .RuleFor(p => p.Id, f => Guid.NewGuid())
            .RuleFor(p => p.Name, f => f.Name.FullName())
            .RuleFor(p => p.Email, f => f.Internet.Email());

        return scenario switch
        {
            PatientScenario.Adult => faker
                .RuleFor(p => p.DateOfBirth, f => f.Date.Past(50, DateTime.Today.AddYears(-18))),
            PatientScenario.Minor => faker
                .RuleFor(p => p.DateOfBirth, f => f.Date.Past(17, DateTime.Today.AddYears(-1))),
            PatientScenario.Elderly => faker
                .RuleFor(p => p.DateOfBirth, f => f.Date.Past(30, DateTime.Today.AddYears(-65))),
            _ => faker
        };
    }

    // Faker with locale
    public static Faker<Patient> BrazilianPatientFaker => new Faker<Patient>("pt_BR")
        .RuleFor(p => p.Name, f => f.Name.FullName())
        .RuleFor(p => p.Phone, f => f.Phone.PhoneNumber());

    // Generate unique values
    public static Faker<Patient> UniquePatientFaker => new Faker<Patient>()
        .RuleFor(p => p.Id, f => Guid.NewGuid())
        .RuleFor(p => p.Email, f => f.Internet.Email().ToLower())
        .RuleFor(p => p.SocialSecurityNumber, f => f.Random.Replace("###-##-####"));
}

public enum PatientScenario { Adult, Minor, Elderly }

Test Builder Pattern

Fluent Builder

public class PatientBuilder
{
    private readonly Patient _patient;
    private readonly Faker _faker = new();

    public PatientBuilder()
    {
        _patient = new Patient
        {
            Id = Guid.NewGuid(),
            Name = _faker.Name.FullName(),
            Email = _faker.Internet.Email(),
            DateOfBirth = _faker.Date.Past(50, DateTime.Today.AddYears(-18)),
            Status = PatientStatus.Active
        };
    }

    public PatientBuilder WithId(Guid id)
    {
        _patient.Id = id;
        return this;
    }

    public PatientBuilder WithName(string name)
    {
        _patient.Name = name;
        return this;
    }

    public PatientBuilder WithEmail(string email)
    {
        _patient.Email = email;
        return this;
    }

    public PatientBuilder WithDateOfBirth(DateTime dob)
    {
        _patient.DateOfBirth = dob;
        return this;
    }

    public PatientBuilder AsMinor()
    {
        _patient.DateOfBirth = DateTime.Today.AddYears(-10);
        return this;
    }

    public PatientBuilder AsInactive()
    {
        _patient.Status = PatientStatus.Inactive;
        return this;
    }

    public PatientBuilder WithAppointments(int count)
    {
        _patient.Appointments = FakeDataGenerators.AppointmentFaker
            .Generate(count)
            .Select(a => { a.PatientId = _patient.Id; return a; })
            .ToList();
        return this;
    }

    public Patient Build() => _patient;

    // Implicit conversion for cleaner tests
    public static implicit operator Patient(PatientBuilder builder) => builder.Build();
}

// Usage
var patient = new PatientBuilder()
    .WithName("John Doe")
    .WithEmail("john@example.com")
    .AsMinor()
    .WithAppointments(3)
    .Build();

DTO Builder

public class CreatePatientDtoBuilder
{
    private readonly CreatePatientDto _dto;
    private readonly Faker _faker = new();

    public CreatePatientDtoBuilder()
    {
        _dto = new CreatePatientDto
        {
            Name = _faker.Name.FullName(),
            Email = _faker.Internet.Email(),
            Phone = _faker.Phone.PhoneNumber(),
            DateOfBirth = _faker.Date.Past(50, DateTime.Today.AddYears(-18))
        };
    }

    public CreatePatientDtoBuilder WithName(string name)
    {
        _dto.Name = name;
        return this;
    }

    public CreatePatientDtoBuilder WithEmail(string email)
    {
        _dto.Email = email;
        return this;
    }

    public CreatePatientDtoBuilder WithInvalidEmail()
    {
        _dto.Email = "not-an-email";
        return this;
    }

    public CreatePatientDtoBuilder WithEmptyName()
    {
        _dto.Name = "";
        return this;
    }

    public CreatePatientDto Build() => _dto;
}

// Usage in tests
[Fact]
public async Task Create_InvalidEmail_ReturnsValidationError()
{
    var input = new CreatePatientDtoBuilder()
        .WithInvalidEmail()
        .Build();

    var result = await _service.CreateAsync(input);
    // Assert...
}

ABP Data Seeders

Test Data Seeder

public class TestDataSeeder : IDataSeedContributor, ITransientDependency
{
    private readonly IRepository<Patient, Guid> _patientRepository;
    private readonly IRepository<Doctor, Guid> _doctorRepository;
    private readonly IGuidGenerator _guidGenerator;

    public TestDataSeeder(
        IRepository<Patient, Guid> patientRepository,
        IRepository<Doctor, Guid> doctorRepository,
        IGuidGenerator guidGenerator)
    {
        _patientRepository = patientRepository;
        _doctorRepository = doctorRepository;
        _guidGenerator = guidGenerator;
    }

    public async Task SeedAsync(DataSeedContext context)
    {
        if (await _patientRepository.GetCountAsync() > 0)
            return;

        // Seed deterministic test data
        var patients = CreateTestPatients();
        await _patientRepository.InsertManyAsync(patients);

        var doctors = CreateTestDoctors();
        await _doctorRepository.InsertManyAsync(doctors);
    }

    private List<Patient> CreateTestPatients()
    {
        return new List<Patient>
        {
            new Patient(TestDataIds.Patient1, "John Doe", "john@test.com",
                new DateTime(1990, 5, 15)),
            new Patient(TestDataIds.Patient2, "Jane Smith", "jane@test.com",
                new DateTime(1985, 8, 22)),
            new Patient(TestDataIds.InactivePatient, "Inactive User", "inactive@test.com",
                new DateTime(1970, 1, 1)) { Status = PatientStatus.Inactive },
            new Patient(TestDataIds.DeletablePatient, "To Be Deleted", "delete@test.com",
                new DateTime(1995, 3, 10))
        };
    }

    private List<Doctor> CreateTestDoctors()
    {
        return new List<Doctor>
        {
            new Doctor(TestDataIds.Doctor1, "Dr. House", "Diagnostics", "LIC001"),
            new Doctor(TestDataIds.Doctor2, "Dr. Wilson", "Oncology", "LIC002")
        };
    }
}

// Centralized test IDs
public static class TestDataIds
{
    public static readonly Guid Patient1 = Guid.Parse("3a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d");
    public static readonly Guid Patient2 = Guid.Parse("4b2c3d4e-5f6a-7b8c-9d0e-1f2a3b4c5d6e");
    public static readonly Guid InactivePatient = Guid.Parse("5c3d4e5f-6a7b-8c9d-0e1f-2a3b4c5d6e7f");
    public static readonly Guid DeletablePatient = Guid.Parse("6d4e5f6a-7b8c-9d0e-1f2a-3b4c5d6e7f8a");
    public static readonly Guid Doctor1 = Guid.Parse("7e5f6a7b-8c9d-0e1f-2a3b-4c5d6e7f8a9b");
    public static readonly Guid Doctor2 = Guid.Parse("8f6a7b8c-9d0e-1f2a-3b4c-5d6e7f8a9b0c");
}

Bulk Data Seeder for Performance Tests

public class BulkTestDataSeeder : IDataSeedContributor, ITransientDependency
{
    private readonly IRepository<Patient, Guid> _patientRepository;

    public async Task SeedAsync(DataSeedContext context)
    {
        if (!context.Properties.ContainsKey("BulkSeed"))
            return;

        var count = (int)context.Properties["BulkSeed"];

        var patients = FakeDataGenerators.PatientFaker.Generate(count);

        // Batch insert for performance
        const int batchSize = 1000;
        for (int i = 0; i < patients.Count; i += batchSize)
        {
            var batch = patients.Skip(i).Take(batchSize).ToList();
            await _patientRepository.InsertManyAsync(batch);
        }
    }
}

// Usage in test
[Fact]
public async Task GetList_LargeDataset_PerformsWell()
{
    await SeedDataAsync(new DataSeedContext()
        .WithProperty("BulkSeed", 10000));

    var stopwatch = Stopwatch.StartNew();
    var result = await _service.GetListAsync(new GetPatientListDto());
    stopwatch.Stop();

    stopwatch.ElapsedMilliseconds.ShouldBeLessThan(500);
}

Test Fixtures

Shared Fixture for Integration Tests

public class DatabaseFixture : IAsyncLifetime
{
    public IServiceProvider Services { get; private set; }
    public ClinicDbContext DbContext { get; private set; }

    public async Task InitializeAsync()
    {
        var services = new ServiceCollection();
        services.AddDbContext<ClinicDbContext>(options =>
            options.UseInMemoryDatabase($"TestDb_{Guid.NewGuid()}"));

        Services = services.BuildServiceProvider();
        DbContext = Services.GetRequiredService<ClinicDbContext>();

        await SeedTestDataAsync();
    }

    public async Task DisposeAsync()
    {
        await DbContext.DisposeAsync();
    }

    private async Task SeedTestDataAsync()
    {
        var patients = FakeDataGenerators.PatientFaker.Generate(10);
        DbContext.Patients.AddRange(patients);
        await DbContext.SaveChangesAsync();
    }
}

// Usage
public class PatientTests : IClassFixture<DatabaseFixture>
{
    private readonly DatabaseFixture _fixture;

    public PatientTests(DatabaseFixture fixture)
    {
        _fixture = fixture;
    }

    [Fact]
    public async Task Test_WithSharedData()
    {
        var patients = await _fixture.DbContext.Patients.ToListAsync();
        patients.ShouldNotBeEmpty();
    }
}

Quick Reference

PatternUse CaseExample
Bogus FakerRandom realistic dataPatientFaker.Generate(10)
BuilderFluent test object creationnew PatientBuilder().WithName("John").Build()
Data SeederDatabase test dataIDataSeedContributor
FixtureShared test contextIClassFixture<T>

Bogus Cheat Sheet

MethodPurpose
f.Name.FullName()Random full name
f.Internet.Email()Random email
f.Phone.PhoneNumber("###-###-####")Formatted phone
f.Date.Past(years)Past date
f.Date.Future(days)Future date
f.Lorem.Sentence()Random sentence
f.Random.Int(min, max)Random integer
f.PickRandom<Enum>()Random enum value
f.Random.AlphaNumeric(length)Random string

Related Skills

  • xunit-testing-patterns - Test structure and assertions
  • api-integration-testing - API test patterns
  • efcore-patterns - Database testing

平台分布

github-copilot

30.45%
按下载量换算36

mcpjam

20.79%
按下载量换算25

Claude Code

18.5%
按下载量换算22

zencoder

13.64%
按下载量换算16

crush

7.94%
按下载量换算9

cline

3.5%
按下载量换算4

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

继续浏览同类 Skills