Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ Understand-Anything works across multiple AI coding platforms.
```


### One-line install (Codex / OpenCode / OpenClaw / Antigravity / Gemini CLI / Pi Agent / Vibe CLI / VS Code Copilot / Hermes / Cline / KIMI CLI / Trae / Nanobot / Kiro)
### One-line install (Codex / OpenCode / OpenClaw / Antigravity / Gemini CLI / Pi Agent / Vibe CLI / VS Code Copilot / Hermes / Cline / KIMI CLI / Trae / Nanobot / Kiro / AdaL)


**macOS / Linux:**
Expand All @@ -217,7 +217,7 @@ The installer clones the repo to `~/.understand-anything/repo` and creates the r

> **Note on invoking skills:** the invocation prefix differs per platform. Most platforms use slash commands (`/understand`), but **Codex uses `$` instead** — type `$understand`, not `/understand`. If neither prefix is recognized on your platform, just ask in plain language: *"Use the understand skill to analyze this project."*

- Supported `<platform>` values: `gemini`, `codex`, `opencode`, `pi`, `openclaw`, `antigravity`, `vibe`, `vscode`, `hermes`, `cline`, `kimi`, `trae`, `nanobot`, `kiro`
- Supported `<platform>` values: `gemini`, `codex`, `opencode`, `pi`, `openclaw`, `antigravity`, `vibe`, `vscode`, `hermes`, `cline`, `kimi`, `trae`, `nanobot`, `kiro`, `adal`
- Update later: `./install.sh --update`
- Uninstall: `./install.sh --uninstall <platform>`

Expand All @@ -239,6 +239,16 @@ For personal skills (available across all projects), run the `install.sh` above
copilot plugin install Egonex-AI/Understand-Anything:understand-anything-plugin
```

### AdaL CLI

```bash
curl -fsSL https://raw.githubusercontent.com/Egonex-AI/Understand-Anything/main/install.sh | bash -s adal
```

After installation, the skills are symlinked into `~/.adal/skills/`. Restart your AdaL CLI session to pick up the skills.

For personal skills (available across all projects), run the `install.sh` above with the `adal` platform.

### Kiro CLI / IDE

```bash
Expand Down Expand Up @@ -272,6 +282,7 @@ For personal skills (available across all projects), run the `install.sh` above
| Trae | ✅ Supported | `install.sh trae` |
| Nanobot | ✅ Supported | `install.sh nanobot` |
| Kiro CLI / IDE | ✅ Supported | `install.sh kiro` |
| AdaL CLI | ✅ Supported | `install.sh adal` |


---
Expand Down
1 change: 1 addition & 0 deletions READMEs/README.es-ES.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ Para habilidades personales (disponibles en todos los proyectos), ejecuta el `in
| KIMI CLI | ✅ Soportado | `install.sh kimi` |
| Nanobot | ✅ Soportado | `install.sh nanobot` |
| Kiro CLI / IDE | ✅ Soportado | `install.sh kiro` |
| AdaL CLI | ✅ Soportado | `install.sh adal` |

---

Expand Down
1 change: 1 addition & 0 deletions READMEs/README.ja-JP.md
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ curl -fsSL https://raw.githubusercontent.com/Egonex-AI/Understand-Anything/main/
| Trae | ✅ サポート | `install.sh trae` |
| Nanobot | ✅ サポート | `install.sh nanobot` |
| Kiro CLI / IDE | ✅ サポート | `install.sh kiro` |
| AdaL CLI | ✅ サポート | `install.sh adal` |

---

Expand Down
1 change: 1 addition & 0 deletions READMEs/README.ko-KR.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ curl -fsSL https://raw.githubusercontent.com/Egonex-AI/Understand-Anything/main/
| KIMI CLI | ✅ 지원 | `install.sh kimi` |
| Nanobot | ✅ 지원 | `install.sh nanobot` |
| Kiro CLI / IDE | ✅ 지원 | `install.sh kiro` |
| AdaL CLI | ✅ 지원 | `install.sh adal` |

---

Expand Down
1 change: 1 addition & 0 deletions READMEs/README.ru-RU.md
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ curl -fsSL https://raw.githubusercontent.com/Egonex-AI/Understand-Anything/main/
| KIMI CLI | ✅ Поддерживается | `install.sh kimi` |
| Nanobot | ✅ Поддерживается | `install.sh nanobot` |
| Kiro CLI / IDE | ✅ Поддерживается | `install.sh kiro` |
| AdaL CLI | ✅ Поддерживается | `install.sh adal` |

---

Expand Down
1 change: 1 addition & 0 deletions READMEs/README.tr-TR.md
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ Tüm projelerde kullanmak için kişisel beceri olarak kurmak istersen yukarıda
| KIMI CLI | ✅ Destekleniyor | `install.sh kimi` |
| Nanobot | ✅ Destekleniyor | `install.sh nanobot` |
| Kiro CLI / IDE | ✅ Destekleniyor | `install.sh kiro` |
| AdaL CLI | ✅ Destekleniyor | `install.sh adal` |

---

Expand Down
1 change: 1 addition & 0 deletions READMEs/README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ curl -fsSL https://raw.githubusercontent.com/Egonex-AI/Understand-Anything/main/
| KIMI CLI | ✅ 支持 | `install.sh kimi` |
| Nanobot | ✅ 支持 | `install.sh nanobot` |
| Kiro CLI / IDE | ✅ 支持 | `install.sh kiro` |
| AdaL CLI | ✅ 支持 | `install.sh adal` |

---

Expand Down
1 change: 1 addition & 0 deletions READMEs/README.zh-TW.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ curl -fsSL https://raw.githubusercontent.com/Egonex-AI/Understand-Anything/main/
| KIMI CLI | ✅ 支援 | `install.sh kimi` |
| Nanobot | ✅ 支援 | `install.sh nanobot` |
| Kiro CLI / IDE | ✅ 支援 | `install.sh kiro` |
| AdaL CLI | ✅ 支援 | `install.sh adal` |

---

Expand Down
4 changes: 4 additions & 0 deletions install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ $Platforms = [ordered]@{
trae = @{ Target = (Join-Path $HOME '.trae\skills'); Style = 'per-skill' }
nanobot = @{ Target = (Join-Path $HOME '.nanobot\workspace\skills'); Style = 'per-skill' }
kiro = @{ Target = (Join-Path $HOME '.kiro\skills'); Style = 'per-skill' }
adal = @{ Target = (Join-Path $HOME '.adal\skills'); Style = 'per-skill' }
}

function Show-Usage {
Expand Down Expand Up @@ -245,6 +246,9 @@ function Cmd-Install([string]$Id) {
if ($Id -eq 'kiro') {
Write-Host "`n Usage: kiro-cli chat --agent understand `"Analyze this project`""
}
if ($Id -eq 'adal') {
Write-Host "`n Tip: AdaL uses /plugin commands — install via the marketplace: /plugin marketplace add Egonex-AI/Understand-Anything then /plugin install understand-anything (or run install.ps1 adal)."
}
}

function Cmd-Uninstall([string]$Id) {
Expand Down
33 changes: 33 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ kimi|$HOME/.kimi/skills|folder
trae|$HOME/.trae/skills|per-skill
nanobot|$HOME/.nanobot/workspace/skills|per-skill
kiro|$HOME/.kiro/skills|per-skill
adal|$HOME/.adal/skills|per-skill
EOF
}

Expand Down Expand Up @@ -178,6 +179,22 @@ link_plugin_root() {
fi
}

link_opencode_commands() {
local src="$REPO_DIR/understand-anything-plugin/commands/opencode/understand.md"
[[ -f "$src" ]] || { printf ' • %s not found, skipping command link\n' "$src"; return 0; }
mkdir -p "$HOME/.config/opencode/commands"
ln -sfn "$src" "$HOME/.config/opencode/commands/understand.md"
printf ' ✓ %s → %s\n' "$HOME/.config/opencode/commands/understand.md" "$src"
}

unlink_opencode_commands() {
local link="$HOME/.config/opencode/commands/understand.md"
if [[ -L "$link" ]]; then
rm -f "$link"
printf ' ✓ removed %s\n' "$link"
fi
}

cmd_install() {
local id="$1"
local row target style
Expand All @@ -191,6 +208,11 @@ cmd_install() {
printf -- '→ Linking universal plugin root\n'
link_plugin_root

if [[ "$id" == "opencode" ]]; then
printf -- '→ Linking OpenCode slash command\n'
link_opencode_commands
fi

if [[ "$id" == "kiro" ]]; then
printf -- '→ Creating Kiro agent configuration\n'
mkdir -p "$HOME/.kiro/agents"
Expand Down Expand Up @@ -225,13 +247,21 @@ KIROEOF
if [[ "$id" == "codex" ]]; then
printf '\n Tip: Codex invokes skills with $ instead of / — type $understand, not /understand.\n'
fi
if [[ "$id" == "opencode" ]]; then
printf '\n Tip: OpenCode runs /understand as a structural-only analysis (no subagent\n'
printf ' dispatch — see docs/platforms/opencode.md upstream). Run it in Claude\n'
printf ' Code for the full LLM-enriched graph.\n'
fi
if [[ "$id" == "vscode" ]]; then
printf '\n Tip: VS Code can also auto-discover the plugin by opening this repo\n'
printf ' directly (it reads .copilot-plugin/plugin.json), no symlinks needed.\n'
fi
if [[ "$id" == "kiro" ]]; then
printf '\n Usage: kiro-cli chat --agent understand "Analyze this project"\n'
fi
if [[ "$id" == "adal" ]]; then
printf '\n Tip: AdaL uses /plugin commands — install via the marketplace: /plugin marketplace add Egonex-AI/Understand-Anything then /plugin install understand-anything (or run install.sh adal).\n'
fi
}

cmd_uninstall() {
Expand All @@ -243,6 +273,9 @@ cmd_uninstall() {

printf -- '→ Removing skill links for %s\n' "$id"
unlink_skills "$target" "$style"
if [[ "$id" == "opencode" ]]; then
unlink_opencode_commands
fi
if [[ "$id" == "kiro" && -f "$HOME/.kiro/agents/understand.json" ]]; then
rm -f "$HOME/.kiro/agents/understand.json"
printf ' ✓ removed %s\n' "$HOME/.kiro/agents/understand.json"
Expand Down
104 changes: 104 additions & 0 deletions understand-anything-plugin/commands/opencode/understand.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
---
description: Analyze the codebase into an interactive knowledge graph (structural-only on OpenCode)
---

# /understand (OpenCode — structural-only)

Analyze the current codebase and produce a schema-valid `knowledge-graph.json`
in the project's data directory (`.ua/`, or legacy `.understand-anything/`),
then launch the interactive dashboard.

**Platform constraint:** OpenCode does not implement Claude Code's `Task` tool,
so the LLM subagent phases of `/understand` (file analysis, architecture,
tour, review) cannot run. This command runs the deterministic pipeline only —
the result is a structural graph (file nodes + import edges) with
schema-valid `complexity`, `tags`, and `summary` fields. No LLM summaries,
layers, or tours. See `docs/platforms/opencode.md` (upstream) for the
compatibility matrix and future directions.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 68292c2: the reference is now self-contained ("see the upstream OpenCode platform documentation"), matching the AdaL tip convention from 76baa9f. docs/platforms/opencode.md is intentionally left to the docs PR #388 to avoid a broken in-repo link on this branch.


## Procedure

1. **Resolve the skill directory.** The deterministic scripts live next to
this skill. Prefer the symlink-resolved path:

```bash
SKILL_ROOT="$(python3 -c "import os;print(os.path.realpath(os.path.expanduser('$HOME/.agents/skills/understand')))" 2>/dev/null)"
[ -d "$SKILL_ROOT" ] || SKILL_ROOT="$HOME/.understand-anything-plugin/skills/understand"
[ -d "$SKILL_ROOT" ] || { echo "[understand] skill dir not found"; exit 1; }
```

2. **Resolve the project root.** Parse `$ARGUMENTS` for a non-flag token; if
found and it is a directory, use it. Otherwise use the current working
directory.

3. **Phase 1 — SCAN** (deterministic):

```bash
UA_DIR="$PROJECT_ROOT/.ua"
mkdir -p "$UA_DIR/intermediate"
node "$SKILL_ROOT/scan-project.mjs" "$PROJECT_ROOT" "$UA_DIR/intermediate/scan-result.json" --exclude-analysis-data
```

4. **Phase 1.5 — IMPORT MAP.** `extract-import-map.mjs` needs an input file
with a `projectRoot` field and the scanned `files` array:

```bash
node -e '
const fs = require("fs");
const scan = JSON.parse(fs.readFileSync("'"$UA_DIR"'/intermediate/scan-result.json", "utf8"));
fs.writeFileSync("'"$UA_DIR"'/intermediate/scan-for-importmap.json",
JSON.stringify({ projectRoot: scan.projectRoot ?? "'"$PROJECT_ROOT"'", files: scan.files }, null, 2));
'
node "$SKILL_ROOT/extract-import-map.mjs" "$UA_DIR/intermediate/scan-for-importmap.json" "$UA_DIR/intermediate/import-map.json"
```

5. **Phase 1.5b — BATCHES** (optional but recommended; needs `@understand-anything/core` — run via the plugin checkout if the symlinked skill dir lacks `node_modules`):

```bash
node "$SKILL_ROOT/compute-batches.mjs" "$PROJECT_ROOT"
```

6. **Assemble the structural graph.** Build `knowledge-graph.json` with the
project metadata schema (`version`, `kind`, `project` with `name`,
`languages`, `frameworks`, `description`, `analyzedAt`, `gitCommitHash`;
`nodes` keyed `file:<relativePath>` with `type: "file"`, `filePath`,
`language`, `fileCategory`, `sizeLines`, `name`; `edges` with `source`,
`target`, `type: "imports"`, `direction: "forward"`, `weight: 0.7`;
plus `layers: []` and `tour: []`). For file count per language, use the
scan's stats. Write it to `$UA_DIR/knowledge-graph.json`.

7. **Enrich (schema validity).** Add `complexity`, `tags`, `summary` to every
node deterministically:

```bash
python3 "$SKILL_ROOT/enrich-structural-graph.py" "$UA_DIR/knowledge-graph.json" --write
```

Verify with the plugin's validator:

```bash
node -e '
const { autoFixGraph } = require(process.env.HOME + "/.understand-anything-plugin/packages/core/dist/schema.js");
const kg = JSON.parse(require("fs").readFileSync("'"$UA_DIR"'/knowledge-graph.json", "utf8"));
const { issues } = autoFixGraph(kg);
console.log("[understand] validation issues:", issues.length);
if (issues.length) process.exit(1);
'
```

8. **Launch the dashboard** and report the URL:

```bash
GRAPH_DIR="$PROJECT_ROOT/.ua" npx --prefix "$HOME/.understand-anything-plugin/packages/dashboard" vite --config "$HOME/.understand-anything-plugin/packages/dashboard/vite.config.ts" --port 5173 &
```

Report `http://localhost:5173/?token=<from stdout>` to the user.

## Report

Report to the user:
- Files scanned, languages, edge count (from `scan-result.json` stats)
- The dashboard URL
- A one-line caveat: structural-only graph (no LLM summaries/layers/tour —
OpenCode lacks subagent dispatch; run `/understand` in Claude Code for the
full graph)
Loading