Skill: aronchick/expanso-xml-to-json (version 1.0.0)

# xml-to-json Convert XML to JSON format ## Requirements - Expanso Edge installed (`expanso-edge` binary in PATH) - Install via: `clawhub install expanso-edge` ## Usage ### CLI Pipeline ```bash # Run standalone echo '<input>' | expanso-edge run pipeline-cli.yaml ``` ### MCP Pipeline ```bash # Start as MCP server expanso-edge run pipeline-mcp.yaml ``` ### Deploy to Expanso Cloud ```bash expanso-cli job deploy https://skills.expanso.io/xml-to-json/pipeline-cli.yaml ``` ## Files | File | Purpose | |------|---------| | `skill.yaml` | Skill metadata (inputs, outputs, credentials) | | `pipeline-cli.yaml` | Standalone CLI pipeline | | `pipeline-mcp.yaml` | MCP server pipeline |

path: README.md
content: # xml-to-json

Convert XML to JSON format.

## Usage

```bash
echo "<root><item>value</item></root>" | expanso-edge run pipeline-cli.yaml
```

## Output

```json
{
  "json": {"root": {"item": "value"}},
  "valid": true
}
```


path: pipeline-cli.yaml
content: name: "xml-to-json-cli"
type: pipeline

config:
  input:
    stdin:
      codec: all
      max_buffer: 1048576

  pipeline:
    processors:
      - mapping: |
          meta trace_id = uuid_v4()
          let input = content().trim()

          # Parse XML to JSON
          let parsed = $input.parse_xml().catch(null)

          root.json = if $parsed != null { $parsed } else { {} }
          root.valid = $parsed != null
          root.error = if $parsed == null { "Invalid XML input" } else { "" }
          root.metadata = {"skill": "xml-to-json", "mode": "cli", "trace_id": meta("trace_id"), "timestamp": now()}

  output:
    stdout:
      codec: json_object


path: pipeline-mcp.yaml
content: name: "xml-to-json-mcp"
type: pipeline

config:
  http:
    enabled: true
    address: "0.0.0.0:${PORT:-8080}"

  input:
    http_server:
      path: /convert
      allowed_verbs: [POST]
      timeout: 30s

  pipeline:
    processors:
      - mapping: |
          meta trace_id = uuid_v4()
          let input = this.xml.or(content()).string().trim()

          let parsed = $input.parse_xml().catch(null)

          root.json = if $parsed != null { $parsed } else { {} }
          root.valid = $parsed != null
          root.error = if $parsed == null { "Invalid XML input" } else { "" }
          root.metadata = {"skill": "xml-to-json", "mode": "mcp", "trace_id": meta("trace_id"), "timestamp": now()}

  output:
    sync_response: {}


path: skill.yaml
content: name: xml-to-json
version: 1.0.0
description: Convert XML to JSON format

inputs:
  - name: xml
    type: string
    required: true
    description: XML string to convert

outputs:
  - name: json
    type: object
    description: JSON representation

backends:
  - name: local
    type: local
    description: Local processing (no API required)

author: expanso
license: MIT


path: test/fixtures/input.txt
content: <root><item>value</item></root>


path: test/test.yaml
content: tests:
  - name: "Convert XML to JSON"
    input: "<root><item>test</item></root>"
    expected:
      has_field: json
      has_field: valid
      metadata_has: [skill, trace_id]


Security scan verdicts — ClawScan: clean | static analysis: clean | VirusTotal: clean | SkillSpector: clean (LOW)