🎁 Get the FREE AI Skills Starter Guide β€” Subscribe β†’
BytesAgainBytesAgain
πŸ¦€ ClawHub✦ BytesAgain

Fixture

by @xueyetianya

Generate and manage test data fixtures using CLI templates. Use when creating seed data, mock records, or reproducible test datasets.

Versionv1.0.0
Downloads360
Installs1
TERMINAL
clawhub install fixture

πŸ“– About This Skill


name: fixture version: "1.0.0" description: "Generate and manage test data fixtures using CLI templates. Use when creating seed data, mock records, or reproducible test datasets." author: BytesAgain homepage: https://bytesagain.com source: https://github.com/bytesagain/ai-skills

Fixture β€” Test Data Fixture Generator

A CLI tool for generating, managing, and exporting test data fixtures. Create reproducible datasets from templates with seeded randomness for consistent test environments.

Prerequisites

  • Python 3.8+
  • bash shell
  • Write access to ~/.fixture/
  • Data Storage

    All fixtures are stored in JSONL format at ~/.fixture/data.jsonl. Templates are stored at ~/.fixture/templates.json.

    Commands

    Run commands via: bash scripts/script.sh [arguments...]

    create

    Create a new fixture record with specified fields and values.

    bash scripts/script.sh create --name "test_user" --type user --fields '{"name":"Alice","email":"alice@test.com","age":30}'
    

    Arguments:

  • --name β€” Fixture name/label (required)
  • --type β€” Fixture type/category (required)
  • --fields β€” JSON object of field values (required)
  • load

    Load fixtures from a JSON or JSONL file into the fixture store.

    bash scripts/script.sh load --file fixtures.json
    bash scripts/script.sh load --file data.jsonl --format jsonl
    

    Arguments:

  • --file β€” Input file path (required)
  • --format β€” File format: json, jsonl (optional, default: auto-detect)
  • dump

    Dump all fixtures or filtered subset to stdout or a file.

    bash scripts/script.sh dump
    bash scripts/script.sh dump --type user --output users.json
    

    Arguments:

  • --type β€” Filter by fixture type (optional)
  • --output β€” Output file path (optional, default: stdout)
  • list

    List all fixtures with summary information.

    bash scripts/script.sh list
    bash scripts/script.sh list --type user
    

    Arguments:

  • --type β€” Filter by fixture type (optional)
  • seed

    Generate multiple fixture records from a template with seeded random data.

    bash scripts/script.sh seed --template user --count 10 --seed 42
    

    Arguments:

  • --template β€” Template name to use (required)
  • --count β€” Number of records to generate (required)
  • --seed β€” Random seed for reproducibility (optional)
  • reset

    Clear all fixtures or a specific type from the data store.

    bash scripts/script.sh reset
    bash scripts/script.sh reset --type user
    

    Arguments:

  • --type β€” Only reset fixtures of this type (optional)
  • --confirm β€” Skip confirmation prompt (optional)
  • template

    Manage fixture templates: create, list, or show template definitions.

    bash scripts/script.sh template --list
    bash scripts/script.sh template --create user --schema '{"name":"string","email":"email","age":"int:18-65"}'
    bash scripts/script.sh template --show user
    

    Arguments:

  • --list β€” List all templates (optional)
  • --create β€” Create template with given name (optional)
  • --schema β€” JSON schema for template creation (optional)
  • --show β€” Show a specific template (optional)
  • validate

    Validate fixtures against their template schema.

    bash scripts/script.sh validate
    bash scripts/script.sh validate --type user
    

    Arguments:

  • --type β€” Validate only a specific type (optional)
  • export

    Export fixtures to various formats: JSON, JSONL, CSV, SQL.

    bash scripts/script.sh export --output fixtures.csv --format csv
    bash scripts/script.sh export --output seed.sql --format sql --table users
    

    Arguments:

  • --output β€” Output file path (required)
  • --format β€” Export format: json, jsonl, csv, sql (required)
  • --table β€” Table name for SQL export (optional)
  • import

    Import fixtures from external sources or standard formats.

    bash scripts/script.sh import --file data.csv --type user
    

    Arguments:

  • --file β€” Input file path (required)
  • --type β€” Assign fixture type (required)
  • help

    Display help information and list all available commands.

    bash scripts/script.sh help
    

    version

    Display the current tool version.

    bash scripts/script.sh version
    

    Examples

    # Create a template
    bash scripts/script.sh template --create user --schema '{"name":"string","email":"email","age":"int:18-65"}'

    Seed 50 users

    bash scripts/script.sh seed --template user --count 50 --seed 42

    List all fixtures

    bash scripts/script.sh list

    Export to SQL

    bash scripts/script.sh export --output seed.sql --format sql --table users

    Reset all data

    bash scripts/script.sh reset --confirm

    Notes

  • Templates define field types: string, email, int:min-max, float:min-max, bool, uuid, date
  • Seeded generation guarantees identical output given the same seed
  • Use validate to check fixtures match their template schema
  • SQL export generates INSERT statements compatible with most databases

  • Powered by BytesAgain | bytesagain.com | hello@bytesagain.com

    πŸ’‘ Examples

    # Create a template
    bash scripts/script.sh template --create user --schema '{"name":"string","email":"email","age":"int:18-65"}'

    Seed 50 users

    bash scripts/script.sh seed --template user --count 50 --seed 42

    List all fixtures

    bash scripts/script.sh list

    Export to SQL

    bash scripts/script.sh export --output seed.sql --format sql --table users

    Reset all data

    bash scripts/script.sh reset --confirm

    βš™οΈ Configuration

  • Python 3.8+
  • bash shell
  • Write access to ~/.fixture/
  • πŸ“‹ Tips & Best Practices

  • Templates define field types: string, email, int:min-max, float:min-max, bool, uuid, date
  • Seeded generation guarantees identical output given the same seed
  • Use validate to check fixtures match their template schema
  • SQL export generates INSERT statements compatible with most databases

  • Powered by BytesAgain | bytesagain.com | hello@bytesagain.com