How lum1104/understand-anything works
1. What this repository is
- This is a monorepo for the Understand Anything plugin ecosystem.
- The main product is a local AI-assistant plugin that analyzes a target repo or knowledge base, produces a knowledge graph JSON artifact, and exposes that graph through commands and a dashboard.
- The repo also contains a separate marketing homepage and platform-specific installation descriptors for several AI coding environments.
2. Top-level architecture
- The system is split into three major runtime surfaces:
- Plugin/runtime package: understand-anything-plugin
- Interactive dashboard: understand-anything-plugin/packages/dashboard
- Homepage site: homepage
- Shared repo-level content includes docs/specs, installation manifests, and CI workflows.
3. Core analysis engine
- understand-anything-plugin/packages/core is the main analysis library.
- It handles:
- project/file discovery
- language and framework detection
- parsing and extraction of symbols
- graph construction and normalization
- persistence of graph state
- search and staleness tracking
- This package is heavily test-driven and is the most important boundary for the graph-generation pipeline.
4. Graph-generation pipeline
- The readme describes a multi-agent pipeline coordinated by the plugin commands.
- The flow is roughly:
- scan project
- analyze files in parallel
- build structural graph nodes/edges
- detect architecture layers
- generate guided tours
- validate graph integrity
- The output is persisted as .understand-anything/knowledge-graph.json, which becomes the central data artifact for downstream features.
5. Agent orchestration layer
- understand-anything-plugin/src contains command-specific builders and orchestrators:
- understand-chat
- diff-analyzer
- explain-builder
- onboard-builder
- context-builder
- These modules assemble context and route tasks to the core analysis layer.
- This is the boundary between the host AI platform’s command system and the repo’s analysis/graph logic.
6. Specialized analyzers and prompt assets
- understand-anything-plugin/agents and skills/ hold the prompt/agent definitions used for different workflows.
- The named agents map to distinct responsibilities:
- project scanning
- file-level extraction
- architecture analysis
- tour generation
- graph review
- domain extraction
- knowledge-base/article analysis
- The skills directory also includes language/framework-specific guidance and helper scripts for extracting or merging graphs.
7. Language and framework intelligence
- The core package contains a broad language registry and framework registry with configs for many ecosystems: TypeScript, Python, Go, Java, Rust, PHP, C#, etc.
- There are also framework profiles for Django, Express, FastAPI, Flask, Gin, Next.js, Rails, React, Spring, and Vue.
- This subsystem matters because it drives symbol extraction, layer inference, and explanations in a language-aware way rather than using one generic parser.
8. Dashboard subsystem
- packages/dashboard is a separate Vite/React frontend that reads graph data and presents it visually.
- It includes:
- graph views
- domain and knowledge-graph views
- file explorer, search, filters, breadcrumbs
- node details, tooltips, code viewer
- diff toggle and export tools
- persona-aware and theme-aware UI
- The dashboard is effectively a read-only visualization layer over the generated graph artifact.
9. Dashboard data and rendering flow
- The dashboard consumes the graph JSON, then applies:
- filtering and edge aggregation
- layout computation, including a web worker for heavier layout work
- theme selection and node rendering
- It supports multiple graph perspectives:
- structural graph
- domain/business flow graph
- knowledge graph
- This makes the graph artifact the shared contract between analysis and visualization.
10. Knowledge-base mode
- The repo is not limited to source code analysis.
- /understand-knowledge targets a Karpathy-style wiki knowledge base and uses a combination of deterministic parsing and LLM-based relationship extraction.
- In this mode, the graph represents articles, entities, claims, categories, and implicit links rather than code symbols.
11. Local artifact model
- The project is designed around local generation and local consumption of artifacts, not a central backend.
- Important persisted outputs include:
- .understand-anything/knowledge-graph.json
- intermediate scratch data
- diff overlays for change analysis
- The readme explicitly treats the graph as something teams can commit and share, so the graph file is a first-class project artifact.
12. Platform integration boundary
- The repo includes plugin manifests and install instructions for multiple hosts:
- Claude Code
- Codex
- Cursor
- GitHub Copilot / VS Code
- OpenCode
- OpenClaw
- Gemini CLI
- Pi Agent
- These platform folders are integration shims, not the core product logic.
- They mainly exist so the same plugin package can be discovered or installed in different AI environments.
13. Homepage and documentation
- homepage/ is an Astro static site for product marketing and demo hosting.
- It is separate from the plugin runtime and exists to publish the homepage and live demo referenced in the readme.
- The docs/superpowers directory contains design/spec/implementation plans, which are architectural and product documentation rather than runtime code.
14. Operational/tooling boundary
- The repo uses a pnpm workspace and TypeScript across the main packages.
- CI workflows cover validation and homepage deployment.
- There is no obvious long-running server in the repository; the architecture is primarily:
- local analysis engine
- generated graph artifact
- interactive frontend viewer
- platform-specific plugin packaging
Main entry points: src Command layer · core Core engine · dashboard Dashboard app · agents Agents & skills
Components 19
Monorepo
Top-level workspace, docs, platform manifests, and shared tooling.
- Docs & plans · Architecture docs, specs, and implementation plans that describe the product and its evolution.
docs/superpowers - Host manifests · Plugin descriptors and install instructions for Claude, Codex, Cursor, Copilot, Gemini, OpenCode, OpenClaw, Pi, and VS Code.
.claude-plugin - CI & deploy · Workspace-level validation and homepage deployment workflows.
.github/workflows
Plugin runtime
Local analysis plugin, agent orchestration, skills, and core graph pipeline.
- Command layer · Command-specific builders that assemble context and route work into the analysis engine.
understand-anything-plugin/src - Chat flow · Understands chat-oriented requests and routes them through the plugin command surface.
understand-anything-plugin/src/understand-chat.ts - Diff flow · Builds change-analysis context and drives diff-oriented workflows.
understand-anything-plugin/src/diff-analyzer.ts - Explain flow · Prepares explanation-oriented context for repo understanding and guided responses.
understand-anything-plugin/src/explain-builder.ts - Onboard flow · Creates onboarding context for first-run project understanding.
understand-anything-plugin/src/onboard-builder.ts - Context builder · Shared context assembly boundary used by the command layer before analysis begins.
understand-anything-plugin/src/context-builder.ts - Agents & skills · Workflow prompts, skills, and helper scripts for scanning, extraction, tours, review, and knowledge-base handling.
understand-anything-plugin/agents - Core engine · Main analysis package responsible for discovery, parsing, graph construction, persistence, search, and staleness tracking.
understand-anything-plugin/packages/core - Discovery layer · File discovery, ignore filtering, plugin discovery, and parser/extractor registry selection.
understand-anything-plugin/packages/core/src/plugins - Lang & framework registry · Language configs and framework profiles that guide symbol extraction and layer inference across many ecosystems.
understand-anything-plugin/packages/core/src/languages - Graph pipeline · Graph builder, normalization, layer detection, LLM-assisted analysis, and tour generation.
understand-anything-plugin/packages/core/src/analyzer - Knowledge graph · Canonical local JSON artifact written under .understand-anything and shared by downstream tools.
UI surfaces
Graph viewer dashboard and marketing homepage.
- Dashboard app · Vite/React application that reads graph data and presents interactive graph, domain, and knowledge views.
understand-anything-plugin/packages/dashboard - View state · Client-side store, filtering, theme selection, and persona-aware rendering state.
understand-anything-plugin/packages/dashboard/src/store.ts - Render engine · Graph view rendering, edge aggregation, filtering, and worker-backed layout computation.
understand-anything-plugin/packages/dashboard/src/utils/layout.ts - Homepage site · Separate marketing and demo site for the product homepage.
homepage
Connections 21
- Docs & plans → Command layer: specifies · Designs and plans describe command and pipeline behavior.
- Host manifests → Command layer: installs · Host-specific manifests expose the plugin runtime to AI platforms.
- Command layer → Chat flow: routes · Chat command entrypoint.
- Command layer → Diff flow: routes · Diff analysis entrypoint.
- Command layer → Explain flow: routes · Explanation entrypoint.
- Command layer → Onboard flow: routes · Onboarding entrypoint.
- Command layer → Context builder: shares · All command flows assemble context through a common boundary.
- Context builder → Core engine: feeds · Command context is converted into analysis requests.
- Agents & skills → Command layer: guides · Prompt assets define workflow-specific behavior.
- Agents & skills → Core engine: informs · Skills and agents complement the core analysis pipeline.
- Core engine → Discovery layer: discovers · Project and file discovery selects parsers and extractors.
- Core engine → Lang & framework registry: classifies · Language and framework profiles drive parsing and layer inference.
- Core engine → Graph pipeline: builds · Analysis output is normalized into graph structure and tours.
- Graph pipeline → Knowledge graph: persists · The final graph is written as a local JSON artifact.
- Core engine → Knowledge graph: updates · Persistence and staleness tracking maintain the shared artifact.
- Knowledge graph → Dashboard app: consumed by · Dashboard reads the generated graph as its main contract.
- Dashboard app → View state: manages · UI state coordinates filters, themes, persona, and selection.
- Dashboard app → Render engine: renders via · Graph views use layout and edge aggregation utilities.
- View state → Render engine: drives · State changes affect rendering and layout presentation.
- Homepage site → CI & deploy: deployed by · Homepage has a dedicated deployment workflow.
- CI & deploy → Dashboard app: validates · Repository CI covers the main plugin and UI surfaces.