Claude Code Plugins

Community-maintained marketplace

Feedback

json-to-xml-converter

@tkubica12/gh-copilot-demo
9
0

Convert JSON data to XML format with customizable root element and attribute handling

Install Skill

1Download skill
2Enable skills in Claude

Open claude.ai/settings/capabilities and find the "Skills" section

3Upload to Claude

Click "Upload skill" and select the downloaded ZIP file

Note: Please verify skill by going through its instructions before using it.

SKILL.md

name json-to-xml-converter
description Convert JSON data to XML format with customizable root element and attribute handling

JSON to XML Converter Skill

Purpose

Convert JSON data structures into well-formed XML documents. Handles nested objects, arrays, and primitive types.

Usage

Command Line

# Basic conversion
python .github/skills/json-to-xml-converter/scripts/json2xml.py input.json output.xml

# Custom root element
python .github/skills/json-to-xml-converter/scripts/json2xml.py input.json output.xml --root "data"

# Pipe data
echo '{"name": "test"}' | python .github/skills/json-to-xml-converter/scripts/json2xml.py - -

Parameters

  • input_file: Path to JSON file or - for stdin
  • output_file: Path to XML output file or - for stdout
  • --root: Root element name (default: "root")

Example

Input JSON:

{"user": {"name": "Alice", "age": 30}, "items": [1, 2, 3]}

Output XML:

<?xml version="1.0" encoding="utf-8"?>
<root>
  <user>
    <name>Alice</name>
    <age>30</age>
  </user>
  <items>
    <item>1</item>
    <item>2</item>
    <item>3</item>
  </items>
</root>

Agent Integration

Use run_in_terminal to invoke the script:

python .github/skills/json-to-xml-converter/scripts/json2xml.py input.json output.xml --root "mydata"

Important Notes:

  • No external dependencies (Python stdlib only)
  • JSON keys with spaces are converted to underscores
  • Arrays become <item> elements
  • Handles invalid JSON with clear error messages