optimize-mock-data

optimize-mock-data is a skill for Claude Code, Codex from mthines/agent-skills. It costs 195 tokens per session (3,050 once invoked), scanned A, original, MIT.

A tool for checking and cleaning related JSON or JSONL test-data files. JSONL is a format with one JSON value per line; the tool compares file structure, formatting, key order, and optional payload size.

In plain words
What is it for?
Use it to analyze fixtures, normalize their formatting and key order, shorten strings, or reduce arrays while keeping the data structure.
Why use it?
It helps find differences that make mock test data inconsistent or harder to review. It can report problems or rewrite files to follow a shared shape and format.

Skill for Claude CodeCodex

Part of the mthines-agent-skills plugin — 54 skills, 4 agents shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/mthines/agent-skills/optimize-mock-data
Any agent
npx skills add mthines/agent-skills --skill optimize-mock-data
Clone the repo
git clone --depth 1 https://github.com/mthines/agent-skills

Made for: Claude Code, Codex.

Or install mthines-agent-skills, the plugin that ships this one along with the rest of its 54 skills, 4 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for optimize-mock-data

README.md
[![agentmods](https://agentmods.dev/badge/skills/mthines/agent-skills/optimize-mock-data.svg)](https://agentmods.dev/skills/mthines/agent-skills/optimize-mock-data)
Your own site
<a href="https://agentmods.dev/skills/mthines/agent-skills/optimize-mock-data"><img src="https://agentmods.dev/badge/skills/mthines/agent-skills/optimize-mock-data.svg" alt="Measured on agentmods" height="20"></a>
Per session 195 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,050 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00195 $0.03050
Opus 5 $0.00097 $0.01525
Sonnet 5 $0.00039 $0.00610
Haiku 4.5 $0.00019 $0.00305

Measured 5d ago against content hash 78f9c1fa05dd, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

optimize-mock-data scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

The scan reads SKILL.md. This mod also ships 5 executable files (scripts/diff-shapes.py, scripts/normalize.py, scripts/shape.py, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/testing/optimize-mock-data/SKILL.md · 263 lines

How it starts

The opening of the file, as written. The whole thing — 263 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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, trim. 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-arrays, compact, slim Rewrites files (array entry reduction; never modifies strings)

State the detected mode, target path, and file count in one line before continuing:

Mode: analyze
Target: components/ui/src/agent0/mocks/ (22 files)

Workflow

A four-phase pipeline. Each phase has a gate; do not proceed until it passes.

Phase Name Rule file Gate
0 Resolve corpus Target resolved to ≥ 2 JSON files
1 Shape extraction rules/shape-extraction.md Each file has a shape fingerprint
2 Drift detection rules/drift-detection.md Drift report produced (or "no drift")
3 Apply (mode-gated) rules/shrink-policy.md (shrink only) Rewrites pass round-trip parse; analyze skips

Read the full file on GitHub · 263 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 263 lines · 195 tokens per session scan A 78f9c1fa05dd

Subscribe to this mod's changes

optimize-mock-data is a skill published in the GitHub repository mthines/agent-skills (12 stars, last pushed yesterday), licensed MIT. It adds 195 tokens to every session and 3,050 once invoked, about $0.0010 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

data-scraper-agent

Build an automated data-collection agent that scrapes a public source on a schedule, enriches results with a cheap/free LLM, stores them in a database, and improves scoring from user feedback over time — runnable entirely on free-tier infrastructure. Use when the user wants to monitor, collect, or track any public…

shennawardana23/skillme · 88 tokens

content-hash-cache-pattern

Cache expensive file-processing results (PDF parsing, OCR, text extraction, image analysis) keyed by a SHA-256 hash of file content rather than file path, so renamed files still hit the cache and changed content auto-invalidates it. Use when building a file-processing pipeline that reprocesses the same files across…

shennawardana23/skillme · 89 tokens

genkit-go-flows

Guides building AI features with Genkit for Go - flows, prompts, structured generation, tool calling, and middleware. Use when defining a Genkit flow, writing a prompt, calling genkit.Generate/GenerateData, defining a tool, debugging Genkit output with traces, or asked how Genkit differs from Google's Agent…

shennawardana23/skillme · 76 tokens

agent-platform-tuning

Agent Platform Model Tuning. Use when you need to fine-tune open models or Gemini models using Agent Platform infrastructure. Don't use for model training outside Agent Platform, model deployment to endpoints (use agent-platform-deploy), or managing serving endpoints (use agent-platform-endpoint-management).

google/skills · 64 tokens

developing-genkit-js

Develop AI-powered applications using Genkit in Node.js/TypeScript. Use when the user asks about Genkit, AI agents, flows, or tools in JavaScript/TypeScript, or when encountering Genkit errors, validation issues, type errors, or API problems.

google/skills · 60 tokens

agent-platform-prompt-management

Manages and orchestrates prompts in Agent Platform. Use when you need to create, list, retrieve, version, or delete managed prompts in Agent Platform. Don't use for model training, model deployment to endpoints, or managing non-Agent Platform prompts.

google/skills · 55 tokens