Agent skill

Wp Rocket Architecture

by wp-media in wp-media/wp-rocket

A skill your agent uses when changing service structure, Subscribers, ServiceProviders, Container wiring, bootstrapping, Context classes, or any code that may affect the core caching engine in WP…

GPL-2.0Auto-check passedDevelopment

Install Wp Rocket Architecture

skills CLI
$ npx skills add wp-media/wp-rocket --skill wp-rocket-architecture -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install wp-media/wp-rocket wp-rocket-architecture --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/wp-media/wp-rocket.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/wp-rocket-architecture .claude/skills/wp-rocket-architecture && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
wp-rocket-architecture
GitHub stars
767
Token cost
~1.8k tokens
SKILL.md length
406 words
Files
1
Skills in repo
15
Repo updated
First seen
Licence
GPL-2.0

At a glance

A skill your agent uses when changing service structure, Subscribers, ServiceProviders, Container wiring, bootstrapping, Context classes, or any code that may affect the core caching engine in WP…

  • Changing service structure
  • SKILL.md covers Core principles, Subscriber pattern, ServiceProvider pattern and Context classes, plus 9 more sections
  • Calls git
  • ServiceProviders

What it does

Wp Rocket Architecture is an agent skill from wp-media/wp-rocket. Use this skill when changing service structure, Subscribers, ServiceProviders, Container wiring, bootstrapping, Context classes, or any code that may affect the core caching engine in WP Rocket. Also use it when reading constants, writing unit tests that depend on constants, or opening a pull request.

Its SKILL.md is about 1.8k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development, covering Unit testing, Caching and Pull requests. It works with WordPress. The repository describes itself as: Performance optimization plugin for WordPress. The licence is GPL-2.0.

When your agent uses it

  • Changing service structure
  • ServiceProviders
  • Container wiring
  • Context classes

Example prompts

  • “/wp-rocket-architecture”

What it can do on your machine

Read from SKILL.md and the folder at commit aa6a655. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • git

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Wp Rocket Architecture loads about 1.8k tokens when it runs. Until then it costs about 81 tokens; SKILL.md has 406 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~81
When it runs · the whole SKILL.md, loaded when a task matches
~1.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from wp-media/wp-rocket at commit aa6a655, republished under its GPL-2.0 licence (© wp-media). 406 words, ~1,752 tokens.

Download SKILL.mdSave it as .claude/skills/wp-rocket-architecture/SKILL.md (or your agent's skills folder).
name
wp-rocket-architecture
description
Use this skill when changing service structure, Subscribers, ServiceProviders, Container wiring, bootstrapping, Context classes, or any code that may affect the core caching engine in WP Rocket. Also use it when reading constants, writing unit tests that depend on constants, or opening a pull request.

WP Rocket Architecture Integrity

Enforce architectural patterns and protect internal service structure.

Core principles

  • Every WordPress hook goes through a Subscriber — never add_action / add_filter directly.
  • Every new filter uses wpm_apply_filters_typed() — never apply_filters().
  • Plugin settings are read via injected Options_Data — never get_option().
  • All instantiation goes through the League Container — never new ClassName() in business code.
  • Do not modify inc/Dependencies/ (Mozart-bundled vendored code).

Subscriber pattern

php
class MySubscriber implements Subscriber_Interface {
    public static function get_subscribed_events(): array {
        return [
            'init'             => 'on_init',                      // priority 10, 1 arg
            'save_post'        => [ 'on_save_post', 10, 2 ],     // priority 10, 2 args
            'admin_menu'       => [
                [ 'add_menu',    9 ],
                [ 'add_submenu', 10 ],
            ],
        ];
    }
}

PHPStan enforces this: every method name in get_subscribed_events() must exist in the class (EnsureCallbackMethodsExistsInSubscribedEvents). Always implement the method before or alongside declaring it.

ServiceProvider pattern

php
class ServiceProvider extends AbstractServiceProvider {
    protected $provides = [ 'my_subscriber', 'my_controller' ];

    public function register(): void {
        $this->getContainer()->addShared( 'my_controller', Controller::class )
            ->addArguments( [ 'options', 'logger' ] );         // string = container key

        $this->getContainer()->addShared( 'my_subscriber', MySubscriber::class )
            ->addArgument( 'my_controller' );
    }
}
  • addShared() → singleton (same instance every get() call)
  • add() → factory (new instance every call)
  • String arguments are container keys; use new StringArgument('...') for literal strings, new ArrayArgument([...]) for literal arrays.

Context classes

Features that are conditionally active encapsulate that logic in a Context class rather than inlining checks in the Subscriber:

inc/Engine/MyFeature/
└── Context/
    └── Context.php   // should_run(): bool — inject into Subscriber

The Subscriber calls $this->context->is_allowed() (or similar) as a guard clause. This keeps the Subscriber clean and the condition unit-testable in isolation.

wpm_apply_filters_typed() — mandatory for all new filters

php
// ❌ Flagged by PHPStan (DiscourageApplyFilters)
$value = apply_filters( 'rocket_my_filter', $default );

// ✅ Required — with full docblock
/**
 * Filters the custom value.
 *
 * @param string $value The value.
 * @return string
 */
$value = wpm_apply_filters_typed( 'string', 'rocket_my_filter', $default );

Available types: 'string', 'integer', 'boolean', 'array', 'string[]'.

Option objects — mandatory for reading plugin settings

php
// ❌ Flagged by PHPStan (DiscourageWPOptionUsage)
$setting = get_option( 'wp_rocket_settings' );

// ✅ Required — inject Options_Data via constructor (PHP 7.3+ compatible)
/** @var Options_Data */
private $options;

public function __construct( Options_Data $options ) {
    $this->options = $options;
}

$setting = $this->options->get( 'option_key', $default );

Constants — read through rocket_get_constant()

Read WordPress and WP Rocket constants with rocket_get_constant(), cast to the type the code expects, with a default that matches WordPress core. Raw constants can't be changed per test, and their value types vary by WordPress version and wp-config (for example, COOKIE_DOMAIN is false before WP 6.6 or when defined as false).

php
// ❌ Not mockable, and a TypeError when the constant isn't a string
$this->set_cookie( $name, $value, $expire, COOKIEPATH, COOKIE_DOMAIN, $secure, true );

// ✅ Required
$cookie_path   = (string) rocket_get_constant( 'COOKIEPATH', '/' );
$cookie_domain = (string) rocket_get_constant( 'COOKIE_DOMAIN', '' );

In unit tests, don't define() constants, use @runInSeparateProcess, or stub rocket_get_constant yourself. The base TestCase::setUp() already stubs it (tests/StubTrait.php), and it returns values from $this->constants. Set only the keys the test needs, and never replace the whole array:

php
// ❌ Wipes out keys set by the base test setup
$this->constants = [ 'COOKIE_DOMAIN' => false ];

// ✅ Required
$this->constants['COOKIE_DOMAIN'] = false;
Show full SKILL.md (133 more words)Show less

PHPStan custom rules — all must pass

RuleImplication
DiscourageApplyFiltersUse wpm_apply_filters_typed()
DiscourageWPOptionUsageUse Options_Data injection
EnsureCallbackMethodsExistsInSubscribedEventsImplement every method you declare in get_subscribed_events()
NoHooksInORMNo add_action, add_filter, apply_filters inside Database/Tables/ or Database/Queries/ classes

Standard module directory structure

inc/Engine/MyFeature/
├── ServiceProvider.php          # all bindings + declares $provides
├── Context/
│   └── Context.php             # feature availability guard
├── Admin/
│   └── Subscriber.php          # admin-only hooks
├── Frontend/
│   ├── Controller.php          # business logic
│   └── Subscriber.php          # frontend hooks
└── Database/                   # only when custom tables are needed
    ├── Tables/MyFeature.php    # BerlinDB schema, version YYYYMMDD
    ├── Queries/MyFeature.php   # query builder
    ├── Rows/MyFeature.php      # row model
    └── Schemas/MyFeature.php   # column definitions

BerlinDB table versioning

php
protected $version = 20251006;  // YYYYMMDD
protected $upgrades = [
    20251006 => 'add_new_column',
];
protected function add_new_column(): void {
    // ALTER TABLE with $wpdb->prepare
}

Structural guardrails

Avoid:

  • Global state or new singletons outside the container
  • Static helpers replacing injected services
  • Business logic inside ServiceProvider register() — wiring only
  • Hooks or filters inside Database/Query/Table classes (NoHooksInORM)

Git Operations

Follow the policy defined in AGENTS.md §5.1. Outside the issue workflow, do not run git commit or git push.

Pull request descriptions

Every PR body must follow .claude/skills/issue-workflow/refs/pr-template.md with its section headings copied exactly, including "What was tested" and "Mandatory Checklist". This applies outside the issue workflow too. The PR Template Checker CI (wp-media/pr-checklist-action) fails otherwise. Full rules are in .github/instructions/pull-request.instructions.md.

© wp-media, GPL-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .claude/skills/wp-rocket-architecture of wp-media/wp-rocket.

Open the folder on GitHubat commit aa6a655

Compare with similar skills

Wp Rocket Architecture next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Wp Rocket Architecture compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Wp Rocket Architecture this skillwp-media/wp-rocket767—~1.8kAutomated safety check: PassGPL-2.0
Flowfile Debugging PlaybookEdwardvaneechoud/Flowfile385—~6.3kAutomated safety check: PassMIT
WooCommerce Dev Cyclewoocommerce/woocommerce11k3 repos~431Automated safety check: PassCustom licence
Adk Setupgoogle/adk-python22k—~993Automated safety check: NotesApache-2.0
WooCommerce Backend Conventionswoocommerce/woocommerce11k1 repos~614Automated safety check: PassCustom licence
Pre PR AblationPopupMaker/Popup-Maker110—~2.5kAutomated safety check: PassNone

Similar skills

  • Flowfile Debugging Playbook

    Edwardvaneechoud/Flowfile

    Symptom-to-cause triage playbook for Flowfile (core/worker/kernel/frontend/AI) — covers "no such table" DB cascades (two distinct causes), import-time Alembic migration corruption, silent…

    385 GitHub stars~6.3k tokensUpdated today
    DevelopmentAuto-check passed
  • WooCommerce Dev Cycle

    woocommerce/woocommerce

    Workflow for WooCommerce development: run PHP and JavaScript tests, lint and fix code style on the current branch, and follow guides for i18n and markdown.

    11k GitHub starsUsed in 3 repos~431 tokens
    DevelopmentAuto-check passed
  • Adk Setup

    google/adk-python

    Official

    Sets up a local ADK Python development environment in a git clone of the open-source adk-python repository: a uv virtual environment, all dependency extras, pre-commit hooks, and a first unit-test…

    22k GitHub stars~993 tokensUpdated today
    DevelopmentAuto-check: notes
  • WooCommerce Backend Conventions

    woocommerce/woocommerce

    Guides agents writing or changing WooCommerce backend PHP so new classes, hooks and unit tests follow the project's conventions.

    11k GitHub starsUsed in 1 repo~614 tokens
    DevelopmentAuto-check passed
  • Pre PR Ablation

    PopupMaker/Popup-Maker

    Use before finalizing or opening/updating a PR for non-trivial code changes, especially third-party integrations, compatibility layers, hooks and filters, lifecycle code, providers, abstractions…

    110 GitHub stars~2.5k tokensUpdated 5 days ago
    DevelopmentAuto-check passed
  • Verify Change

    druxt/druxt.js

    Runs the druxt.js verification gate (lint, build, unit tests and the checks for whatever else changed) and reports the real results.

    114 GitHub stars~916 tokensUpdated today
    DevelopmentAuto-check passed

More from wp-media/wp-rocket

All 15 skills in this repo
  • Knowledge Graph

    wp-media/wp-rocket

    Read and refresh wp-rocket's pre-built dependency graph at .claude/graph/dependency-graph.json.

    767 GitHub stars~1.3k tokensUpdated yesterday
    Auto-check passed
  • Wordpress Compliance

    wp-media/wp-rocket

    A skill your agent uses when modifying templates, admin UI, output, hooks, plugin metadata, sanitization, escaping, or any code that must remain compliant with WordPress.org and repository PHPCS…

    767 GitHub stars~809 tokensUpdated yesterday
    Auto-check passed
  • Challenge

    wp-media/wp-rocket

    Adversarially review a grooming spec before implementation starts.

    767 GitHub stars~674 tokensUpdated yesterday
    Auto-check passed
  • Compliance

    wp-media/wp-rocket

    Check a change against WordPress.org plugin rules and PHPCS standards.

    767 GitHub stars~551 tokensUpdated yesterday
    Auto-check passed
  • Docs

    wp-media/wp-rocket

    Update developer-facing documentation to reflect code changes on the current branch.

    767 GitHub stars~1.1k tokensUpdated yesterday
    Auto-check passed
  • Dod

    wp-media/wp-rocket

    Run the Definition of Done checklist for the current wp-rocket branch and report PASS/WARN/FAIL with evidence.

    767 GitHub stars~4k tokensUpdated yesterday
    Auto-check passed

Works with

Questions about Wp Rocket Architecture

What does Wp Rocket Architecture do?

A skill your agent uses when changing service structure, Subscribers, ServiceProviders, Container wiring, bootstrapping, Context classes, or any code that may affect the core caching engine in WP…. Wp Rocket Architecture is an agent skill from wp-media/wp-rocket. Use this skill when changing service structure, Subscribers, ServiceProviders, Container wiring, bootstrapping, Context classes, or any code that may affect the core caching engine in WP Rocket.

When should I use Wp Rocket Architecture?

Wp Rocket Architecture fits situations like: changing service structure; serviceProviders; container wiring; context classes.

How do I install Wp Rocket Architecture in Claude Code?

Run `npx skills add wp-media/wp-rocket --skill wp-rocket-architecture -a claude-code`. Or copy the skill folder (.claude/skills/wp-rocket-architecture in wp-media/wp-rocket) into .claude/skills/wp-rocket-architecture in your project. Claude Code loads it when a task matches its description.

How do I install Wp Rocket Architecture in Codex?

Run `npx skills add wp-media/wp-rocket --skill wp-rocket-architecture -a codex`. Or copy the skill folder (.claude/skills/wp-rocket-architecture in wp-media/wp-rocket) into .agents/skills/wp-rocket-architecture in your project. Codex loads it when a task matches its description.

Can I use Wp Rocket Architecture in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add wp-media/wp-rocket --skill wp-rocket-architecture -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/wp-rocket-architecture, .gemini/skills/wp-rocket-architecture, .github/skills/wp-rocket-architecture and .opencode/skills/wp-rocket-architecture in your project.

What does Wp Rocket Architecture need to run?

Going by SKILL.md and its folder, Wp Rocket Architecture needs the command-line tools its instructions call (git).

Does Wp Rocket Architecture access the network?

SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Wp Rocket Architecture safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Wp Rocket Architecture use?

Wp Rocket Architecture is published under the GPL-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Wp Rocket Architecture use?

About 1.8k tokens (SKILL.md is roughly 7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Wp Rocket Architecture?

Skills that share tags, products or a category with Wp Rocket Architecture: Flowfile Debugging Playbook (Edwardvaneechoud/Flowfile, 385 stars), WooCommerce Dev Cycle (woocommerce/woocommerce, 11k stars), Adk Setup (google/adk-python, 22k stars) and WooCommerce Backend Conventions (woocommerce/woocommerce, 11k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Wp Rocket Architecture?

wp-media (a GitHub organization) maintains it in wp-media/wp-rocket, which has 767 GitHub stars. The repository holds 15 skills in this directory. The repository was last updated on October 9, 2026.

Source: wp-media/wp-rocket on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.