HTML Skills for AI Coding Assistants

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

The compare-html skill teaches AI coding assistants to run @compare-html/cli for local HTML comparisons.

What the workflow does

After installation, ask your assistant to compare two HTML files, templates, fragments, or inline strings. It can run the CLI, inspect the reported paths, and summarize added, deleted, and valueChanged differences.

The skill works with Claude Code, OpenAI Codex CLI, OpenCode, Cursor, and other agents compatible with the Agent Skills format.

Install the skill

Use npx skills to detect supported agents and install the skill:

npx skills add unitstack/compare-html

Compare from the terminal

Each positional argument can be an inline HTML string or a path to an HTML file:

npx @compare-html/cli '<main><h1>Hello</h1></main>' '<main><h1>Welcome</h1></main>'
npx @compare-html/cli base.html contrast.html

By default, the CLI prints a table of paths and change types. Use the current output options when an assistant or script needs a different destination or format:

  • -j, --json-export — emit the difference array as JSON instead of a table.
  • -o, --output <file> — write the table or JSON output to a file.

For example:

npx @compare-html/cli base.html contrast.html --json-export --output diff.json

Run npx @compare-html/cli --help for the interface installed in your environment.

Use through MCP

For a persistent assistant integration instead of an on-demand skill, configure the CLI’s stdio MCP server and its compare_html tool. See HTML MCP Server.