dependency-graph
Skill1 starsChanged 7 months agoMITView on GitHub
Build the Apex call graph (class → class) and LWC import graph (component → component / Apex method) for the project. Output is a Mermaid graph plus a JSON edge list for downstream impact analysis. Use for refactoring planning and "what does this depend on?" questions.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- Ovich/swarmstormtheir own version, first seen Oct 25, 2026
- Ovich/charrettetheir own version, first seen Oct 13, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- Ovich/charrette★ 14same name
- Ovich/swarmstorm★ 14same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository53 other files it gives its agents.
- templates/CLAUDE.mdCLAUDE.md
- adrSkill
- agent-deploySkill
- agent-discoverSkill
- agent-eval-trendSkill
- agent-exchange-listSkill
- agent-specSkill
- agent-testSkill
- agent-vs-flow-vs-apexSkill
- before-vs-after-triggerSkill
- code-reviewSkill
- complexitySkill
- coverage-trendSkill
- dead-codeSkill
- deploySkill
- destructive-changesSkill
- diff-deploySkill
- erdSkill
- field-impactSkill
- flaky-test-finderSkill
- flow-auditSkill
- flow-vs-apexSkill
- fls-auditSkill
- gateway-configSkill
- generate-docsSkill
- limit-usageSkill
- lwc-vs-reactSkill
- mcp-tool-vs-restSkill
- notifySkill
- onboardSkill
- org-diffSkill
- org-exploreSkill
- package-versionSkill
- pattern-packSkill
- perf-reviewSkill
- permset-auditSkill
- pr-prepareSkill
- queueable-vs-batchSkill
- quick-deploySkill
- react-initSkill
- release-notesSkill
- scratch-orgSkill
- security-scanSkill
- sequence-diagramSkill
- sf-initSkill
- sharing-reviewSkill
- slack-agentSkill
- soql-analyzerSkill
- test-coverageSkill
- test-dataSkill
- test-planSkill
- trust-evalSkill
- trust-layer-auditSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 50
If a <symbol> is provided:
- Distinctive: line 58
Default Markdown (full graph):
- Very specific: line 118
Don't include test classes by default: Add --include-tests if you want them
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
You are building a dependency graph of the project's source code so impact-analysis questions become quick to answer.
Read Project Config First
source "${CLAUDE_PLUGIN_ROOT}/hooks/lib/config.sh"
APEX_SRC="$(sf_config_get '.paths.apexSource' "$ENV")"
LWC_SRC="$(sf_config_get '.paths.lwcSource' "$ENV")"Input
$ARGUMENTS:
- (empty) — build the full graph
apex— Apex call graph onlylwc— LWC import graph only<symbol>— focused subgraph: predecessors and successors of<symbol>(e.g.,OrderServiceoracmeOrderForm)--depth <n>— when focused, how far to walk (default 2)--out <path>— output file (defaultdocs/diagrams/deps.md)--ci— emit JSON edge list
Steps
Apex call graph
For each .cls and .trigger:
- Capture the class name and parent (extends) and interfaces
- For each method/property body, identify outgoing references:
<OtherClassName>\.<member>— call into another classnew <OtherClassName>(— instantiation\bextends\s+<OtherClass>— inheritance\bimplements\s+<Interface>— implementation
- Build edges
<thisClass> -> <otherClass>(deduped per class pair)
LWC import graph
For each LWC bundle:
- From the JS file, parse
import X from 'c/<lwcName>'— edge<thisLwc> -> <otherLwc> - From the HTML, parse
<c-<kebab-case>>— edge<thisLwc> -> <otherLwc>(same as JS imports usually) - From the JS, parse
import X from '@salesforce/apex/<Class>.<method>'— edge<thisLwc> -> <Class>(cross into Apex)
Focused subgraph
If a <symbol> is provided:
- Find the node in the graph
- Walk predecessors (up): callers of
<symbol> - Walk successors (down): things
<symbol>calls - Both bounded by
--depth
Output
Default Markdown (full graph):
# Dependency Graph: <project.name>
Generated: 2026-04-28T15:30:00Z (`/argo:dependency-graph`)
Apex classes: 47 | LWC bundles: 18 | Cross-edges: 42
## Apex call graph
```mermaid
graph LR
OrderController --> OrderService
OrderService --> OrderApiClient
OrderService --> Logger
OrderApiClient --> Logger
...LWC import graph (with Apex calls)
graph LR
acmeOrderForm --> acmeFormButton
acmeOrderForm --> OrderController
acmeOrderList --> OrderController
acmeOrderList --> acmeOrderRow
...Highly-connected nodes (most callers)
| Node | Type | Caller count |
| Logger | Apex | 22 |
| OrderService | Apex | 8 |
| acmeFormButton | LWC | 5 |
| ... |
CI mode JSON edge list:
```json
{
"nodes": [
{"id": "OrderController", "type": "ApexClass", "file": "..."},
{"id": "acmeOrderForm", "type": "LightningComponentBundle", "file": "..."}
],
"edges": [
{"from": "acmeOrderForm", "to": "OrderController", "kind": "lwc-imports-apex"},
{"from": "OrderController", "to": "OrderService", "kind": "apex-calls-apex"}
]
}Exit codes
- 0 — graph emitted
- 2 — config error
Rules
- Approximate, not perfect. Without a real AST, some indirect references (reflection, dynamic SOQL) are missed. Flag dynamic Apex sites in the JSON output with a
dynamic: trueflag - Don't include test classes by default. Add
--include-testsif you want them - Idempotent. Same source → same graph. Sort edges deterministically
- Cap focused-subgraph size. Above 50 nodes the Mermaid graph is illegible; truncate with a note
Consumers
@architectand@data-architectuse focused subgraphs to reason about refactor blast radius/argo:dead-codeshares the graph-building logic to find zero-incoming-edge nodes/argo:field-impactuses LWC-to-Apex edges to find which LWCs depend on a controller that touches a given field
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

