json-data-handling

json-data-handling is a skill for Claude Code from bobmatnyc/claude-mpm-skills. It costs 12 tokens per session (1,217 once invoked), scanned A, original, MIT.

A guide to reading, changing, and writing JSON, a common text format for structured data. It includes examples for Python and JavaScript.

In plain words
What is it for?
Use it when a program needs to load JSON files, parse JSON text, convert data to JSON, or save structured results.
Why use it?
Handling JSON incorrectly can cause parsing errors, lost data, or badly formatted output. This guide provides basic patterns for common data operations.

Skill for Claude Code

Written for Claude Code: disable-model-invocation in frontmatter.

not rated 74repo 1mo ago A scan Socket: passSnyk: passSkillSpector: pass 12 tokens original MIT

Good fit Use it when a program needs to load JSON files, parse JSON text, convert data to JSON, or save structured results.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/bobmatnyc/claude-mpm-skills/json-data-handling
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.

Any agent
npx skills add bobmatnyc/claude-mpm-skills --skill json-data-handling
Clone the repo
git clone --depth 1 https://github.com/bobmatnyc/claude-mpm-skills

Made for: Claude Code.

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 json-data-handling

README.md
[![agentmods](https://agentmods.dev/badge/skills/bobmatnyc/claude-mpm-skills/json-data-handling/github.svg)](https://agentmods.dev/skills/bobmatnyc/claude-mpm-skills/json-data-handling)
Your own site
<a href="https://agentmods.dev/skills/bobmatnyc/claude-mpm-skills/json-data-handling"><img src="https://agentmods.dev/badge/skills/bobmatnyc/claude-mpm-skills/json-data-handling/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for json-data-handling

Your own site · 80×15
<a href="https://agentmods.dev/skills/bobmatnyc/claude-mpm-skills/json-data-handling"><img src="https://agentmods.dev/badge/skills/bobmatnyc/claude-mpm-skills/json-data-handling.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 12 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,217 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • Socket pass 18 Mar 2026
  • Snyk pass 15 Feb 2026
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.1 $0.00012 $0.01217
Opus 5 $0.00006 $0.00609
Sonnet 5 $0.00002 $0.00243
Haiku 4.5 $0.00001 $0.00122

Measured 7d ago against content hash a7f9fe912a5c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

json-data-handling 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 7d ago.

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.

universal/data/json-data-handling/SKILL.md · 229 lines

How it starts

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

JSON Data Handling

Working effectively with JSON data structures.

Python

Basic Operations

import json

# Parse JSON string
data = json.loads('{"name": "John", "age": 30}')

# Convert to JSON string
json_str = json.dumps(data)

# Pretty print
json_str = json.dumps(data, indent=2)

# Read from file
with open('data.json', 'r') as f:
    data = json.load(f)

# Write to file
with open('output.json', 'w') as f:
    json.dump(data, f, indent=2)

Advanced

# Custom encoder for datetime
from datetime import datetime

class DateTimeEncoder(json.JSONEncoder):
    def default(self, obj):
        if isinstance(obj, datetime):
            return obj.isoformat()
        return super().default(obj)

json_str = json.dumps({'date': datetime.now()}, cls=DateTimeEncoder)

# Handle None values
json.dumps(data, skipkeys=True)

# Sort keys
json.dumps(data, sort_keys=True)

JavaScript

Basic Operations

// Parse JSON string
const data = JSON.parse('{"name": "John", "age": 30}');

// Convert to JSON string
const jsonStr = JSON.stringify(data);

// Pretty print
const jsonStr = JSON.stringify(data, null, 2);

// Read from file (Node.js)
const fs = require('fs');
const data = JSON.parse(fs.readFileSync('data.json', 'utf8'));

// Write to file
fs.writeFileSync('output.json', JSON.stringify(data, null, 2));

Advanced

// Custom replacer
const jsonStr = JSON.stringify(data, (key, value) => {
  if (typeof value === 'bigint') {
    return value.toString();
  }
  return value;
});

// Filter properties
const filtered = JSON.stringify(data, ['name', 'age']);

// Handle circular references
const getCircularReplacer = () => {
  const seen = new WeakSet();
  return (key, value) => {
    if (typeof value === 'object' && value !== null) {
      if (seen.has(value)) return;
      seen.add(value);
    }
    return value;
  };
};
JSON.stringify(circularObj, getCircularReplacer());

Common Patterns

Validation

from jsonschema import validate

schema = {
    "type": "object",
    "properties": {
        "name": {"type": "string"},
        "age": {"type": "number", "minimum": 0}
    },
    "required": ["name", "age"]
}

# Validate
validate(instance=data, schema=schema)

Read the full file on GitHub · 229 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 7d ago First seen · 229 lines · 12 tokens per session scan A a7f9fe912a5c

Subscribe to this mod's changes

json-data-handling is a skill published in the GitHub repository bobmatnyc/claude-mpm-skills (74 stars, last pushed 1mo ago), licensed MIT. It adds 12 tokens to every session and 1,217 once invoked, about $0.0001 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-09-03.