From 9b2a7ea91f078f51a3db851f42acddea9e89a132 Mon Sep 17 00:00:00 2001 From: Serge Gatezh <2880401+gatezh@users.noreply.github.com> Date: Mon, 13 Apr 2026 21:38:40 -0600 Subject: [PATCH] fix(claude-code): register marketplaces + fix ARM64 cache path in init-plugins (#74) Plugin installs failed silently because marketplaces were never registered before postCreateCommand runs. Also fix the Playwright ARM64 patch to target the runtime cache dir instead of the marketplace source dir, and surface errors instead of suppressing. --- claude-code/.devcontainer/init-plugins.sh | 38 +++++++++++++++++++---- 1 file changed, 32 insertions(+), 6 deletions(-) diff --git a/claude-code/.devcontainer/init-plugins.sh b/claude-code/.devcontainer/init-plugins.sh index c286231..268b0b1 100644 --- a/claude-code/.devcontainer/init-plugins.sh +++ b/claude-code/.devcontainer/init-plugins.sh @@ -16,6 +16,22 @@ else echo '{"hasCompletedOnboarding":true}' > "$HOME/.claude/.claude.json" fi +# ── Claude Code marketplaces ──────────────────────────────────────────────── +# The official marketplace is auto-configured on first interactive launch, but +# postCreateCommand runs before that — register explicitly so plugin install works. +MARKETPLACES=( + "anthropics/claude-plugins-official" + "umputun/ralphex" +) + +for marketplace in "${MARKETPLACES[@]}"; do + if claude plugin marketplace add "$marketplace" 2>&1; then + echo "✔ Marketplace added: $marketplace" + else + echo "⚠ Failed to add marketplace: $marketplace" >&2 + fi +done + # ── Claude Code plugins ───────────────────────────────────────────────────── # Customize this list — remove plugins you don't use. PLUGINS=( @@ -33,17 +49,27 @@ PLUGINS=( ) for plugin in "${PLUGINS[@]}"; do - claude plugin install "$plugin" 2>/dev/null || true + if claude plugin install "$plugin" 2>&1; then + echo "✔ Installed: $plugin" + else + echo "⚠ Failed to install: $plugin" >&2 + fi done # ── Playwright MCP: use Chromium on ARM64 (#64) ───────────────────────────── # @playwright/mcp defaults to --browser chrome, which has no Linux ARM64 builds. # Patch the plugin config to use chromium instead. No-op on AMD64. -PLAYWRIGHT_MCP_CONFIG="$HOME/.claude/plugins/marketplaces/claude-plugins-official/external_plugins/playwright/.mcp.json" -if [ "$(uname -m)" = "aarch64" ] && [ -f "$PLAYWRIGHT_MCP_CONFIG" ]; then - jq '.playwright.args = ["@playwright/mcp@latest", "--browser", "chromium"]' \ - "$PLAYWRIGHT_MCP_CONFIG" > /tmp/playwright-mcp.json \ - && mv /tmp/playwright-mcp.json "$PLAYWRIGHT_MCP_CONFIG" +# Plugins run from the cache dir (~/.claude/plugins/cache), not the marketplace +# source dir. The cache path includes a version hash — resolve via find. +if [ "$(uname -m)" = "aarch64" ]; then + PLAYWRIGHT_MCP_CONFIG=$(find "$HOME/.claude/plugins/cache" \ + -path "*/playwright*/.mcp.json" -print -quit 2>/dev/null) + if [ -n "$PLAYWRIGHT_MCP_CONFIG" ]; then + jq '.playwright.args = ["@playwright/mcp@latest", "--browser", "chromium"]' \ + "$PLAYWRIGHT_MCP_CONFIG" > /tmp/playwright-mcp.json \ + && mv /tmp/playwright-mcp.json "$PLAYWRIGHT_MCP_CONFIG" + echo "✔ Playwright MCP patched for ARM64 Chromium" + fi fi # ── rtk init (token-optimized CLI proxy) ────────────────────────────────────