XML Skills for AI Coding Assistants

Install an Agent Skill that teaches assistants to run the Compare XML CLI locally.

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. Ask it to diff XML documents, configs, fixtures, or API responses and it can 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 through npx skills. It detects supported agents on your machine and installs the skill for them:

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> — Repeated-element 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

Unordered comparison uses multiset semantics, so duplicate occurrence counts still matter. See the CLI guide for all commands and XML Comparison Rules for option behavior.

Difference Types

  • added — A value exists in the Contrast XML but not in the Base XML
  • deleted — A value exists in the Base XML but not in the Contrast XML
  • valueChanged — A value changed between the two XML inputs