# Codebase Q and A

Answers questions about a codebase using its knowledge graph.

- Repository: https://github.com/Egonex-AI/Understand-Anything (89616 stars)
- Category: Engineering
- License: MIT
- Last updated: 2026-10-26
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add Egonex-AI/Understand-Anything --skill understand-chat -g -a claude-code -y`
Codex: `npx skills add Egonex-AI/Understand-Anything --skill understand-chat -g -a codex -y`
Cursor: `npx skills add Egonex-AI/Understand-Anything --skill understand-chat -g -a cursor -y`
Gemini CLI: `npx skills add Egonex-AI/Understand-Anything --skill understand-chat -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add Egonex-AI/Understand-Anything`

## Description

Use when you need to ask questions about a codebase or understand code using a knowledge graph

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# /understand-chat

Answer questions about this codebase using the knowledge graph in the project's data directory (`.ua/knowledge-graph.json`, or the legacy `.understand-anything/knowledge-graph.json` when that directory is present).

## Graph Structure Reference

The knowledge graph JSON has this structure:
- `project`, {name, description, languages, frameworks, analyzedAt, gitCommitHash}
- `nodes[]`, each has {id, type, name, filePath?, summary, tags[], complexity, languageNotes?}
  - Code node types: file, function, class, module, concept
  - Non-code node types: config, document, service, table, endpoint, pipeline, schema, resource
  - Domain/knowledge node types: domain, flow, step, article, entity, topic, claim, source
  - IDs use the node type as prefix, e.g. `file:path`, `function:path:name`, `config:path`, `article:path`
- `edges[]`, each has {source, target, type, direction, weight}
  - Key types: imports, contains, calls, depends_on, configures, documents, deploys, triggers, contains_flow, flow_step, related, cites
- `layers[]`, each has {id, name, description, nodeIds[]}
- `tour[]`, each has {order, title, description, nodeIds[]}

## How to Read Efficiently

1. Use Grep to search within the JSON for relevant entries BEFORE reading the full file
2. Only read sections you need, don't dump the entire graph into context
3. Node names and summaries are the most useful fields for understanding
4. Edges tell you how components connect, follow imports and calls for dependency chains

## Instructions

1. **Resolve the data directory `$UA_DIR`.** Run `UA_DIR=$([ -d .understand-anything ] && echo .understand-anything || echo .ua)`, this is the legacy `.understand-anything/` when it already exists, otherwise the new `.ua/`. Check that `$UA_DIR/knowledge-graph.json` exists in the current project root. If not, tell the user to run `/understand` first.

The rest: https://github.com/Egonex-AI/Understand-Anything/blob/HEAD/understand-anything-plugin/skills/understand-chat/SKILL.md
