Skip to content
Merged
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: 17 additions & 0 deletions .cursor/environment.json
Original file line number Diff line number Diff line change
@@ -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
}
]
}
5 changes: 1 addition & 4 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1140,12 +1140,10 @@ <h3>No Staged Changes</h3>

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();
Expand Down Expand Up @@ -1696,7 +1694,6 @@ <h3>No Staged Changes</h3>
.replace(/>/g, '&gt;')
.replace(/"/g, '&quot;')
.replace(/'/g, '&#39;');
.replace(/'/g, '&#039;');
}

// Keyboard shortcuts
Expand Down
35 changes: 35 additions & 0 deletions scripts/link-agent-skills.sh
Original file line number Diff line number Diff line change
@@ -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"
Loading