-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Add DevContainer recommendations and enhance config-base-sync-update #201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,19 @@ | ||
| --- | ||
| description: Update DevContainer to latest config-base image and create PR | ||
| allowed-tools: Read, Write, Edit, Bash(git:*), Bash(gh:*), Bash(curl:*), Bash(jq:*) | ||
| description: Update DevContainer to latest config-base image, sync recommended features, and create PR | ||
| allowed-tools: Read, Write, Edit, Bash(git:*), Bash(gh:*), Bash(curl:*), Bash(jq:*), Bash(find:*), Bash(test:*), Bash(ls:*) | ||
| argument-hint: [--version X.Y.Z] | ||
| --- | ||
|
|
||
| # DevContainer Update Workflow | ||
|
|
||
| このコマンドは以下を自動実行します: | ||
|
|
||
| - config-baseイメージの最新バージョンへの更新 | ||
| - プロジェクトタイプに基づいた推奨featuresの自動追加 | ||
| - Claude Code動作に必要な設定の確保(mounts, postCreateCommand) | ||
| - 重複featuresの検出と報告 | ||
| - GitHub PRの自動作成 | ||
|
|
||
| ## Step 1: Load Settings | ||
|
|
||
| Try to read `.claude/config-base-sync.local.md` for user configuration. | ||
|
|
@@ -74,35 +82,112 @@ If branch already exists: | |
| - Suggest: "Delete the branch with: git branch -D update-config-base-{target-version}" | ||
| - Stop execution | ||
|
|
||
| ## Step 6: Read Template Configuration | ||
| ## Step 6: Read Template and Recommended Configuration | ||
|
|
||
| Read the reference configuration from this repository: | ||
|
|
||
| - Read `/Users/keito4/develop/github.com/keito4/config/.devcontainer/devcontainer.json` | ||
| - Read `/Users/keito4/develop/github.com/keito4/config/.devcontainer/codex-config.json` | ||
| - Read `/Users/keito4/develop/github.com/keito4/config/.devcontainer/claude-settings.json` | ||
| - Read `/Users/keito4/develop/github.com/keito4/config/.codex/devcontainer-recommendations.md` | ||
|
|
||
| Extract recommended configuration based on `updateScope`: | ||
|
|
||
| - **all**: Update image, features, mounts, postCreateCommand, customizations, remoteEnv | ||
| - **image-only**: Update only the image field | ||
| - **minimal**: Update image and features only | ||
|
|
||
| ### Recommended Features Detection | ||
|
|
||
| From `devcontainer-recommendations.md`, identify: | ||
|
|
||
| 1. **必須Features(全プロジェクト共通)**: | ||
| - `ghcr.io/devcontainers/features/github-cli:1` | ||
| - `ghcr.io/devcontainers/features/docker-in-docker:2` | ||
| - `ghcr.io/devcontainers/features/git:1` | ||
|
|
||
| 2. **Claude Code必須設定**: | ||
| - `.codex` mount (必須) | ||
| - `.claude` mount (必須) | ||
| - `postCreateCommand`に`/usr/local/bin/setup-claude.sh`を含める | ||
|
|
||
| 3. **プロジェクトタイプ別Features**(現在のプロジェクトに基づいて判定): | ||
| - Node.js/TypeScriptプロジェクト(package.jsonが存在): | ||
| - `ghcr.io/devcontainers/features/node:1` | ||
| - `ghcr.io/devcontainers-extra/features/pnpm:2` | ||
| - `ghcr.io/eitsupi/devcontainer-features/jq-likes:2` | ||
| - Supabaseプロジェクト(supabase/config.tomlが存在): | ||
| - `ghcr.io/devcontainers-extra/features/supabase-cli` | ||
| - E2Eテスト(playwright.config.tsが存在): | ||
| - `ghcr.io/schlich/devcontainer-features/playwright:0` | ||
| - Terraformプロジェクト(\*.tfファイルが存在): | ||
| - `ghcr.io/devcontainers/features/terraform:1` | ||
|
|
||
| ## Step 7: Update devcontainer.json | ||
|
|
||
| Based on `updateScope`, update `.devcontainer/devcontainer.json`: | ||
|
|
||
| 1. Update `image` field to `ghcr.io/keito4/config-base:{target-version}` | ||
| ### 7.1: Update Image Version | ||
|
|
||
| Update `image` field to `ghcr.io/keito4/config-base:{target-version}` | ||
|
|
||
| ### 7.2: Update Features (if updateScope is "all" or "minimal") | ||
|
|
||
| **Features Update Strategy**: | ||
|
|
||
| 1. **必須Features追加**(存在しない場合のみ追加): | ||
| - GitHub CLI | ||
| - Docker-in-Docker | ||
| - Git | ||
|
|
||
| 2. **プロジェクトタイプ別Features追加**: | ||
| - プロジェクト内のファイル存在をチェック | ||
| - 該当するfeaturesを自動追加(存在しない場合のみ) | ||
|
|
||
| 3. **既存Features保持**: | ||
| - ユーザーが手動追加したfeaturesは保持 | ||
| - 推奨設定に含まれるfeaturesのバージョン設定を更新 | ||
|
|
||
| 4. **非推奨Features検出**: | ||
| - config-baseに既に含まれるfeaturesを検出 | ||
| - ユーザーに削除推奨として報告(自動削除はしない) | ||
|
|
||
| **Features更新の報告**: | ||
|
|
||
| - ✅ 追加されるfeatures: [リスト] | ||
| - 📝 更新されるfeatures: [リスト] | ||
| - ⚠️ 削除推奨features: [リスト](重複) | ||
| - ✨ 保持されるユーザー追加features: [リスト] | ||
|
|
||
| 2. If `updateScope` is "all" or "minimal": | ||
| - Update `features` object with recommended features from template | ||
| - Preserve any user-added features not in template | ||
| ### 7.3: Update Mounts (if updateScope is "all") | ||
|
|
||
| 3. If `updateScope` is "all": | ||
| - Update `remoteEnv` with recommended environment variables | ||
| - Update `mounts` with recommended mounts (preserve user additions) | ||
| - Update `customizations` with recommended VS Code settings | ||
| - Update `postCreateCommand` if significantly different | ||
| **Claude Code必須mounts**を確認・追加: | ||
|
|
||
| - `.codex` mount | ||
| - `.claude` mount | ||
|
|
||
| **標準mounts**を確認・追加: | ||
|
|
||
| - `.cursor` mount | ||
| - `.gitconfig` mount | ||
| - `.config/gh` mount | ||
|
|
||
| 既存のユーザー追加mountsは保持。 | ||
|
|
||
| ### 7.4: Update postCreateCommand (if updateScope is "all") | ||
|
|
||
| **Claude Code必須**: | ||
|
|
||
| - `postCreateCommand`に`/usr/local/bin/setup-claude.sh`が含まれているか確認 | ||
| - 含まれていない場合は末尾に追加: | ||
| ``` | ||
| 既存コマンド && /usr/local/bin/setup-claude.sh | ||
| ``` | ||
|
|
||
| ### 7.5: Update Other Settings (if updateScope is "all") | ||
|
|
||
| - Update `remoteEnv` with recommended environment variables | ||
| - Update `customizations` with recommended VS Code settings | ||
|
|
||
| Use the Edit tool to make precise updates to the JSON file. | ||
|
|
||
|
|
@@ -117,28 +202,82 @@ If `updateScope` is "all": | |
|
|
||
| ## Step 9: Report Changes | ||
|
|
||
| Display a summary of changes made: | ||
| Display a detailed summary of all changes made: | ||
|
|
||
| ### Image Version | ||
|
|
||
| - `ghcr.io/keito4/config-base:{old-version}` → `v{target-version}` | ||
|
|
||
| ### Features Changes (if updateScope is "all" or "minimal") | ||
|
|
||
| **✅ 追加されたFeatures**: | ||
|
|
||
| - Image version: old → new | ||
| - Added features (if any) | ||
| - Updated settings (if any) | ||
| - Changed commands (if any) | ||
| ``` | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add language identifier to code block for markdown compliance. Line 215 needs a language identifier for the code block showing feature names and versions. 🔎 Proposed fix-```
+```text
- feature-name-1: version
- feature-name-2: version
-```
+```🧰 Tools🪛 markdownlint-cli2 (0.18.1)215-215: Fenced code blocks should have a language specified (MD040, fenced-code-language) 🤖 Prompt for AI Agents |
||
| - feature-name-1: version | ||
| - feature-name-2: version | ||
| ``` | ||
|
|
||
| **📝 更新されたFeatures**: | ||
|
|
||
| ``` | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add language identifier to code block for markdown compliance. Line 222 needs a language identifier for the feature version update examples. 🔎 Proposed fix-```
+```text
- feature-name: old-version → new-version
-```
+```
🧰 Tools🪛 markdownlint-cli2 (0.18.1)222-222: Fenced code blocks should have a language specified (MD040, fenced-code-language) 🤖 Prompt for AI Agents |
||
| - feature-name: old-version → new-version | ||
| ``` | ||
|
|
||
| **⚠️ 削除推奨Features** (config-baseに含まれるため重複): | ||
|
|
||
| ``` | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add language identifier to code block for markdown compliance. Line 228 needs a language identifier for the duplicate features list. 🔎 Proposed fix-```
+```text
- feature-name-1
- feature-name-2
-```
+```🧰 Tools🪛 markdownlint-cli2 (0.18.1)228-228: Fenced code blocks should have a language specified (MD040, fenced-code-language) 🤖 Prompt for AI Agents |
||
| - feature-name-1 | ||
| - feature-name-2 | ||
| ``` | ||
|
|
||
| _注意: これらのfeaturesは自動削除されていません。必要に応じて手動で削除してください。_ | ||
|
|
||
| **✨ 保持されたユーザー追加Features**: | ||
|
|
||
| ``` | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add language identifier to code block for markdown compliance. Line 237 needs a language identifier for the preserved features list. 🔎 Proposed fix-```
+```text
- custom-feature-1: version
- custom-feature-2: version
-```
+```🧰 Tools🪛 markdownlint-cli2 (0.18.1)237-237: Fenced code blocks should have a language specified (MD040, fenced-code-language) 🤖 Prompt for AI Agents |
||
| - custom-feature-1: version | ||
| - custom-feature-2: version | ||
| ``` | ||
|
|
||
| ### Mounts Changes (if updateScope is "all") | ||
|
|
||
| **追加されたMounts**: | ||
|
|
||
| - `.codex` (Claude Code必須) | ||
| - `.claude` (Claude Code必須) | ||
|
|
||
| ### Commands Changes (if updateScope is "all") | ||
|
|
||
| **postCreateCommand**: | ||
|
|
||
| - 追加: `/usr/local/bin/setup-claude.sh` (Claude Code必須) | ||
|
|
||
| ### Other Changes (if updateScope is "all") | ||
|
|
||
| - Updated remoteEnv settings | ||
| - Updated VS Code customizations | ||
|
|
||
| ## Step 10: Commit Changes | ||
|
|
||
| Create commit with conventional commit message: | ||
| Create commit with conventional commit message including features details: | ||
|
|
||
| ```bash | ||
| git add .devcontainer/ | ||
| git commit -m "feat: Update config-base image to v{target-version} | ||
|
|
||
| - Update DevContainer image from v{old-version} to v{target-version} | ||
| - Sync configuration with latest recommended settings | ||
| - Add {count} new features based on project type detection | ||
| - Ensure Claude Code compatibility (mounts, postCreateCommand) | ||
| - Update features, mounts, and environment variables | ||
|
|
||
| Features added: {list-of-added-features} | ||
|
|
||
| Release notes: https://github.com/keito4/config/releases/tag/v{target-version}" | ||
| ``` | ||
|
|
||
| _Note: Replace `{count}` and `{list-of-added-features}` with actual values from Step 9._ | ||
|
|
||
| ## Step 11: Push and Create PR | ||
|
|
||
| Push branch to remote: | ||
|
|
@@ -157,19 +296,44 @@ If `autoCreatePR` is true: | |
| --title "feat: Update config-base to v{target-version}" \ | ||
| --body "## Summary | ||
|
|
||
| Updates DevContainer configuration to use the latest config-base image. | ||
| Updates DevContainer configuration to use the latest config-base image and syncs with recommended settings. | ||
|
|
||
| ### Changes | ||
|
|
||
| #### Image Version | ||
| - **Image**: ghcr.io/keito4/config-base:{old-version} → v{target-version} | ||
| - **Configuration**: Synced with latest recommended settings | ||
|
|
||
| #### Features | ||
| - ✅ **Added**: {added-features-list} | ||
| - 📝 **Updated**: {updated-features-list} | ||
| - ⚠️ **Recommended for removal** (duplicates): {duplicate-features-list} | ||
| - ✨ **Preserved**: {preserved-features-list} | ||
|
|
||
| #### Configuration | ||
| - 📁 **Mounts**: Added Claude Code required mounts (`.codex`, `.claude`) | ||
| - 🔧 **postCreateCommand**: Ensured `/usr/local/bin/setup-claude.sh` execution | ||
| - ⚙️ **Settings**: Synced remoteEnv and VS Code customizations | ||
|
|
||
| ### Claude Code Compatibility | ||
| This update ensures full Claude Code compatibility with: | ||
| - Required mounts for `.codex` and `.claude` | ||
| - Automatic Claude CLI setup via `setup-claude.sh` | ||
| - Recommended features based on project type | ||
|
|
||
| ### Release Notes | ||
| See: https://github.com/keito4/config/releases/tag/v{target-version} | ||
|
|
||
| ### Testing | ||
| ### Testing Checklist | ||
| - [ ] DevContainer builds successfully | ||
| - [ ] All tools and features work as expected | ||
| - [ ] Claude Code works (can run claude commands) | ||
| - [ ] All project-specific tools work as expected | ||
| - [ ] CI passes | ||
| - [ ] No permission issues with mounts | ||
|
|
||
| ### Recommended Actions | ||
| {if duplicate-features exist} | ||
| - Consider removing duplicate features: {duplicate-features-list} | ||
| {endif} | ||
|
|
||
| 🤖 Generated with [Claude Code](https://claude.com/claude-code) | ||
| " | ||
|
|
@@ -184,19 +348,44 @@ If `autoCreatePR` is false: | |
|
|
||
| ## Step 12: Final Report | ||
|
|
||
| Provide a complete summary: | ||
| Provide a complete summary including features changes: | ||
|
|
||
| ``` | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add language identifier to code block for markdown compliance. Line 353 contains the final summary block without a language identifier. 🔎 Proposed fix-```
+```text
✅ DevContainer update complete!
📦 Image Version
...
-```
+```🧰 Tools🪛 markdownlint-cli2 (0.18.1)353-353: Fenced code blocks should have a language specified (MD040, fenced-code-language) 🤖 Prompt for AI Agents |
||
| ✅ DevContainer update complete! | ||
|
|
||
| Version: v{old-version} → v{target-version} | ||
| Branch: update-config-base-{target-version} | ||
| PR: {PR-URL or "Manual creation required"} | ||
|
|
||
| Next steps: | ||
| 1. Review the pull request | ||
| 2. Test the DevContainer locally | ||
| 3. Merge when ready | ||
| 📦 Image Version | ||
| - ghcr.io/keito4/config-base:{old-version} → v{target-version} | ||
|
|
||
| 🔧 Features Summary | ||
| - Added: {count} features | ||
| - Updated: {count} features | ||
| - Recommended for removal: {count} features (duplicates) | ||
| - Preserved: {count} custom features | ||
|
|
||
| 📁 Configuration | ||
| - Claude Code mounts: ✅ Configured | ||
| - setup-claude.sh: ✅ Included in postCreateCommand | ||
| - Standard mounts: ✅ Updated | ||
|
|
||
| 🌿 Git Branch | ||
| - Branch: update-config-base-{target-version} | ||
| - PR: {PR-URL or "Manual creation required"} | ||
|
|
||
| 📋 Next Steps | ||
| 1. Review the pull request (check features changes) | ||
| 2. Test the DevContainer locally: | ||
| - Rebuild container: Cmd/Ctrl + Shift + P → "Dev Containers: Rebuild Container" | ||
| - Verify Claude Code works: `claude --version` | ||
| - Check all tools are available | ||
| 3. {if duplicate features exist} | ||
| Consider removing duplicate features before merging | ||
| {endif} | ||
| 4. Merge when all checks pass | ||
|
|
||
| 💡 Tips | ||
| - Run `claude help` to verify Claude Code is working | ||
| - Check logs if container build fails | ||
| - Review `.devcontainer/devcontainer.json` for any conflicts | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add language identifier to code block for markdown compliance.
Line 183 contains a code block without a language specification, which violates MD040. This should specify
bashsince it shows a bash command continuation.🔎 Proposed fix
🧰 Tools
🪛 markdownlint-cli2 (0.18.1)
183-183: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
🤖 Prompt for AI Agents