From 7841a5310220ec4b74bae8902ef7a12bb8a80ff5 Mon Sep 17 00:00:00 2001 From: bastien Date: Wed, 6 May 2026 17:09:28 +0200 Subject: [PATCH] chore(memory): capitalize LRN-007 from toggle-external fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pattern: toggle scripts for tools with separate install + symlink steps must check 3 states (disabled-dir, enabled-dir, source-only), not 2. Source-only branch creates symlink in place rather than failing. Error messages name the path checked, not just the abstract tool name, so callers can diagnose install vs symlink state without rereading the script. Symmetric pairs (enable/disable) must both cover the same lifecycle states — missing state in one half = silent dead end. Co-Authored-By: Claude --- .claude/memory/learnings.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.claude/memory/learnings.md b/.claude/memory/learnings.md index 49cea12..c3f9909 100644 --- a/.claude/memory/learnings.md +++ b/.claude/memory/learnings.md @@ -94,4 +94,15 @@ rules: ``` - Detection of "is this MCP correctly set up?" must look for the derived name (`caveman-shrink-*`), not the bare proxy name. Bare-name registration is treated as broken. - Default install scripts should NOT auto-register middleware MCPs — print the snippet for the user to choose an upstream. See `install-plugins.sh` STEP 5.5. -- **Reference**: commit `9b20b84`, `lib/detect-plugins.sh:detect_caveman_shrink`, `install-plugins.sh` STEP 5.5 MCP block. \ No newline at end of file +- **Reference**: commit `9b20b84`, `lib/detect-plugins.sh:detect_caveman_shrink`, `install-plugins.sh` STEP 5.5 MCP block. + +## LRN-007 — `toggle-external.sh enable` missed source-only state + +- **Date**: 2026-05-06 +- **Pattern**: `lib/toggle-external.sh enable ` for npx/external skills (`darwin-skill`, `find-skills`, `emil-design-eng`) handled 2 states only: symlink in `skills-disabled/` → move to `skills/`, or symlink in `skills/` → already enabled. Missed 3rd: source dir at `~/.agents/skills/` but no symlink. First-run after `make plugin` lands here until `bash link.sh` runs. `enable` errored `not installed — run: make plugin` — misleading, plugin already installed. +- **Context**: user ran `./lib/toggle-external.sh enable darwin-skill` after fresh install. `~/.agents/skills/darwin-skill/` populated by `install-plugins.sh` STEP 8.5 npx call, but `link.sh` (separate step) not run, so `skills/darwin-skill` symlink never created. Fix `lib/toggle-external.sh:161-179` — add `elif [ -d "$src" ]` branch creating symlink direct when source dir present. Error message now show resolved source path. +- **Future application**: + - Any toggle script for tools with separate install + symlink steps must check 3 states: disabled-dir, enabled-dir, source-only. Source-only branch create symlink in place, not fail. + - Error messages name path checked, not abstract tool name — caller verify install vs symlink state without rereading script. + - Symmetric pairs (`enable`/`disable`) both handle same lifecycle states; missing state in one half = silent dead end. +- **Reference**: `lib/toggle-external.sh:161-179`, `link.sh:69-83`, `install-plugins.sh:598-633` STEP 8.5. \ No newline at end of file