wp-measure

wp-measure is a command for coding agents from Abdulkader-Safi/wp-to-code. It costs 19 tokens per session (578 once invoked), scanned A, original, MIT.

A command that records a web page’s layout, sections, content, or interactive elements in a file. A layout tree describes the page’s nested elements and their sizes and positions.

In plain words
What is it for?
Use it to inspect sections, text, images, links, forms, menus, sliders, accordions, and other page elements.
Why use it?
It gives you measurable page details when recreating or checking a web page, instead of relying on visual guesses.

Command

Installs and runs on its own, but its text points at files inside its plugin — anything it tells you to read at a ${CLAUDE_PLUGIN_ROOT} path is only there once the plugin is installed. Installing the plugin gets both.

Part of the wp-to-code plugin — 1 skill, 8 commands, 1 hook shipped together

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-measure
Clone the repo
git clone --depth 1 https://github.com/Abdulkader-Safi/wp-to-code

Or install wp-to-code, the plugin that ships this one along with the rest of its 1 skill, 8 commands, 1 hook.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for wp-measure

README.md
[![agentmods](https://agentmods.dev/badge/commands/abdulkader-safi/wp-to-code/wp-measure.svg)](https://agentmods.dev/commands/abdulkader-safi/wp-to-code/wp-measure)
Your own site
<a href="https://agentmods.dev/commands/abdulkader-safi/wp-to-code/wp-measure"><img src="https://agentmods.dev/badge/commands/abdulkader-safi/wp-to-code/wp-measure.svg" alt="Measured on agentmods" height="20"></a>
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 578 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.00578
Opus 5 $0.00010 $0.00289
Sonnet 5 $0.00004 $0.00116
Haiku 4.5 $0.00002 $0.00058

Measured 3d ago against content hash d0a9f4ee8ef3, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

wp-measure 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 3d ago.

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-measure.md · 49 lines

How it starts

The opening of the file, as written. The whole thing — 49 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Measure the page the user named: $ARGUMENTS.

NODE_PATH="${CLAUDE_PLUGIN_DATA}/node_modules" \
  node "${CLAUDE_PLUGIN_ROOT}/scripts/measure.mjs" \
  --page <slug> --side original --mode tree [--viewport 1440]

Modes

Mode Use it for
sections First look at a page. Top-level blocks with height, top, padding, background.
tree Writing a section. Every element with text or an image, with rect, font, margin, padding.
content Text, image URLs, hrefs, alt text. Nothing about geometry.
interactive Inventory of sliders, menus, accordions, forms and video that need behaviour reimplemented.

Run sections first. Only run tree for the section you are about to write.

Context discipline

The dump goes to a file under .wp-to-code/measure/. The command prints a summary; that summary is usually all you need.

Never read a whole tree dump into the conversation. A 3000px section is tens of thousands of tokens and it will stall the session. Query the file instead:

# every element inside one section, height and font only
jq '.nodes[] | select(.path | startswith("section:nth-child(4)"))
    | {path, text, h: .rect.height, size: .font.size, lh: .font.lineHeight}' \
  .wp-to-code/measure/home-original-1440-tree.json

# what line-heights are actually in use
jq -r '.nodes[].font | "\(.size)/\(.lineHeight)"' <file> | sort -u

Print only what you are about to act on.

Reading geometry

Take line-height from the measurement, never from a named token. A lineHeight: "normal" in the dump resolves to roughly 1.5x the font size, and designs rarely want that. Every normal in the summary is a value you need to check against the original rather than inherit.

Read the full file on GitHub · 49 lines

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. 3d ago First seen · 49 lines · 19 tokens per session scan A d0a9f4ee8ef3

Subscribe to this mod's changes

wp-measure is a command published in the GitHub repository Abdulkader-Safi/wp-to-code (2 stars, last pushed 15d ago), licensed MIT. It adds 19 tokens to every session and 578 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.