diff --git a/.cursor/environment.json b/.cursor/environment.json new file mode 100644 index 0000000..6226e4b --- /dev/null +++ b/.cursor/environment.json @@ -0,0 +1,17 @@ +{ + "name": "AI Visual Code Review", + "install": "npm ci\nbash scripts/link-agent-skills.sh", + "terminals": [ + { + "name": "server", + "command": "npm start", + "description": "Express web server for the AI Visual Code Review app, served at http://localhost:3002" + } + ], + "ports": [ + { + "name": "web", + "port": 3002 + } + ] +} diff --git a/public/index.html b/public/index.html index cd715a1..9d62d07 100644 --- a/public/index.html +++ b/public/index.html @@ -1140,12 +1140,10 @@

No Staged Changes

container.innerHTML = ''; - // Create a DocumentFragment to batch DOM insertions + // Create a DocumentFragment to batch DOM insertions to prevent O(N) layout thrashing const fragment = document.createDocumentFragment(); // Enhanced file processing with better icons and metadata - // ⚡ Bolt: Batch DOM insertions using a DocumentFragment to prevent O(N) layout thrashing - const fragment = document.createDocumentFragment(); data.files.forEach((file, index) => { const fileId = file.replace(/[^a-zA-Z0-9]/g, '_'); const fileExt = file.substring(file.lastIndexOf('.')).toLowerCase(); @@ -1696,7 +1694,6 @@

No Staged Changes

.replace(/>/g, '>') .replace(/"/g, '"') .replace(/'/g, '''); - .replace(/'/g, '''); } // Keyboard shortcuts diff --git a/scripts/link-agent-skills.sh b/scripts/link-agent-skills.sh new file mode 100755 index 0000000..d09cdc9 --- /dev/null +++ b/scripts/link-agent-skills.sh @@ -0,0 +1,35 @@ +#!/usr/bin/env bash +# +# link-agent-skills.sh +# +# Symlinks the repo-vendored agent skill packs into the user's home skill +# directories so they are active for agents that read ~/.claude/skills +# (Claude Code, Cursor) and ~/.agents/skills (Codex, Prime Agent) globally, +# not just from this repo's working tree. +# +# Idempotent and safe to run on every boot: it skips gracefully when the +# repo skill directories are not present (e.g. before the skills PR is merged). +# +# Called from `.cursor/environment.json` install after `npm ci`. +set -euo pipefail + +REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" +HOME_DIR="${HOME:-/home/ubuntu}" + +link_packs() { + local repo_dir="$1" home_dir="$2" + [ -d "$repo_dir" ] || { echo "link-agent-skills: $repo_dir not present, skipping"; return 0; } + mkdir -p "$home_dir" + local pack name + for pack in "$repo_dir"/*/; do + [ -d "$pack" ] || continue + name="$(basename "$pack")" + ln -sfn "${pack%/}" "$home_dir/$name" + echo "link-agent-skills: linked $home_dir/$name -> ${pack%/}" + done +} + +link_packs "$REPO_ROOT/.claude/skills" "$HOME_DIR/.claude/skills" +link_packs "$REPO_ROOT/.agents/skills" "$HOME_DIR/.agents/skills" + +echo "link-agent-skills: done"