agentleFS
julismanjulisman/virtual-worker/skills/data/json-wrangler/SKILL.md

Json Wrangler

Skill0 starsChanged 29 days agoApache-2.0View on GitHub

Transform JSON files with a bundled stdlib tool — flatten nested objects to dot-keys, convert an array of objects to CSV, or filter array items by a field value.

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Run it via shell, e.g.:

    line 42
  2. Very specific:

    Verify: read_file the first lines of the output.

    line 46
  3. Very specific:

    If shell is unavailable: for small files (< ~100 items) do the transform manually and write_file the result, stating it was done by hand.

    line 64
  4. Very specific:

    Never reorder or rewrite values beyond the transform.

    line 67

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Json Wrangler

You transform JSON files in the working folder with scripts/json_tool.py, choosing the right subcommand for the user's ask.

Inputs

  • Path to a .json file in the working folder (if unnamed, glob for *.json and confirm).
  • The transformation the user wants; output filename (defaults: out.json / out.csv).

Choosing the subcommand

  • flatten — the user wants nested structure collapsed: {"user":{"name":"Ana"}} becomes {"user.name":"Ana"}; list items get numeric keys (tags.0). Right for "make this flat / diffable / one key per line".
  • tocsv — the input is an ARRAY of objects and the user wants a table/spreadsheet/Excel-openable file. Each object becomes a row (nested keys are flattened into dot-named columns; the column set is the union across rows).
  • filter --path a.b --equals X — keep only array items whose field at the dot-path equals X (string compare, so --equals 42 matches the number 42). Right for "only the active ones", "just the rows where region is ID".
  • Combinations run as a pipeline: e.g. filter first to filtered.json, then tocsv on that output.

Steps

  1. Inspect the input with read_file (or document_info if very large) to see the shape: object vs array, nesting depth, the field to filter on.
  2. Pick the subcommand(s) per the guide above; tell the user your plan in one line.
  3. Fetch the tool: load_skill_resource({"slug": "json-wrangler", "path": "scripts/json_tool.py"}), save it into the working folder with write_file as json_tool.py.
  4. Run it via shell, e.g.:
    • shell("python3 json_tool.py flatten data.json -o data.flat.json")
    • shell("python3 json_tool.py tocsv data.json -o data.csv")
    • shell("python3 json_tool.py filter data.json --path status --equals active -o active.json")
  5. Verify: read_file the first lines of the output; for tocsv confirm the header columns; for filter confirm the kept-count printed by the tool is plausible against step 1.
  6. Report what was produced and the counts.

Output format

<subcommand> on <in.json> → <out file>
- items in / out (filter) or rows x columns (tocsv) or keys produced (flatten)
- note anything lossy (e.g. empty cells for objects missing a column)

Rules

  • The tool errors (exit non-zero) if the shape does not fit — e.g. tocsv on a non-array. Relay the error and suggest the fix (often: flatten or filter first, or the array lives under a top-level key — extract it first).
  • If shell is unavailable: for small files (< ~100 items) do the transform manually and write_file the result, stating it was done by hand; for large files tell the user to enable shell.
  • Never reorder or rewrite values beyond the transform; filter keeps items byte-equivalent, tocsv writes values as-is.
  • The original file is never modified; always write to a new output path.
  • Deep filtering beyond exact equality (ranges, contains) is out of scope — offer to do it manually on small data instead of inventing flags.
  • Local-first: no network; inputs and outputs stay in the working folder.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.