.agents/skills/code-style/SKILL.md
PHP coding standards and WordPress patterns for ATmosphere plugin. Use when writing PHP code, creating classes, implementing WordPress hooks, or structuring plugin files.
npx skillsauth add Automattic/wordpress-atmosphere code-styleInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Plugin-specific conventions and architectural patterns.
class-{name}.php # Regular classes.
namespace Atmosphere;
namespace Atmosphere\OAuth;
namespace Atmosphere\Transformer;
namespace Atmosphere\WP_Admin;
Always use 'atmosphere' for translations:
\__( 'Text', 'atmosphere' );
\esc_html_e( 'Text', 'atmosphere' );
When in a namespace, always escape WordPress and PHP global functions with backslash:
\get_option(), \add_action(), \is_wp_error(), \strlen(), \time()
Use use imports — never inline \Namespace\Class:
use Atmosphere\OAuth\Client;
use function Atmosphere\get_did;
use function Atmosphere\is_connected;
includes/
├── class-*.php # Core classes.
├── functions.php # Helper functions.
├── oauth/ # OAuth flow classes.
├── transformer/ # AT Protocol record transformers.
└── wp-admin/ # Admin functionality.
templates/ # PHP template files.
assets/ # CSS and JS.
tests/phpunit/ # PHPUnit tests.
Convert WordPress content into AT Protocol records.
Base class: includes/transformer/class-base.php
Pattern:
namespace Atmosphere\Transformer;
class Custom extends Base {
public function transform(): array {
// Build the AT Protocol record array.
}
public function get_collection(): string {
return 'app.custom.collection';
}
public function get_rkey(): string {
// Return or generate TID.
}
}
Examples:
includes/transformer/class-post.php — app.bsky.feed.post.includes/transformer/class-document.php — site.standard.document.includes/transformer/class-publication.php — site.standard.publication.Handle the full PKCE + DPoP + PAR native OAuth flow.
includes/oauth/class-resolver.php — Handle → DID → PDS → Auth Server chain.includes/oauth/class-client.php — OAuth lifecycle (authorize, callback, refresh).includes/oauth/class-dpop.php — ES256 DPoP proof generation.includes/oauth/class-encryption.php — libsodium token encryption.includes/class-api.php — DPoP-authenticated PDS requests with automatic nonce retry.
includes/class-publisher.php — Atomic batch applyWrites for both bsky post + document.
Filters:
\apply_filters( 'atmosphere_transform_bsky_post', $record, $post );
\apply_filters( 'atmosphere_transform_document', $record, $post );
\apply_filters( 'atmosphere_transform_publication', $record );
\apply_filters( 'atmosphere_client_metadata', $metadata );
\apply_filters( 'atmosphere_syncable_post_types', array( 'post' ) );
development
Testing patterns for PHPUnit tests. Use when writing tests, debugging test failures, setting up test coverage, or implementing test patterns for ATmosphere features.
documentation
Version management and release processes using Jetpack Changelogger. Use when creating releases, managing changelogs, bumping versions, or preparing releases.
testing
MUST be invoked before creating any PR, pushing a branch for review, or running `gh pr create`. Covers changelog entries, branch naming, PHPCS/PHPUnit checks, and reviewer assignment.
tools
Development workflows for WordPress ATmosphere plugin including wp-env setup, testing commands, linting, and build processes. Use when setting up development environment, running tests, checking code quality, or working with wp-env.