fix: プラグインインストールの PATH 不整合とライブラリパス修正 - #474
Conversation
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>
📝 WalkthroughWalkthroughThis 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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
🔍 AI Code Review (Local Hook)Models: Codex (default) / Gemini (default) 🤖 Codex Review
発見事項:
補足(残留リスク/テストギャップ):
判定: 🤖 Generated by post_pr_ai_review.py hook |
🔍 AI Code Review (Local Hook)Models: Codex (default) / Gemini (default) 🤖 Codex Review発見事項はありません。 判定: patch is correct 🤖 Generated by post_pr_ai_review.py hook |
Code Review - PR #474概要Docker ビルド時のプラグインインストール失敗を修正する重要な変更です。PATH設定の修正とライブラリパスの統一により、根本原因が適切に解決されています。 ✅ 良い点1. 根本原因の適切な解決
2. リファクタリングの質
3. セキュリティ
4. マーケットプレイス管理の改善
|
| 項目 | 評価 |
|---|---|
| コード品質 | ⭐⭐⭐⭐☆ (4/5) |
| セキュリティ | ⭐⭐⭐⭐⭐ (5/5) |
| 保守性 | ⭐⭐⭐⭐⭐ (5/5) |
| テストカバレッジ | ⭐⭐⭐☆☆ (3/5) |
| パフォーマンス | ⭐⭐⭐☆☆ (3/5) |
総合: ⭐⭐⭐⭐☆ (4/5)
✅ 推奨アクション
必須(マージ前):
- ✅ ShellCheck 通過確認
- ⏳ CI が完全に green になることを確認
⚠️ log_warn→log_errorの修正を検討
推奨(フォローアップ):
apt-get upgradeをセキュリティアップデートのみに限定- PATH フォールバックコードの削除または整理
- CVE-2024-45296 の tracking issue 作成
📚 参考
- Docker ベストプラクティス
- ShellCheck Wiki
- CLAUDE.md の TDD 要件 - 行カバレッジ 70%+ 推奨
結論: この PR は根本原因を適切に解決しており、コード品質も高いです。いくつかの改善提案はありますが、現状でもマージ可能な品質です。CI が完全に green になることを確認後、マージを推奨します。
🤖 Reviewed by Claude Sonnet 4.5
There was a problem hiding this comment.
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 | 🟡 MinorMissing
chmod 600for credentials created via environment variables.The BuildKit secret path (line 57) correctly restricts permissions with
chmod 600, but theCLAUDE_CODE_OAUTH_TOKENandANTHROPIC_API_KEYbranches 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 600is 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 -ymay reduce build reproducibility.Adding
upgrade -ypulls 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 andplugins::copy_config_files.The
sed "s|{{HOME}}|${HOME}|g"template substitution here (lines 91) duplicates the same logic inplugins::copy_config_files(line 116 ofclaude_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_filesfor generation.
|
🎉 This PR is included in version 1.74.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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>
Summary
claude: command not foundで失敗していた根本原因を修正ENV PATH追加で claude CLI をビルド全体で利用可能に/tmp/script-lib→/tmp/script/lib)を修正install-claude-plugins.shをライブラリ関数利用にリファクタリングTest plan
shellcheck -x script/install-claude-plugins.shが警告なしで通ることclaude plugin marketplace addが成功すること🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Improvements
Chores