wp-init

wp-init is a command for Claude Code from Abdulkader-Safi/wp-to-code. It costs 26 tokens per session (759 once invoked), scanned A, original, MIT.

A command that prepares a WordPress site port by detecting the source builder, available pages, target stack, and styling setup. It then writes the detected project settings to a configuration file.

In plain words
What is it for?
Use it to inspect a site, choose pages and styling mode, confirm the development URL, and create the port configuration.
Why use it?
It removes much of the initial guesswork before rebuilding a named site in code. It also identifies the decisions that still need the user's input, such as which pages to port.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: names the AskUserQuestion tool.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

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

Good fit Use it to inspect a site, choose pages and styling mode, confirm the development URL, and create the port configuration.

Compare 6 commands from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add Abdulkader-Safi/wp-to-code
Claude Code
/plugin install wp-to-code

Made for: Claude 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-init

README.md
[![agentmods](https://agentmods.dev/badge/commands/abdulkader-safi/wp-to-code/wp-init/github.svg)](https://agentmods.dev/commands/abdulkader-safi/wp-to-code/wp-init)
Your own site
<a href="https://agentmods.dev/commands/abdulkader-safi/wp-to-code/wp-init"><img src="https://agentmods.dev/badge/commands/abdulkader-safi/wp-to-code/wp-init/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for wp-init

Your own site · 80×15
<a href="https://agentmods.dev/commands/abdulkader-safi/wp-to-code/wp-init"><img src="https://agentmods.dev/badge/commands/abdulkader-safi/wp-to-code/wp-init.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 26 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 759 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00026 $0.00759
Opus 5.5 $0.00010 $0.00304
Sonnet 5.5 $0.00005 $0.00152
Haiku 4.5 $0.00003 $0.00076

Measured 3mo ago against content hash a59b7c82f9a1, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

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 3mo 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-init.md · 66 lines

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. tailwind rebuilds the styles from measured values, which is slower and gives clean output. passthrough keeps 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.

Read the full file on GitHub · 66 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. 3mo ago First seen · 66 lines · 26 tokens per session scan A a59b7c82f9a1

Subscribe to this mod's changes

wp-init is a command published in the GitHub repository Abdulkader-Safi/wp-to-code (4 stars, last pushed 3mo ago), licensed MIT. It adds 26 tokens to every session and 759 once invoked, about $0.0001 per session on Opus 5.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.

Related

wp-init compared with commands from other repositories

wp-init next to 6 commands from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
wp-initAbdulkader-Safi/wp-to-codeCommand43mo agoMITA26Claude Code
brandManavarya09/design-extractCommand5.2k5d agoMITA62Claude Code
pairManavarya09/design-extractCommand5.2k5d agoMITA60Claude Code
theme-swapManavarya09/design-extractCommand5.2k5d agoMITA59Claude Code
dnaManavarya09/design-extractCommand5.2k5d agoMITA19Claude Code
extractManavarya09/design-extractCommand5.2k5d agoMITA27Claude Code
fidelityManavarya09/design-extractCommand5.2k5d agoMITA40Claude Code