/human-made-standards:php-standardsfrom human-made-standards
Human Made PHP conventions for WordPress: namespaced procedural code, bootstrap pattern, file naming, type hints, HM-Minimum PHPCS ruleset, and input/output security. Use when writing or reviewing PHP in a plugin or theme.
Ships in human-made-standards. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
These standards follow the Human Made coding standards (HM-Minimum PHPCS ruleset).
Project\Reports not Project\CLI)Use the bootstrap pattern for feature initialization:
<?php
namespace Project\Feature;
function bootstrap() : void {
add_action( 'init', __NAMESPACE__ . '\\register' );
add_filter( 'the_content', __NAMESPACE__ . '\\filter_content' );
}
function register() : void {
// Implementation
}
plugin.phpfunctions.phpclass-{classname}.php (lowercase)namespace.php or {feature}.phpinc/[] over array()public, protected, privateprotected over private for extensibilitysanitize_text_field(), absint(), wp_kses_post(), etc.esc_html(), esc_attr(), esc_url(), wp_kses_post()current_user_can()$wpdb->prepare()Projects use PHPCS with Human Made standards:
HM-Minimum (or project-specific extension)phpcs.xml or phpcs.xml.distcomposer run phpcs or vendor/bin/phpcsPHPStan is used for static analysis:
phpstan.neon or phpstan.neon.distcomposer run phpstan or vendor/bin/phpstan analyseWhen PHPCS reports violations, read references/fixing-violations.md for the fix pattern for each sniff.
Every <exclude> in a project's phpcs.xml carries a comment saying why. An exclusion without a reason becomes permanent, because the next person cannot tell a considered trade-off from a rule someone found annoying.
For anything security-related, prefer a per-line phpcs:ignore with a reason over a project-wide <exclude>. A project-wide exclusion silences the sniff everywhere, including the places where it would have caught a real bug:
// Table names cannot be parameterised through wpdb::prepare().
$table = $wpdb->prefix . 'my_table';
// phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- table name is not user input
$rows = $wpdb->get_results( "SELECT * FROM {$table}" );
On PHP 8, use humanmade/coding-standards 2.x. Version 1.x pins WPCS 2.x, and PHPCS crashes with a trim(null) deprecation in the PHPCompatibility and WordPress.WP.I18n sniffs. Excluding WordPress.WP.I18n does not stop the crash, because PHPCompatibility fails first.
Projects that use PSR-4 autoloading need one exclusion whatever the team prefers:
<rule ref="HM">
<!--
PSR-4 autoloading uses PascalCase file names; these sniffs
assume the WordPress hyphenated-lower convention.
-->
<exclude name="WordPress.Files.FileName.NotHyphenatedLowercase"/>
<exclude name="WordPress.Files.FileName.InvalidClassFileName"/>
<exclude name="HM.Files.ClassFileName.MismatchedName"/>
</rule>
Treat any other exclusion as a project decision to argue for in review.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
wordpress, php-standards, hm-minimum, phpcs, coding-conventions
Other plugins' skills for the same job
npx claudepluginhub humanmade/claude-code-standards --plugin human-made-standards8 skills in this plugin
/altis-developmentAltis DXP projects — local server commands, mu-plugins architecture, asset handling and deploys. Use when a project has an Altis config or `composer server` scripts, or when asked to start or stop the local server, run WP-CLI, open a database shell, tail logs, or run a PHP script in WordPress context on Altis./css-scss-standardsHuman Made CSS and SCSS conventions — BEM class naming, custom properties, theme.json integration, Stylelint config. Use when writing or reviewing styles, adding a stylesheet or SCSS partial, naming classes, wiring theme.json tokens, or when asked whether some CSS follows HM standards./hm-coding-philosophyHuman Made engineering principles — what to prioritise when evaluating tradeoffs between code quality and directness, why simple beats clever, and how to spot over-engineering. Use when choosing between implementation approaches, reviewing a design or PR for unnecessary complexity, justifying a simpler option, or when asked what HM's position on something is./javascript-standardsHuman Made JavaScript and TypeScript conventions — ES6+ patterns, module organisation, ESLint config, WordPress integration. Use when writing or reviewing JS or TS, adding a module, or when asked whether some JavaScript follows HM standards./react-standardsHuman Made React conventions — functional components with hooks, semantic HTML, props and state, component organisation, block editor interfaces. Use when writing or reviewing a React component, structuring a component directory, or building WordPress block editor UI./run-lintersDiscover and run a project's linters — PHPCS, PHPStan, ESLint, Stylelint. Use when asked to lint, run the linters, check code quality, run static analysis, fix coding standard violations, or verify changes before opening a pull request. Prefers the project's own composer or npm script over calling the binary.