Skill Press Index Software & Web Development WP Plugin Development SOFTWARE & WEB DEVELOPMENT WP Plugin Development WordPress No. 961 · wp-plugin-development
WP Plugin Development A field guide from WordPress
WordPress
When to use it Use when developing WordPress plugins: architecture and hooks, activation/deactivation/uninstall, admin UI and Settings API, data storage, cron/tasks, security (nonces/capabilities/sanitization/escaping), and release packaging.
Rank No. 961 of 971
Installs Not listed yet
Runs in Claude, GitHub Copilot, Codex, Cursor
Length 487 words · 2 min
Files 10
License GPL-2.0-or-later Get this skill Download the skill folder (.zip, 14 KB) ↓ · SKILL.md only ↓
Agent prompt Paste into a coding agent with terminal access. Check the upstream requirements for the skill you’re installing.
Prompt Copy
Install the "wp-plugin-development" Agent Skill by WordPress, from https://github.com/WordPress/agent-skills.
1. Fetch the whole folder skills/wp-plugin-development — SKILL.md plus every script, reference, and asset beside it, not just SKILL.md. For example:
skill_checkout=$(mktemp -d)
git init "$skill_checkout"
git -C "$skill_checkout" fetch --depth 1 https://github.com/WordPress/agent-skills.git 7374e6f1c913b3b02b25465d266d9c0e0a04fc96
git -C "$skill_checkout" checkout --detach FETCH_HEAD
2. Copy it into your skills directory as a folder named "wp-plugin-development":
- Claude Code: ~/.claude/skills/wp-plugin-development/ (all projects) or .claude/skills/wp-plugin-development/ (this project only)
- Another agent: the directory you load Agent Skills from (folders containing a SKILL.md)
3. Check that wp-plugin-development/SKILL.md exists and its frontmatter says name: wp-plugin-development.
4. Read SKILL.md, then tell me in two or three sentences what the skill does and when it will trigger, and list any dependencies it mentions (Python packages, npm packages, CLIs) that aren't installed yet. Don't install them without asking. skills CLI One command; the skills.sh installer detects your agents (Claude Code, Cursor, Codex, and more).
Terminal Copy
npx skills add https://github.com/WordPress/agent-skills/tree/7374e6f1c913b3b02b25465d266d9c0e0a04fc96/skills/wp-plugin-development --skill wp-plugin-development Claude.ai Upload the .zip as a custom skill.
In Settings → Capabilities, turn on “Code execution and file creation”. Download the .zip above. Go to Customize → Skills, click + → Create skill → Upload a skill, and choose it. Anthropic’s guide to using skills ↗ The skill, in full When to use
Use this skill for plugin work such as:
creating or refactoring plugin structure (bootstrap, includes, namespaces/classes)
adding hooks/actions/filters
activation/deactivation/uninstall behavior and migrations
adding settings pages / options / admin UI (Settings API)
security fixes (nonces, capabilities, sanitization/escaping, SQL safety)
packaging a release (build artifacts, readme, assets)
Repo root + target plugin(s) (path to plugin main file if known).
Where this plugin runs: single site vs multisite; WP.com conventions if applicable.
Target WordPress + PHP versions (affects available APIs and placeholder support in $wpdb->prepare()).
Procedure
0) Triage and locate plugin entrypoints
Run triage:
node skills/wp-project-triage/scripts/detect_wp_project.mjs
Detect plugin headers (deterministic scan):
node skills/wp-plugin-development/scripts/detect_plugins.mjs
If this is a full site repo, pick the specific plugin under wp-content/plugins/ or mu-plugins/ before changing code.
1) Follow a predictable architecture
Guidelines:
Keep a single bootstrap (main plugin file with header).
Avoid heavy side effects at file load time; load on hooks.
Prefer a dedicated loader/class to register hooks.
Keep admin-only code behind is_admin() (or admin hooks) to reduce frontend overhead.
See:
2) Hooks and lifecycle (activation/deactivation/uninstall)
Activation hooks are fragile; follow guardrails:
register activation/deactivation hooks at top-level, not inside other hooks
flush rewrite rules only when needed and only after registering CPTs/rules
uninstall should be explicit and safe (uninstall.php or register_uninstall_hook)
See:
3) Settings and admin UI (Settings API)
Prefer Settings API for options:
register_setting(), add_settings_section(), add_settings_field()
sanitize via sanitize_callback
See:
references/settings-api.md
4) Security baseline (always)
Before shipping:
Validate/sanitize input early; escape output late.
Use nonces to prevent CSRF and capability checks for authorization.
Avoid directly trusting $_POST / $_GET; use wp_unslash() and specific keys.
Use $wpdb->prepare() for SQL; avoid building SQL with string concatenation.
See:
5) Data storage, cron, migrations (if needed)
Prefer options for small config; custom tables only if necessary.
For cron tasks, ensure idempotency and provide manual run paths (WP-CLI or admin).
For schema changes, write upgrade routines and store schema version.
See:
references/data-and-cron.md
Verification
Plugin activates with no fatals/notices.
Settings save and read correctly (capability + nonce enforced).
Uninstall removes intended data (and nothing else).
Run repo lint/tests (PHPUnit/PHPCS if present) and any JS build steps if the plugin ships assets.
Failure modes / debugging
Activation hook not firing:
hook registered incorrectly (not in main file scope), wrong main file path, or plugin is network-activated
Settings not saving:
settings not registered, wrong option group, missing capability, nonce failure
Security regressions:
nonce present but missing capability checks; or sanitized input not escaped on output
See:
Escalation
For canonical detail, consult the Plugin Handbook and security guidelines before inventing patterns.
More in Software & Web Development Improve Codebase Architecture improve-codebase-architecture · Matt Pocock · 1,321,490 installs Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.
Codebase Design codebase-design · Matt Pocock · 1,010,770 installs Shared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a seam goes, make code more testable or AI-navigable, or when another skill needs the deep-module vocabulary.
Using Git Worktrees using-git-worktrees · Jesse Vincent · 248,308 installs Use when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallback
Finishing a Development Branch finishing-a-development-branch · Jesse Vincent · 245,613 installs Use when implementation is complete, all tests pass, and you need to decide how to integrate the work
Building MCP Servers mcp-builder · Anthropic · 149,371 installs Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).
Site Architecture site-architecture · Corey Haines · 143,441 installs When the user wants to plan or restructure a website, or asks which pages they need or where something belongs: hierarchy, navigation, URL structure, internal linking, website builders and migrations. Not XML sitemaps (see seo-audit). For structured data, see schema.
Building Web Artifacts web-artifacts-builder · Anthropic · 125,181 installs Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use for complex artifacts requiring state management, routing, or shadcn/ui components - not for simple single-file HTML/JSX artifacts.
TypeScript Advanced Types typescript-advanced-types · Seth Hobson · 102,749 installs Master TypeScript's advanced type system including generics, conditional types, mapped types, template literals, and utility types for building type-safe applications. Use when implementing complex type logic, creating reusable type utilities, or ensuring compile-time type safety in TypeScript projects.
All Software & Web Development skills → More from WordPress WordPress Playground Blueprints blueprint · WordPress Use when the deliverable is WordPress Playground Blueprint JSON or a Blueprint bundle, including creating, editing, reviewing, validating schema keys, choosing steps/resources, and debugging Blueprint files. For only running or sharing a Playground environment, use wp-playground.
WordPress Router wordpress-router · WordPress Use when the user asks about WordPress codebases (plugins, themes, block themes, Gutenberg blocks, WP core checkouts) and you need to quickly classify the repo and route to the correct workflow/skill (blocks, theme.json, REST API, WP-CLI, performance, security, testing, release packaging).
WP Abilities API wp-abilities-api · WordPress Use when working with the WordPress Abilities API (wp_register_ability, wp_register_ability_category, /wp-json/wp-abilities/v1/*, @wordpress/abilities) including defining abilities, categories, meta, REST exposure, and permissions checks for clients.
WP Abilities Audit wp-abilities-audit · WordPress Audit a WordPress plugin's REST surface and produce a standardized audit document proposing Abilities API registrations. Produces a markdown doc with a YAML schema and prose sections that humans and agents can both consume when planning a registration rollout. Works on any WP plugin.
WP Abilities Verify wp-abilities-verify · WordPress Verify a WordPress plugin's Abilities API registrations: enumerate abilities, check that callback behavior matches each annotation's claim (the adversarial readonly-but-writes detection), validate permissions and schemas, and validate audit documents produced by wp-abilities-audit.
WordPress Ability Development wp-ability-development · WordPress Use when designing, updating, or reviewing the schemas or behavior of a WordPress ability.
From WordPress/agent-skills at 7374e6f , GPL-2.0-or-later. Install counts from skills.sh .