Optimize Mock Data

Optimizes a directory of structurally-related JSON / JSONL mock fixtures by inferring a shared schema, detecting structural drift between files, normalizing formatting and key order, and optionally shrinking verbose payloads while preserving shape. Use when fixture files have grown inconsistent (mixed tabs / 2-space indent, reordered keys, fields present in some files but missing from others, megabyte-sized payloads), when adding a new mock that must match an existing set, or when preparing fixtures for a storage-cost-sensitive context. Four modes — `analyze` (default, read-only), `normalize` (rewrites files in place), `shrink` (caps verbose string fields), `trim` (reduces array cardinality without touching strings). Triggers on "optimize mock data", "normalize fixtures", "check mock structure", "audit mocks", "shrink test fixtures", "are these mocks consistent", "/optimize-mock-data".

mthines 6f68935 12 files · 89.8 KB Updated

File contents

mthines/agent-skills/tree/main/skills/testing/optimize-mock-data commit 6f689351f5

Frequently asked questions

npx skillmds@latest add mthines/optimize-mock-data