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.
npx agentmods add commands/abdulkader-safi/wp-to-code/wp-initgit clone --depth 1 https://github.com/Abdulkader-Safi/wp-to-codeWhat 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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00026 | $0.00759 |
| Opus 5 | $0.00013 | $0.00380 |
| Sonnet 5 | $0.00005 | $0.00152 |
| Haiku 4.5 | $0.00003 | $0.00076 |
Grade A, and why
wp-init 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 2d 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.
How it starts
The opening of the file, as written. The whole thing — 66 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Set up a port of the site the user named: $ARGUMENTS.
1. Detect
node "${CLAUDE_PLUGIN_ROOT}/scripts/detect.mjs" --url <url>
This reports the page builder, whether the REST API and a sitemap are available, the pages it found, and which stack the current directory already is. The JSON goes to stdout, the readable summary to stderr.
2. Ask only what detection could not answer
Detection covers the builder, the page list, the stack and the Tailwind version. What is left:
- Which pages to port. The sitemap usually returns everything including blog posts. Show the list and let the user pick. Ten pages is a normal scope; forty is not.
- Styling mode.
tailwindrebuilds the styles from measured values, which is slower and gives clean output.passthroughkeeps the original CSS, which is fast but, on Elementor, means keeping the original wrapper markup too, because the CSS is scoped per post ID. Say that trade-off plainly rather than listing the modes. - Dev server URL, if the guess is wrong.
Do not ask about the builder, the breakpoints or the token names. Those come from measurement later.
3. Write the config
{
"source": {
"url": "https://example.com",
"builder": "elementor",
"restApi": true,
"sitemap": "/wp-sitemap.xml",
"headers": {}
},
"pages": [
{ "slug": "home", "sourcePath": "/", "targetRoute": "/",
"originalRoot": null, "portRoot": "main" }
],
"target": { "stack": "next-app", "componentDir": "components/sections", "routeDir": "app" },
"css": { "mode": "tailwind", "tailwindVersion": 4, "tokenFile": "app/globals.css" },
"viewports": [1440, 1280, 1024, 768, 390],
"mirror": { "dir": ".wp-to-code/mirror", "port": 4321, "images": "remote" },
"port": { "devUrl": "http://localhost:3000" }
}
originalRoot is the selector whose direct children are the page's top-level sections. Leave it null now: you cannot know it until the page is mirrored. /wp-mirror is the next step, and after it you find the root by grepping the mirrored HTML for the builder's page-root class, then checking which candidate has the most sections with /wp-measure --mode sections.
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.
- 2d ago First seen · 66 lines · 26 tokens per session scan A a59b7c82f9a1
wp-init is a command published in the GitHub repository Abdulkader-Safi/wp-to-code (2 stars, last pushed 13d ago), licensed MIT. It adds 26 tokens to every session and 759 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.
Other commands, from other repositories
pack
Bundle every designlang output (DTCG tokens, Tailwind, shadcn, Figma vars, motion, anatomy, Storybook, prompts) into one polished design-system directory ready to zip and ship.
verify
Fidelity check — rebuild a page from the extracted tokens, pixel-diff it against the live site, and score how faithfully the tokens capture the design.
battle
Head-to-head graded battle card between two sites — eight dimensions, bar-by-bar, verdict line.
add-library
Kullanıcı "kütüphane ekle", "library ekle", "tasarım sistemi ekle", "design system ekle" dediğinde bu komutu uygula.
test
Run tests and ensure code quality for the F-MCP ATezer server.
sheleg-design
Apply the SHELEG Design methodology (single-clock, layered, degrade-to-calm motion) to the current landing-page / hero / scroll-animation task — or its style packs to product UI (dashboards, admin, internal tools).