wp-custom-theme

A guide for building and maintaining custom WordPress themes, including PHP templates, site styling, and WordPress editing features.

In plain words
What is it for?
Use it to create or change templates such as header.php and single.php, add WordPress hooks, and style Gutenberg content.
Why use it?
It gives developers a structured way to choose a theme approach and handle common theme code, performance, and security work.

Skill for Claude CodeCodex

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 skills/trtmn/agent-plugins/wp-custom-theme
Any agent
npx skills add trtmn/agent-plugins --skill wp-custom-theme
Clone the repo
git clone --depth 1 https://github.com/trtmn/agent-plugins

Made for: Claude Code, Codex.

Per session 143 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 9,060 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. 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.00143 $0.09060
Opus 5 $0.00072 $0.04530
Sonnet 5 $0.00029 $0.01812
Haiku 4.5 $0.00014 $0.00906

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

Security

Grade C, and why

wp-custom-theme scanned grade C with 1 finding 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.

Hidden instructionshighPrompt injection

Directives inside HTML comments, invisible characters or bidirectional overrides are read by the model and not by the person reviewing the file.

<!-- wp:query {"queryId":0,"query":{"perPage":10,"pages":0,"offset":0,"postType":"post","order":"desc","orderBy":"date","inherit":true}} -->
plugins/wp-custom-theme/skills/wp-custom-theme/SKILL.md · 1,118 lines

How it starts

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

Custom WordPress Theme Skill

A comprehensive guide for creating and maintaining custom WordPress themes at an intermediate level, covering theme structure, PHP hooks & template tags, CSS/Gutenberg, and performance & security.


0. Discovery Interview (Start Here for New Themes)

Before writing any code, interview the user to understand their requirements. Use the answers to recommend the right theme approach (FSE, Classic, or Hybrid) and tailor the implementation.

Interview Questions

Ask these questions — you can combine them into a single message, but keep it conversational:

  1. Site type — What kind of site is this? (blog, portfolio, business/marketing, e-commerce, membership, news/magazine, or other)
  2. Client editing — Will the site owner / client edit pages and layouts themselves after launch, or is this developer-managed?
  3. Dynamic PHP logic — Does the theme need complex server-side logic in templates? (e.g. conditional content based on user roles, custom WP_Query loops, real-time data from external APIs)
  4. WordPress version — What WP version will this run on? (or: is the host keeping WP up to date?)
  5. Existing base — Starting from scratch, extending an existing theme, or building a child theme?
  6. Plugins — Any must-have plugins? (WooCommerce, ACF, Elementor, etc. — some conflict with FSE)
  7. Design complexity — Is this a pixel-perfect custom design, or is an opinionated block-based layout acceptable?

You do not need to ask all seven at once. Start with 1–4; follow up if answers are ambiguous.

FSE Recommendation Logic

After gathering answers, apply this decision table:

Signal Favours
Client will edit layouts/pages themselves FSE
New project on WP 6.4+ FSE
Design-focused, visually rich site FSE
No complex PHP needed in templates FSE
Complex PHP logic in templates (conditional output, custom queries) Classic
Legacy/existing classic theme being extended Classic
Page-builder plugin (Elementor, Divi) in use Classic
WooCommerce without FSE-compatible theme Classic (or verify plugin FSE support first)
Wants block editor design system, but keeps some PHP templates Hybrid
Migrating gradually from classic → FSE Hybrid

Read the full file on GitHub · 1,118 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. yesterday First seen · 1,118 lines · 143 tokens per session scan C 7b9e51ef5472

Subscribe to this mod's changes

wp-custom-theme is a skill published in the GitHub repository trtmn/agent-plugins (2 stars, last pushed 5d ago), licensed Unlicense. It adds 143 tokens to every session and 9,060 once invoked, about $0.0007 per session on Opus 5. A static security scan graded it C with 1 finding (hidden instructions). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

next-cache-components-adoption

Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…

vercel/next.js · 95 tokens

babysit-pr

Babysit a GitHub pull request after creation by continuously polling review comments, CI checks/workflow runs, and mergeability state until the PR is merged/closed or user help is required. Diagnose failures, retry likely flaky failures up to 3 times, auto-fix/push branch-related issues when appropriate, and keep…

openai/codex · 114 tokens

imagegen

Generate or edit raster images when the task benefits from AI-created bitmap visuals such as photos, illustrations, textures, sprites, mockups, or transparent-background cutouts. Use when Codex should create a brand-new image, transform an existing image, or derive visual variants from references, and the output…

openai/codex · 113 tokens

cpu-profile-analysis

Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…

microsoft/vscode · 71 tokens

next-cache-components-optimizer

Drive a Next.js route to instant navigation by setting up an agentic loop, under Cache Components / PPR, on initial load (hard navigation) and client-side navigation (soft navigation). Encode the goal as a failing @next/playwright instant() e2e and work it to green, one verified route at a time; the shipped test then…

vercel/next.js · 170 tokens