Skip to content

fix: include local skills in Docker build and expand trigger paths - #400

Merged
keito4 merged 1 commit into
mainfrom
fix/skills-docker-build
Feb 2, 2026
Merged

fix: include local skills in Docker build and expand trigger paths#400
keito4 merged 1 commit into
mainfrom
fix/skills-docker-build

Conversation

@keito4

@keito4 keito4 commented Feb 2, 2026

Copy link
Copy Markdown
Owner

Summary

  • Dockerビルド時にローカルスキルファイル(*.md)がコピーされていなかった問題を修正
  • Dockerイメージのビルドトリガーパスを拡張し、Claude設定ファイルの変更を検知するように

Problem

1. ローカルスキルがDockerイメージにコピーされていない

Dockerfileでは skills.txt のみコピーしていたため、ローカルスキルファイル(ci-check.mdcodex-review.md)がDockerイメージに含まれていませんでした。

2. トリガーパスが不足

docker-image.yml のトリガーパスに以下が含まれておらず、これらのファイルを変更してもDockerイメージが再ビルドされませんでした:

  • .claude/commands/**
  • .claude/agents/**
  • .claude/hooks/**
  • .claude/skills/**
  • .claude/plugins/**
  • script/**

Changes

Dockerfile

+# Copy local skill files (*.md) and skills list
+COPY --chown=vscode:vscode .claude/skills/*.md /home/vscode/.claude/skills/
 COPY --chown=vscode:vscode .claude/skills/skills.txt /home/vscode/.claude/skills/skills.txt

docker-image.yml

 paths:
   - '.devcontainer/**'
+  - '.claude/commands/**'
+  - '.claude/agents/**'
+  - '.claude/hooks/**'
+  - '.claude/skills/**'
+  - '.claude/plugins/**'
+  - 'script/**'
   - 'npm/global.json'

Test plan

  • Dockerイメージをビルドして、ローカルスキルファイルがコピーされていることを確認
  • .claude/skills/*.md を変更した際にDockerイメージのビルドがトリガーされることを確認

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Enhanced container setup to include skill markdown files.
    • Extended automated build process to monitor additional configuration paths for skills, plugins, commands, agents, and hooks.

✏️ Tip: You can customize this high-level summary in your review settings.

- Copy local skill files (*.md) to Docker image alongside skills.txt
- Add trigger paths for .claude/commands, agents, hooks, skills, plugins
- Add trigger path for script/ directory changes

Previously, local skills (ci-check.md, codex-review.md) were not
copied to the Docker image, and changes to Claude configuration
files did not trigger a new image build.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

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

coderabbitai Bot commented Feb 2, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

This PR adds skill markdown files to the DevContainer environment and expands GitHub Actions workflow triggers. The Dockerfile now copies local skill markdown files from .claude/skills/ into the container, while the Docker image workflow is configured to watch additional .claude subdirectories for changes that should trigger builds.

Changes

Cohort / File(s) Summary
DevContainer Configuration
.devcontainer/Dockerfile
Added COPY instruction to include local skill markdown files (*.md) from .claude/skills/ into the container's /home/vscode/.claude/skills/ directory.
GitHub Actions Workflow
.github/workflows/docker-image.yml
Expanded push event trigger paths to watch .claude/commands/, .claude/agents/, .claude/hooks/, .claude/skills/, .claude/plugins/, and script/ directories in addition to existing monitored paths.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

Suggested labels

size/XS

Poem

🐰 Markdown skills now find their home,
In containers where code can roam,
Workflows watch paths both wide and far,
Where rabbits build their DevContainer star!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes both main changes: fixing inclusion of local skills in Docker build and expanding trigger paths in the workflow.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/skills-docker-build

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.

@claude

claude Bot commented Feb 2, 2026

Copy link
Copy Markdown
Contributor

PR Review - fix: include local skills in Docker build and expand trigger paths

概要

Dockerビルド時にローカルスキルファイル(*.md)がコピーされていなかった問題と、GitHub Actions のトリガーパスが不足していた問題を修正するPRです。


✅ Code Quality & Best Practices

良い点:

  1. 問題の特定が的確: ローカルスキルファイルが Docker イメージに含まれていなかった根本原因を正しく特定
  2. 最小限の変更: 問題解決に必要な最小限の変更のみを実装(over-engineering を回避)
  3. コメントの追加: .devcontainer/Dockerfile:103-104 でコピー処理の意図を明確化
  4. トリガーパスの論理的な拡張: Claude 設定ファイルの変更時に Docker イメージを再ビルドするのは合理的

改善提案:

  1. Dockerfile のワイルドカード使用について(低優先度)

    • .devcontainer/Dockerfile:104COPY .claude/skills/*.md を使用していますが、スキルファイルが存在しない場合にビルドが失敗する可能性があります
    • ただし、現在のリポジトリには ci-check.mdcodex-review.md が存在するため、実害はありません
    • 将来的に柔軟性を高めたい場合は、以下のような対応を検討できます:
    # Option 1: Copy directory entirely (includes both .md files and skills.txt)
    COPY --chown=vscode:vscode .claude/skills /home/vscode/.claude/skills
    
    # Option 2: Use shell to handle optional files
    RUN mkdir -p /home/vscode/.claude/skills
    COPY --chown=vscode:vscode .claude/skills/skills.txt /home/vscode/.claude/skills/skills.txt
    COPY --chown=vscode:vscode .claude/skills/*.md /home/vscode/.claude/skills/ 2>/dev/null || true

    ただし、現在の実装で問題ないため、この変更は必須ではありません

  2. トリガーパスの粒度(検討事項)

    • .claude/commands/**.claude/agents/** などのディレクトリが現在のリポジトリに存在しない可能性があります
    • GitHub Actions はパスが存在しない場合でもエラーにはなりませんが、将来的な拡張を見越した設定として適切です

🔒 Security Concerns

問題なし: このPRはDocker ビルド設定とCI トリガー設定の変更であり、セキュリティリスクは導入していません。

  • 認証情報の漏洩: なし
  • コマンドインジェクション: なし
  • 権限の適切な設定: --chown=vscode:vscode で適切に設定されている

⚡ Performance Considerations

影響は軽微:

  1. Docker イメージサイズ: *.md ファイル(合計約4KB)の追加は無視できるレベル
  2. ビルドトリガー頻度: トリガーパスの拡張により、.claude/**script/** の変更時にビルドが実行されるようになりますが、これは意図された動作です
  3. ビルド時間: 追加の COPY 命令は数ミリ秒のオーバーヘッドのみ

🧪 Test Coverage

テスト計画の改善提案:

PR本文に記載されているテスト計画は以下の通りです:

- [ ] Dockerイメージをビルドして、ローカルスキルファイルがコピーされていることを確認
- [ ] .claude/skills/*.md を変更した際にDockerイメージのビルドがトリガーされることを確認

追加で検証すべき項目:

  1. Docker イメージの検証

    # ローカルでDockerイメージをビルド
    docker build -t test-config-base -f .devcontainer/Dockerfile .
    
    # コピーされたファイルを確認
    docker run --rm test-config-base ls -la /home/vscode/.claude/skills/
    # 期待結果: ci-check.md, codex-review.md, skills.txt が存在
  2. CI トリガーの検証(マージ後に自動的に検証されます)

    • mainブランチにマージ後、docker-image.yml が実行されることを確認
    • 将来的に .claude/skills/*.md を変更した際にワークフローがトリガーされることを確認

現状の評価: テスト計画は適切ですが、実際の検証実施状況がチェックリストで明確になっていません。


📋 CLAUDE.md Compliance Check

リポジトリの品質基準 (CLAUDE.md) に照らした確認:

基準 状態 詳細
Conventional Commits fix: タイプで適切
Branch命名規則 fix/skills-docker-build は規約に準拠
PR Diff サイズ 8行の変更のみ(≤400行の基準を満たす)
Linked Issue Issue番号が見当たらない(ブランチ名にも含まれていない)
CI Status CI実行待ち
Test Coverage N/A 設定ファイルの変更のため単体テスト不要
Documentation PR本文で変更内容を明確に説明

改善提案: ブランチ名に Issue 番号を含めることが推奨されています(fix/<issue#>-skills-docker-build)。ただし、軽微な修正のため必須ではありません。


🎯 総合評価

Verdict: ✅ Approve with minor suggestions

理由:

  1. 問題解決が的確: ローカルスキルファイルがDockerイメージに含まれていなかった問題を正しく修正
  2. 最小限の変更: 必要な修正のみを実装し、over-engineering を回避
  3. コード品質: 適切なコメント、権限設定、論理的なトリガーパス拡張
  4. リスク: セキュリティリスクやパフォーマンス劣化のリスクなし
  5. ⚠️ 軽微な改善余地: Dockerfile のワイルドカード使用について将来的な考慮事項あり(現状問題なし)

推奨アクション:

  1. マージ前にローカルで Docker ビルドを実行し、スキルファイルが正しくコピーされることを確認
  2. マージ後、docker-image.yml ワークフローが正常に実行されることを確認
  3. (オプション)将来的にスキルファイルが存在しない環境でもビルドが成功するよう、Dockerfile を改善

📝 Commit Message Quality

コミットメッセージは Conventional Commits に準拠しており、変更内容を適切に説明しています:

fix: include local skills in Docker build and expand trigger paths

- Copy local skill files (*.md) to Docker image alongside skills.txt
- Add trigger paths for .claude/commands, agents, hooks, skills, plugins
- Add trigger path for script/ directory changes

Previously, local skills (ci-check.md, codex-review.md) were not
copied to the Docker image, and changes to Claude configuration
files did not trigger a new image build.

Good: Why/What/How が明確で、リリースノートにも使いやすい形式です。


Co-Authored-By: Claude Sonnet 4.5 noreply@anthropic.com

@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.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In @.devcontainer/Dockerfile:
- Around line 103-105: The COPY using a wildcard (COPY --chown=vscode:vscode
.claude/skills/*.md ...) will fail the build if there are no .md files; replace
the two COPY lines by copying the whole skills directory (e.g., COPY
--chown=vscode:vscode .claude/skills/ /home/vscode/.claude/skills/) and remove
the separate skills.txt wildcard copy, then control which files get included via
.dockerignore; update references to the destination folder if necessary so
functions expecting /home/vscode/.claude/skills//*.md or skills.txt still work.

Comment thread .devcontainer/Dockerfile
Comment on lines +103 to 105
# Copy local skill files (*.md) and skills list
COPY --chown=vscode:vscode .claude/skills/*.md /home/vscode/.claude/skills/
COPY --chown=vscode:vscode .claude/skills/skills.txt /home/vscode/.claude/skills/skills.txt

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Avoid build failure when no *.md files exist.

COPY with a wildcard fails if the glob is empty; if .claude/skills/ ever has no .md files (e.g., forks or future cleanup), the image build will error. Consider copying the directory and filtering via .dockerignore instead.

🔧 Suggested resilient copy
- COPY --chown=vscode:vscode .claude/skills/*.md /home/vscode/.claude/skills/
- COPY --chown=vscode:vscode .claude/skills/skills.txt /home/vscode/.claude/skills/skills.txt
+ COPY --chown=vscode:vscode .claude/skills/ /home/vscode/.claude/skills/
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# Copy local skill files (*.md) and skills list
COPY --chown=vscode:vscode .claude/skills/*.md /home/vscode/.claude/skills/
COPY --chown=vscode:vscode .claude/skills/skills.txt /home/vscode/.claude/skills/skills.txt
# Copy local skill files (*.md) and skills list
COPY --chown=vscode:vscode .claude/skills/ /home/vscode/.claude/skills/
🤖 Prompt for AI Agents
In @.devcontainer/Dockerfile around lines 103 - 105, The COPY using a wildcard
(COPY --chown=vscode:vscode .claude/skills/*.md ...) will fail the build if
there are no .md files; replace the two COPY lines by copying the whole skills
directory (e.g., COPY --chown=vscode:vscode .claude/skills/
/home/vscode/.claude/skills/) and remove the separate skills.txt wildcard copy,
then control which files get included via .dockerignore; update references to
the destination folder if necessary so functions expecting
/home/vscode/.claude/skills//*.md or skills.txt still work.

@keito4
keito4 merged commit 6d39f39 into main Feb 2, 2026
16 checks passed
@github-actions

github-actions Bot commented Feb 2, 2026

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 1.61.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@github-actions github-actions Bot added the released リリース済み label Feb 2, 2026
@keito4
keito4 deleted the fix/skills-docker-build 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