[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M79TNZSTF6TPG7YEKX73ZP7K":3,"skill-same:01M79TNZSTF6TPG7YEKX73ZP7K":52},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":29,"ownerHtmlUrl":30,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":31,"install":32,"resources":45},"01M79TNZSTF6TPG7YEKX73ZP7K","understand-domain",null,"Extract business domain knowledge from a codebase and generate an interactive domain flow graph. Works standalone (lightweight scan) or derives from an existing \u002Funderstand knowledge graph.","nahid-sparktales\u002Flocus","nahid-sparktales","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F278225096?v=4","01M79TH2FX7X29N8H3X182C80G","01M79TH2H2GAQMG6QSF80M16G8",22,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fnahid-sparktales\u002Flocus\u002Fblob\u002Fmain\u002Fagent\u002Follama_code\u002Fbuiltin_skills\u002Funderstand-anything\u002Fupstream\u002Fskills\u002Funderstand-domain\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: understand-domain\ndescription: Extract business domain knowledge from a codebase and generate an interactive domain flow graph. Works standalone (lightweight scan) or derives from an existing \u002Funderstand knowledge graph.\nargument-hint: \"[--full]\"\n---\n\n# \u002Funderstand-domain\n\nExtracts business domain knowledge — domains, business flows, and process steps — from a codebase and produces an interactive horizontal flow graph in the dashboard.\n\n## How It Works\n\n- If a knowledge graph already exists (`.ua\u002Fknowledge-graph.json`, or the legacy `.understand-anything\u002Fknowledge-graph.json` when that directory is present), derives domain knowledge from it (cheap, no file scanning)\n- If no knowledge graph exists, performs a lightweight scan: file tree + entry point detection + sampled files\n- Use `--full` flag to force a fresh scan even if a knowledge graph exists\n\n## Instructions\n\n### Phase 0: Resolve `PROJECT_ROOT`\n\nSet `PROJECT_ROOT` to the current working directory.\n\n**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\u002F`, or legacy `.understand-anything\u002F`) 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.\n\n```bash\nCOMMON_DIR=$(git -C \"$PROJECT_ROOT\" rev-parse --git-common-dir 2>\u002Fdev\u002Fnull)\nGIT_DIR=$(git -C \"$PROJECT_ROOT\" rev-parse --git-dir 2>\u002Fdev\u002Fnull)\nif [ -n \"$COMMON_DIR\" ] && [ -n \"$GIT_DIR\" ]; then\n  COMMON_ABS=$(cd \"$PROJECT_ROOT\" && cd \"$COMMON_DIR\" 2>\u002Fdev\u002Fnull && pwd -P)\n  GIT_ABS=$(cd \"$PROJECT_ROOT\" && cd \"$GIT_DIR\" 2>\u002Fdev\u002Fnull && pwd -P)\n  if [ -n \"$COMMON_ABS\" ] && [ \"$COMMON_ABS\" != \"$GIT_ABS\" ]; then\n    MAIN_ROOT=$(dirname \"$COMMON_ABS\")\n    if [ -d \"$MAIN_ROOT\" ] && [ \"${UNDERSTAND_NO_WORKTREE_REDIRECT:-0}\" != \"1\" ]; then\n      echo \"[understand-domain] Detected git worktree at $PROJECT_ROOT\"\n      echo \"[understand-domain] Redirecting output to main repo root: $MAIN_ROOT\"\n      echo \"[understand-domain] (Set UNDERSTAND_NO_WORKTREE_REDIRECT=1 to keep PROJECT_ROOT as the worktree.)\"\n      PROJECT_ROOT=\"$MAIN_ROOT\"\n    fi\n  fi\nfi\n```\n\nUse `$PROJECT_ROOT` (not the bare CWD) for every reference to \"the current project\" \u002F `\u003Cproject-root>` in subsequent phases.\n\n**Resolve the data directory `$UA_DIR`.** All Understand-Anything artifacts live in the project's data directory. Resolve it once, now that `$PROJECT_ROOT` is known, and reuse `$UA_DIR` for every read and write in later phases:\n```bash\nUA_DIR=\"$PROJECT_ROOT\u002F$([ -d \"$PROJECT_ROOT\u002F.understand-anything\" ] && echo .understand-anything || echo .ua)\"\n```\nThis keeps the legacy `.understand-anything\u002F` directory when it already exists (existing projects keep working with no migration) and uses the new `.ua\u002F` otherwise. Because each phase may run in a fresh shell, carry `$UA_DIR` forward like `$PROJECT_ROOT`, re-resolving it with the line above if a later command block needs it.\n\n**Important:** do **not** assume the plugin root is simply two directories above the skill path string. In many installations `~\u002F.agents\u002Fskills\u002Funderstand-domain` is a symlink into the real plugin checkout. Prefer runtime-provided plugin roots first (for Claude), then fall back to universal symlinks, skill symlink resolution, and common clone-based install paths.\n\nResolve the plugin root like this:\n\n```bash\nSKILL_REAL=$(realpath ~\u002F.agents\u002Fskills\u002Funderstand-domain 2>\u002Fdev\u002Fnull || readlink -f ~\u002F.agents\u002Fskills\u002Funderstand-domain 2>\u002Fdev\u002Fnull || echo \"\")\nSELF_RELATIVE=$([ -n \"$SKILL_REAL\" ] && cd \"$SKILL_REAL\u002F..\u002F..\" 2>\u002Fdev\u002Fnull && pwd || echo \"\")\nCOPILOT_SKILL_REAL=$(realpath ~\u002F.copilot\u002Fskills\u002Funderstand-domain 2>\u002Fdev\u002Fnull || readlink -f ~\u002F.copilot\u002Fskills\u002Funderstand-domain 2>\u002Fdev\u002Fnull || echo \"\")\nCOPILOT_SELF_RELATIVE=$([ -n \"$COPILOT_SKILL_REAL\" ] && cd \"$COPILOT_SKILL_REAL\u002F..\u002F..\" 2>\u002Fdev\u002Fnull && pwd || echo \"\")\n\nPLUGIN_ROOT=\"\"\nfor candidate in \\\n  \"${CLAUDE_PLUGIN_ROOT}\" \\\n  \"$HOME\u002F.understand-anything-plugin\" \\\n  \"$SELF_RELATIVE\" \\\n  \"$COPILOT_SELF_RELATIVE\" \\\n  \"$HOME\u002F.codex\u002Funderstand-anything\u002Funderstand-anything-plugin\" \\\n  \"$HOME\u002F.opencode\u002Funderstand-anything\u002Funderstand-anything-plugin\" \\\n  \"$HOME\u002F.pi\u002Funderstand-anything\u002Funderstand-anything-plugin\" \\\n  \"$HOME\u002Funderstand-anything\u002Funderstand-anything-plugin\"; do\n  if [ -n \"$candidate\" ] && [ -f \"$candidate\u002Fpackage.json\" ] && [ -f \"$candidate\u002Fpnpm-workspace.yaml\" ]; then\n    PLUGIN_ROOT=\"$candidate\"\n    break\n  fi\ndone\n\nif [ -z \"$PLUGIN_ROOT\" ]; then\n  echo \"Error: Cannot find the understand-anything plugin root.\"\n  echo \"Checked:\"\n  echo \"  - ${CLAUDE_PLUGIN_ROOT:-\u003Cunset CLAUDE_PLUGIN_ROOT>}\"\n  echo \"  - $HOME\u002F.understand-anything-plugin\"\n  echo \"  - ${SELF_RELATIVE:-\u003Cunresolved path derived from ~\u002F.agents\u002Fskills\u002Funderstand-domain>}\"\n  echo \"  - ${COPILOT_SELF_RELATIVE:-\u003Cunresolved path derived from ~\u002F.copilot\u002Fskills\u002Funderstand-domain>}\"\n  echo \"  - $HOME\u002F.codex\u002Funderstand-anything\u002Funderstand-anything-plugin\"\n  echo \"  - $HOME\u002F.opencode\u002Funderstand-anything\u002Funderstand-anything-plugin\"\n  echo \"  - $HOME\u002F.pi\u002Funderstand-anything\u002Funderstand-anything-plugin\"\n  echo \"  - $HOME\u002Funderstand-anything\u002Funderstand-anything-plugin\"\n  echo \"Make sure the plugin is installed correctly.\"\n  exit 1\nfi\n```\n\nUse `$PLUGIN_ROOT` for every reference to agent definitions in subsequent phases.\n\n### Phase 1: Detect Existing Graph\n\n1. Check if `$UA_DIR\u002Fknowledge-graph.json` exists\n2. If it exists AND `--full` was NOT passed, check freshness before deriving from it:\n   - Read `project.gitCommitHash` from the graph metadata as `GRAPH_COMMIT_RAW`. Change to `$PROJECT_ROOT`, resolve it as a commit before using it in any Git diff, compare the resolved commit with `git rev-parse HEAD`, and inspect project-scoped committed and working-tree changes:\n     ```bash\n     GRAPH_COMMIT=$(git rev-parse --verify --end-of-options \"${GRAPH_COMMIT_RAW}^{commit}\" 2>\u002Fdev\u002Fnull)\n     git rev-parse HEAD\n     git diff --name-only \"$GRAPH_COMMIT\" HEAD -- .\n     git diff --cached --name-only -- .\n     git diff --name-only -- .\n     git ls-files --others --exclude-standard -- .\n     ```\n   - The `-- .` pathspec is required: commits that only touch a sibling monorepo project must not make this graph stale. A hash mismatch alone is not stale when the project diff is empty.\n   - Ignore the selected data directory (`.ua\u002F` or legacy `.understand-anything\u002F`) in every command's output because it contains generated graph artifacts, not project source drift.\n   - If the committed diff or any working-tree command reports project files, warn that domain extraction may omit those changes. Suggest: Run `\u002Funderstand` to refresh the knowledge graph.\n   - Run the commit diff only when `GRAPH_COMMIT_RAW` resolves successfully. If the graph commit or Git metadata is missing, invalid, or unavailable, give a brief best-effort warning and continue instead of blocking.\n3. After that preflight, proceed to Phase 3 (derive from graph).\n4. Otherwise, proceed to Phase 2 (lightweight scan). When `--full` is used, skip this preflight because the command performs a fresh scan instead of consuming the existing graph.\n\n### Phase 2: Lightweight Scan (Path 1)\n\nThe preprocessing script does NOT produce a domain graph — it produces **raw material** (file tree, entry points, exports\u002Fimports) so the domain-analyzer agent can focus on the actual domain analysis instead of spending dozens of tool calls exploring the codebase. Think of it as a cheat sheet: cheap Python preprocessing → expensive LLM gets a clean, small input → better results for less cost.\n\n1. Run the preprocessing script bundled with this skill, passing `$PROJECT_ROOT` from Phase 0:\n   ```\n   python .\u002Fextract-domain-context.py \"$PROJECT_ROOT\"\n   ```\n   This outputs `$UA_DIR\u002Fintermediate\u002Fdomain-context.json` containing:\n   - File tree (respecting `.gitignore`)\n   - Detected entry points (HTTP routes, CLI commands, event handlers, cron jobs, exported handlers)\n   - File signatures (exports, imports per file)\n   - Code snippets for each entry point (signature + first few lines)\n   - Project metadata (package.json, README, etc.)\n2. Read the generated `domain-context.json` as context for Phase 4\n3. Proceed to Phase 4\n\n### Phase 3: Derive from Existing Graph (Path 2)\n\n1. Read `$UA_DIR\u002Fknowledge-graph.json`\n2. Format the graph data as structured context:\n   - All nodes with their types, names, summaries, and tags\n   - All edges with their types (especially `calls`, `imports`, `contains`)\n   - All layers with their descriptions\n   - Tour steps if available\n3. This is the context for the domain analyzer — no file reading needed\n4. Proceed to Phase 4\n\n### Phase 4: Domain Analysis\n\n1. Read the domain-analyzer agent prompt from `$PLUGIN_ROOT\u002Fagents\u002Fdomain-analyzer.md`\n2. Dispatch a subagent with the domain-analyzer prompt + the context from Phase 2 or 3\n3. The agent writes its output to `$UA_DIR\u002Fintermediate\u002Fdomain-analysis.json`\n\n### Phase 5: Validate and Save\n\n1. Read the domain analysis output\n2. Validate using the standard graph validation pipeline (the schema now supports domain\u002Fflow\u002Fstep types)\n3. If validation fails, log warnings but save what's valid (error tolerance)\n4. Save to `$UA_DIR\u002Fdomain-graph.json`\n5. Clean up `$UA_DIR\u002Fintermediate\u002Fdomain-analysis.json` and `$UA_DIR\u002Fintermediate\u002Fdomain-context.json`\n\n### Phase 6: Launch Dashboard\n\n1. Auto-trigger `\u002Funderstand-dashboard` to visualize the domain graph\n2. The dashboard will detect `domain-graph.json` and show the domain view by default\n","# \u002Funderstand-domain\n\nExtracts business domain knowledge — domains, business flows, and process steps — from a codebase and produces an interactive horizontal flow graph in the dashboard.\n\n## How It Works\n\n- If a knowledge graph already exists (`.ua\u002Fknowledge-graph.json`, or the legacy `.understand-anything\u002Fknowledge-graph.json` when that directory is present), derives domain knowledge from it (cheap, no file scanning)\n- If no knowledge graph exists, performs a lightweight scan: file tree + entry point detection + sampled files\n- Use `--full` flag to force a fresh scan even if a knowledge graph exists\n\n## Instructions\n\n### Phase 0: Resolve `PROJECT_ROOT`\n\nSet `PROJECT_ROOT` to the current working directory.\n\n**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\u002F`, or legacy `.understand-anything\u002F`) 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.\n\n```bash\nCOMMON_DIR=$(git -C \"$PROJECT_ROOT\" rev-parse --git-common-dir 2>\u002Fdev\u002Fnull)\nGIT_DIR=$(git -C \"$PROJECT_ROOT\" rev-parse --git-dir 2>\u002Fdev\u002Fnull)\nif [ -n \"$COMMON_DIR\" ] && [ -n \"$GIT_DIR\" ]; then\n  COMMON_ABS=$(cd \"$PROJECT_ROOT\" && cd \"$COMMON_DIR\" 2>\u002Fdev\u002Fnull && pwd -P)\n  GIT_ABS=$(cd \"$PROJECT_ROOT\" && cd \"$GIT_DIR\" 2>\u002Fdev\u002Fnull && pwd -P)\n  if [ -n \"$COMMON_ABS\" ] && [ \"$COMMON_ABS\" != \"$GIT_ABS\" ]; then\n    MAIN_ROOT=$(dirname \"$COMMON_ABS\")\n    if [ -d \"$MAIN_ROOT\" ] && [ \"${UNDERSTAND_NO_WORKTREE_REDIRECT:-0}\" != \"1\" ]; then\n      echo \"[understand-domain] Detected git worktree at $PROJECT_ROOT\"\n      echo \"[understand-domain] Redirecting output to main repo root: $MAIN_ROOT\"\n      echo \"[understand-domain] (Set UNDERSTAND_NO_WORKTREE_REDIRECT=1 to keep PROJECT_ROOT as the worktree.)\"\n      PROJECT_ROOT=\"$MAIN_ROOT\"\n    fi\n  fi\nfi\n```\n\nUse `$PROJECT_ROOT` (not the bare CWD) for every reference to \"the current project\" \u002F `\u003Cproject-root>` in subsequent phases.\n\n**Resolve the data directory `$UA_DIR`.** All Understand-Anything artifacts live in the project's data directory. Resolve it once, now that `$PROJECT_ROOT` is known, and reuse `$UA_DIR` for every read and write in later phases:\n```bash\nUA_DIR=\"$PROJECT_ROOT\u002F$([ -d \"$PROJECT_ROOT\u002F.understand-anything\" ] && echo .understand-anything || echo .ua)\"\n```\nThis keeps the legacy `.understand-anything\u002F` directory when it already exists (existing projects keep working with no migration) and uses the new `.ua\u002F` otherwise. Because each phase may run in a fresh shell, carry `$UA_DIR` forward like `$PROJECT_ROOT`, re-resolving it with the line above if a later command block needs it.\n\n**Important:** do **not** assume the plugin root is simply two directories above the skill path string. In many installations `~\u002F.agents\u002Fskills\u002Funderstand-domain` is a symlink into the real plugin checkout. Prefer runtime-provided plugin roots first (for Claude), then fall back to universal symlinks, skill symlink resolution, and common clone-based install paths.\n\nResolve the plugin root like this:\n\n```bash\nSKILL_REAL=$(realpath ~\u002F.agents\u002Fskills\u002Funderstand-domain 2>\u002Fdev\u002Fnull || readlink -f ~\u002F.agents\u002Fskills\u002Funderstand-domain 2>\u002Fdev\u002Fnull || echo \"\")\nSELF_RELATIVE=$([ -n \"$SKILL_REAL\" ] && cd \"$SKILL_REAL\u002F..\u002F..\" 2>\u002Fdev\u002Fnull && pwd || echo \"\")\nCOPILOT_SKILL_REAL=$(realpath ~\u002F.copilot\u002Fskills\u002Funderstand-domain 2>\u002Fdev\u002Fnull || readlink -f ~\u002F.copilot\u002Fskills\u002Funderstand-domain 2>\u002Fdev\u002Fnull || echo \"\")\nCOPILOT_SELF_RELATIVE=$([ -n \"$COPILOT_SKILL_REAL\" ] && cd \"$COPILOT_SKILL_REAL\u002F..\u002F..\" 2>\u002Fdev\u002Fnull && pwd || echo \"\")\n\nPLUGIN_ROOT=\"\"\nfor candidate in \\\n  \"${CLAUDE_PLUGIN_ROOT}\" \\\n  \"$HOME\u002F.understand-anything-plugin\" \\\n  \"$SELF_RELATIVE\" \\\n  \"$COPILOT_SELF_RELATIVE\" \\\n  \"$HOME\u002F.codex\u002Funderstand-anything\u002Funderstand-anything-plugin\" \\\n  \"$HOME\u002F.opencode\u002Funderstand-anything\u002Funderstand-anything-plugin\" \\\n  \"$HOME\u002F.pi\u002Funderstand-anything\u002Funderstand-anything-plugin\" \\\n  \"$HOME\u002Funderstand-anything\u002Funderstand-anything-plugin\"; do\n  if [ -n \"$candidate\" ] && [ -f \"$candidate\u002Fpackage.json\" ] && [ -f \"$candidate\u002Fpnpm-workspace.yaml\" ]; then\n    PLUGIN_ROOT=\"$candidate\"\n    break\n  fi\ndone\n\nif [ -z \"$PLUGIN_ROOT\" ]; then\n  echo \"Error: Cannot find the understand-anything plugin root.\"\n  echo \"Checked:\"\n  echo \"  - ${CLAUDE_PLUGIN_ROOT:-\u003Cunset CLAUDE_PLUGIN_ROOT>}\"\n  echo \"  - $HOME\u002F.understand-anything-plugin\"\n  echo \"  - ${SELF_RELATIVE:-\u003Cunresolved path derived from ~\u002F.agents\u002Fskills\u002Funderstand-domain>}\"\n  echo \"  - ${COPILOT_SELF_RELATIVE:-\u003Cunresolved path derived from ~\u002F.copilot\u002Fskills\u002Funderstand-domain>}\"\n  echo \"  - $HOME\u002F.codex\u002Funderstand-anything\u002Funderstand-anything-plugin\"\n  echo \"  - $HOME\u002F.opencode\u002Funderstand-anything\u002Funderstand-anything-plugin\"\n  echo \"  - $HOME\u002F.pi\u002Funderstand-anything\u002Funderstand-anything-plugin\"\n  echo \"  - $HOME\u002Funderstand-anything\u002Funderstand-anything-plugin\"\n  echo \"Make sure the plugin is installed correctly.\"\n  exit 1\nfi\n```\n\nUse `$PLUGIN_ROOT` for every reference to agent definitions in subsequent phases.\n\n### Phase 1: Detect Existing Graph\n\n1. Check if `$UA_DIR\u002Fknowledge-graph.json` exists\n2. If it exists AND `--full` was NOT passed, check freshness before deriving from it:\n   - Read `project.gitCommitHash` from the graph metadata as `GRAPH_COMMIT_RAW`. Change to `$PROJECT_ROOT`, resolve it as a commit before using it in any Git diff, compare the resolved commit with `git rev-parse HEAD`, and inspect project-scoped committed and working-tree changes:\n     ```bash\n     GRAPH_COMMIT=$(git rev-parse --verify --end-of-options \"${GRAPH_COMMIT_RAW}^{commit}\" 2>\u002Fdev\u002Fnull)\n     git rev-parse HEAD\n     git diff --name-only \"$GRAPH_COMMIT\" HEAD -- .\n     git diff --cached --name-only -- .\n     git diff --name-only -- .\n     git ls-files --others --exclude-standard -- .\n     ```\n   - The `-- .` pathspec is required: commits that only touch a sibling monorepo project must not make this graph stale. A hash mismatch alone is not stale when the project diff is empty.\n   - Ignore the selected data directory (`.ua\u002F` or legacy `.understand-anything\u002F`) in every command's output because it contains generated graph artifacts, not project source drift.\n   - If the committed diff or any working-tree command reports project files, warn that domain extraction may omit those changes. Suggest: Run `\u002Funderstand` to refresh the knowledge graph.\n   - Run the commit diff only when `GRAPH_COMMIT_RAW` resolves successfully. If the graph commit or Git metadata is missing, invalid, or unavailable, give a brief best-effort warning and continue instead of blocking.\n3. After that preflight, proceed to Phase 3 (derive from graph).\n4. Otherwise, proceed to Phase 2 (lightweight scan). When `--full` is used, skip this preflight because the command performs a fresh scan instead of consuming the existing graph.\n\n### Phase 2: Lightweight Scan (Path 1)\n\nThe preprocessing script does NOT produce a domain graph — it produces **raw material** (file tree, entry points, exports\u002Fimports) so the domain-analyzer agent can focus on the actual domain analysis instead of spending dozens of tool calls exploring the codebase. Think of it as a cheat sheet: cheap Python preprocessing → expensive LLM gets a clean, small input → better results for less cost.\n\n1. Run the preprocessing script bundled with this skill, passing `$PROJECT_ROOT` from Phase 0:\n   ```\n   python .\u002Fextract-domain-context.py \"$PROJECT_ROOT\"\n   ```\n   This outputs `$UA_DIR\u002Fintermediate\u002Fdomain-context.json` containing:\n   - File tree (respecting `.gitignore`)\n   - Detected entry points (HTTP routes, CLI commands, event handlers, cron jobs, exported handlers)\n   - File signatures (exports, imports per file)\n   - Code snippets for each entry point (signature + first few lines)\n   - Project metadata (package.json, README, etc.)\n2. Read the generated `domain-context.json` as context for Phase 4\n3. Proceed to Phase 4\n\n### Phase 3: Derive from Existing Graph (Path 2)\n\n1. Read `$UA_DIR\u002Fknowledge-graph.json`\n2. Format the graph data as structured context:\n   - All nodes with their types, names, summaries, and tags\n   - All edges with their types (especially `calls`, `imports`, `contains`)\n   - All layers with their descriptions\n   - Tour steps if available\n3. This is the context for the domain analyzer — no file reading needed\n4. Proceed to Phase 4\n\n### Phase 4: Domain Analysis\n\n1. Read the domain-analyzer agent prompt from `$PLUGIN_ROOT\u002Fagents\u002Fdomain-analyzer.md`\n2. Dispatch a subagent with the domain-analyzer prompt + the context from Phase 2 or 3\n3. The agent writes its output to `$UA_DIR\u002Fintermediate\u002Fdomain-analysis.json`\n\n### Phase 5: Validate and Save\n\n1. Read the domain analysis output\n2. Validate using the standard graph validation pipeline (the schema now supports domain\u002Fflow\u002Fstep types)\n3. If validation fails, log warnings but save what's valid (error tolerance)\n4. Save to `$UA_DIR\u002Fdomain-graph.json`\n5. Clean up `$UA_DIR\u002Fintermediate\u002Fdomain-analysis.json` and `$UA_DIR\u002Fintermediate\u002Fdomain-context.json`\n\n### Phase 6: Launch Dashboard\n\n1. Auto-trigger `\u002Funderstand-dashboard` to visualize the domain graph\n2. The dashboard will detect `domain-graph.json` and show the domain view by default\n",{"name":5,"description":7,"argument-hint":23},"[--full]","main","f208867dc28cb250af1bb839cc9eb78d5bdf8df1","agent\u002Follama_code\u002Fbuiltin_skills\u002Funderstand-anything\u002Fupstream\u002Fskills\u002Funderstand-domain",1,"https:\u002F\u002Fgithub.com\u002Fnahid-sparktales\u002Flocus","https:\u002F\u002Flocushost.co","https:\u002F\u002Fgithub.com\u002Fnahid-sparktales","2026-10-23 06:15:17",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add nahid-sparktales\u002Flocus --skill understand-domain",{"tool":38,"command":39},"bunx","bunx skills add nahid-sparktales\u002Flocus --skill understand-domain",{"tool":41,"command":42},"pnpm","pnpm dlx skills add nahid-sparktales\u002Flocus --skill understand-domain","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fnahid-sparktales\u002Flocus\u002Fblob\u002Fmain\u002Fagent\u002Follama_code\u002Fbuiltin_skills\u002Funderstand-anything\u002Fupstream\u002Fskills\u002Funderstand-domain\u002FSKILL.md",true,[46],{"path":47,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":50,"sourceHtmlUrl":51},"extract-domain-context.py","SCRIPT","脚本",16273,"https:\u002F\u002Fgithub.com\u002Fnahid-sparktales\u002Flocus\u002Fblob\u002Fmain\u002Fagent\u002Follama_code\u002Fbuiltin_skills\u002Funderstand-anything\u002Fupstream\u002Fskills\u002Funderstand-domain\u002Fextract-domain-context.py",[53,62,70,78,86,94],{"skillNo":54,"name":55,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":57,"licenseFileUrl":58,"sourceHtmlUrl":59,"categories":60,"keywords":61,"publishedAt":18},"01M79TQNH2XPDQRDZCJKZ5FMQY","writing-skills","Use when creating new skills, editing existing skills, or verifying skills work before deployment","MIT","https:\u002F\u002Fgithub.com\u002Fnahid-sparktales\u002Flocus\u002Fblob\u002Fmain\u002Fagent\u002Follama_code\u002Fbuiltin_skills\u002Fwriting-skills\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fnahid-sparktales\u002Flocus\u002Fblob\u002Fmain\u002Fagent\u002Follama_code\u002Fbuiltin_skills\u002Fwriting-skills\u002FSKILL.md",[],[],{"skillNo":63,"name":64,"nameZh":6,"description":65,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":57,"licenseFileUrl":66,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":18},"01M79TQH62FT3Q5WNFSNYPHW5Q","writing-plans","Prepare a saved implementation plan for a substantial multi-step request.","https:\u002F\u002Fgithub.com\u002Fnahid-sparktales\u002Flocus\u002Fblob\u002Fmain\u002Fagent\u002Follama_code\u002Fbuiltin_skills\u002Fwriting-plans\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fnahid-sparktales\u002Flocus\u002Fblob\u002Fmain\u002Fagent\u002Follama_code\u002Fbuiltin_skills\u002Fwriting-plans\u002FSKILL.md",[],[],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":57,"licenseFileUrl":74,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":18},"01M79TQBAG6D20EPN45KZ2G1Y5","verification-before-completion","Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always","https:\u002F\u002Fgithub.com\u002Fnahid-sparktales\u002Flocus\u002Fblob\u002Fmain\u002Fagent\u002Follama_code\u002Fbuiltin_skills\u002Fverification-before-completion\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fnahid-sparktales\u002Flocus\u002Fblob\u002Fmain\u002Fagent\u002Follama_code\u002Fbuiltin_skills\u002Fverification-before-completion\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":57,"licenseFileUrl":82,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":18},"01M79TQ2TH5FW4KQZ5194BB961","vercel-react-best-practices","React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React\u002FNext.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.","https:\u002F\u002Fgithub.com\u002Fnahid-sparktales\u002Flocus\u002Fblob\u002Fmain\u002Fagent\u002Follama_code\u002Fbuiltin_skills\u002Fvercel-react-best-practices\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fnahid-sparktales\u002Flocus\u002Fblob\u002Fmain\u002Fagent\u002Follama_code\u002Fbuiltin_skills\u002Fvercel-react-best-practices\u002FSKILL.md",[],[],{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":57,"licenseFileUrl":90,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":18},"01M79TPXZHP81WAXKW9CVMXACB","using-superpowers","Use when starting any conversation - establishes how to find and use skills, requiring skill invocation before ANY response including clarifying questions","https:\u002F\u002Fgithub.com\u002Fnahid-sparktales\u002Flocus\u002Fblob\u002Fmain\u002Fagent\u002Follama_code\u002Fbuiltin_skills\u002Fusing-superpowers\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fnahid-sparktales\u002Flocus\u002Fblob\u002Fmain\u002Fagent\u002Follama_code\u002Fbuiltin_skills\u002Fusing-superpowers\u002FSKILL.md",[],[],{"skillNo":95,"name":96,"nameZh":6,"description":97,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":57,"licenseFileUrl":98,"sourceHtmlUrl":99,"categories":100,"keywords":101,"publishedAt":18},"01M79TPR4TSQ1YXAPRXR0778HV","using-git-worktrees","Use when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallback","https:\u002F\u002Fgithub.com\u002Fnahid-sparktales\u002Flocus\u002Fblob\u002Fmain\u002Fagent\u002Follama_code\u002Fbuiltin_skills\u002Fusing-git-worktrees\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fnahid-sparktales\u002Flocus\u002Fblob\u002Fmain\u002Fagent\u002Follama_code\u002Fbuiltin_skills\u002Fusing-git-worktrees\u002FSKILL.md",[],[]]