fix(plugins): DevContainer用プラグインリストとドキュメントを更新 - #330
Conversation
## Why(なぜ) setup-claude-build.shが「プラグインがインストールされていません」と 表示する問題を修正するため。 ## What(何を) - プラグインインストール時にHOME=/home/vscodeを設定 - setup-claude-build.sh実行時にもHOME=/home/vscodeを明示的に設定 ## How(どのように) ROOTユーザーでプラグインインストールを実行すると、claudeコマンドは デフォルトで/root/.claudeにプラグインをインストールします。 これを防ぐため、env HOME=/home/vscodeを設定し、vscodeユーザーの ディレクトリにプラグインをインストールするようにしました。 ## Risk(リスク) なし。環境変数の明示的な設定により、より確実に動作します。 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
## 修正内容 ### 1. setup-claude.sh のライブラリパス問題 - `/usr/local/bin/setup-claude.sh` が依存する `script/lib/` を `/usr/local/script/lib` にコピー - 別リポジトリで `setup-claude.sh` を実行した際のパスエラーを解決 ### 2. playwright-skill マーケットプレイスの追加 - `install-claude-plugins.sh` に playwright-skill マーケットプレイスを追加 - plugins.txt に記載されている playwright-skill プラグインがインストールできるように修正 ## 影響範囲 - 新しいリポジトリで config-base イメージを使用した際の setup-claude.sh 実行 - playwright-skill プラグインのインストール 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
## 修正内容 ### GitHub Actions ビルドでのプラグインインストール対応 **変更点**: - docker-image.yml に `build-args` で `ANTHROPIC_API_KEY` を追加 - Dockerfile に `ARG ANTHROPIC_API_KEY` を追加 - プラグインインストール時に環境変数を渡すように修正 **使用方法**: GitHub Secrets に `ANTHROPIC_API_KEY` を設定すると、ビルド時にプラグインが自動インストールされます。 ## 利点 - BuildKit secret と環境変数の両方に対応 - GitHub Actions でのビルドでプラグインがインストール可能に - ローカルビルドでも `--build-arg ANTHROPIC_API_KEY=$ANTHROPIC_API_KEY` で対応 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
## 修正内容 ### CLAUDE_CODE_OAUTH_TOKEN のサポート追加 **変更点**: 1. `install-claude-plugins.sh` に `CLAUDE_CODE_OAUTH_TOKEN` 環境変数のサポートを追加 2. Dockerfile に `ARG CLAUDE_CODE_OAUTH_TOKEN` を追加 3. docker-image.yml で `CLAUDE_CODE_OAUTH_TOKEN` を `build-args` として渡す **優先順位**: 1. BuildKit secret (`/run/secrets/claude_credentials`) 2. `CLAUDE_CODE_OAUTH_TOKEN` 環境変数 ← 新規追加 3. `ANTHROPIC_API_KEY` 環境変数(後方互換性のため残す) ## 動作確認 GitHub Secrets に `CLAUDE_CODE_OAUTH_TOKEN` を設定すると: - ビルド時に認証情報が自動生成される - プラグインが正常にインストールされる - setup-claude-build.sh が正常に実行される 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
## 修正内容 plugins.txt を更新して、実際に存在するプラグインのみを記載しました。 ### 削除したプラグイン - frontend-design@claude-plugins-official (存在しない) - code-review-ai@claude-code-workflows (存在しない) - playwright-skill@playwright-skill (マーケットプレイスが不安定) ### 追加したプラグイン - backend-development@claude-code-workflows - full-stack-orchestration@claude-code-workflows - database-design@claude-code-workflows - database-migrations@claude-code-workflows ## 影響 DevContainer ビルド時に存在しないプラグインのインストールエラーが解消されます。 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
📝 WalkthroughWalkthroughPR updates DevContainer plugin configuration and installation by adding OAuth token authentication support, reorganizing plugin listings, introducing new marketplace entries, and enhancing documentation with recommended setup guidance and example configurations. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
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 |
There was a problem hiding this comment.
📝 [actionlint] reported by reviewdog 🐶
shellcheck reported issue in this script: SC2086:info:30:32: Double quote to prevent globbing and word splitting [shellcheck]
config/.github/workflows/docker-image.yml
Line 55 in 7f49495
There was a problem hiding this comment.
📝 [actionlint] reported by reviewdog 🐶
shellcheck reported issue in this script: SC2086:info:31:37: Double quote to prevent globbing and word splitting [shellcheck]
config/.github/workflows/docker-image.yml
Line 55 in 7f49495
There was a problem hiding this comment.
📝 [actionlint] reported by reviewdog 🐶
shellcheck reported issue in this script: SC2086:info:32:30: Double quote to prevent globbing and word splitting [shellcheck]
config/.github/workflows/docker-image.yml
Line 55 in 7f49495
There was a problem hiding this comment.
🚫 [actionlint] reported by reviewdog 🐶
shellcheck reported issue in this script: SC2129:style:30:1: Consider using { cmd1; cmd2; } >> file instead of individual redirects [shellcheck]
config/.github/workflows/docker-image.yml
Line 55 in 7f49495
There was a problem hiding this comment.
📝 [actionlint] reported by reviewdog 🐶
shellcheck reported issue in this script: SC2086:info:10:39: Double quote to prevent globbing and word splitting [shellcheck]
config/.github/workflows/docker-image.yml
Line 97 in 7f49495
There was a problem hiding this comment.
📝 [actionlint] reported by reviewdog 🐶
shellcheck reported issue in this script: SC2086:info:11:32: Double quote to prevent globbing and word splitting [shellcheck]
config/.github/workflows/docker-image.yml
Line 97 in 7f49495
There was a problem hiding this comment.
📝 [actionlint] reported by reviewdog 🐶
shellcheck reported issue in this script: SC2086:info:6:31: Double quote to prevent globbing and word splitting [shellcheck]
config/.github/workflows/docker-image.yml
Line 97 in 7f49495
There was a problem hiding this comment.
📝 [actionlint] reported by reviewdog 🐶
shellcheck reported issue in this script: SC2086:info:9:34: Double quote to prevent globbing and word splitting [shellcheck]
config/.github/workflows/docker-image.yml
Line 97 in 7f49495
There was a problem hiding this comment.
🚫 [actionlint] reported by reviewdog 🐶
shellcheck reported issue in this script: SC2129:style:9:3: Consider using { cmd1; cmd2; } >> file instead of individual redirects [shellcheck]
config/.github/workflows/docker-image.yml
Line 97 in 7f49495
There was a problem hiding this comment.
📝 [actionlint] reported by reviewdog 🐶
shellcheck reported issue in this script: SC2086:info:3:50: Double quote to prevent globbing and word splitting [shellcheck]
config/.github/workflows/docker-image.yml
Line 203 in 7f49495
Pull Request Review概要DevContainer環境で正常に動作するプラグインリストとドキュメントの更新です。存在しないプラグインを削除し、正しいプラグインを追加したことで、イメージビルド時のエラーを防止しています。 ✅ 良い点1. プラグインリストの正確性向上
2. 認証方法の柔軟性向上
3. ドキュメントの明確化
4. サンプルファイルの提供
|
| 項目 | 状態 | コメント |
|---|---|---|
| Conventional Commits | ✅ | fix(plugins): 形式で正しい |
| テストカバレッジ | 手動確認のみ、自動テスト推奨 | |
| ドキュメント更新 | プラグインリスト要修正 | |
| セキュリティ | ✅ | 認証情報は適切に削除 |
🎯 承認前のアクションアイテム
必須(高優先度):
- ドキュメント修正:
docs/using-config-base-image.md:62-69のプラグインリストを実際のplugins.txtと同期
推奨(中優先度):
playwright-skillマーケットプレイス追加の意図を明確化(コメント or 削除)script/lib重複コピーの理由をコメントで説明
オプション(低優先度):
- プラグインインストールの自動テストを追加(将来的な改善)
総評
全体として、実用的で必要な改善を含む良いPRです。特に:
- 実在しないプラグインの削除による信頼性向上
- 認証方法の柔軟性向上
- ドキュメントの明確化
ドキュメントのプラグインリスト同期を修正すれば、承認可能です。
参考資料
Review by Claude Sonnet 4.5
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (3)
docs/using-config-base-image.md (2)
55-70: Docs plugin list is out of sync with.claude/plugins/plugins.txt(nonexistent entries listed).
This section still listsfrontend-design@claude-plugins-official,code-review-ai@claude-code-workflows, andplaywright-skill@playwright-skill, which the PR objectives say were removed as “存在しないプラグイン”. This will mislead users and undermine the PR intent.Proposed diff (align with current plugins.txt)
- `commit-commands@claude-plugins-official` - `hookify@claude-plugins-official` - `plugin-dev@claude-plugins-official` -- `frontend-design@claude-plugins-official` - `typescript-lsp@claude-plugins-official` - `code-refactoring@claude-code-workflows` - `code-review@claude-plugins-official` -- `code-review-ai@claude-code-workflows` - `kubernetes-operations@claude-code-workflows` - `javascript-typescript@claude-code-workflows` -- `playwright-skill@playwright-skill` +- `backend-development@claude-code-workflows` +- `full-stack-orchestration@claude-code-workflows` +- `database-design@claude-code-workflows` +- `database-migrations@claude-code-workflows`
125-138: One snippet still uses a pinned tag (:1.43.0) while others use:latest.
Line 130 should likely be updated for consistency (or explicitly explain why this section pins).Proposed diff
- "image": "ghcr.io/keito4/config-base:1.43.0", + "image": "ghcr.io/keito4/config-base:latest",script/install-claude-plugins.sh (1)
29-55: Credentials schema appears custom/undocumented; verify against Claude Code expectations and fix JSON escaping.The
claudeAiOauthschema used here doesn't match official Claude Code documentation, which recommends usingANTHROPIC_API_KEYenvironment variable directly or system keychain, not JSON files with custom structures. Before merging, confirm:
- Verify schema compatibility: Is
claudeAiOauthwithaccessToken+expiresAta custom extension for this project, or does it match a specific Claude Code version/configuration?- Fix heredoc escaping: If tokens can contain quotes or newlines, this JSON construction will fail. Use
jqfor safe escaping.If the custom schema is intentional, document it. Otherwise, align with standard Claude Code authentication methods.
Proposed fix (JSON escaping via jq)
elif [[ -n "${CLAUDE_CODE_OAUTH_TOKEN:-}" ]]; then echo "[INFO] CLAUDE_CODE_OAUTH_TOKEN から認証情報を作成中..." - cat > "${CLAUDE_DIR}/.credentials.json" << EOF -{ - "claudeAiOauth": { - "accessToken": "${CLAUDE_CODE_OAUTH_TOKEN}", - "expiresAt": 9999999999999 - } -} -EOF + jq -n --arg token "${CLAUDE_CODE_OAUTH_TOKEN}" \ + '{ claudeAiOauth: { accessToken: $token, expiresAt: 9999999999999 } }' \ + > "${CLAUDE_DIR}/.credentials.json" elif [[ -n "${ANTHROPIC_API_KEY:-}" ]]; then echo "[INFO] ANTHROPIC_API_KEY から認証情報を作成中..." - cat > "${CLAUDE_DIR}/.credentials.json" << EOF -{ - "claudeAiOauth": { - "accessToken": "${ANTHROPIC_API_KEY}", - "expiresAt": 9999999999999 - } -} -EOF + jq -n --arg token "${ANTHROPIC_API_KEY}" \ + '{ claudeAiOauth: { accessToken: $token, expiresAt: 9999999999999 } }' \ + > "${CLAUDE_DIR}/.credentials.json" else
🧹 Nitpick comments (3)
docs/devcontainer.json.example (1)
1-12: EnsureTMPDIRexists (avoid first-run edge cases).
TMPDIRpoints to/home/vscode/.claude/tmp; consider adding an init/postCreate mkdir to avoid tools failing if the directory isn’t present.Proposed diff
{ "name": "Management Tools", "image": "ghcr.io/keito4/config-base:latest", "remoteEnv": { "TMPDIR": "/home/vscode/.claude/tmp" }, + "initializeCommand": "mkdir -p /home/vscode/.claude/tmp", "customizations": { "vscode": { "extensions": ["esbenp.prettier-vscode", "dbaeumer.vscode-eslint"] } } }.devcontainer/Dockerfile (2)
92-94: Remove the unused/usr/local/script/libcopy to reduce image bloat.The second
COPYcommand on line 93 copiesscript/libto/usr/local/script/lib, but this path is never referenced anywhere in the codebase. Only/tmp/script-lib(line 92) is actively used during Docker builds (seescript/setup-claude-build.sh:14-15). Drop the unused copy to reduce image size.
96-106: Consider only exporting credentials when non-empty for cleaner code.The current
env ... CLAUDE_CODE_OAUTH_TOKEN="${CLAUDE_CODE_OAUTH_TOKEN}" ANTHROPIC_API_KEY="${ANTHROPIC_API_KEY}" ...passes empty strings when build-args aren't provided. While the install script correctly handles this with${VAR:-}checks, it's cleaner practice to export only when values are present.Proposed change
RUN --mount=type=secret,id=claude_credentials,uid=0,gid=0 \ - env HOME=/home/vscode CLAUDE_CODE_OAUTH_TOKEN="${CLAUDE_CODE_OAUTH_TOKEN}" ANTHROPIC_API_KEY="${ANTHROPIC_API_KEY}" /tmp/install-claude-plugins.sh /home/vscode/.claude/plugins/plugins.txt || ( \ + bash -lc 'set -e; export HOME=/home/vscode; \ + if [ -n "${CLAUDE_CODE_OAUTH_TOKEN:-}" ]; then export CLAUDE_CODE_OAUTH_TOKEN; fi; \ + if [ -n "${ANTHROPIC_API_KEY:-}" ]; then export ANTHROPIC_API_KEY; fi; \ + /tmp/install-claude-plugins.sh /home/vscode/.claude/plugins/plugins.txt' || ( \ echo "[WARN] Claude プラグインのインストールに失敗しました(認証情報が不足している可能性があります)" && \ echo "[INFO] コンテナ起動後に手動でインストールしてください: claude plugin install <plugin>@<marketplace>" \ ) \ && chown -R vscode:vscode /home/vscode/.claude
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
.claude/plugins/plugins.txt.devcontainer/Dockerfile.github/workflows/docker-image.ymldocs/devcontainer.json.exampledocs/using-config-base-image.mdscript/install-claude-plugins.sh
🧰 Additional context used
📓 Path-based instructions (1)
.github/workflows/docker-image.yml
📄 CodeRabbit inference engine (CLAUDE.md)
Build DevContainer images automatically with semantic versioning and multi-platform support in .github/workflows/docker-image.yml
Files:
.github/workflows/docker-image.yml
🧠 Learnings (7)
📓 Common learnings
Learnt from: CR
Repo: keito4/config PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-01T03:45:17.253Z
Learning: Applies to .github/workflows/docker-image.yml : Build DevContainer images automatically with semantic versioning and multi-platform support in .github/workflows/docker-image.yml
📚 Learning: 2026-01-04T04:05:56.913Z
Learnt from: CR
Repo: keito4/config PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-04T04:05:56.913Z
Learning: Follow development quality standards defined in `CLAUDE.md` for AI-assisted development workflows
Applied to files:
.claude/plugins/plugins.txtdocs/using-config-base-image.md
📚 Learning: 2026-01-04T04:05:56.913Z
Learnt from: CR
Repo: keito4/config PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-04T04:05:56.913Z
Learning: Use automated Claude commands from `.claude/commands/` directory for maintenance, Git workflows, code analysis, quality checks, dependency management, security reviews, and tool configuration
Applied to files:
.claude/plugins/plugins.txt.devcontainer/Dockerfiledocs/using-config-base-image.mdscript/install-claude-plugins.sh
📚 Learning: 2025-12-01T03:45:17.253Z
Learnt from: CR
Repo: keito4/config PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-01T03:45:17.253Z
Learning: Applies to .github/workflows/claude.yml : Trigger automatic AI assistance on claude mentions in issues, PRs, and comments using .github/workflows/claude.yml
Applied to files:
.claude/plugins/plugins.txt.github/workflows/docker-image.yml
📚 Learning: 2025-12-01T03:45:17.253Z
Learnt from: CR
Repo: keito4/config PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-01T03:45:17.253Z
Learning: Applies to .github/workflows/docker-image.yml : Build DevContainer images automatically with semantic versioning and multi-platform support in .github/workflows/docker-image.yml
Applied to files:
.github/workflows/docker-image.ymldocs/devcontainer.json.exampledocs/using-config-base-image.md
📚 Learning: 2025-12-01T03:45:17.253Z
Learnt from: CR
Repo: keito4/config PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-01T03:45:17.253Z
Learning: Publish DevContainer images to ghcr.io/keito4/config-base with semantic versioning
Applied to files:
docs/devcontainer.json.example
📚 Learning: 2026-01-04T04:05:56.913Z
Learnt from: CR
Repo: keito4/config PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-04T04:05:56.913Z
Learning: Refer to `CLAUDE.md` for quality standards, AI prompt design guidelines, and CI integration
Applied to files:
docs/using-config-base-image.md
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: claude-review
- GitHub Check: Trivy Container Scan
- GitHub Check: Generate SBOM
🔇 Additional comments (5)
docs/using-config-base-image.md (2)
14-39: Good structure split (recommended vs advanced), but keep snippets consistent.
The “マウントしない推奨” guidance is clear; just ensure all later examples don’t contradict the :latest guidance.
71-95: Nice: explicit warning about host mount overriding image config.
This matches the “DevContainer 専用なら mount なし推奨” objective and should prevent config::import_claude 等の事故を減らせそうです。.claude/plugins/plugins.txt (1)
1-25: Plugin list properly curated; verification satisfied by commit history.The four newly added plugins (
backend-development,full-stack-orchestration,database-design,database-migrationson lines 22–25) are confirmed to exist in theclaude-code-workflowsmarketplace (wshobson/agents). The commit message explicitly documents this change as intentional replacement of non-existent plugins with verified ones. No further verification needed.script/install-claude-plugins.sh (1)
57-63: All marketplace additions are justified and documented—no changes needed.The
@playwright-skillmarketplace is actively used (documented indocs/using-config-base-image.mdasplaywright-skill@playwright-skill), as are the other three marketplaces being added. All correspond to plugins with actual documented usage in the codebase. The unconditional marketplace addition is appropriate and necessary for the configured plugins to function correctly.Likely an incorrect or invalid review comment.
.github/workflows/docker-image.yml (1)
160-177: Action versions are correct and recommended; however, the build-arg cannot be removed as shown.The Dockerfile explicitly declares
ARG CLAUDE_CODE_OAUTH_TOKEN(line 3) and uses it in the RUN command via environment variable expansion (CLAUDE_CODE_OAUTH_TOKEN="${CLAUDE_CODE_OAUTH_TOKEN}"). Removing the build-arg would break the Dockerfile's ability to pass the token to the installation script.If you want to eliminate the build-arg for security reasons (tokens in layer history), refactor the Dockerfile to read credentials exclusively from the mounted secret file instead of relying on ARG expansion. The Dockerfile comments already document both approaches as valid options—align on one pattern.
All action versions are current and recommended as of January 2026.
Likely an incorrect or invalid review comment.
| # Build arguments for Claude Code authentication | ||
| ARG CLAUDE_CODE_OAUTH_TOKEN | ||
| ARG ANTHROPIC_API_KEY | ||
|
|
There was a problem hiding this comment.
Avoid ARG/--build-arg for auth secrets (leak risk); prefer BuildKit secrets in CI.
Adding ARG CLAUDE_CODE_OAUTH_TOKEN / ARG ANTHROPIC_API_KEY enables --build-arg flows, but build-args are not a safe secret transport (they can surface in build logs/metadata/caches depending on builder/settings). If CI is using build-args for these, I’d strongly prefer switching CI to BuildKit secrets (e.g., separate secrets for OAuth token / API key, optionally using secret-to-env mounts) and keeping build-args only as a clearly-documented local-only escape hatch (or removing them entirely).
|
🎉 This PR is included in version 1.45.3 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
概要
DevContainer環境で動作する正しいプラグインリストとドキュメントを更新しました。
変更内容
1. プラグインリストの修正 (
.claude/plugins/plugins.txt)削除したプラグイン(存在しないため):
frontend-design@claude-plugins-officialcode-review-ai@claude-code-workflowsplaywright-skill@playwright-skill追加したプラグイン(存在確認済み):
backend-development@claude-code-workflowsfull-stack-orchestration@claude-code-workflowsdatabase-design@claude-code-workflowsdatabase-migrations@claude-code-workflows2. ドキュメント更新 (
docs/using-config-base-image.md)~/.claudeをマウントしない構成を推奨3. サンプルファイル追加 (
docs/devcontainer.json.example)新規リポジトリで即座に使用できるdevcontainer.jsonのサンプルを提供
重要な変更点
DevContainer 専用で使う場合は、ホストの ~/.claude をマウントしないでください
理由:
~/.claudeをマウントすると、イメージの設定が上書きされるconfig::import_claudeなどが正しく配置されないテスト
関連Issue
githubでbuildするのは全てdevcontainerで動かすことを想定
🤖 Generated with Claude Code
Co-Authored-By: Claude Sonnet 4.5 noreply@anthropic.com
Summary by CodeRabbit
New Features
Documentation
Chores
✏️ Tip: You can customize this high-level summary in your review settings.