switch-extension-source
БесплатноЗапускает вложенные скриптыНе проверенSwitch a monorepo extension/skill package between its published npm source and its local working-tree source, guaranteeing exactly one source per package. Use…
от BlackBeltTechnology★ 357 звёзд на GitHubОб этом скилле
Toggle a monorepo extension between npm (published) and local (working tree) source.
Why this exists
GUI equivalent: Settings → Packages exposes a per-row Reset to published version action (change: reset-override-to-npm) that resets a local/git-installed row back to its canonical
npm:<name>— install-first / remove-second, confirm-gated. It is the one-click UI analog ofswitch <pkg> npmhere; keep the two semantically aligned (both drop the localpackages[]registration only, never the working-tree files).
On a dev machine you want extensions to load your live working tree so edits take effect. Distribution users consume the published npm package. Both can be wired at once across two config layers, and whichever pi resolves last wins — non-deterministic ("I edited it but nothing changed"). This skill enforces exactly one source per package.
GLOBAL ~/.pi/agent/settings.json "packages": [...]
npm -> "npm:<npmName>"
local -> "<repoRoot>/packages/<dir>" (dir path; pi resolves package.json "pi")
PROJECT <repo>/.pi/settings.json cleanup only — never added to, never created
strips old "+packages/<dir>/<entry>" paths; prunes entries left with an empty filter
local = global dir path → loads in every session everywhere. There is no project-only mode:
the old overlay flag was removed (a +path filter can only re-enable files already in the root
manifest, so it never loaded anything new) and now exits 1 pointing at plain local.
Commands
npx tsx ./scripts/switch-source.ts status # where each installed pkg loads from
npx tsx ./scripts/switch-source.ts local <pkg> # -> local working tree (global path)
npx tsx ./scripts/switch-source.ts npm <pkg> # -> published npm build
<pkg> = monorepo dir name (kb-extension) OR npm name (@blackbelt-technology/pi-dashboard-kb-extension).
Each switch removes all other representations of that package, timestamped-backs-up every file it
edits (*.bak-switch-*), and re-validates JSON before writing.
Procedure
status— see current source per package.local <pkg>ornpm <pkg>— flip it. Script guarantees single-source.- Re-load:
packages[]is read at session init, so the change takes effect on the next session start. Respawn sessions ornpm run reload(reload alone may not re-resolve the package list in an already-running process — fresh session is the guaranteed path).
Pitfalls
- Bridge plugins (flows/goal/automation) are dashboard-managed via
dashboardPluginBridges/_dashboardManagedPackages. This skill does NOT toggle those — leave them to the dashboard UI. - npm copy is a frozen snapshot, not a symlink to your monorepo. After
npmmode your working-tree edits do NOT load until youlocalagain. - An empty project filter shadows global packages. pi resolves project
packages[]before global and keeps the first entry per extension file path.{"source":"..","extensions":[]}in.pi/settings.jsondisables the root manifest'spackages/extension/src/bridge.ts, so the global bridge entry (same file) is ignored → every session in the repo hitsREGISTER_TIMEOUT. The script prunes such entries on every switch;node scripts/check-pi-settings-paths.mjs(CI) rejects a committed one. - Same package wired in both layers = non-deterministic load order. Always end with
statusshowing one source.
Verification
npx tsx ./scripts/switch-source.ts statusshows the target package at exactly one source.python3 -c "import json; json.load(open('<file>'))"confirms both settings files are valid JSON.- Respawn a session; the extension loads from the chosen source.
Установить switch-extension-source в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл switch-extension-source?
Switch a monorepo extension/skill package between its published npm source and its local working-tree source, guaranteeing exactly one source per package. Use when "my edits don't take effect", "load local extension", "test the published npm build", or reconciling dev vs distribution package sources.
Как установить скилл switch-extension-source?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл switch-extension-source запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic