How legendaryabhi/understand-anything works
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: graph-builder.ts Scan & Graph · index.ts Orchestration · App.tsx Dashboard App · package.json Workspace
Components 22
Monorepo
Workspace, manifests, install scripts, CI, docs, and tests
- Workspace · Root package/workspace and shared repo-level setup
package.json - Plugin Manifests · Discoverability files for supported AI coding environments
.claude-plugin/plugin.json - Install Scripts · Cross-platform installation and symlink setup
install.sh - CI & Docs · Automation, specs, plans, and contribution guidance
.github/workflows/ci.yml - Automation · CI, deployment, and generation automation for repo outputs
.github/workflows/deploy-homepage.yml
Plugin
Multi-platform plugin package and skill entrypoints
- Plugin Package · Main plugin entrypoint and skill bundle
understand-anything-plugin/package.json - Skill Entry · User-facing command surface such as understand and understand-diff
understand-anything-plugin/skills/understand/SKILL.md - Orchestration · Routes intent into context, diff, explain, onboard, and chat flows
understand-anything-plugin/src/index.ts - Context Builder · Builds graph-aware context and retrieval inputs
understand-anything-plugin/src/context-builder.ts - Diff Analyzer · 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 · Deterministic scanning, graph building, persistence, search, and staleness
understand-anything-plugin/packages/core/src/index.ts - Scan & Graph · Project scanning, import/definition extraction, normalization, and graph assembly
understand-anything-plugin/packages/core/src/analyzer/graph-builder.ts - Languages · Language configs and tree-sitter-based extractors
understand-anything-plugin/packages/core/src/languages/index.ts - Frameworks · Framework and architecture classification rules
understand-anything-plugin/packages/core/src/languages/framework-registry.ts - Store & Search · Knowledge-graph persistence, search, fingerprints, and staleness
understand-anything-plugin/packages/core/src/persistence/index.ts - LLM Semantics · 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 · Interactive visualization app for generated knowledge graphs
understand-anything-plugin/packages/dashboard/src/App.tsx - Graph Views · Structural, domain, and knowledge-graph rendering paths
understand-anything-plugin/packages/dashboard/src/components/GraphView.tsx - Layout Tools · Edge aggregation, clustering, ELK layout, and worker-based placement
understand-anything-plugin/packages/dashboard/src/utils/layout.ts - UI 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 · Public marketing and demo site for the product
homepage/src/pages/index.astro - Site Sections · Hero, features, install, showcase, and community sections
homepage/src/components/Hero.astro
Connections 24
- 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