Skip to content

fix: プラグインインストールの PATH 不整合とライブラリパス修正 - #474

Merged
keito4 merged 1 commit into
mainfrom
fix/plugin-install-path-and-marketplace
Feb 13, 2026
Merged

fix: プラグインインストールの PATH 不整合とライブラリパス修正#474
keito4 merged 1 commit into
mainfrom
fix/plugin-install-path-and-marketplace

Conversation

@keito4

@keito4 keito4 commented Feb 13, 2026

Copy link
Copy Markdown
Owner

Summary

  • Docker ビルド時に全12プラグインが claude: command not found で失敗していた根本原因を修正
  • ENV PATH 追加で claude CLI をビルド全体で利用可能に
  • lib コピー先パスの不整合(/tmp/script-lib/tmp/script/lib)を修正
  • install-claude-plugins.sh をライブラリ関数利用にリファクタリング
  • 3 マーケットプレイス追加(supabase, agent-browser, context7)でスキルと Plugin を併用管理

Test plan

  • shellcheck -x script/install-claude-plugins.sh が警告なしで通ること
  • Docker ビルドログで claude plugin marketplace add が成功すること
  • Docker ビルドログで全プラグインのインストールが成功すること
  • CI が green であること

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added three new plugins and skills: postgres-best-practices, agent-browser, and context7 for enhanced functionality.
  • Improvements

    • Enhanced plugin installation process with improved credential handling and structured logging.
    • Expanded development environment toolchain with additional system dependencies.
  • Chores

    • Updated Vercel dependency to latest version.
    • Added security vulnerability ignores for path-to-regexp and related CVEs.

Docker ビルド時に全プラグインが `claude: command not found` で失敗していた問題を修正。

- ENV PATH 追加で claude CLI をビルド全体で利用可能に
- lib コピー先を /tmp/script-lib → /tmp/script/lib に統一
- install-claude-plugins.sh をライブラリ関数利用にリファクタリング
- 3 マーケットプレイス追加 (supabase, agent-browser, context7)
- vercel 50.16.0 更新、CVE-2024-45296 を .trivyignore に追加

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Feb 13, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

This PR adds three new Claude marketplaces (agent-browser, intellectronica-skills, supabase-agent-skills) and corresponding plugins. It refactors the plugin installation script to support dynamic credential handling, generate marketplace configurations from templates, and implement structured logging. It also updates development environment dependencies and security vulnerability ignores.

Changes

Cohort / File(s) Summary
Marketplace and Plugin Configuration
.claude/plugins/known_marketplaces.json.template, .claude/plugins/plugins.txt, .claude/skills/skills.txt, script/lib/claude_plugins.sh
Added three new marketplace entries (agent-browser, intellectronica-skills, supabase-agent-skills) with corresponding plugin registrations and skill associations; expanded fallback marketplace resolution array.
Plugin Installation Workflow
script/install-claude-plugins.sh
Refactored to support multiple credential sources (BuildKit secret, OAuth token, API key), generate known_marketplaces.json from template, implement structured logging functions, and delegate marketplace/plugin operations to helper functions; removed hard-coded marketplace initialization.
Development Environment
.devcontainer/Dockerfile
Added apt-get upgrade step, expanded toolchain and runtime dependencies (sox, build-essential, pkg-config, libssl-dev, libasound2-dev, ca-certificates, gnupg, wget, xz-utils, shellcheck, Python packages, apt-transport-https), introduced explicit PATH update for Claude CLI, updated script library copy destination path.
Security and Dependencies
.trivyignore, npm/global.json
Added Vercel path-to-regexp vulnerability and ReDoS CVE-2024-45296 ignore entries; updated vercel dependency from 50.15.1 to 50.16.0.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

size/S

Poem

🐰 Three new marketplaces hop into the warren,
With plugins and skills in tidy arrangement!
Credentials flow gently through structured cascades,
And templates blooming where config once lived—
A rabbit's refactor, both tidy and swift! ✨

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main changes: fixing PATH inconsistencies in plugin installation and correcting library paths, which are the core fixes for the Docker build issues.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into main

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/plugin-install-path-and-marketplace

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

keito4 commented Feb 13, 2026

Copy link
Copy Markdown
Owner Author

🔍 AI Code Review (Local Hook)

Models: Codex (default) / Gemini (default)

🤖 Codex Review

origin/main とのマージベース 6b85bb4b722d564273ec8c073bf4c5675265cc38 から HEAD までの差分をレビューしました。

発見事項:

  • 重大なアクション可能問題は見つかりませんでした。

補足(残留リスク/テストギャップ):

  • script/install-claude-plugins.shscript/lib/claude_plugins.sh の構文は bash -n で問題なし。
  • ただし、プラグイン追加/インストール処理は外部サービス依存のため、この環境では実行時成否(実際の marketplace 解決や認証連携)までは検証できていません。

判定: patch is correct
理由: 差分に明確な正確性・性能・セキュリティ・保守性の回帰を示す変更は確認できませんでした。
信頼度: 0.88


🤖 Generated by post_pr_ai_review.py hook

keito4 commented Feb 13, 2026

Copy link
Copy Markdown
Owner Author

🔍 AI Code Review (Local Hook)

Models: Codex (default) / Gemini (default)

🤖 Codex Review

発見事項はありません。
git merge-base origin/main HEAD で取得した 6b85bb4b722d564273ec8c073bf4c5675265cc38 から HEAD までの差分を確認し、正確性・パフォーマンス・セキュリティ・保守性・開発者体験に関して、変更によって新規導入されたアクション可能な重大問題は見つかりませんでした。

判定: patch is correct
理由: 変更は主にプラグイン導入フローの整理・マーケットプレイス定義追加・パス整合性修正で、差分上で機能破壊や明確な脆弱化は確認できませんでした。
信頼度: 0.82


🤖 Generated by post_pr_ai_review.py hook

@claude

claude Bot commented Feb 13, 2026

Copy link
Copy Markdown
Contributor

Code Review - PR #474

概要

Docker ビルド時のプラグインインストール失敗を修正する重要な変更です。PATH設定の修正とライブラリパスの統一により、根本原因が適切に解決されています。


✅ 良い点

1. 根本原因の適切な解決

  • ENV PATH の追加により、Docker ビルド全体で claude CLI が利用可能に
  • ライブラリパスの不整合 (/tmp/script-lib/tmp/script/lib) を修正
  • .devcontainer/Dockerfile:80 での PATH 設定により、以降のすべての RUN 命令で claude コマンドが利用可能

2. リファクタリングの質

  • install-claude-plugins.sh がライブラリ関数を活用する構造に改善
  • 重複コードを削減し、保守性が向上
  • エラーハンドリングが改善され、詳細なログ出力を実装

3. セキュリティ

  • 認証情報の削除 (L105) を確実に実行
  • chmod 600 による適切な権限設定 (L57)
  • 機密情報の適切な管理

4. マーケットプレイス管理の改善

  • known_marketplaces.json.template からの自動生成
  • 新規マーケットプレイス (supabase, agent-browser, context7) の追加
  • フォールバック機構の実装により堅牢性が向上

⚠️ 潜在的な問題点

1. apt-get upgrade のリスク (.devcontainer/Dockerfile:15)

RUN apt-get update && apt-get upgrade -y && apt-get install -y \

問題:

  • apt-get upgrade -y はビルドの再現性を損なう可能性があります
  • セキュリティパッチは必要ですが、予期しないパッケージ更新によりビルドが壊れる可能性

推奨:

# セキュリティアップデートのみ適用
RUN apt-get update && apt-get install -y --only-upgrade \
    $(apt-get --just-print upgrade | grep "^Inst" | grep -i security | awk '{print $2}') \
    && apt-get install -y \

または、特定のパッケージのみ明示的にアップグレード:

RUN apt-get update && apt-get install -y --only-upgrade openssl libssl3 \
    && apt-get install -y \

2. PATH フォールバックの重複 (script/install-claude-plugins.sh:14-20)

# Dockerfile の ENV PATH で設定されるが、念のため確認
for _bin_dir in "/home/vscode/.claude/local/bin" "${HOME}/.claude/local/bin"; do
    if [[ -d "$_bin_dir" ]] && [[ ":${PATH}:" != *":${_bin_dir}:"* ]]; then
        export PATH="${_bin_dir}:${PATH}"
    fi
done

問題:

  • Dockerfile:80 で ENV PATH が設定されているため、このループは不要になった
  • コメントにも「念のため」とあるが、実質的にデッドコード

推奨:
このコードを削除するか、実行時スクリプト(DevContainer起動後)でのみ使用するように分離

3. エラーハンドリングの一貫性 (script/install-claude-plugins.sh:78-83)

else
    log_warn "認証情報が見つかりません"
    echo "  - BuildKit secret: $CREDENTIALS_SECRET"
    echo "  - 環境変数: CLAUDE_CODE_OAUTH_TOKEN または ANTHROPIC_API_KEY"
    exit 1

問題:

  • log_warn を使用しているが、直後に exit 1 で失敗している
  • 警告ではなくエラーなので log_error を使用すべき

推奨:

else
    log_error "認証情報が見つかりません"
    echo "  - BuildKit secret: $CREDENTIALS_SECRET"
    echo "  - 環境変数: CLAUDE_CODE_OAUTH_TOKEN または ANTHROPIC_API_KEY"
    exit 1
fi

4. バージョン固定の欠如 (npm/global.json:77)

"vercel": {
  "version": "50.16.0",
  "overridden": false
}

懸念:

  • vercel 50.16.0 への更新は良いが、CVE-2024-45296 は transitive dependency (path-to-regexp) の問題
  • .trivyignore で無視しているが、Vercel 側の修正を待つ必要がある

推奨:

  • Vercel の GitHub issues でトラッキング issue を作成し、定期的に確認
  • package.json に resolutions/overrides を追加して path-to-regexp を強制的にアップデート(可能な場合)

🔍 テストカバレッジ

Test Plan のチェック項目:

  • shellcheck -x script/install-claude-plugins.sh警告なし
  • ⏳ Docker ビルドログでのマーケットプレイス追加成功 → CI pending
  • ⏳ Docker ビルドログでの全プラグインインストール成功 → CI pending
  • ⏳ CI が green → Trivy Container Scan pending

追加推奨テスト:

  1. ローカルでの Docker ビルドテスト(認証情報あり/なし)
  2. インストールされたプラグインの動作確認
  3. known_marketplaces.json の生成確認

📝 コードスタイル & ベストプラクティス

✅ 良好な点:

  • ShellCheck ディレクティブの適切な使用 (L38, 40)
  • set -euo pipefail による厳格なエラーハンドリング
  • 詳細なコメントとセクション分割
  • ライブラリの再利用性

改善提案:

  1. ログレベルの一貫性: log_error の追加を検討
  2. テンプレート生成の冪等性: known_marketplaces.json が既に存在する場合の処理
  3. Exit Code の明確化: 異なるエラー条件で異なる exit code を使用

🔐 セキュリティレビュー

✅ 適切な対応:

  • 認証情報の削除 (L105)
  • chmod 600 による権限制限 (L57)
  • BuildKit secret の活用

追加推奨:

  • unset CLAUDE_CODE_OAUTH_TOKEN ANTHROPIC_API_KEY で環境変数も削除
  • ビルドログに認証トークンが漏れないよう確認

📊 パフォーマンス考慮事項

  • Docker レイヤーキャッシング: apt-get upgrade により毎回フルビルドが必要になる可能性
  • ビルド時間: マーケットプレイス追加とプラグインインストールは適切に並列化されていない(逐次実行)

🎯 総合評価

項目 評価
コード品質 ⭐⭐⭐⭐☆ (4/5)
セキュリティ ⭐⭐⭐⭐⭐ (5/5)
保守性 ⭐⭐⭐⭐⭐ (5/5)
テストカバレッジ ⭐⭐⭐☆☆ (3/5)
パフォーマンス ⭐⭐⭐☆☆ (3/5)

総合: ⭐⭐⭐⭐☆ (4/5)


✅ 推奨アクション

必須(マージ前):

  1. ✅ ShellCheck 通過確認
  2. ⏳ CI が完全に green になることを確認
  3. ⚠️ log_warnlog_error の修正を検討

推奨(フォローアップ):

  1. apt-get upgrade をセキュリティアップデートのみに限定
  2. PATH フォールバックコードの削除または整理
  3. CVE-2024-45296 の tracking issue 作成

📚 参考


結論: この PR は根本原因を適切に解決しており、コード品質も高いです。いくつかの改善提案はありますが、現状でもマージ可能な品質です。CI が完全に green になることを確認後、マージを推奨します。

🤖 Reviewed by Claude Sonnet 4.5

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
script/install-claude-plugins.sh (1)

58-77: ⚠️ Potential issue | 🟡 Minor

Missing chmod 600 for credentials created via environment variables.

The BuildKit secret path (line 57) correctly restricts permissions with chmod 600, but the CLAUDE_CODE_OAUTH_TOKEN and ANTHROPIC_API_KEY branches write credentials with the default umask (typically 644 in Docker), leaving them world-readable until deletion.

While the file is removed at line 105 within the same Docker layer, adding chmod 600 is still good hygiene — especially if this script is ever run outside a Docker build context.

🔒 Proposed fix
 elif [[ -n "${CLAUDE_CODE_OAUTH_TOKEN:-}" ]]; then
     log_info "CLAUDE_CODE_OAUTH_TOKEN から認証情報を作成中..."
     cat > "${CLAUDE_DIR}/.credentials.json" << EOF
 {
   "claudeAiOauth": {
     "accessToken": "${CLAUDE_CODE_OAUTH_TOKEN}",
     "expiresAt": 9999999999999
   }
 }
 EOF
+    chmod 600 "${CLAUDE_DIR}/.credentials.json"
 elif [[ -n "${ANTHROPIC_API_KEY:-}" ]]; then
     log_info "ANTHROPIC_API_KEY から認証情報を作成中..."
     cat > "${CLAUDE_DIR}/.credentials.json" << EOF
 {
   "claudeAiOauth": {
     "accessToken": "${ANTHROPIC_API_KEY}",
     "expiresAt": 9999999999999
   }
 }
 EOF
+    chmod 600 "${CLAUDE_DIR}/.credentials.json"
 else
🧹 Nitpick comments (2)
.devcontainer/Dockerfile (1)

15-15: apt-get upgrade -y may reduce build reproducibility.

Adding upgrade -y pulls in whatever security patches are available at build time, making builds non-deterministic. For a DevContainer this is generally acceptable for security posture, but be aware it can cause unexpected breakage if an upstream package introduces a regression.

script/install-claude-plugins.sh (1)

85-93: Template generation is duplicated between this script and plugins::copy_config_files.

The sed "s|{{HOME}}|${HOME}|g" template substitution here (lines 91) duplicates the same logic in plugins::copy_config_files (line 116 of claude_plugins.sh). If the template format ever changes, both locations would need updating.

Consider extracting a shared helper or relying solely on plugins::copy_config_files for generation.

@keito4
keito4 merged commit f57bc4a into main Feb 13, 2026
20 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 1.74.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@github-actions github-actions Bot added the released リリース済み label Feb 13, 2026
@claude claude Bot mentioned this pull request Feb 15, 2026
github-actions Bot added a commit that referenced this pull request Feb 15, 2026
PR #474 で追加された以下のプラグイン/マーケットプレイスをドキュメントに反映:

- supabase-agent-skills: PostgreSQL/Supabase開発のベストプラクティス
- agent-browser: ブラウザ自動化(テスト、フォーム、スクリーンショット)
- intellectronica-skills: ライブラリ・フレームワークの最新ドキュメント取得

README.md と .claude/plugins/README.md の両方を更新し、
現在利用可能な全9つのマーケットプレイスを網羅的に記載。

Closes #475

Co-authored-by: keito4 <keito4@users.noreply.github.com>
@keito4
keito4 deleted the fix/plugin-install-path-and-marketplace branch March 1, 2026 09:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released リリース済み

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant