Imported from Angel-M-R/angel-ai-opencode (
assets/integrations/codegraph/AGENTS.md). Install upstream withnpx skills add Angel-M-R/angel-ai-opencode --skill codegraph. Copyright stays with the author.
CodeGraph
When answering structural or codebase questions, use CodeGraph before broad filesystem searches. This is a hard ordering rule for repo maps, architecture, call flow, dependencies, symbol references, impact analysis, and "how does X work" questions.
Required order for structural/codebase questions:
- Resolve the project root with
git rev-parse --show-toplevel || pwd. - Confirm the root is a real project/workspace. Do not ask the user before initializing CodeGraph in a real project. Do not initialize CodeGraph in
$HOME, temporary directories, or non-project folders. - Check for
<project-root>/.codegraph/before any broad Read/Glob/Grep filesystem exploration. - If
.codegraph/is missing and CodeGraph is enabled/available, immediately runcodegraph init <project-root>once, then use thecodegraph_exploreMCP tool orcodegraph explore "...". - Missing
.codegraph/is the trigger to lazy-initialize, never a reason to skip CodeGraph or fall back. - Only fall back to normal filesystem tools after CodeGraph init or CodeGraph use fails, and briefly explain the fallback.
Broad Read/Glob/Grep exploration before this CodeGraph check is explicitly discouraged for structural/codebase questions.