wp-diff

A command that compares a ported webpage with a mirrored original, section by section. It reports differences in each section’s height and position at desktop and mobile viewport sizes.

In plain words
What is it for?
Checking pixel-accurate webpage ports and locating the first section where layout geometry differs.
Why use it?
It shows whether a visual mismatch comes from a section being the wrong size or from content above it moving the section.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/abdulkader-safi/wp-to-code/wp-diff
Clone the repo
git clone --depth 1 https://github.com/Abdulkader-Safi/wp-to-code
Per session 19 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 540 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00019 $0.00540
Opus 5 $0.00010 $0.00270
Sonnet 5 $0.00004 $0.00108
Haiku 4.5 $0.00002 $0.00054

Measured yesterday against content hash 67bb4678cdce, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

wp-diff scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/wp-to-code/commands/wp-diff.md · 43 lines

What it actually says

Run the diff gate for the page the user named: $ARGUMENTS.

NODE_PATH="${CLAUDE_PLUGIN_DATA}/node_modules" \
  node "${CLAUDE_PLUGIN_ROOT}/scripts/diff.mjs" --page <slug> [--viewport 1440,768,390]

Before running, confirm both sides are actually being served:

  • The mirror server on the port in .wp-to-code/config.json (mirror.port). Start it with node "${CLAUDE_PLUGIN_ROOT}/scripts/serve.mjs" if it is not up.
  • The project's own dev server on port.devUrl.

A connection error against one of those two URLs is the most common cause of a failed run, so check that before touching any markup.

Reading the output

1440px
   #           height              top   verdict   section
   0     839 vs    838       0 vs      0   MATCH     header
   1     267 vs    267     839 vs    838   MATCH     section.stats
   2     612 vs    612    1106 vs   1206   Δtop +100 section.mission
  • Δh means the section is the wrong height. Work inside it.
  • Δtop with Δh absent means the section is the right size and in the wrong place. Something above it moved, or a margin collapsed out of it. Check the first section above with a delta, and check for a negative margin on an inner element that has escaped its parent. flow-root on the container is the usual fix.
  • clientWidth differs means the two pages are laying out at different widths, usually a scrollbar. Nothing below that line is comparable until it matches.
  • section count mismatch means the structure diverged. Fix that before reading any number.

What to do next

Work top down: the first section with a delta often explains every delta below it. Fix one section, run the diff again. Two to four rounds per page is normal.

Do not round measured values to the framework's spacing scale. Use the measured number as an arbitrary value.

When every section matches, say so with the table. Never report a page as done without a diff run behind it, and never report it on height alone.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 43 lines · 19 tokens per session scan A 67bb4678cdce

Subscribe to this mod's changes

wp-diff is a command published in the GitHub repository Abdulkader-Safi/wp-to-code (2 stars, last pushed 13d ago), licensed MIT. It adds 19 tokens to every session and 540 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.