json-schema-converter
Skill0 starsChanged 2 months agoMITView on GitHub
Transforms unstructured or semi-structured data into strictly schema-conforming JSON with type validation.
In this repository49 other files it gives its agents.
- bug-reproducerSkill
- claim-checkerSkill
- command-failure-diagnoserSkill
- config-risk-reviewerSkill
- csv-validatorSkill
- deployment-checklist-makerSkill
- diff-reviewerSkill
- factual-summarizerSkill
- field-extractorSkill
- api-contract-testerSkill
- database-migration-helperSkill
- security-vulnerability-fixerSkill
- git-commit-stagerSkill
- git-conflict-resolverSkill
- github-actions-debuggerSkill
- github-issue-triagerSkill
- github-pr-creatorSkill
- github-pr-reviewerSkill
- go-code-qualitySkill
- go-lint-and-vetSkill
- go-testingSkill
- lint-and-typecheckSkill
- meaning-preserving-editorSkill
- meeting-notes-to-actionsSkill
- minimal-bug-fixSkill
- option-comparatorSkill
- py-code-qualitySkill
- py-lint-and-typecheckSkill
- py-testingSkill
- readme-writerSkill
- regression-test-writerSkill
- release-notes-drafterSkill
- repo-inspectorSkill
- research-briefSkill
- reversible-cleanup-plannerSkill
- rust-clippy-checkSkill
- rust-code-qualitySkill
- rust-testingSkill
- small-refactorSkill
- status-updateSkill
- step-by-step-tutorialSkill
- step-decomposerSkill
- tabular-analyzerSkill
- task-briefSkill
- test-runner-debuggerSkill
- ts-code-qualitySkill
- ts-lint-and-typecheckSkill
- ts-testingSkill
- skill-templateSkill
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 3 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
Use this skill when:
- Very specific: line 20
Do not use for tabular CSV verification.
- Very specific: line 21
Do not use to extract isolated fields.
- Very specific: line 28
If raw_input is missing: stop and ask: "Please provide the data to convert."
- Very specific: line 29
If target_schema is missing: ask for the expected schema or generate a minimal typed schema and request confirmation.
- Very specific: line 30
If a required schema field is absent in raw_input: set to null if nullable, or list under missing fields.
- Distinctive: line 33
Follow these numbered actions:
- Very specific: line 47
If raw data contains fields not in schema: omit them if additionalProperties: false, or include under extra_metadata if allowed.
- Distinctive: line 81
Stop and ask the user when:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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.
Files
JSON Schema Converter
Converts unstructured text, logs, or informal records into valid, schema-compliant JSON. Ensures exact type mapping, required keys, and deterministic output.
1. Purpose
Turn loose data into machine-readable JSON that validates against a provided JSON Schema (Draft 7 / 2020-12). Enforces data types (string, integer, boolean, array, object).
2. When to Use
Use this skill when:
- Converting email summaries, logs, or transcripts into structured API payloads.
- Normalizing messy data before database ingestion.
- User requests: "Convert this text into JSON matching this schema."
3. When Not to Use
- Do not use for tabular CSV verification; use
csv-validator. - Do not use to extract isolated fields; use
field-extractor.
4. Required Inputs
raw_input: Text, table, or key-value snippets to convert.target_schema: JSON schema specification defining expected keys and types.
5. Missing-Input Behavior
- If
raw_inputis missing: stop and ask: "Please provide the data to convert." - If
target_schemais missing: ask for the expected schema or generate a minimal typed schema and request confirmation. - If a required schema field is absent in
raw_input: set tonullif nullable, or list under missing fields. Do not hallucinate values.
6. Procedure
Follow these numbered actions:
- Action 1: Parse Schema Keys & Types
- Identify required fields and expected types (integer, boolean, string, array).
- Action 2: Map Raw Data to Schema Keys
- Cast strings to numbers/booleans where safe (e.g.
"true"->true,"42"->42).
- Cast strings to numbers/booleans where safe (e.g.
- Action 3: Validate Against Schema
- Run validator helper:
python3 skills/json-schema-converter/scripts/validate_json.py <json_file>
- Run validator helper:
- Action 4: Emit JSON Payload
- Output clean, indented JSON per Section 8.
7. Decision Rules
- If raw data contains fields not in schema: omit them if
additionalProperties: false, or include underextra_metadataif allowed. - Dates must be formatted as ISO-8601 (
YYYY-MM-DDTHH:MM:SSZ) if schema format isdate-time.
8. Output Format
Emit the JSON conversion using this template:
### JSON Conversion Result
- **Validation**: [VALID | INVALID]
- **Target Schema Keys Met**: [Count] / [Total]
```json
{
"key": "value"
}Field Mapping Notes
[key]: [Mapped from raw text]
## 9. Verification Checklist
- [ ] Output is 100% valid JSON (passes `json.loads`).
- [ ] All required schema fields are present.
- [ ] Types conform strictly to schema specifications.
- [ ] Companion script [validate_json.py](./scripts/validate_json.py) confirms syntax.
## 10. Common Failures and Recovery
| Failure Symptom | Cause | Recovery Action |
| :--- | :--- | :--- |
| Trailing comma error | Invalid JSON formatting | Strip trailing commas before returning. |
| Type mismatch (string vs int) | Failing to cast `"10"` to `10` | Check schema type property and cast numeric strings. |
## 11. Stop or Escalation Conditions
Stop and ask the user when:
- Raw input contains none of the required schema fields.
## 12. Examples
### Example 1: Successful Execution
**Input:**
```text
Raw input: Customer Alice Smith (id: 402), signed up 2026-05-10, plan: Pro, active.
Schema: {
"type": "object",
"required": ["id", "name", "plan", "is_active"],
"properties": {
"id": { "type": "integer" },
"name": { "type": "string" },
"plan": { "type": "string" },
"is_active": { "type": "boolean" }
}
}Output:
### JSON Conversion Result
- **Validation**: VALID
- **Target Schema Keys Met**: 4 / 4
```json
{
"id": 402,
"name": "Alice Smith",
"plan": "Pro",
"is_active": true
}Field Mapping Notes
id: Cast string 402 to integer 402.is_active: Inferredtruefrom "active".
### Example 2: Ambiguous or Missing Input
**Input:**
```text
Raw input: Just a random note without customer data.
Schema: (Requires id, name, plan)Output:
### JSON Conversion Result
- **Validation**: INVALID - Missing Required Fields
- **Target Schema Keys Met**: 0 / 3
The raw input does not contain the required fields `id`, `name`, or `plan`. Please provide customer data matching the schema.Example 3: Expected Final Output
Output:
### JSON Conversion Result
- **Validation**: VALID
- **Target Schema Keys Met**: 2 / 2
```json
{
"event": "user_signup",
"timestamp": "2026-09-10T12:00:00Z"
}Field Mapping Notes
- ISO-8601 timestamp formatted per schema date-time requirement.
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
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.

