← ClaudeAtlas

optimize-mock-datalisted

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. Three modes — `analyze` (default, read-only), `normalize` (rewrites files in place), `shrink` (caps verbose string fields). Triggers on "optimize mock data", "normalize fixtures", "check mock structure", "audit mocks", "shrink test fixtures", "are these mocks consistent", "/optimize-mock-data".
mthines/agent-skills · ★ 5 · Data & Documents · score 83
Install: claude install-skill mthines/agent-skills
# Optimize Mock Data Audit and normalize a set of related JSON (or JSONL) mock fixtures so every file shares the same shape, formatting, and verbosity budget. Pure shape work — never touches semantics or business values unless the user explicitly asks for `shrink`. > **This `SKILL.md` is a thin index.** Detailed rules live in > `rules/*.md` and load on demand. Reusable Python scripts live in > `scripts/*.py` and run via `Bash`. Worked example output lives in > `references/example-report.md`. --- ## Mode Detection Parse `$ARGUMENTS` as `<mode> <path> [flags]` where `<mode>` is one of `analyze`, `normalize`, `shrink`. If the first token is a path (starts with `/`, `./`, or `~`) treat it as `<path>` and default `<mode>` to `analyze`. | Mode | Default | Trigger | Side effect | | ----------- | ------- | ---------------------------------------------------------------------- | --------------------------------- | | `analyze` | **yes** | `analyze`, `audit`, `check`, `report`, or first arg is a path | Read-only report | | `normalize` | | `normalize`, `fix`, `format`, `reorder` | Rewrites files | | `shrink` | | `shrink`, `shorten`, `truncate-strings` | Rewrites files (string truncation) | | `trim` | | `trim`, `trim-arrays`, `cardinality`, `reduce-array