Project Knowledge Graph
Use this skill as the unified entry point for project knowledge graphs. It decides when to use CodeGraph, Understand-Anything, or both, then turns graph output into a compact context handoff for Codex and subagents.
Decision
- Use CodeGraph first when the task needs code-level semantic search, symbols, callers, impact analysis, implementation entry points, or low-token targeted context.
- Use Understand-Anything first when the task needs visual architecture maps, project onboarding, chat/explain/diff workflows, durable project maps, or broad module relationship understanding.
- Use both for Standard/Strict work, unfamiliar repositories, cross-module changes, architecture review, performance/security review, or multi-agent planning.
- Fall back to
rg --files, rg, and direct file reads when either graph tool is unavailable. Record the failure and do not pretend graph context exists.
Workflow
- Confirm the project root with
pwd / Get-Location.
- Run
scripts/probe_project_knowledge_graph.py --root <project-root> from this skill.
- Check existing artifacts:
- CodeGraph:
.codegraph/
- Understand-Anything:
.understand-anything/knowledge-graph.json
- Choose the tool path:
- CodeGraph-only for narrow implementation or impact questions.
- Understand-Anything-only for project map, dashboard, onboarding, or chat-style exploration.
- Hybrid for multi-agent work or high-risk changes.
- Query graph tools before broad repository scans, then open exact files directly before editing.
- Produce one concise handoff summary for all agents.
- Refresh or mark graph context stale after major edits, refactors, or dependency layout changes.
Quick Commands
# From this skill folder, or replace <skill-dir> with the installed skill path.
python <skill-dir>\scripts\probe_project_knowledge_graph.py --root .
# CodeGraph when installed
codegraph status
codegraph context "<task or feature>"
codegraph search "<symbol, class, route, or table>"
codegraph impact "<file or symbol>"
# Understand-Anything in supported assistants
/understand
/understand-dashboard
/understand-chat
/understand-explain <file-or-symbol>
/understand-diff
Multi-Agent Handoff
Run one shared graph orientation before dispatching subagents. Pass this template:
Project knowledge graph context:
- Project root:
- Tool path: CodeGraph / Understand-Anything / Hybrid / Fallback
- Graph status:
- Relevant modules:
- Entry points:
- Candidate files:
- Symbol/caller/impact findings:
- Visual/chat/dashboard findings:
- Exclusions/blind spots:
- Staleness:
- Required verification:
Role usage:
- Planner: convert graph findings into module boundaries, dependencies, task order, and unknowns.
- Developer: open candidate files directly and implement from the graph-derived path.
- Tester: derive smoke/regression paths from entry points, data flows, and impacted files.
- Reviewer: compare the diff against semantic impact and dependency paths.
- Release writer: record graph freshness, generated artifacts, fallback analysis, and validation evidence.
Matrix Cloud Pattern
For PHP / CodeIgniter projects, orient graph queries around:
controller -> model -> view -> helper/library -> queue/cron -> SQL/config -> validation path
Prioritize:
application/controllers/
application/models/
application/views/
application/helpers/
application/libraries/
application/queue/
theme/
scripts/
- selected
sql/ files when database behavior is involved
Exclude dependency, cache, log, generated, private dump, and graph output directories unless explicitly required.
Context Cache
When a repository benefits from durable context, create one small project-local summary:
# Project Knowledge Graph Map
- Generated:
- Tool path:
- Graph artifacts:
- Exclusions:
- Main modules:
- Entry points:
- Cross-cutting services:
- Risk areas:
- Common validation commands:
- Refresh rule:
Prefer .codex/memories/, .specstory/history/, or the repository's documented agent notes. Do not paste full graph databases or JSON dumps into prompts.
Guardrails
- Graphs guide orientation; direct file reads remain mandatory before edits.
- Do not index secrets,
.git/, logs, caches, dependency folders, private dumps, or production-only data unless explicitly required.
- Do not commit
.codegraph/ or .understand-anything/ artifacts unless the team intentionally tracks them.
- Keep graph summaries factual, dated, and scoped to the task.
- If graph tools disagree, prefer direct code facts and note the discrepancy.
References
- Read
references/tool-comparison.md to choose between CodeGraph, Understand-Anything, or hybrid mode.
- Read
references/setup-notes.md when installing, configuring, or troubleshooting either tool.
- Run
scripts/probe_project_knowledge_graph.py when entering a new repository or preparing multi-agent handoff.
1---2name: project-knowledge-graph3description: Orchestrate CodeGraph and Understand-Anything for project knowledge graphs before coding. Use when entering a new repository, onboarding Codex or subagents, choosing between semantic code search and visual/chat project maps, reducing repeated repository scans, preparing multi-agent context, analyzing impact, or reusing durable project graph summaries.4---56# Project Knowledge Graph78Use this skill as the unified entry point for project knowledge graphs. It decides when to use CodeGraph, Understand-Anything, or both, then turns graph output into a compact context handoff for Codex and subagents.910## Decision1112- Use **CodeGraph first** when the task needs code-level semantic search, symbols, callers, impact analysis, implementation entry points, or low-token targeted context.13- Use **Understand-Anything first** when the task needs visual architecture maps, project onboarding, chat/explain/diff workflows, durable project maps, or broad module relationship understanding.14- Use **both** for Standard/Strict work, unfamiliar repositories, cross-module changes, architecture review, performance/security review, or multi-agent planning.15- Fall back to `rg --files`, `rg`, and direct file reads when either graph tool is unavailable. Record the failure and do not pretend graph context exists.1617## Workflow18191. Confirm the project root with `pwd` / `Get-Location`.202. Run `scripts/probe_project_knowledge_graph.py --root <project-root>` from this skill.213. Check existing artifacts:22 - CodeGraph: `.codegraph/`23 - Understand-Anything: `.understand-anything/knowledge-graph.json`244. Choose the tool path:25 - CodeGraph-only for narrow implementation or impact questions.26 - Understand-Anything-only for project map, dashboard, onboarding, or chat-style exploration.27 - Hybrid for multi-agent work or high-risk changes.285. Query graph tools before broad repository scans, then open exact files directly before editing.296. Produce one concise handoff summary for all agents.307. Refresh or mark graph context stale after major edits, refactors, or dependency layout changes.3132## Quick Commands3334```powershell35# From this skill folder, or replace <skill-dir> with the installed skill path.36python <skill-dir>\scripts\probe_project_knowledge_graph.py --root .3738# CodeGraph when installed39codegraph status40codegraph context "<task or feature>"41codegraph search "<symbol, class, route, or table>"42codegraph impact "<file or symbol>"4344# Understand-Anything in supported assistants45/understand46/understand-dashboard47/understand-chat48/understand-explain <file-or-symbol>49/understand-diff50```5152## Multi-Agent Handoff5354Run one shared graph orientation before dispatching subagents. Pass this template:5556```markdown57Project knowledge graph context:58- Project root:59- Tool path: CodeGraph / Understand-Anything / Hybrid / Fallback60- Graph status:61- Relevant modules:62- Entry points:63- Candidate files:64- Symbol/caller/impact findings:65- Visual/chat/dashboard findings:66- Exclusions/blind spots:67- Staleness:68- Required verification:69```7071Role usage:7273- Planner: convert graph findings into module boundaries, dependencies, task order, and unknowns.74- Developer: open candidate files directly and implement from the graph-derived path.75- Tester: derive smoke/regression paths from entry points, data flows, and impacted files.76- Reviewer: compare the diff against semantic impact and dependency paths.77- Release writer: record graph freshness, generated artifacts, fallback analysis, and validation evidence.7879## Matrix Cloud Pattern8081For PHP / CodeIgniter projects, orient graph queries around:8283```text84controller -> model -> view -> helper/library -> queue/cron -> SQL/config -> validation path85```8687Prioritize:8889- `application/controllers/`90- `application/models/`91- `application/views/`92- `application/helpers/`93- `application/libraries/`94- `application/queue/`95- `theme/`96- `scripts/`97- selected `sql/` files when database behavior is involved9899Exclude dependency, cache, log, generated, private dump, and graph output directories unless explicitly required.100101## Context Cache102103When a repository benefits from durable context, create one small project-local summary:104105```markdown106# Project Knowledge Graph Map107108- Generated:109- Tool path:110- Graph artifacts:111- Exclusions:112- Main modules:113- Entry points:114- Cross-cutting services:115- Risk areas:116- Common validation commands:117- Refresh rule:118```119120Prefer `.codex/memories/`, `.specstory/history/`, or the repository's documented agent notes. Do not paste full graph databases or JSON dumps into prompts.121122## Guardrails123124- Graphs guide orientation; direct file reads remain mandatory before edits.125- Do not index secrets, `.git/`, logs, caches, dependency folders, private dumps, or production-only data unless explicitly required.126- Do not commit `.codegraph/` or `.understand-anything/` artifacts unless the team intentionally tracks them.127- Keep graph summaries factual, dated, and scoped to the task.128- If graph tools disagree, prefer direct code facts and note the discrepancy.129130## References131132- Read `references/tool-comparison.md` to choose between CodeGraph, Understand-Anything, or hybrid mode.133- Read `references/setup-notes.md` when installing, configuring, or troubleshooting either tool.134- Run `scripts/probe_project_knowledge_graph.py` when entering a new repository or preparing multi-agent handoff.