wp-coding-standards

wp-coding-standards is a skill for Claude Code from mralaminahamed/wp-dev-skills. It costs 303 tokens per session (2,430 once invoked), scanned A, original, MIT.

A setup and checking guide for WordPress Coding Standards, the style rules commonly used for WordPress PHP code. It uses PHP_CodeSniffer to find violations and PHPCBF to automatically fix some of them.

In plain words
What is it for?
Use it to configure PHPCS, fix style warnings, add checks to GitHub Actions, investigate false positives, or audit a plugin before submission.
Why use it?
Inconsistent code style creates review problems and can prevent a plugin from meeting WordPress.org submission requirements. This helps developers check and enforce the expected style locally, in editors, and in CI, the automated checks run for changes.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the wp-dev-skills plugin — 19 skills, 1 command shipped together

Good fit Use it to configure PHPCS, fix style warnings, add checks to GitHub Actions, investigate false positives, or audit a plugin before submission.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/mralaminahamed/wp-dev-skills/wp-coding-standards
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.

Any agent
npx skills add mralaminahamed/wp-dev-skills --skill wp-coding-standards
Clone the repo
git clone --depth 1 https://github.com/mralaminahamed/wp-dev-skills

Made for: Claude Code.

Or install wp-dev-skills, the plugin that ships this one along with the rest of its 19 skills, 1 command.

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-coding-standards

README.md
[![agentmods](https://agentmods.dev/badge/skills/mralaminahamed/wp-dev-skills/wp-coding-standards.svg)](https://agentmods.dev/skills/mralaminahamed/wp-dev-skills/wp-coding-standards)
Your own site
<a href="https://agentmods.dev/skills/mralaminahamed/wp-dev-skills/wp-coding-standards"><img src="https://agentmods.dev/badge/skills/mralaminahamed/wp-dev-skills/wp-coding-standards.svg" alt="Measured on agentmods" height="20"></a>
Per session 303 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,430 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.00303 $0.02430
Opus 5 $0.00151 $0.01215
Sonnet 5 $0.00061 $0.00486
Haiku 4.5 $0.00030 $0.00243

Measured 8d ago against content hash 9f5b7c08dbb0, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

wp-coding-standards 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 8d 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.

skills/wp-coding-standards/SKILL.md · 233 lines

How it starts

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

WordPress Coding Standards (PHPCS + WPCS)

Model note: Setup and config steps are mechanical (haiku). Fixing sniff violations across many files works fine on haiku. Only reach for sonnet/opus when violations involve subtle logic (e.g. escaping inside complex SQL builders).

Configure and enforce the WordPress Coding Standards via PHP_CodeSniffer. WPCS is required for WP.org submission and is the canonical style guide for all WordPress PHP code.

When to use

  • "Set up PHPCS for my plugin", "add WordPress coding standards", "configure phpcs.xml".
  • "Fix sniff violations", "run phpcbf", "auto-fix coding standards".
  • "Add PHPCS to GitHub Actions / CI".
  • "Why is PHPCS flagging X?", "suppress a false-positive sniff".
  • Pre-submission audit: "is my code style WP.org–compliant?"

Not for: PHPStan static analysis or type checking — use wp-phpstan-stubs. Security auditing beyond style issues — use wp-plugin-audit.

Method

1. Install

composer require --dev squizlabs/php_codesniffer wp-coding-standards/wpcs dealerdirect/phpcodesniffer-composer-installer

Current WPCS is 3.1 (July 2026) — requires PHP 7.4+ and PHP_CodeSniffer 3.9+. Leave the requirement unpinned (as above) or pin wp-coding-standards/wpcs:"^3.1"; the 3.x line recognizes pluggable functions and reserved post types through WP 6.4/6.5 and defaults minimum_supported_wp_version to 6.2.

dealerdirect/phpcodesniffer-composer-installer auto-registers WPCS paths so no manual --config-set is needed. Verify:

vendor/bin/phpcs -i
# should list: WordPress, WordPress-Core, WordPress-Docs, WordPress-Extra

2. Configure phpcs.xml.dist

Place at project root. This is the canonical config file (.dist allows local phpcs.xml override).

<?xml version="1.0"?>
<ruleset name="My Plugin">
    <description>WordPress Coding Standards for My Plugin</description>

    <!-- What to scan -->
    <file>.</file>
    <exclude-pattern>vendor/*</exclude-pattern>
    <exclude-pattern>node_modules/*</exclude-pattern>
    <exclude-pattern>build/*</exclude-pattern>
    <exclude-pattern>*.min.js</exclude-pattern>
    <exclude-pattern>*.min.css</exclude-pattern>
    <exclude-pattern>tests/bootstrap.php</exclude-pattern>

    <!-- PHP version target -->
    <config name="testVersion" value="7.4-"/>

    <!-- Ruleset -->
    <rule ref="WordPress-Extra">
        <!-- Suppress if you use short array syntax (WP allows it since WP 5.5) -->
        <!-- <exclude name="Generic.Arrays.DisallowShortArraySyntax"/> -->
    </rule>
    <rule ref="WordPress-Docs"/>

    <!-- Text domain for i18n sniffs -->
    <rule ref="WordPress.WP.I18n">
        <properties>
            <property name="text_domain" type="array" value="my-plugin"/>
        </properties>
    </rule>

    <!-- Minimum WP version for deprecated functions -->
    <rule ref="WordPress.WP.DeprecatedFunctions">
        <properties>
            <property name="minimum_supported_version" value="5.9"/>
        </properties>
    </rule>

    <!-- Prefix all globals -->
    <rule ref="WordPress.NamingConventions.PrefixAllGlobals">
        <properties>
            <property name="prefixes" type="array" value="my_plugin,MyPlugin"/>
        </properties>
    </rule>

    <!-- Show sniff codes in output (for targeted suppression) -->
    <arg value="ps"/>
    <arg name="extensions" value="php"/>
    <arg name="colors"/>
</ruleset>

Read the full file on GitHub · 233 lines

Files

What ships with it

4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 8d ago First seen · 233 lines · 303 tokens per session scan A 9f5b7c08dbb0

Subscribe to this mod's changes

wp-coding-standards is a skill published in the GitHub repository mralaminahamed/wp-dev-skills (27 stars, last pushed 1mo ago), licensed MIT. It adds 303 tokens to every session and 2,430 once invoked, about $0.0015 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-30.

Related

Other skills, from other repositories

wp-phpcs-coding-standards

Set up and run PHPCodeSniffer with the WordPress Coding Standards (WPCS) and PHPCompatibility on a plugin or theme. Covers the composer dev-dependencies and their exact (and confusingly-named) packages — squizlabs/phpcodesniffer, wp-coding-standards/wpcs, phpcompatibility/phpcompatibility-wp…

Lonsdale201/wp-agent-skills · 261 tokens

php-code-review

Comprehensive PHP code review with security analysis, performance optimization, and PSR-12 compliance checking for PHP7/PHP8 projects.

jeeinn/claude-skills · 30 tokens

laravel-specialist

Build and configure Laravel 10+ applications, including creating Eloquent models and relationships, implementing Sanctum authentication, configuring Horizon queues, designing RESTful APIs with API resources, and building reactive interfaces with Livewire. Use when creating Laravel models, setting up queue workers…

Jeffallan/claude-skills · 86 tokens

php-pro

Use when building PHP applications with modern PHP 8.3+ features, Laravel, or Symfony frameworks. Invokes strict typing, PHPStan level 9, async patterns with Swoole, and PSR standards. Creates controllers, configures middleware, generates migrations, writes PHPUnit/Pest tests, defines typed DTOs and value objects…

Jeffallan/claude-skills · 107 tokens

phx-review

Review changed Elixir/Phoenix code read-only. Check requirements, cite evidence, deduplicate findings, and return a severity-based verdict.

oliver-kriska/claude-elixir-phoenix · 32 tokens

121-java-object-oriented-design

Use when reviewing, improving, or refactoring Java object-oriented design, including applying SOLID, DRY, or YAGNI; improving classes and interfaces; correcting encapsulation, inheritance, or polymorphism; resolving God Class, Feature Envy, or Data Clumps; and improving object creation, methods, or exception…

jabrena/plinth · 107 tokens