# legendaryabhi/understand-anything architecture

> Architecture diagram of the GitHub repository legendaryabhi/understand-anything, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-05-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/legendaryabhi/understand-anything
- Repository: https://github.com/legendaryabhi/understand-anything

## Overview

1. **Repository shape**
   This is a monorepo centered on the `understand-anything-plugin` product, with two main user-facing surfaces: an analysis/plugin runtime that builds knowledge graphs, and a separate `homepage` site that markets and demonstrates the dashboard.

2. **Primary product boundary: plugin + skills**
   The `understand-anything-plugin/` directory contains the actual multi-platform plugin package. Its `plugin.json` files and platform-specific manifests in the root (`.claude-plugin`, `.copilot-plugin`, `.cursor-plugin`) make the same capability discoverable in different AI coding environments. The plugin package is the entry point for commands like `/understand`, `/understand-chat`, `/understand-diff`, `/understand-explain`, `/understand-domain`, and `/understand-knowledge`.

3. **Orchestration layer**
   `understand-anything-plugin/src/` is the command/orchestration layer. It contains builders such as `context-builder`, `diff-analyzer`, `explain-builder`, `onboard-builder`, and `understand-chat`, which assemble prompts, fetch graph context, and route work to the right analysis mode. This layer is what binds user intent in the host AI tool to the underlying analysis engine and graph outputs.

4. **Core analysis engine**
   `understand-anything-plugin/packages/core/` is the deterministic analysis foundation. It handles project scanning, graph building, normalization, persistence, search, staleness detection, fingerprinting, ignore rules, and change classification. This package is the main “facts” layer: it turns source files into structured data that can be reused by both the dashboard and the command workflows.

5. **Language and framework detection**
   The core package has a substantial registry of language configs and framework detectors under `src/languages/` and `src/plugins/`. Tree-sitter-based parsers/extractors are used for many languages and config formats, while framework registries help classify projects into architectural layers and patterns. This is important architecturally because it separates generic parsing from language-specific interpretation.

6. **Graph production pipeline**
   The README’s described flow is reflected in the code layout: project scanning discovers files and languages, batch processing extracts imports/definitions/call sites, and semantic passes add summaries, layer labels, tours, and domain concepts. The output is a JSON knowledge graph written under `.understand-anything/`, with incremental updates driven by fingerprints and staleness so unchanged files are not reprocessed.

7. **LLM vs deterministic split**
   A key architectural boundary is deterministic structure vs semantic interpretation. Tree-sitter and related parsers provide reproducible structural facts, while LLM-based analyzers produce plain-English summaries, business-domain mapping, guided tours, and article/knowledge-base relationships. That split is central to the repo’s design: the graph’s topology is stable, while the meaning layered on top can be generated in different languages and for different audiences.

8. **Dashboard application**
   `understand-anything-plugin/packages/dashboard/` is a separate React/Vite app that renders the knowledge graph interactively. It includes graph views, node renderers, search/filtering, layer clustering, domain visualization, diff toggles, mobile layouts, theming, localization, and a layout worker. Its main input is the generated graph JSON, not the source code itself.

9. **Specialized dashboard data flows**
   The dashboard supports multiple visualization modes: structural graph, domain graph, and knowledge-graph/article views. Utilities like layout, edge aggregation, louvain clustering, and ELK-based layouting reshape the graph for display, while theme and i18n contexts adapt the UI to user persona and language. This is a presentation layer over the persisted graph, not a source-of-truth store.

10. **Knowledge-base and domain workflows**
   There are separate skill paths for `/understand-domain` and `/understand-knowledge`. The first extracts business domains, flows, and steps; the second parses Karpathy-style wiki knowledge bases, merging deterministic link/category extraction with LLM-derived entities and claims. These are parallel pipelines that share the graph-oriented output model but target different source types.

11. **Automation and deployment**
   GitHub Actions in `.github/workflows/` cover CI and homepage deployment. The root `install.sh` and `install.ps1` scripts create the cross-platform installation layer, symlinking the plugin into supported tools. That makes the repo both a source tree and a distribution mechanism.

12. **Docs, specs, and test boundaries**
   `docs/superpowers/` contains design/spec/implementation history for major subsystem changes, which is useful for understanding intended architecture. Tests are split between root-level integration fixtures and package-level unit tests, with the core package heavily tested around graph normalization, plugin discovery, language handling, search, and persistence. There is also a dedicated script for generating large graphs, indicating the system is designed to scale beyond toy projects.

Main entry points: [`understand-anything-plugin/packages/core/src/analyzer/graph-builder.ts`](https://github.com/legendaryabhi/understand-anything/blob/main/understand-anything-plugin/packages/core/src/analyzer/graph-builder.ts) (Scan & Graph), [`understand-anything-plugin/src/index.ts`](https://github.com/legendaryabhi/understand-anything/blob/main/understand-anything-plugin/src/index.ts) (Orchestration), [`understand-anything-plugin/packages/dashboard/src/App.tsx`](https://github.com/legendaryabhi/understand-anything/blob/main/understand-anything-plugin/packages/dashboard/src/App.tsx) (Dashboard App), [`package.json`](https://github.com/legendaryabhi/understand-anything/blob/main/package.json) (Workspace)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_root["Monorepo"]
  node_root_pkg["Workspace<br/>monorepo config<br/>[package.json]"]
  node_platform_manifests["Plugin Manifests<br/>platform manifests<br/>[plugin.json]"]
  node_installers["Install Scripts<br/>distribution scripts<br/>[install.sh]"]
  node_ci_docs["CI & Docs<br/>repo governance<br/>[ci.yml]"]
  node_automation["Automation<br/>workflows"]
end

subgraph group_plugin["Plugin"]
  node_plugin_pkg["Plugin Package<br/>multi-skill plugin<br/>[package.json]"]
  node_skill_entry["Skill Entry<br/>skill commands<br/>[SKILL.md]"]
  node_orchestration["Orchestration<br/>command builders<br/>[index.ts]"]
  node_context_builder["Context Builder<br/>prompt assembly<br/>[context-builder.ts]"]
  node_diff_builder["Diff Analyzer<br/>change analysis<br/>[diff-analyzer.ts]"]
end

subgraph group_core["Core"]
  node_core_pkg["Core Engine<br/>analysis foundation<br/>[index.ts]"]
  node_scan_graph["Scan & Graph<br/>pipeline<br/>[graph-builder.ts]"]
  node_lang_registry["Languages<br/>parsers registry<br/>[index.ts]"]
  node_framework_registry["Frameworks<br/>framework detection"]
  node_persistence_search["Store & Search<br/>graph persistence<br/>[index.ts]"]
  node_llm_semantics["LLM Semantics<br/>semantic enrichment<br/>[llm-analyzer.ts]"]
end

subgraph group_dashboard["Dashboard"]
  node_dashboard_pkg["Dashboard App<br/>react viewer<br/>[App.tsx]"]
  node_graph_views["Graph Views<br/>visualization modes<br/>[GraphView.tsx]"]
  node_layout_utils["Layout Tools<br/>graph layout<br/>[layout.ts]"]
  node_ui_system["UI System<br/>presentation system<br/>[SearchBar.tsx]"]
end

subgraph group_homepage["Homepage"]
  node_homepage_app["Homepage Site<br/>astro marketing site<br/>[index.astro]"]
  node_homepage_parts["Site Sections<br/>content components<br/>[Hero.astro]"]
end

node_root_pkg -->|"workspace includes"| node_plugin_pkg
node_root_pkg -->|"workspace includes"| node_dashboard_pkg
node_root_pkg -->|"workspace includes"| node_homepage_app
node_platform_manifests -->|"discoverable entry"| node_plugin_pkg
node_installers -->|"installs"| node_platform_manifests
node_ci_docs -.->|"documents"| node_automation
node_plugin_pkg -->|"exposes skills"| node_skill_entry
node_skill_entry -->|"dispatches to"| node_orchestration
node_orchestration -->|"builds context"| node_context_builder
node_orchestration -->|"analyzes changes"| node_diff_builder
node_orchestration -->|"uses engine"| node_core_pkg
node_core_pkg -->|"produces graph"| node_scan_graph
node_scan_graph -->|"parses source"| node_lang_registry
node_scan_graph -->|"classifies stack"| node_framework_registry
node_scan_graph -->|"stores state"| node_persistence_search
node_scan_graph -->|"enriches meaning"| node_llm_semantics
node_llm_semantics -->|"writes output"| node_persistence_search
node_persistence_search -->|"feeds UI"| node_dashboard_pkg
node_dashboard_pkg -->|"renders"| node_graph_views
node_graph_views -->|"reshapes graph"| node_layout_utils
node_graph_views -->|"uses controls"| node_ui_system
node_homepage_app -->|"composes"| node_homepage_parts
node_automation -->|"deploys"| node_homepage_app
node_automation -.->|"benchmarks"| node_dashboard_pkg

click node_root_pkg "https://github.com/legendaryabhi/understand-anything/blob/main/package.json"
click node_platform_manifests "https://github.com/legendaryabhi/understand-anything/blob/main/.claude-plugin/plugin.json"
click node_installers "https://github.com/legendaryabhi/understand-anything/blob/main/install.sh"
click node_ci_docs "https://github.com/legendaryabhi/understand-anything/blob/main/.github/workflows/ci.yml"
click node_plugin_pkg "https://github.com/legendaryabhi/understand-anything/blob/main/understand-anything-plugin/package.json"
click node_skill_entry "https://github.com/legendaryabhi/understand-anything/blob/main/understand-anything-plugin/skills/understand/SKILL.md"
click node_orchestration "https://github.com/legendaryabhi/understand-anything/blob/main/understand-anything-plugin/src/index.ts"
click node_context_builder "https://github.com/legendaryabhi/understand-anything/blob/main/understand-anything-plugin/src/context-builder.ts"
click node_diff_builder "https://github.com/legendaryabhi/understand-anything/blob/main/understand-anything-plugin/src/diff-analyzer.ts"
click node_core_pkg "https://github.com/legendaryabhi/understand-anything/blob/main/understand-anything-plugin/packages/core/src/index.ts"
click node_scan_graph "https://github.com/legendaryabhi/understand-anything/blob/main/understand-anything-plugin/packages/core/src/analyzer/graph-builder.ts"
click node_lang_registry "https://github.com/legendaryabhi/understand-anything/blob/main/understand-anything-plugin/packages/core/src/languages/index.ts"
click node_framework_registry "https://github.com/legendaryabhi/understand-anything/blob/main/understand-anything-plugin/packages/core/src/languages/framework-registry.ts"
click node_persistence_search "https://github.com/legendaryabhi/understand-anything/blob/main/understand-anything-plugin/packages/core/src/persistence/index.ts"
click node_llm_semantics "https://github.com/legendaryabhi/understand-anything/blob/main/understand-anything-plugin/packages/core/src/analyzer/llm-analyzer.ts"
click node_dashboard_pkg "https://github.com/legendaryabhi/understand-anything/blob/main/understand-anything-plugin/packages/dashboard/src/App.tsx"
click node_graph_views "https://github.com/legendaryabhi/understand-anything/blob/main/understand-anything-plugin/packages/dashboard/src/components/GraphView.tsx"
click node_layout_utils "https://github.com/legendaryabhi/understand-anything/blob/main/understand-anything-plugin/packages/dashboard/src/utils/layout.ts"
click node_ui_system "https://github.com/legendaryabhi/understand-anything/blob/main/understand-anything-plugin/packages/dashboard/src/components/SearchBar.tsx"
click node_homepage_app "https://github.com/legendaryabhi/understand-anything/blob/main/homepage/src/pages/index.astro"
click node_homepage_parts "https://github.com/legendaryabhi/understand-anything/blob/main/homepage/src/components/Hero.astro"
click node_automation "https://github.com/legendaryabhi/understand-anything/blob/main/.github/workflows/deploy-homepage.yml"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_root_pkg,node_platform_manifests,node_installers,node_ci_docs,node_automation toneBlue
class node_plugin_pkg,node_skill_entry,node_orchestration,node_context_builder,node_diff_builder toneAmber
class node_core_pkg,node_scan_graph,node_lang_registry,node_framework_registry,node_persistence_search,node_llm_semantics toneMint
class node_dashboard_pkg,node_graph_views,node_layout_utils,node_ui_system toneRose
class node_homepage_app,node_homepage_parts toneIndigo
```

## Components

### Monorepo

Workspace, manifests, install scripts, CI, docs, and tests

- [Workspace](https://github.com/legendaryabhi/understand-anything/blob/main/package.json): monorepo config · Root package/workspace and shared repo-level setup · `package.json`
- [Plugin Manifests](https://github.com/legendaryabhi/understand-anything/blob/main/.claude-plugin/plugin.json): platform manifests · Discoverability files for supported AI coding environments · `.claude-plugin/plugin.json`
- [Install Scripts](https://github.com/legendaryabhi/understand-anything/blob/main/install.sh): distribution scripts · Cross-platform installation and symlink setup · `install.sh`
- [CI & Docs](https://github.com/legendaryabhi/understand-anything/blob/main/.github/workflows/ci.yml): repo governance · Automation, specs, plans, and contribution guidance · `.github/workflows/ci.yml`
- [Automation](https://github.com/legendaryabhi/understand-anything/blob/main/.github/workflows/deploy-homepage.yml): workflows · CI, deployment, and generation automation for repo outputs · `.github/workflows/deploy-homepage.yml`

### Plugin

Multi-platform plugin package and skill entrypoints

- [Plugin Package](https://github.com/legendaryabhi/understand-anything/blob/main/understand-anything-plugin/package.json): multi-skill plugin · Main plugin entrypoint and skill bundle · `understand-anything-plugin/package.json`
- [Skill Entry](https://github.com/legendaryabhi/understand-anything/blob/main/understand-anything-plugin/skills/understand/SKILL.md): skill commands · User-facing command surface such as understand and understand-diff · `understand-anything-plugin/skills/understand/SKILL.md`
- [Orchestration](https://github.com/legendaryabhi/understand-anything/blob/main/understand-anything-plugin/src/index.ts): command builders · Routes intent into context, diff, explain, onboard, and chat flows · `understand-anything-plugin/src/index.ts`
- [Context Builder](https://github.com/legendaryabhi/understand-anything/blob/main/understand-anything-plugin/src/context-builder.ts): prompt assembly · Builds graph-aware context and retrieval inputs · `understand-anything-plugin/src/context-builder.ts`
- [Diff Analyzer](https://github.com/legendaryabhi/understand-anything/blob/main/understand-anything-plugin/src/diff-analyzer.ts): change analysis · Compares worktree or project changes for understand-diff · `understand-anything-plugin/src/diff-analyzer.ts`

### Core

Deterministic analysis engine and language/framework registries

- [Core Engine](https://github.com/legendaryabhi/understand-anything/blob/main/understand-anything-plugin/packages/core/src/index.ts): analysis foundation · Deterministic scanning, graph building, persistence, search, and staleness · `understand-anything-plugin/packages/core/src/index.ts`
- [Scan & Graph](https://github.com/legendaryabhi/understand-anything/blob/main/understand-anything-plugin/packages/core/src/analyzer/graph-builder.ts): pipeline · Project scanning, import/definition extraction, normalization, and graph assembly · `understand-anything-plugin/packages/core/src/analyzer/graph-builder.ts`
- [Languages](https://github.com/legendaryabhi/understand-anything/blob/main/understand-anything-plugin/packages/core/src/languages/index.ts): parsers registry · Language configs and tree-sitter-based extractors · `understand-anything-plugin/packages/core/src/languages/index.ts`
- [Frameworks](https://github.com/legendaryabhi/understand-anything/blob/main/understand-anything-plugin/packages/core/src/languages/framework-registry.ts): framework detection · Framework and architecture classification rules · `understand-anything-plugin/packages/core/src/languages/framework-registry.ts`
- [Store & Search](https://github.com/legendaryabhi/understand-anything/blob/main/understand-anything-plugin/packages/core/src/persistence/index.ts): graph persistence · Knowledge-graph persistence, search, fingerprints, and staleness · `understand-anything-plugin/packages/core/src/persistence/index.ts`
- [LLM Semantics](https://github.com/legendaryabhi/understand-anything/blob/main/understand-anything-plugin/packages/core/src/analyzer/llm-analyzer.ts): semantic enrichment · Summaries, tours, language lessons, and domain interpretation · `understand-anything-plugin/packages/core/src/analyzer/llm-analyzer.ts`

### Dashboard

Interactive graph viewer and presentation layer

- [Dashboard App](https://github.com/legendaryabhi/understand-anything/blob/main/understand-anything-plugin/packages/dashboard/src/App.tsx): react viewer · Interactive visualization app for generated knowledge graphs · `understand-anything-plugin/packages/dashboard/src/App.tsx`
- [Graph Views](https://github.com/legendaryabhi/understand-anything/blob/main/understand-anything-plugin/packages/dashboard/src/components/GraphView.tsx): visualization modes · Structural, domain, and knowledge-graph rendering paths · `understand-anything-plugin/packages/dashboard/src/components/GraphView.tsx`
- [Layout Tools](https://github.com/legendaryabhi/understand-anything/blob/main/understand-anything-plugin/packages/dashboard/src/utils/layout.ts): graph layout · Edge aggregation, clustering, ELK layout, and worker-based placement · `understand-anything-plugin/packages/dashboard/src/utils/layout.ts`
- [UI System](https://github.com/legendaryabhi/understand-anything/blob/main/understand-anything-plugin/packages/dashboard/src/components/SearchBar.tsx): presentation system · Search, filters, node panels, themes, localization, and mobile UI · `understand-anything-plugin/packages/dashboard/src/components/SearchBar.tsx`

### Homepage

Marketing site for the product

- [Homepage Site](https://github.com/legendaryabhi/understand-anything/blob/main/homepage/src/pages/index.astro): astro marketing site · Public marketing and demo site for the product · `homepage/src/pages/index.astro`
- [Site Sections](https://github.com/legendaryabhi/understand-anything/blob/main/homepage/src/components/Hero.astro): content components · Hero, features, install, showcase, and community sections · `homepage/src/components/Hero.astro`

## Connections

- Workspace → Plugin Package: workspace includes · The monorepo hosts the plugin package and shared workspace config
- Workspace → Dashboard App: workspace includes · The monorepo hosts the dashboard package
- Workspace → Homepage Site: workspace includes · The monorepo hosts the homepage site
- Plugin Manifests → Plugin Package: discoverable entry · Platform manifests point to the same plugin capability
- Install Scripts → Plugin Manifests: installs · Install scripts wire the plugin into supported tools
- CI & Docs → Automation: documents · Repo docs and workflows describe governance and automation
- Plugin Package → Skill Entry: exposes skills · The package publishes user-facing skill commands
- Skill Entry → Orchestration: dispatches to · Skill invocations are handled by the orchestration layer
- Orchestration → Context Builder: builds context · Common command flow prepares graph and repository context
- Orchestration → Diff Analyzer: analyzes changes · Diff-oriented commands route through change analysis
- Orchestration → Core Engine: uses engine · Command builders rely on the deterministic core analysis package
- Core Engine → Scan & Graph: produces graph · Core scanning and graph building create the facts layer
- Scan & Graph → Languages: parses source · Language configs and extractors provide structural facts
- Scan & Graph → Frameworks: classifies stack · Framework detection adds architectural interpretation
- Scan & Graph → Store & Search: stores state · Results are persisted and reused incrementally
- Scan & Graph → LLM Semantics: enriches meaning · Semantic passes add summaries, tours, and domain concepts
- LLM Semantics → Store & Search: writes output · Semantic enrichments are saved into the graph store
- Store & Search → Dashboard App: feeds UI · Dashboard consumes persisted knowledge-graph JSON
- Dashboard App → Graph Views: renders · The app hosts multiple graph visualization modes
- Graph Views → Layout Tools: reshapes graph · Visualization modes rely on layout and clustering utilities
- Graph Views → UI System: uses controls · Search, filters, themes, and node panels support exploration
- Homepage Site → Site Sections: composes · The homepage is assembled from reusable content sections
- Automation → Homepage Site: deploys · Deployment workflow publishes the homepage site
- Automation → Dashboard App: benchmarks · Scripts and CI support dashboard validation and packaging
