Agent skill

Knowledge Graph

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

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

GPL-2.0Auto-check passedKnowledge Management

Install Knowledge Graph

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

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

GitHub CLI
$ gh skill install wp-media/wp-rocket knowledge-graph --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/knowledge-graph .claude/skills/knowledge-graph && 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
knowledge-graph
GitHub stars
767
Token cost
~1.3k tokens
SKILL.md length
497 words
Files
1
Skills in repo
15
Repo updated
First seen
Licence
GPL-2.0

At a glance

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

  • Works in 2 steps: Refresh the graph at session start if it… → Read the graph to answer dependency,…
  • Locate a class file
  • SKILL.md covers Graph shape, WP Rocket specific query…, Keeping the graph fresh and Supported languages, plus 1 more section
  • Calls node and git

What it does

Knowledge Graph is an agent skill from wp-media/wp-rocket. Read and refresh wp-rocket's pre-built dependency graph at .claude/graph/dependency-graph.json. Use to locate a class file, trace dependencies, find the ServiceProvider that wires a service, or enumerate Subscribers in a module — without re-scanning the codebase from scratch. This skill is primarily a reader: the graph is built (and incrementally refreshed) by node bin/build-knowledge-graph.js. Invoke this skill at session start (to refresh if stale) and before grep/glob searches for class relationships.

Its SKILL.md is about 1.3k 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 Knowledge Management, covering Knowledge graphs. It works with WordPress and PHP. The repository describes itself as: Performance optimization plugin for WordPress. The licence is GPL-2.0.

When your agent uses it

  • Locate a class file
  • Trace dependencies
  • Find the ServiceProvider that wires a service
  • Enumerate Subscribers in a module — without re-scanning the codebase from scratch

Example prompts

  • “/knowledge-graph”

Workflow steps

2 steps, taken from the first numbered list in SKILL.md.

  1. Refresh the graph at session start if it is stale (base_commit ≠ git rev-parse HEAD).
  2. Read the graph to answer dependency, namespace, and structure questions instantly.

What it can do on your machine

Read from SKILL.md and the folder at commit 3a96b66. 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:

    • node
    • 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

Knowledge Graph loads about 1.3k tokens when it runs. Until then it costs about 132 tokens; SKILL.md has 497 words of instructions outside code blocks.

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

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 3a96b66, republished under its GPL-2.0 licence (© wp-media). 497 words, ~1,285 tokens.

Download SKILL.mdSave it as .claude/skills/knowledge-graph/SKILL.md (or your agent's skills folder).
name
knowledge-graph
description
Read and refresh wp-rocket's pre-built dependency graph at .claude/graph/dependency-graph.json. Use to locate a class file, trace dependencies, find the ServiceProvider that wires a service, or enumerate Subscribers in a module — without re-scanning the codebase from scratch. This skill is primarily a reader: the graph is built (and incrementally refreshed) by `node bin/build-knowledge-graph.js`. Invoke this skill at session start (to refresh if stale) and before grep/glob searches for class relationships.

Knowledge Graph

A pre-built dependency graph lives at .claude/graph/dependency-graph.json. The builder is node bin/build-knowledge-graph.js (incremental by default, --full to force rebuild).

This skill has two responsibilities:

  1. Refresh the graph at session start if it is stale (base_commit ≠ git rev-parse HEAD).
  2. Read the graph to answer dependency, namespace, and structure questions instantly.

Read it before running grep/glob searches for class relationships, namespace exploration, or dependency tracing. It eliminates redundant file scans and speeds up the first useful response in any session.


Graph shape

json
{
  "generated_at": "<ISO timestamp>",
  "base_commit":  "<git SHA>",
  "node_count":   913,
  "nodes": {
    "inc/Engine/Cache/Subscriber.php": {
      "language":  "php",
      "namespace": "WP_Rocket\\Engine\\Cache",
      "symbols": [
        { "kind": "class", "name": "Subscriber", "extends": [], "implements": ["Subscriber_Interface"] }
      ],
      "imports": [
        "WP_Rocket\\Event_Management\\Subscriber_Interface",
        "WP_Rocket\\Engine\\Cache\\Purge"
      ]
    }
  },
  "symbol_index": {
    "WP_Rocket\\Engine\\Cache\\Subscriber": "inc/Engine/Cache/Subscriber.php"
  }
}
  • nodes — keyed by relative file path. Each node has the language (php or js), declared symbols (PHP only), and all import/use statements.
  • symbol_index — maps every fully-qualified PHP class / interface / trait / enum to its file path. Use this for instant "where is this class?" lookups.

WP Rocket specific query patterns

Find a class file (zero grep)
symbol_index["WP_Rocket\\Engine\\Cache\\Purge"]
→ "inc/Engine/Cache/Purge.php"
Find the ServiceProvider that wires a class

The ServiceProvider that registers a class imports it. Search for files whose imports contain the target FQN:

filter nodes where "WP_Rocket\\Engine\\Cache\\Purge" ∈ node.imports
→ "inc/Engine/Cache/ServiceProvider.php"

Then read that ServiceProvider to see how the class is registered in register().

Find all Subscribers in a module

Filter nodes where:

  • namespace starts with the module prefix (e.g. WP_Rocket\Engine\Cache)
  • symbols[*].implements contains Subscriber_Interface
Find all ServiceProviders in the codebase

Filter nodes where symbols[*].extends contains AbstractServiceProvider.

Trace a class's full dependency chain
  1. Start at symbol_index["WP_Rocket\\...\\ClassName"] → get file path
  2. Read nodes[file].imports → these are its direct dependencies
  3. For each dependency, repeat → you get the full constructor injection tree without reading any PHP
Verify no unexpected cross-module dependencies

Check nodes[file].imports for any FQN that shouldn't be there. For example, a Frontend Subscriber importing an Admin class is a red flag.

Find classes that use apply_filters directly (not wpm_apply_filters_typed)

This requires reading the actual files, but the graph narrows the field: only check PHP nodes in inc/Engine/ and inc/Addon/ (the paths covered by PHPStan).


Show full SKILL.md (192 more words)Show less

Keeping the graph fresh

The graph records the git commit it was built from (base_commit). If that SHA differs from HEAD, run:

bash
node bin/build-knowledge-graph.js

The script is incremental — it only re-parses files changed since base_commit. Use --full to force a complete rebuild.

When to refresh:

  • At the start of every issue workflow session (step 9 checks this automatically).
  • After merging a branch with structural changes (new classes, namespace moves).
  • Before an architecture review session.

Supported languages

LanguageWhat is extracted
PHPnamespace, class/interface/trait/enum declarations (with extends/implements), use imports (including grouped \{A, B} forms)
TypeScript / JavaScriptimport (static + dynamic) and require() sources

Practical workflow (issue implementation)

Before writing a single line of code for an issue:

  1. Check base_commit vs HEAD — refresh if stale.
  2. Use symbol_index to locate all classes involved in the fix.
  3. For each class, read nodes[file].imports — know the dependency chain before touching the constructor.
  4. Find the ServiceProvider via the import search above — know where to add/modify the binding.
  5. List all Subscribers in the module — know which ones may need new hook entries.
  6. Only then open the actual PHP files (now you know exactly which ones to read).

© 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/knowledge-graph of wp-media/wp-rocket.

Open the folder on GitHubat commit 3a96b66

Compare with similar skills

Knowledge Graph 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.

Knowledge Graph compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Knowledge Graph this skillwp-media/wp-rocket767—~1.3kAutomated safety check: PassGPL-2.0
WooCommerce Code Reviewwoocommerce/woocommerce11k3 repos~1.1kAutomated safety check: PassCustom licence
Wp Performance Reviewelvismdev/claude-wordpress-skills2341 repos~4.5kAutomated safety check: PassMIT
Wp Interactivity APIAutomattic/agent-skills2112 repos~1.5kAutomated safety check: PassNone
WooCommerce Email Editor Developmentwoocommerce/woocommerce11k—~893Automated safety check: PassCustom licence
WooCommerce Dev Cyclewoocommerce/woocommerce11k3 repos~431Automated safety check: PassCustom licence

Similar skills

  • WooCommerce Code Review

    woocommerce/woocommerce

    Reviews WooCommerce code changes against the project's standards, flagging backend PHP architecture, naming, documentation, data integrity and testing violations.

    11k GitHub starsUsed in 3 repos~1.1k tokens
    DevelopmentAuto-check passed
  • Wp Performance Review

    elvismdev/claude-wordpress-skills

    WordPress performance code review and optimization analysis.

    234 GitHub starsUsed in 1 repo~4.5k tokens
    Business, Finance & HRAuto-check passed
  • Wp Interactivity API

    Automattic/agent-skills

    A skill your agent uses when building or debugging WordPress Interactivity API features (data-wp- directives, @wordpress/interactivity store/state/actions, block viewScriptModule integration…

    211 GitHub starsUsed in 2 repos~1.5k tokens
    DevelopmentAuto-check passed
  • Sets up a local environment for the WooCommerce block email editor, with a watcher, Mailpit email capture and build and test commands for its PHP and JS packages.

    11k GitHub stars~893 tokensUpdated today
    Backend & APIsAuto-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
  • Blueprint

    bonny/WordPress-Simple-History

    A skill your agent uses when the deliverable is WordPress Playground Blueprint JSON or a Blueprint bundle, including creating, editing, reviewing, validating schema keys, choosing steps/resources…

    317 GitHub starsUsed in 1 repo~4k tokens
    DevelopmentAuto-check passed

More from wp-media/wp-rocket

All 15 skills in this repo
  • 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
  • Wp Rocket Architecture

    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…

    767 GitHub stars~1.8k 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 Knowledge Graph

What does Knowledge Graph do?

Read and refresh wp-rocket's pre-built dependency graph at .claude/graph/dependency-graph.json. Knowledge Graph is an agent skill from wp-media/wp-rocket.json.

When should I use Knowledge Graph?

Knowledge Graph fits situations like: locate a class file; trace dependencies; find the ServiceProvider that wires a service; enumerate Subscribers in a module — without re-scanning the codebase from scratch.

How do I install Knowledge Graph in Claude Code?

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

How do I install Knowledge Graph in Codex?

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

Can I use Knowledge Graph 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 knowledge-graph -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/knowledge-graph, .gemini/skills/knowledge-graph, .github/skills/knowledge-graph and .opencode/skills/knowledge-graph in your project.

What does Knowledge Graph need to run?

Going by SKILL.md and its folder, Knowledge Graph needs the command-line tools its instructions call (node and git).

Does Knowledge Graph 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 Knowledge Graph 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 Knowledge Graph use?

Knowledge Graph 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 Knowledge Graph use?

About 1.3k tokens (SKILL.md is roughly 5.1k 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 Knowledge Graph?

Skills that share tags, products or a category with Knowledge Graph: WooCommerce Code Review (woocommerce/woocommerce, 11k stars), Wp Performance Review (elvismdev/claude-wordpress-skills, 234 stars), Wp Interactivity API (Automattic/agent-skills, 211 stars) and WooCommerce Email Editor Development (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 Knowledge Graph?

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 6, 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.