# Business Domain Map

Extracts business domain knowledge from code into an interactive domain flow graph.

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

## Install

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

## Description

Extract business domain knowledge from a codebase and generate an interactive domain flow graph. Works standalone (lightweight scan) or derives from an existing /understand knowledge graph.

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

# /understand-domain

Extracts business domain knowledge, domains, business flows, and process steps, from a codebase and produces an interactive horizontal flow graph in the dashboard.

## How It Works

- If a knowledge graph already exists (`.ua/knowledge-graph.json`, or the legacy `.understand-anything/knowledge-graph.json` when that directory is present), derives domain knowledge from it (cheap, no file scanning)
- If no knowledge graph exists, performs a lightweight scan: file tree + entry point detection + sampled files
- Use `--full` flag to force a fresh scan even if a knowledge graph exists

## Instructions

### Phase 0: Resolve `PROJECT_ROOT`

Set `PROJECT_ROOT` to the current working directory.

**Worktree redirect.** If `PROJECT_ROOT` is inside a git worktree (not the main checkout), redirect output to the main repository root. Worktrees managed by Claude Code are ephemeral, the data directory (`.ua/`, or legacy `.understand-anything/`) written there is destroyed when the session ends, taking the domain graph with it (issue #133). Detect a worktree by comparing `git rev-parse --git-dir` against `git rev-parse --git-common-dir`; in a normal checkout or submodule they resolve to the same path, in a worktree they differ and the parent of `--git-common-dir` is the main repo root.

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