From aa3a220e75221e83df725cc8a33001fcb59656eb Mon Sep 17 00:00:00 2001 From: smjeong84 Date: Tue, 2 Jun 2026 13:46:55 +0900 Subject: [PATCH 1/2] feat: add Kiro CLI/IDE platform support - Add kiro to install.sh platforms_table (per-skill symlinks to ~/.kiro/skills/) - Generate ~/.kiro/agents/understand.json on install for full pipeline support - Clean up agent JSON on uninstall - Add .kiro-plugin/plugin.json for IDE auto-discovery - Update README with Kiro in platform table, one-line install list, and dedicated section --- .kiro-plugin/plugin.json | 12 ++++++++++++ README.md | 17 +++++++++++++++-- install.sh | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 61 insertions(+), 2 deletions(-) create mode 100644 .kiro-plugin/plugin.json diff --git a/.kiro-plugin/plugin.json b/.kiro-plugin/plugin.json new file mode 100644 index 00000000..d877dbdd --- /dev/null +++ b/.kiro-plugin/plugin.json @@ -0,0 +1,12 @@ +{ + "name": "understand-anything", + "description": "AI-powered codebase understanding — analyze, visualize, and explain any project", + "version": "2.7.5", + "author": { "name": "Lum1104" }, + "homepage": "https://github.com/Lum1104/Understand-Anything", + "repository": "https://github.com/Lum1104/Understand-Anything", + "license": "MIT", + "keywords": ["codebase-analysis", "knowledge-graph", "architecture", "onboarding", "dashboard"], + "skills": "./understand-anything-plugin/skills/", + "agents": "./understand-anything-plugin/agents/" +} diff --git a/README.md b/README.md index 3bdb4db2..550ed56f 100644 --- a/README.md +++ b/README.md @@ -184,7 +184,7 @@ Understand-Anything works across multiple AI coding platforms. /plugin install understand-anything ``` -### One-line install (Codex / OpenCode / OpenClaw / Antigravity / Gemini CLI / Pi Agent / Vibe CLI / VS Code Copilot / Hermes / Cline / KIMI CLI / Trae) +### One-line install (Codex / OpenCode / OpenClaw / Antigravity / Gemini CLI / Pi Agent / Vibe CLI / VS Code Copilot / Hermes / Cline / KIMI CLI / Trae / Kiro) **macOS / Linux:** ```bash @@ -200,7 +200,7 @@ iwr -useb https://raw.githubusercontent.com/Lum1104/Understand-Anything/main/ins The installer clones the repo to `~/.understand-anything/repo` and creates the right symlinks for the chosen platform. Restart your CLI/IDE afterwards. -- Supported `` values: `gemini`, `codex`, `opencode`, `pi`, `openclaw`, `antigravity`, `vibe`, `vscode`, `hermes`, `cline`, `kimi`, `trae` +- Supported `` values: `gemini`, `codex`, `opencode`, `pi`, `openclaw`, `antigravity`, `vibe`, `vscode`, `hermes`, `cline`, `kimi`, `trae`, `kiro` - Update later: `./install.sh --update` - Uninstall: `./install.sh --uninstall ` @@ -222,6 +222,18 @@ For personal skills (available across all projects), run the `install.sh` above copilot plugin install Lum1104/Understand-Anything:understand-anything-plugin ``` +### Kiro CLI / IDE + +```bash +curl -fsSL https://raw.githubusercontent.com/Lum1104/Understand-Anything/main/install.sh | bash -s kiro +``` + +After installation: +- **Kiro CLI**: `kiro-cli chat --agent understand "Analyze this project"` +- **Kiro IDE**: Open the cloned repo — auto-discovered via `.kiro-plugin/plugin.json` + +For personal skills (available across all projects), run the `install.sh` above with the `kiro` platform. + ### Platform Compatibility | Platform | Status | Install Method | @@ -241,6 +253,7 @@ copilot plugin install Lum1104/Understand-Anything:understand-anything-plugin | Cline | ✅ Supported | `install.sh cline` | | KIMI CLI | ✅ Supported | `install.sh kimi` | | Trae | ✅ Supported | `install.sh trae` | +| Kiro CLI / IDE | ✅ Supported | `install.sh kiro` | --- diff --git a/install.sh b/install.sh index 8ff42935..2563812f 100755 --- a/install.sh +++ b/install.sh @@ -40,6 +40,7 @@ hermes|$HOME/.hermes/skills|folder cline|$HOME/.cline/skills|folder kimi|$HOME/.kimi/skills|folder trae|$HOME/.trae/skills|per-skill +kiro|$HOME/.kiro/skills|per-skill EOF } @@ -189,12 +190,41 @@ cmd_install() { printf -- '→ Linking universal plugin root\n' link_plugin_root + if [[ "$id" == "kiro" ]]; then + printf -- '→ Creating Kiro agent configuration\n' + mkdir -p "$HOME/.kiro/agents" + local plugin_root="$REPO_DIR/understand-anything-plugin" + cat > "$HOME/.kiro/agents/understand.json" < Date: Tue, 16 Jun 2026 14:18:56 +0900 Subject: [PATCH 2/2] fix(install): address PR #364 review feedback for Kiro support Addresses the maintainer (@Lum1104) change requests and the Codex review on PR #364. install.sh - Build the Kiro agent's "resources" list dynamically by iterating over understand-anything-plugin/agents/*.md instead of hard-coding each path (review: "do not hard code the agents, instead use loop of the repo dir"). Deterministic order via LC_ALL=C sort; pure bash, no jq dependency. This also fixes pre-existing drift: the hard-coded list had 7 entries and was missing article-analyzer.md and knowledge-graph-guide.md, while 9 agent files actually exist. - Drop the unsupported "Kiro IDE auto-discovers .kiro-plugin/plugin.json" install tip; keep the usage hint. install.ps1 (Windows) - Add the `kiro` platform entry (~/.kiro/skills, per-skill) so `install.ps1 kiro` no longer fails with "Unknown platform: kiro". - Generate ~/.kiro/agents/understand.json in Cmd-Install using the same dynamic agent discovery; emit forward-slashed file:// URIs and write UTF-8 without a BOM via [System.IO.File]::WriteAllText. - Remove the agent JSON in Cmd-Uninstall. README.md - Point the Kiro install command at the canonical Egonex-AI repo instead of Lum1104 (Codex P2: a lagging fork would error "Unknown platform: kiro" before cloning the canonical repo). - Replace the unverified ".kiro-plugin auto-discovery" claim with the actual behavior (skills symlinked into ~/.kiro/skills, agent written to ~/.kiro/agents/understand.json). Remove .kiro-plugin/plugin.json - Kiro's documented discovery locations are ~/.kiro/agents, .kiro/skills and .kiro/prompts only; .kiro-plugin/plugin.json is never read, so the file and the claims that referenced it are removed (maintainer: "use install.sh only is fine"). Verification - install.sh: `bash -n` clean; executed the real agent-JSON generation block -> valid JSON with 9 resources; `kiro-cli agent validate` exit 0. - install.ps1: parsed with 0 syntax errors (PowerShell 7.6.2 AST parser); ConvertTo-FileUri yields file:///C:/... for Windows paths; the real Cmd-Install "kiro" path runs without error and produces JSON that passes `kiro-cli agent validate` (exit 0). --- .kiro-plugin/plugin.json | 12 ------------ README.md | 4 ++-- install.ps1 | 42 ++++++++++++++++++++++++++++++++++++++++ install.sh | 23 ++++++++++++---------- 4 files changed, 57 insertions(+), 24 deletions(-) delete mode 100644 .kiro-plugin/plugin.json diff --git a/.kiro-plugin/plugin.json b/.kiro-plugin/plugin.json deleted file mode 100644 index d877dbdd..00000000 --- a/.kiro-plugin/plugin.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "understand-anything", - "description": "AI-powered codebase understanding — analyze, visualize, and explain any project", - "version": "2.7.5", - "author": { "name": "Lum1104" }, - "homepage": "https://github.com/Lum1104/Understand-Anything", - "repository": "https://github.com/Lum1104/Understand-Anything", - "license": "MIT", - "keywords": ["codebase-analysis", "knowledge-graph", "architecture", "onboarding", "dashboard"], - "skills": "./understand-anything-plugin/skills/", - "agents": "./understand-anything-plugin/agents/" -} diff --git a/README.md b/README.md index 117ac92d..98ab4cc2 100644 --- a/README.md +++ b/README.md @@ -236,12 +236,12 @@ copilot plugin install Egonex-AI/Understand-Anything:understand-anything-plugin ### Kiro CLI / IDE ```bash -curl -fsSL https://raw.githubusercontent.com/Lum1104/Understand-Anything/main/install.sh | bash -s kiro +curl -fsSL https://raw.githubusercontent.com/Egonex-AI/Understand-Anything/main/install.sh | bash -s kiro ``` After installation: - **Kiro CLI**: `kiro-cli chat --agent understand "Analyze this project"` -- **Kiro IDE**: Open the cloned repo — auto-discovered via `.kiro-plugin/plugin.json` +- **Kiro IDE**: The skills are symlinked into `~/.kiro/skills/` and the `understand` agent is written to `~/.kiro/agents/understand.json`, so both are available after restarting the IDE. For personal skills (available across all projects), run the `install.sh` above with the `kiro` platform. diff --git a/install.ps1 b/install.ps1 index b5504d0f..5476887b 100644 --- a/install.ps1 +++ b/install.ps1 @@ -40,6 +40,7 @@ $Platforms = [ordered]@{ kimi = @{ Target = (Join-Path $HOME '.kimi\skills'); Style = 'folder' } 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' } } function Show-Usage { @@ -192,6 +193,11 @@ function Link-Plugin-Root { } } +function ConvertTo-FileUri([string]$Path) { + # Produce a forward-slashed file URI (Windows: file:///C:/path/...). + return 'file:///' + ($Path -replace '\\', '/') +} + function Cmd-Install([string]$Id) { $cfg = Resolve-Platform $Id Clone-Or-Update @@ -200,18 +206,54 @@ function Cmd-Install([string]$Id) { Write-Host '→ Linking universal plugin root' Link-Plugin-Root + if ($Id -eq 'kiro') { + Write-Host '→ Creating Kiro agent configuration' + $agentsDir = Join-Path $HOME '.kiro\agents' + if (-not (Test-Path $agentsDir)) { New-Item -ItemType Directory -Path $agentsDir | Out-Null } + $pluginRoot = Join-Path $RepoDir 'understand-anything-plugin' + + # Build the "resources" list dynamically from the agent definitions in + # the repo so it never drifts as agents are added or removed. + $resources = @( + Get-ChildItem -Path (Join-Path $pluginRoot 'agents') -Filter '*.md' -File | + Sort-Object Name | + ForEach-Object { ConvertTo-FileUri $_.FullName } + ) + $agent = [ordered]@{ + name = 'understand' + description = 'Analyze codebase into interactive knowledge graph — Understand Anything' + prompt = ConvertTo-FileUri (Join-Path $pluginRoot 'skills\understand\SKILL.md') + tools = @('read', 'write', 'shell', 'grep', 'glob', 'code', 'subagent') + resources = $resources + } + $agentJson = Join-Path $agentsDir 'understand.json' + # WriteAllText emits UTF-8 without a BOM on every PowerShell version. + [System.IO.File]::WriteAllText($agentJson, ($agent | ConvertTo-Json -Depth 5)) + Write-Host " ✓ $agentJson" + } + Write-Host "`n✓ Installed Understand-Anything for $Id" Write-Host ' Restart your CLI or IDE to pick up the skills.' if ($Id -eq 'vscode') { Write-Host "`n Tip: VS Code can also auto-discover the plugin by opening this repo" Write-Host ' directly (it reads .copilot-plugin/plugin.json), no symlinks needed.' } + if ($Id -eq 'kiro') { + Write-Host "`n Usage: kiro-cli chat --agent understand `"Analyze this project`"" + } } function Cmd-Uninstall([string]$Id) { $cfg = Resolve-Platform $Id Write-Host "→ Removing skill links for $Id" Unlink-Skills $cfg.Target $cfg.Style + if ($Id -eq 'kiro') { + $agentJson = Join-Path $HOME '.kiro\agents\understand.json' + if (Test-Path $agentJson) { + Remove-Item -LiteralPath $agentJson -Force + Write-Host " ✓ removed $agentJson" + } + } if (Remove-Reparse $PluginLink) { Write-Host " ✓ removed $PluginLink" } diff --git a/install.sh b/install.sh index 71eda519..1c342311 100755 --- a/install.sh +++ b/install.sh @@ -195,6 +195,17 @@ cmd_install() { printf -- '→ Creating Kiro agent configuration\n' mkdir -p "$HOME/.kiro/agents" local plugin_root="$REPO_DIR/understand-anything-plugin" + + # Build the "resources" list dynamically from the agent definitions in the + # repo so it never drifts as agents are added or removed. Deterministic + # order via LC_ALL=C sort; no external deps (no jq) so it runs anywhere. + local resources="" agent_md + while IFS= read -r agent_md; do + [[ -n "$agent_md" ]] || continue + [[ -n "$resources" ]] && resources+=$',\n' + resources+=" \"file://$agent_md\"" + done < <(find "$plugin_root/agents" -maxdepth 1 -type f -name '*.md' | LC_ALL=C sort) + cat > "$HOME/.kiro/agents/understand.json" <