# JSON File Processing

> Read input JSON files with email requests and write results.json with reply filenames and recipients.

- Skill: `cxcscmu/json-file-processing` (Agent Skill)
- Install (CLI): `npx get-skill add cxcscmu/json-file-processing`
- Raw SKILL.md: https://api.skillmd.com/api/skills/cxcscmu/json-file-processing/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Productivity
- Author: cxcscmu (https://skillmd.com/u/cxcscmu)
- Updated: 2026-11-24
- Page: https://skillmd.com/skills/cxcscmu/json-file-processing

---


# JSON File Processing for Meeting Scheduler

## Reading Input
```python
import json

with open("/root/test_input.json") as f:
    emails = json.load(f)

# Each item has: email_text, from_email
for i, email in enumerate(emails, start=1):
    msg_id = i
    text = email["email_text"]
    sender = email["from_email"]
```

## Writing Reply Files
```python
def save_reply(msg_id, content):
    filename = f"/root/reply_{msg_id}.txt"
    with open(filename, "w") as f:
        f.write(content)
    return f"reply_{msg_id}.txt"
```

## Writing results.json
```python
results = {
    "sent_results": [
        {"filename": f"reply_{msg_id}.txt", "recipient": sender}
        for msg_id, sender in ...
    ]
}
with open("/root/results.json", "w") as f:
    json.dump(results, f, indent=2)
```

## Date Formatting Rules
- Day name: full name, e.g. "Monday"
- Month: full name, e.g. "March"
- Day: zero-padded two digits, e.g. "09"
- Year: four digits, e.g. "2026"
- Example: "Monday, March 09, 2026"

## Time Formatting Rules
- Hours: zero-padded two digits, e.g. "09", "10", "11"
- Minutes: zero-padded two digits, e.g. "00", "30"
- Period: "AM" or "PM"
- Example: "09:00 AM - 10:30 AM"

