一键导入
knowledge-graph
Read and refresh the project's dependency graph to trace classes, services, and modules.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Read and refresh the project's dependency graph to trace classes, services, and modules.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Run the Definition of Done checklist for the current branch — PASS/WARN/FAIL with evidence.
Start a full delivery run from a GitHub issue number, URL, or raw description.
Adversarially review a grooming spec before implementation starts. Finds hidden risks, unvalidated assumptions, and missing dependencies. Standalone entry point for the challenger agent.
Check a change against WordPress.org plugin rules and PHPCS standards.
Update developer-facing documentation to reflect code changes on the current branch.
Run E2E smoke tests (basic) or full acceptance + regression suite (extended).
| name | knowledge-graph |
| description | Read and refresh the project's dependency graph to trace classes, services, and modules. |
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:
base_commit ≠ git rev-parse HEAD).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.
{
"generated_at": "<ISO timestamp>",
"base_commit": "<git SHA>",
"node_count": 913,
"nodes": {
"classes/Engine/Cache/Subscriber.php": {
"language": "php",
"namespace": "Imagify\\Engine\\Cache",
"symbols": [
{ "kind": "class", "name": "Subscriber", "extends": [], "implements": ["SubscriberInterface"] }
],
"imports": [
"Imagify\\Event_Management\\SubscriberInterface",
"Imagify\\Engine\\Cache\\Purge"
]
}
},
"symbol_index": {
"Imagify\\Engine\\Cache\\Subscriber": "classes/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.symbol_index["Imagify\\Engine\\Cache\\Purge"]
→ "classes/Engine/Cache/Purge.php"
The ServiceProvider that registers a class imports it. Search for files whose imports contain the target FQN:
filter nodes where "Imagify\\Engine\\Cache\\Purge" ∈ node.imports
→ "classes/Engine/Cache/ServiceProvider.php"
Then read that ServiceProvider to see how the class is registered in register().
Filter nodes where:
namespace starts with the module prefix (e.g. Imagify\Engine\Cache)symbols[*].implements contains SubscriberInterfaceFilter nodes where symbols[*].extends contains AbstractServiceProvider.
symbol_index["Imagify\\...\\ClassName"] → get file pathnodes[file].imports → these are its direct dependenciesCheck nodes[file].imports for any FQN that shouldn't be there.
For example, a Frontend Subscriber importing an Admin class is a red flag.
Imagify\ in classes/ = modern PSR-4 (declare(strict_types=1)). New code goes here.inc/classes/ with classmap prefix Imagify_ = legacy. Do not add new classes here; migrate out instead.Imagify\Dependencies\ — do not modify.The graph records the git commit it was built from (base_commit). If that SHA differs from HEAD, run:
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:
| Language | What is extracted |
|---|---|
| PHP | namespace, class/interface/trait/enum declarations (with extends/implements), use imports (including grouped \{A, B} forms) |
| TypeScript / JavaScript | import (static + dynamic) and require() sources |
Before writing a single line of code for an issue:
base_commit vs HEAD — refresh if stale.symbol_index to locate all classes involved in the fix.nodes[file].imports — know the dependency chain before touching the constructor.config/providers.php to confirm the ServiceProvider is registered.