From 4535cce70097dab1ac3f61845f28f350c2ab5a6f Mon Sep 17 00:00:00 2001 From: bastien Date: Wed, 6 May 2026 17:09:21 +0200 Subject: [PATCH] fix(toggle-external): handle source-only state in enable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `enable ` for npx/external skills (darwin-skill, find-skills, emil-design-eng) only handled two states: symlink in skills-disabled/ (move) and symlink in skills/ (already enabled). Missed the state right after `make plugin` where the source dir exists at ~/.agents/skills/ but no symlink has been created yet — first run errored "not installed — run: make plugin" misleadingly. Add a third branch: when the resolved source dir exists, create the symlink in place. Resolve source path per tool (skills-external for emil-design-eng, ~/.agents/skills for darwin-skill/find-skills). Error message now names the path checked so the caller can verify install vs symlink state without rereading the script. Co-Authored-By: Claude --- lib/toggle-external.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/toggle-external.sh b/lib/toggle-external.sh index b7904d2..29a5f6a 100755 --- a/lib/toggle-external.sh +++ b/lib/toggle-external.sh @@ -159,14 +159,22 @@ enable_tool() { fi ;; emil-design-eng|darwin-skill|find-skills) + local src + case "$tool" in + emil-design-eng) src="$REPO/skills-external/$tool" ;; + darwin-skill|find-skills) src="$HOME/.agents/skills/$tool" ;; + esac if [ -e "$DISABLED_DIR/$tool" ]; then rm -rf "${SKILLS_DIR:?}/${tool:?}" mv "$DISABLED_DIR/$tool" "$SKILLS_DIR/$tool" ok "$tool enabled" elif [ -e "$SKILLS_DIR/$tool" ]; then warn "$tool already enabled" + elif [ -d "$src" ]; then + ln -sf "$src" "$SKILLS_DIR/$tool" + ok "$tool enabled (symlink created → $src)" else - err "$tool not installed — run: make plugin" + err "$tool not installed at $src — run: make plugin" return 1 fi ;;