← 返回 Skills 市场
xueyetianya

Fixture

作者 bytesagain4 · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
166
总下载
0
收藏
1
当前安装
1
版本数
在 OpenClaw 中安装
/install fixture
功能描述
Generate and manage test data fixtures using CLI templates. Use when creating seed data, mock records, or reproducible test datasets.
使用说明 (SKILL.md)

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 \x3Ccommand> [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":"[email protected]","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 | [email protected]

安全使用建议
This tool is local-only and coherent with its description, but be aware it will create and overwrite files under $HOME/.fixture/data.jsonl and templates.json. Only load/import files you trust (don't pass sensitive system files as --file), and ensure you have Python 3.8+ available. If you need stricter isolation, run the script in a contained environment or change DATA_DIR to a dedicated path before use.
功能分析
Type: OpenClaw Skill Name: fixture Version: 1.0.0 The 'fixture' skill bundle is a legitimate utility for generating and managing test data fixtures. It stores data locally in the user's home directory (~/.fixture/) and provides standard CLI operations like creating, seeding, and exporting datasets. The implementation in scripts/script.sh uses safe practices, such as passing arguments via environment variables to embedded Python scripts to avoid shell injection. While the SQL export functionality in the export command lacks sanitization (making the resulting SQL file potentially unsafe if executed blindly), this is a common functional limitation rather than a sign of malice. No evidence of data exfiltration, unauthorized network access, or persistence mechanisms was found.
能力评估
Purpose & Capability
Name/description (fixture generator) match the included shell+Python implementation. Required resources (Python, bash, write access to ~/.fixture) are appropriate and necessary for the stated functionality.
Instruction Scope
SKILL.md instructs only local operations (create, load, seed, dump, list, reset, template, validate, export, import). The script reads/writes the declared ~/.fixture files and any user-supplied input/output paths; it does not access unrelated system configuration or environment variables.
Install Mechanism
No install spec; the skill ships a single script (scripts/script.sh) invoked by bash which embeds Python snippets. No downloads or archive extraction are performed.
Credentials
No environment variables, credentials, or external tokens are required. The script uses a few internally exported env vars for subprocess communication (e.g., FIXTURE_DATA_FILE) which is standard and local-only.
Persistence & Privilege
Skill does not require always:true and does not modify other skills or global agent configuration. It persists only to $HOME/.fixture as documented.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install fixture
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /fixture 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
publish v1.0.0
元数据
Slug fixture
版本 1.0.0
许可证 MIT-0
累计安装 1
当前安装数 1
历史版本数 1
常见问题

Fixture 是什么?

Generate and manage test data fixtures using CLI templates. Use when creating seed data, mock records, or reproducible test datasets. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 166 次。

如何安装 Fixture?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install fixture」即可一键安装,无需额外配置。

Fixture 是免费的吗?

是的,Fixture 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Fixture 支持哪些平台?

Fixture 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Fixture?

由 bytesagain4(@xueyetianya)开发并维护,当前版本 v1.0.0。

💬 留言讨论