Skills

A single SKILL.md teaches AI coding assistants how to invoke @compare-xml/cli on demand.

What It Does

Once installed, the skill lets your AI assistant compare two XML files or strings directly from the conversation. Just ask it to diff two XML documents, configs, fixtures, or API responses and it will run the CLI locally and report the differences.

Supported Agents

  • Claude Code
  • OpenAI Codex CLI
  • OpenCode
  • Cursor
  • Any agent compatible with the Agent Skills format

Installation

The fastest install is via npx skills — it auto-detects every agent you have installed and drops the skill into each one:

npx skills add unitstack/compare-xml

Quick Example

Compare two inline XML strings:

npx @compare-xml/cli '<root><name>Alice</name></root>' '<root><name>Bob</name></root>'

Or compare two XML files:

npx @compare-xml/cli base.xml contrast.xml

Common Options

  • -a, --array-compare-method <method> — Array comparison strategy: byIndex (default), lcs, or unordered
  • -k, --key-case-insensitive — Ignore case when comparing element and attribute names
  • -v, --value-case-insensitive — Ignore case when comparing text and attribute values
  • -j, --json-export — Output the diff as JSON instead of a table
  • -o, --output <file> — Write the diff to a file

Difference Types

  • added — Value exists in the contrast XML but not in the base XML
  • deleted — Value exists in the base XML but not in the contrast XML
  • valueChanged — Value changed between the two XML inputs