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
2 changes: 1 addition & 1 deletion .cursor/environment.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "AI Visual Code Review",
"install": "npm ci\nbash scripts/link-agent-skills.sh",
"install": "npm ci && bash scripts/link-agent-skills.sh",
"terminals": [
{
"name": "server",
Expand Down
11 changes: 8 additions & 3 deletions scripts/link-agent-skills.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
# (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).
# Idempotent and safe to run repeatedly: 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`.
# Called from `.cursor/environment.json` install (after `npm ci`).
set -euo pipefail

REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
Expand All @@ -24,6 +24,11 @@ link_packs() {
for pack in "$repo_dir"/*/; do
[ -d "$pack" ] || continue
name="$(basename "$pack")"
# If a real (non-symlink) directory/file already occupies the target,
# remove it first so ln does not create a nested link inside it.
if [ -e "$home_dir/$name" ] && [ ! -L "$home_dir/$name" ]; then
rm -rf "$home_dir/$name"
fi
ln -sfn "${pack%/}" "$home_dir/$name"
echo "link-agent-skills: linked $home_dir/$name -> ${pack%/}"
done
Expand Down
Loading