/wp-mnemon:wp-mnemonfrom wp-mnemon
Analyzes WordPress plugin architecture, hooks, execution flows, data lifecycle, and extensibility from a local path or GitHub URL.
Ships in wp-mnemon. 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; scripts run unread.
You are performing a deep architectural analysis of a WordPress plugin. Your goal is not just to catalog hooks and data structures, but to understand what the plugin does, how it works, what triggers what, and how data flows through the system.
Follow every phase below in order. Do not skip phases even if the plugin seems simple. The one exception is Phase 1b: when it finds an existing analysis of the same plugin version, the analysis phases are skipped.
All documentation lives under one root, called <root> in this skill:
<claude config dir>/agent-memory/wp-mnemon/
<claude config dir> is $CLAUDE_CONFIG_DIR when set, otherwise ~/.claude. Resolve it
once, for example ROOT="${CLAUDE_CONFIG_DIR:-$HOME/.claude}/agent-memory/wp-mnemon".
Check what the user provided:
Local path (e.g. /wp-content/plugins/my-plugin or ~/plugins/my-plugin):
Glob and Read tools directly on the filesystemscripts/ folder for fast scanning:
SKILL_DIR=<this skill's folder>
GitHub URL (e.g. https://github.com/org/repo):
{owner} and {repo} from the URLGITHUB_API=https://api.github.com/repos/{owner}/{repo}Authorization: Bearer {token} header on all requestsGET {GITHUB_API}/git/trees/HEAD?recursive=1GET {GITHUB_API}/contents/{path}Find the main plugin file (contains the plugin header comment):
Plugin Name:
Plugin URI:
Description:
Version:
Author:
Glob for *.php in the root, read each until you find the header.php files, fetch and scan themExtract and record:
PLUGIN_VERSION, PLUGIN_DIR, PLUGIN_URL, etc.)<version> is the header Version: value verbatim (for example 2.4.1). When the header
has no version, use unversioned.
Each version of a plugin has its own analysis, because versions can differ in hooks, data, and behavior.
1. Migrate the legacy layout. Earlier runs wrote the docs directly in
<root>/plugins/<slug>/*.md, with no version folder. When <root>/plugins/<slug>/overview.md
exists:
overview.md (# <Plugin Name> — v<version>
or a Version field). Take whatever the header records.unversioned.<root>/plugins/<slug>/<that version>/.<root>/MEMORY.md so it matches the moved docs (name, slug,
that version, the analyzed date from the header).2. Look for this version. Check <root>/plugins/<slug>/<version>/overview.md.
<version>/ folder in Phase 11. Leave the other versions' folders
untouched. Note the other versions on record for Phase 12.Build a complete map of the plugin. Categorize every directory:
| Directory | Purpose |
|---|---|
includes/ or src/ | Core classes and logic |
admin/ | Admin-only code |
public/ or frontend/ | Frontend-facing code |
templates/ or views/ | Template files |
assets/ | JS, CSS, images |
languages/ | i18n .pot files |
vendor/ | Third-party dependencies |
tests/ | Test suite |
Note the architectural pattern: procedural, OOP singleton, OOP dependency injection, service container, or mixed.
Count total PHP files and estimate plugin complexity.
For local plugins, run:
bash "$SKILL_DIR/scripts/scan_classes.sh" /path/to/plugin
For GitHub, read key PHP files and scan for the same patterns.
Build a class architecture map:
extends and implements relationships as a treeRead the main plugin class and any bootstrap/loader files thoroughly. These reveal the overall architecture better than any grep.
Trace the complete loading sequence starting from the main plugin file. Read the actual code — don't just grep. Answer:
What happens when WordPress loads this plugin file?
What happens at each WordPress lifecycle stage? Trace the chain through key hooks in order:
plugins_loaded — what runs here?init — what gets registered? (CPTs, taxonomies, shortcodes, etc.)wp_loaded — any late initialization?admin_init — admin-specific setup?admin_menu — menu/page registration?wp_enqueue_scripts / admin_enqueue_scripts — asset loading?rest_api_init — REST route registration?widgets_init — widget registration?Dependency chain — what must load before what? Are there conditional loads (e.g., admin-only classes, frontend-only classes)?
Document this as a sequential flow with clear arrows/steps.
For local plugins, run:
bash "$SKILL_DIR/scripts/scan_hooks.sh" /path/to/plugin
For GitHub, scan PHP files for hook patterns.
Look for ALL of these:
add_action(, add_filter( — hooks the plugin listens todo_action(, apply_filters( — hooks the plugin exposesdo_action_ref_array(, apply_filters_ref_array(remove_action(, remove_filter( — hooks intentionally removedhas_action(, has_filter( — conditional hook checksFor each hook, document:
Group hooks into:
add_action, add_filter) — what WP/plugin hooks it listens todo_action, apply_filters) — extension points for other pluginsremove_action, remove_filter) — intentional overrides and whyFor local plugins, run:
bash "$SKILL_DIR/scripts/scan_data.sh" /path/to/plugin
For GitHub, scan PHP files for data patterns.
For each data structure found, go beyond the grep match — read surrounding code to understand context:
dbDelta SQL or CREATE TABLE statements)register_rest_route( — namespace, route pattern, methods, permission callbackadd_shortcode( — tag, accepted attributes and defaults, what it rendersregister_block_type( — block name, attributes, supports, render callbackblock.json files in the pluginWP_CLI::add_command( — command name, subcommands, what they doLook for conditional checks:
This is the most important analytical phase. For each major feature of the plugin, trace the complete execution flow from trigger to outcome.
Identify major features from:
For each major flow, trace:
Trigger -> Entry point -> Processing chain -> Data operations -> Output/Side effects
Example format:
### Form Submission Flow
1. User submits form on frontend (JS event listener in `assets/js/public.js`)
2. AJAX POST to `admin-ajax.php` action `my_plugin_submit`
3. Handler: `Ajax_Handler::process_submission()` (`includes/class-ajax-handler.php:45`)
4. Validates nonce and fields via `Validator::validate()` (`includes/class-validator.php:22`)
5. Calls `apply_filters('my_plugin_pre_save', $data)` — extension point
6. Stores data: `$wpdb->insert()` into `{prefix}my_plugin_entries` table
7. Fires `do_action('my_plugin_after_save', $entry_id, $data)` — extension point
8. Sends email notification via `Notification::send()` if enabled in settings
9. Returns JSON response to frontend
Read the actual code for each step. Do not guess flow from function names alone.
Describe the typical user workflow:
[foo], which displays Y"Based on everything found, document:
apply_filters calls are meant as config points?do_action calls are documented extension points?Write 3-5 concrete, practical code examples of how a developer would extend this plugin. Focus on the most common real-world use cases.
Create a directory for this plugin version and write multiple focused files. A version folder is written once per analysis run and overwritten only on an explicit refresh. Other versions' folders are never modified.
<root>/plugins/{plugin-slug}/{version}/
├── overview.md
├── architecture.md
├── hooks.md
├── data.md
└── extending.md
{version} is the plugin header Version: value verbatim, or unversioned when the
header has none.
overview.md — What it does & how it works# {Plugin Name} — v{version}
**Slug**: {slug} | **Author**: {author} | **Analyzed**: {date}
## What This Plugin Does
{Clear description of the plugin's purpose, target users, and main features.
Write this for a developer who has never seen the plugin.}
## File Structure
{Directory map with purpose annotations}
## Bootstrap Flow
{Step-by-step initialization sequence from plugin load through WordPress lifecycle.
Show what loads when and what triggers what.}
## Major Execution Flows
{For each key feature, the full trigger -> processing -> output chain.
This is the most valuable section. Be specific with file paths and line references.}
## Admin Workflow
{What admins see and do — pages, settings, editors}
## Frontend Output
{What visitors see — rendered shortcodes, blocks, templates}
architecture.md — How it's built internally# {Plugin Name} — Architecture
## Architectural Pattern
{OOP/procedural/mixed, design patterns used, DI approach}
## Class Map
{Class hierarchy with inheritance and interface relationships.
For each key class: responsibility, file path, key methods.}
## Namespace Structure
{Namespace tree if applicable}
## Autoloading
{How classes are loaded}
## Dependency Chain
{What depends on what, conditional loading}
hooks.md — All hooks with context# {Plugin Name} — Hooks Reference
## Hooks Registered (listens to WP/others)
{For each: hook name, callback, file:line, priority, what it does}
## Hooks Exposed (extension points)
{For each: hook name, file:line, parameters passed, use case, expected return for filters}
## Hooks Removed
{For each: hook name, why it's removed}
data.md — Data structures & integrations# {Plugin Name} — Data & Integrations
## Custom Post Types
{Slug, labels, supports, capabilities, admin UI}
## Taxonomies
{Slug, associated CPTs, hierarchical}
## Meta Keys
{Key, object type, data type, where set/read/deleted}
## Options
{Key, default, autoload, what controls it}
## Custom DB Tables
{Table name, full schema, what CRUD operations exist}
## REST API Routes
{Method, route, permission, request/response shape}
## Shortcodes & Blocks
{Tag/name, attributes, what it renders}
## Assets
{Handle, type, conditions, dependencies}
## Cron Jobs
{Hook, interval, what it does}
## Transients
{Key pattern, expiry, invalidation trigger}
## Third-party Integrations
{Plugin, what the integration does, conditional check used}
extending.md — How to extend it# {Plugin Name} — Extensibility Guide
## Extension Patterns
{Template overrides, class replacement, filter-based config, action hooks}
## Key Extension Points
{The most useful hooks for developers, with context on when/why to use each}
## Code Examples
{3-5 practical, real-world examples of extending this plugin}
## Data Lifecycle
{How data is created, updated, read, deleted — and where to hook in}
<root>/MEMORY.mdThe table has one row per slug and version. Add a row for this version, or update the existing row when the same slug and version is refreshed:
| {name} | {slug} | {version} | {date} |
Different versions of one plugin are separate rows.
Add a note under Cross-Plugin Patterns if you observe patterns shared with other analyzed plugins.
Tell the user:
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub s3rgiosan/wp-skills --plugin wp-mnemon