Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
17 changes: 16 additions & 1 deletion 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' }
grok = @{ Target = (Join-Path $HOME '.grok\skills'); Style = 'per-skill' }
}

function Show-Usage {
Expand Down Expand Up @@ -129,7 +130,16 @@ function New-Junction([string]$LinkPath, [string]$TargetPath) {
if (Test-IsReparse $LinkPath) {
(Get-Item -LiteralPath $LinkPath -Force).Delete()
} else {
Write-Error "Refusing to overwrite $LinkPath — it is a real file/directory, not a junction. Move or remove it first."
# Previous manual copies of skills leave real directories; replace
# them so re-install can switch to a junction into the checkout.
$item = Get-Item -LiteralPath $LinkPath -Force
if ($item.PSIsContainer) {
Write-Host " • replacing existing directory $LinkPath with a junction"
Remove-Item -LiteralPath $LinkPath -Recurse -Force
} else {
Write-Host " • replacing existing file $LinkPath with a junction"
Remove-Item -LiteralPath $LinkPath -Force
}
}
}
New-Item -ItemType Junction -Path $LinkPath -Target $TargetPath | Out-Null
Expand Down Expand Up @@ -245,6 +255,11 @@ function Cmd-Install([string]$Id) {
if ($Id -eq 'kiro') {
Write-Host "`n Usage: kiro-cli chat --agent understand `"Analyze this project`""
}
if ($Id -eq 'grok') {
Write-Host "`n Tip: Grok Build loads skills from ~/.grok/skills/ as slash commands"
Write-Host ' (e.g. /understand). Restart Grok, then run /skills to confirm.'
Write-Host ' Alternative: grok plugin install Egonex-AI/Understand-Anything#understand-anything-plugin --trust'
}
}

function Cmd-Uninstall([string]$Id) {
Expand Down
28 changes: 26 additions & 2 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
grok|$HOME/.grok/skills|per-skill
EOF
}

Expand Down Expand Up @@ -117,6 +118,25 @@ list_skills() {
done
}

# Replace an existing path with a symlink. macOS `ln -sfn` will nest a
# symlink *inside* a real directory instead of replacing it, so remove any
# non-symlink destination first (common when users previously copied skills).
replace_with_symlink() {
local link_path="$1" src_path="$2"
if [[ -e "$link_path" || -L "$link_path" ]]; then
if [[ -L "$link_path" ]]; then
rm -f "$link_path"
elif [[ -d "$link_path" ]]; then
printf ' • replacing existing directory %s with a symlink\n' "$link_path"
rm -rf "$link_path"
else
printf ' • replacing existing file %s with a symlink\n' "$link_path"
rm -f "$link_path"
fi
fi
ln -sfn "$src_path" "$link_path"
}

link_skills() {
local target="$1" style="$2"
local root
Expand All @@ -126,12 +146,12 @@ link_skills() {
per-skill)
local skill
while IFS= read -r skill; do
ln -sfn "$root/$skill" "$target/$skill"
replace_with_symlink "$target/$skill" "$root/$skill"
printf ' ✓ %s → %s\n' "$target/$skill" "$root/$skill"
done < <(list_skills)
;;
folder)
ln -sfn "$root" "$target/understand-anything"
replace_with_symlink "$target/understand-anything" "$root"
printf ' ✓ %s → %s\n' "$target/understand-anything" "$root"
;;
*)
Expand Down Expand Up @@ -232,6 +252,10 @@ KIROEOF
if [[ "$id" == "kiro" ]]; then
printf '\n Usage: kiro-cli chat --agent understand "Analyze this project"\n'
fi
if [[ "$id" == "grok" ]]; then
printf '\n Tip: Grok Build loads skills from ~/.grok/skills/ as slash commands\n'
printf ' (e.g. /understand). Restart Grok, then run /skills to confirm.\n'
fi
}

cmd_uninstall() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,11 @@ Start the Understand Anything dashboard to visualize the knowledge graph for the

3. Find the dashboard code. The dashboard is at `packages/dashboard/` relative to this plugin's root directory. Check these paths in order and use the first that exists:
- `${CLAUDE_PLUGIN_ROOT}/packages/dashboard/` (Claude Code runtime root, highest priority)
- `${GROK_PLUGIN_ROOT}/packages/dashboard/` (Grok Build plugin runtime root)
- `~/.understand-anything-plugin/packages/dashboard/` (universal symlink, all installs)
- Two levels up from `~/.agents/skills/understand-dashboard` real path (self-relative fallback)
- Two levels up from `~/.copilot/skills/understand-dashboard` real path (Copilot personal skills fallback)
- Two levels up from `~/.grok/skills/understand-dashboard` real path (Grok Build personal skills fallback)
- Common clone-based install roots:
- `~/.codex/understand-anything/understand-anything-plugin/packages/dashboard/`
- `~/.opencode/understand-anything/understand-anything-plugin/packages/dashboard/`
Expand All @@ -66,13 +68,17 @@ Start the Understand Anything dashboard to visualize the knowledge graph for the
SELF_RELATIVE=$([ -n "$SKILL_REAL" ] && cd "$SKILL_REAL/../.." 2>/dev/null && pwd || echo "")
COPILOT_SKILL_REAL=$(realpath ~/.copilot/skills/understand-dashboard 2>/dev/null || readlink -f ~/.copilot/skills/understand-dashboard 2>/dev/null || echo "")
COPILOT_SELF_RELATIVE=$([ -n "$COPILOT_SKILL_REAL" ] && cd "$COPILOT_SKILL_REAL/../.." 2>/dev/null && pwd || echo "")
GROK_SKILL_REAL=$(realpath ~/.grok/skills/understand-dashboard 2>/dev/null || readlink -f ~/.grok/skills/understand-dashboard 2>/dev/null || echo "")
GROK_SELF_RELATIVE=$([ -n "$GROK_SKILL_REAL" ] && cd "$GROK_SKILL_REAL/../.." 2>/dev/null && pwd || echo "")

PLUGIN_ROOT=""
for candidate in \
"${CLAUDE_PLUGIN_ROOT}" \
"${GROK_PLUGIN_ROOT}" \
"$HOME/.understand-anything-plugin" \
"$SELF_RELATIVE" \
"$COPILOT_SELF_RELATIVE" \
"$GROK_SELF_RELATIVE" \
"$HOME/.codex/understand-anything/understand-anything-plugin" \
"$HOME/.opencode/understand-anything/understand-anything-plugin" \
"$HOME/.pi/understand-anything/understand-anything-plugin" \
Expand All @@ -86,9 +92,11 @@ Start the Understand Anything dashboard to visualize the knowledge graph for the
echo "Error: Cannot find the understand-anything plugin root."
echo "Checked:"
echo " - ${CLAUDE_PLUGIN_ROOT:-<unset CLAUDE_PLUGIN_ROOT>}"
echo " - ${GROK_PLUGIN_ROOT:-<unset GROK_PLUGIN_ROOT>}"
echo " - $HOME/.understand-anything-plugin"
echo " - ${SELF_RELATIVE:-<unresolved path derived from ~/.agents/skills/understand-dashboard>}"
echo " - ${COPILOT_SELF_RELATIVE:-<unresolved path derived from ~/.copilot/skills/understand-dashboard>}"
echo " - ${GROK_SELF_RELATIVE:-<unresolved path derived from ~/.grok/skills/understand-dashboard>}"
echo " - $HOME/.codex/understand-anything/understand-anything-plugin"
echo " - $HOME/.opencode/understand-anything/understand-anything-plugin"
echo " - $HOME/.pi/understand-anything/understand-anything-plugin"
Expand Down
6 changes: 6 additions & 0 deletions understand-anything-plugin/skills/understand-domain/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,17 @@ SKILL_REAL=$(realpath ~/.agents/skills/understand-domain 2>/dev/null || readlink
SELF_RELATIVE=$([ -n "$SKILL_REAL" ] && cd "$SKILL_REAL/../.." 2>/dev/null && pwd || echo "")
COPILOT_SKILL_REAL=$(realpath ~/.copilot/skills/understand-domain 2>/dev/null || readlink -f ~/.copilot/skills/understand-domain 2>/dev/null || echo "")
COPILOT_SELF_RELATIVE=$([ -n "$COPILOT_SKILL_REAL" ] && cd "$COPILOT_SKILL_REAL/../.." 2>/dev/null && pwd || echo "")
GROK_SKILL_REAL=$(realpath ~/.grok/skills/understand-domain 2>/dev/null || readlink -f ~/.grok/skills/understand-domain 2>/dev/null || echo "")
GROK_SELF_RELATIVE=$([ -n "$GROK_SKILL_REAL" ] && cd "$GROK_SKILL_REAL/../.." 2>/dev/null && pwd || echo "")

PLUGIN_ROOT=""
for candidate in \
"${CLAUDE_PLUGIN_ROOT}" \
"${GROK_PLUGIN_ROOT}" \
"$HOME/.understand-anything-plugin" \
"$SELF_RELATIVE" \
"$COPILOT_SELF_RELATIVE" \
"$GROK_SELF_RELATIVE" \
"$HOME/.codex/understand-anything/understand-anything-plugin" \
"$HOME/.opencode/understand-anything/understand-anything-plugin" \
"$HOME/.pi/understand-anything/understand-anything-plugin" \
Expand All @@ -78,9 +82,11 @@ if [ -z "$PLUGIN_ROOT" ]; then
echo "Error: Cannot find the understand-anything plugin root."
echo "Checked:"
echo " - ${CLAUDE_PLUGIN_ROOT:-<unset CLAUDE_PLUGIN_ROOT>}"
echo " - ${GROK_PLUGIN_ROOT:-<unset GROK_PLUGIN_ROOT>}"
echo " - $HOME/.understand-anything-plugin"
echo " - ${SELF_RELATIVE:-<unresolved path derived from ~/.agents/skills/understand-domain>}"
echo " - ${COPILOT_SELF_RELATIVE:-<unresolved path derived from ~/.copilot/skills/understand-domain>}"
echo " - ${GROK_SELF_RELATIVE:-<unresolved path derived from ~/.grok/skills/understand-domain>}"
echo " - $HOME/.codex/understand-anything/understand-anything-plugin"
echo " - $HOME/.opencode/understand-anything/understand-anything-plugin"
echo " - $HOME/.pi/understand-anything/understand-anything-plugin"
Expand Down
6 changes: 6 additions & 0 deletions understand-anything-plugin/skills/understand/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,17 @@ Determine whether to run a full analysis or incremental update.
SELF_RELATIVE=$([ -n "$SKILL_REAL" ] && cd "$SKILL_REAL/../.." 2>/dev/null && pwd || echo "")
COPILOT_SKILL_REAL=$(realpath ~/.copilot/skills/understand 2>/dev/null || readlink -f ~/.copilot/skills/understand 2>/dev/null || echo "")
COPILOT_SELF_RELATIVE=$([ -n "$COPILOT_SKILL_REAL" ] && cd "$COPILOT_SKILL_REAL/../.." 2>/dev/null && pwd || echo "")
GROK_SKILL_REAL=$(realpath ~/.grok/skills/understand 2>/dev/null || readlink -f ~/.grok/skills/understand 2>/dev/null || echo "")
GROK_SELF_RELATIVE=$([ -n "$GROK_SKILL_REAL" ] && cd "$GROK_SKILL_REAL/../.." 2>/dev/null && pwd || echo "")

PLUGIN_ROOT=""
for candidate in \
"${CLAUDE_PLUGIN_ROOT}" \
"${GROK_PLUGIN_ROOT}" \
"$HOME/.understand-anything-plugin" \
"$SELF_RELATIVE" \
"$COPILOT_SELF_RELATIVE" \
"$GROK_SELF_RELATIVE" \
"$HOME/.codex/understand-anything/understand-anything-plugin" \
"$HOME/.opencode/understand-anything/understand-anything-plugin" \
"$HOME/.pi/understand-anything/understand-anything-plugin" \
Expand All @@ -103,9 +107,11 @@ Determine whether to run a full analysis or incremental update.
echo "Error: Cannot find the understand-anything plugin root."
echo "Checked:"
echo " - ${CLAUDE_PLUGIN_ROOT:-<unset CLAUDE_PLUGIN_ROOT>}"
echo " - ${GROK_PLUGIN_ROOT:-<unset GROK_PLUGIN_ROOT>}"
echo " - $HOME/.understand-anything-plugin"
echo " - ${SELF_RELATIVE:-<unresolved path derived from ~/.agents/skills/understand>}"
echo " - ${COPILOT_SELF_RELATIVE:-<unresolved path derived from ~/.copilot/skills/understand>}"
echo " - ${GROK_SELF_RELATIVE:-<unresolved path derived from ~/.grok/skills/understand>}"
echo " - $HOME/.codex/understand-anything/understand-anything-plugin"
echo " - $HOME/.opencode/understand-anything/understand-anything-plugin"
echo " - $HOME/.pi/understand-anything/understand-anything-plugin"
Expand Down