SKILL.md--- name: understand description: Analyze a codebase to produce an interactive knowledge graph for understanding architecture, components, and relationships argument-hint: ["[path] [--full|--auto-update|--no-auto-update|--review|--language <lang>|--exclude <patterns>]"] --- # /understand Analyze the current codebase and produce a `knowledge-graph.json` file in the project's data directory (`.ua/`, or the legacy `.understand-anything/` when it already exists). This file powers the interactive dashboard for exploring the project's architecture. ## Options - `$ARGUMENTS` may contain: - `--full` — Force a full rebuild, ignoring any existing graph - `--auto-update` — Enable automatic graph updates on commit (writes `autoUpdate: true` to `$UA_DIR/config.json`) - `--no-auto-update` — Disable automatic graph updates (writes `autoUpdate: false` to `$UA_DIR/config.json`) - `--review` — Run full LLM graph-reviewer instead of inline deterministic validation - `--language <lang>` — Generate all textual content (summaries, descriptions, tags, titles, languageNotes, languageLesson) in the specified language. Accepts ISO 639-1 codes (`zh`, `ja`, `ko`, `en`, `es`, `fr`, `de`, etc.) or friendly names (`chinese`, `japanese`, `korean`, `english`, `spanish`, etc.). Locale variants supported: `zh-TW`, `zh-HK`, etc. Defaults to `en` (English). Stores preference in `$UA_DIR/config.json` for consistency across incremental updates. - `--exclude <patterns>` — Comma-separated glob patterns for additional files/directories to exclude from analysis (e.g., `--exclude "tests/*,docs/*"`). These patterns take highest priority over built-in defaults and `.understandignore` rules. Supports gitignore syntax including `!` negation. - A directory path (e.g. `/path/to/repo` or `../other-project`) — Analyze the given directory instead of the current working directory --- ## Progress Reporting Throughout execution, report progress to the user at each phase transition and during batch processing. This keeps users informed on large codebases where analysis can take a long time. - **Phase transitions:** At the start of each phase, print a status line: > `[Phase N/7] <phase name>...` > > Example: `[Phase 2/7] Analyzing files (12 batches)...` - **Batch progress:** During Phase 2, report each batch with its index and total: > `Analyzing batch X/N (files: foo.ts, bar.ts, ...)` (list up to 3 filenames, then `...` if more) - **Phase completion:** When a phase finishes, briefly confirm: > `Phase N complete. <one-line summary of result>` > > Example: `Phase 1 complete. Found 247 files across 3 languages.` --- ## Phase 0 — Pre-flight Determine whether to run a full analysis or incremental update. 1. **Resolve `PROJECT_ROOT`:** - Parse `$ARGUMENTS` for a non-flag token (any argument that does not start with `--`). If found, treat it as the target directory path. - If the path is relative, resolve it ag