# Load and Validate Data from JSON for Document Templating

> Use this skill to read employee/candidate data from a JSON file and validate that all required fields exist before attempting document generation. This prevents placeholder errors caused by missing data.

- Skill: `cxcscmu/load-and-validate-data-from-json-for-document-templating` (Agent Skill)
- Install (CLI): `npx get-skill add cxcscmu/load-and-validate-data-from-json-for-document-templating`
- Raw SKILL.md: https://api.skillmd.com/api/skills/cxcscmu/load-and-validate-data-from-json-for-document-templating/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: cxcscmu (https://skillmd.com/u/cxcscmu)
- Updated: 2026-11-24
- Page: https://skillmd.com/skills/cxcscmu/load-and-validate-data-from-json-for-document-templating

---


## Algorithm

```
def load_employee_data(json_file_path):
    with open(json_file_path, 'r') as f:
        data = json.load(f)
    
    required_fields = [
        'CANDIDATE_FULL_NAME', 'POSITION', 'START_DATE',
        'SALARY', 'BENEFITS', 'RELOCATION_PACKAGE'
    ]
    
    for field in required_fields:
        if field not in data:
            raise ValueError(f"Missing required field: {field}")
    
    return data
```

## Validation Checks

- Verify all keys match placeholder names exactly (case-sensitive)
- Check that `RELOCATION_PACKAGE` is either "Yes" or "No"
- Ensure salary and date values are in expected formats
- Raise descriptive errors for missing fields

## Return Format

Return a dictionary where keys match placeholder names and values are the data to insert.
