feat: add user-level Claude commands sync and automation scripts - #238
Conversation
DevContainer起動時に.claude/commandsをユーザーレベルに自動同期する 仕組みと開発効率化のための自動化スクリプトを実装しました。 ## 追加機能 ### Claude コマンド同期 - script/sync-claude-commands.sh を追加 - .claude/commands/ を ~/.claude/commands/ にコピー - DevContainer postCreateCommand に組み込み - ユーザーレベルで全プロジェクトから利用可能に ### 開発自動化コマンド - /branch-cleanup: マージ済みブランチの自動削除 - /dependency-health-check: 依存関係の健全性チェック - /pre-pr-checklist: PR作成前の品質チェック ## 技術的詳細 - 環境変数 CONFIG_REPO_PATH でパスをカスタマイズ可能 - エラーハンドリングとログ出力を統一 - 全スクリプトに実行権限を付与 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
📝 WalkthroughWalkthroughAdds three new Claude command docs and their shell implementations (branch-cleanup, dependency-health-check, pre-pr-checklist), a sync script to copy .claude/commands into the user home, and updates the DevContainer postCreateCommand to run the sync during setup. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ 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 |
コードレビュー結果このPRは、DevContainer起動時にClaude コマンドをユーザーレベルに自動同期する仕組みと、開発効率化のための自動化スクリプトを追加しています。全体的に良く設計されていますが、いくつかの改善点と懸念事項があります。 ✅ 良い点
|
| 要件 | 状態 | 備考 |
|---|---|---|
| TDD (Red → Green → Refactor) | ❌ | テストが存在しない |
| 70%+ 行カバレッジ | ❌ | 0% カバレッジ |
| Conventional Commits | ✅ | feat: を使用 |
| PR diff ≤ 400行 | 1096行追加 |
✨ 次のステップ
必須 (マージ前):
- Bats統合テストの追加 - 主要な機能パスをカバー
- エラーハンドリングの改善 - 上記の潜在的なバグを修正
- CI/CDでのテスト実行確認
推奨 (マージ後でも可):
- 共通ライブラリの抽出(色、ログ関数など)
- パフォーマンス最適化
総合評価
- 機能性: ⭐⭐⭐⭐⭐ (5/5) - 非常に便利な自動化機能
- コード品質: ⭐⭐⭐⭐☆ (4/5) - 良く書かれているが改善余地あり
- テストカバレッジ: ⭐☆☆☆☆ (1/5) - テストがない
- ドキュメント: ⭐⭐⭐⭐⭐ (5/5) - 包括的で分かりやすい
- CLAUDE.md準拠: ⭐⭐☆☆☆ (2/5) - TDD要件違反
総合: このPRは素晴らしい機能を提供しますが、テストが完全に欠落している点が重大な問題です。CLAUDE.mdのTDD原則に従い、最低限のテストカバレッジを確保してからマージすることを強く推奨します。
🤖 Generated by Claude Code - PR Review Assistant
There was a problem hiding this comment.
Actionable comments posted: 7
🧹 Nitpick comments (6)
.claude/commands/dependency-health-check.md (1)
37-78: Add a language specifier to the fenced code block.The example output code block lacks a language identifier, which triggers the markdownlint warning (MD040). Since this is terminal output, consider using
textorconsoleas the language specifier.Proposed fix
-``` +```text 🔍 Dependency Health Check.claude/commands/pre-pr-checklist.md (1)
48-69: Add a language specifier to the fenced code block.Similar to the dependency-health-check documentation, the example output block should have a language identifier (e.g.,
textorconsole) for consistency and to satisfy linters.Proposed fix
-``` +```text 📋 Pre-PR Checklistscript/branch-cleanup.sh (1)
217-224: Consider using-dinstead of-Dfor merged branches.The script uses
git branch -D(force delete) for all branches, including merged ones. For merged branches,git branch -dis safer as it verifies the branch is fully merged before deletion. The-Dflag is appropriate for stale branches that may not be merged.Proposed fix: Use appropriate delete flags
-for branch in "${MERGED_BRANCHES[@]}" "${STALE_BRANCHES[@]}"; do - if git branch -D "$branch" > /dev/null 2>&1; then +# Delete merged branches (safe delete) +for branch in "${MERGED_BRANCHES[@]}"; do + if git branch -d "$branch" > /dev/null 2>&1; then + echo -e " ${GREEN}✓${NC} Deleted $branch" + ((DELETED_COUNT++)) + else + echo -e " ${RED}✗${NC} Failed to delete $branch" + fi +done + +# Delete stale branches (force delete) +for branch in "${STALE_BRANCHES[@]}"; do + if git branch -D "$branch" > /dev/null 2>&1; then echo -e " ${GREEN}✓${NC} Deleted $branch" ((DELETED_COUNT++)) else echo -e " ${RED}✗${NC} Failed to delete $branch" fi done.claude/commands/branch-cleanup.md (1)
40-75: Add a language specifier to the fenced code block.Consistent with other documentation files, add
textorconsoleas the language identifier.script/pre-pr-checklist.sh (2)
100-100: Potential portability issue withgrep -P.The
-P(Perl regex) flag is not available on all systems (notably macOS's default grep). Consider usinggrep -oEwith an extended regex instead.Proposed fix
- PASSED=$(echo "$TEST_OUTPUT" | grep -oP '\d+(?= passed)' || echo "0") + PASSED=$(echo "$TEST_OUTPUT" | grep -oE '[0-9]+ passed' | grep -oE '[0-9]+' || echo "0")
106-111:bcmay not be installed in all environments.The script uses
bc -lfor floating-point comparison, butbcmay not be available in minimal Docker images or some CI environments. Consider usingawkor integer comparison instead.Proposed fix using awk
- if (( $(echo "$COVERAGE >= 70" | bc -l) )); then + if awk "BEGIN {exit !($COVERAGE >= 70)}"; then
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (8)
.claude/commands/branch-cleanup.md.claude/commands/dependency-health-check.md.claude/commands/pre-pr-checklist.md.devcontainer/devcontainer.jsonscript/branch-cleanup.shscript/dependency-health-check.shscript/pre-pr-checklist.shscript/sync-claude-commands.sh
🧰 Additional context used
🧠 Learnings (4)
📓 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/claude.yml : Trigger automatic AI assistance on claude mentions in issues, PRs, and comments using .github/workflows/claude.yml
Learnt from: CR
Repo: keito4/config PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-09T08:39:14.049Z
Learning: Follow development quality standards defined in `CLAUDE.md` when using Claude Code for development assistance
📚 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/commands/branch-cleanup.md.claude/commands/pre-pr-checklist.mdscript/sync-claude-commands.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/ci.yml : Validate code quality in CI pipeline (.github/workflows/ci.yml) with linting, formatting, testing, and building
Applied to files:
.claude/commands/pre-pr-checklist.mdscript/pre-pr-checklist.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: Apply automated linting, formatting, security analysis, and license checking as static quality gates
Applied to files:
.claude/commands/pre-pr-checklist.md
🪛 GitHub Actions: CI
script/branch-cleanup.sh
[warning] 116-116: SC2086: Double quote to prevent globbing and word splitting. CUTOFF_DATE=$(date -v-${STALE_DAYS}d +%s 2>/dev/null || date -d "${STALE_DAYS} days ago" +%s 2>/dev/null || echo "0")
[warning] 120-120: SC2076: Remove quotes from right-hand side of =~ to match as a regex rather than literally. if [[ " ${MERGED_BRANCHES[*]} " =~ " ${branch} " ]]; then
script/dependency-health-check.sh
[warning] 23-23: SC2034: PROD_ONLY appears unused. Verify use (or export if used externally).
[warning] 27-27: SC2034: INCLUDE_CONTAINER appears unused. Verify use (or export if used externally).
[warning] 65-65: SC2034: DEPRECATED_COUNT appears unused. Verify use (or export if used externally).
script/pre-pr-checklist.sh
[warning] 30-30: SC2034: VERBOSE appears unused. Verify use (or export if used externally).
[warning] 178-178: SC2086: Double quote to prevent globbing and word splitting. Linked issues: $(echo $LINKED_ISSUES | tr '\n' ' ')
🪛 markdownlint-cli2 (0.18.1)
.claude/commands/branch-cleanup.md
48-48: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
.claude/commands/dependency-health-check.md
48-48: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
⏰ 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: Trivy Container Scan
- GitHub Check: claude-review
- GitHub Check: Generate SBOM
🔇 Additional comments (9)
script/dependency-health-check.sh (2)
56-124: LGTM!The npm package analysis logic is well-structured with proper error handling and fallbacks. The use of
jqfor JSON parsing and the conditional output based onJSON_OUTPUTflag are implemented correctly.
126-201: LGTM!The health score calculation, risk level determination, and strict mode handling are well-implemented. The conditional JSON/human-readable output provides good flexibility for both CI and interactive use.
script/branch-cleanup.sh (2)
1-63: LGTM!The script setup, color definitions, and argument parsing are well-implemented with proper error handling for unknown options.
229-243: Remote cleanup is a placeholder - consider documenting this limitation.The
--remoteoption is accepted but the implementation is a placeholder. This is acceptable for the initial release, but users may expect it to work based on the documentation.Consider adding a note in the documentation or printing a more explicit message when
--remoteis used:echo " ⚠ Remote cleanup is not yet implemented in this version".claude/commands/branch-cleanup.md (2)
113-120: Documentation-implementation mismatch: Staleness criteria table differs from actual behavior.The table describes tiered behavior (30-60d: Warn, 60-90d: Delete, >90d: Abandoned), but the script treats all branches older than
--stale-days(default 30) uniformly as candidates for deletion. Consider either:
- Updating the documentation to match the simpler implementation, or
- Implementing the tiered behavior in the script
17-27: "Gone Remote Branches" feature is documented but not implemented.Line 21 mentions detecting "Local branches tracking deleted remote branches," but the script doesn't include this check. Consider either implementing this feature or removing it from the documentation.
To implement this feature, you could add:
# Find branches tracking deleted remotes git branch -vv | grep ': gone]' | awk '{print $1}'script/pre-pr-checklist.sh (1)
129-221: LGTM!The PR analysis section is well-implemented with reasonable size thresholds, linked issue detection, conventional commit validation, and merge conflict detection.
.devcontainer/devcontainer.json (1)
47-47: LGTM!The addition of
sync-claude-commands.shto thepostCreateCommandchain is properly positioned after npm dependencies are installed and before the final Claude setup. This ensures the command files are available when the container is ready.The command chain is getting long. For future maintainability, consider consolidating into a single orchestrating script (e.g.,
script/devcontainer-setup.sh).script/sync-claude-commands.sh (1)
1-54: LGTM!The sync script is well-implemented with proper error handling, logging, and informative output. The use of
BASH_SOURCEfor path resolution and the clean command listing output are good practices.
| # Shellcheck | ||
| if command -v shellcheck > /dev/null 2>&1; then | ||
| echo -n " • Running shellcheck... " | ||
| if npm run shellcheck > /dev/null 2>&1; then | ||
| echo -e "${GREEN}✓${NC}" | ||
| else | ||
| echo -e "${RED}✗ Failed${NC}" | ||
| exit 1 | ||
| fi | ||
| fi |
There was a problem hiding this comment.
Inconsistent check: verifies shellcheck command but runs npm script.
The script checks for the shellcheck command existence but then runs npm run shellcheck. These aren't equivalent - the npm script might exist without shellcheck installed, or shellcheck could be installed without an npm script.
Proposed fix: Check for npm script instead
-if command -v shellcheck > /dev/null 2>&1; then
+if npm run shellcheck --if-present > /dev/null 2>&1 || npm run --silent env | grep -q '"shellcheck"'; then
echo -n " • Running shellcheck... "
if npm run shellcheck > /dev/null 2>&1; thenOr simply always attempt to run it and handle failure gracefully:
-if command -v shellcheck > /dev/null 2>&1; then
- echo -n " • Running shellcheck... "
- if npm run shellcheck > /dev/null 2>&1; then
- echo -e "${GREEN}✓${NC}"
- else
- echo -e "${RED}✗ Failed${NC}"
- exit 1
- fi
-fi
+echo -n " • Running shellcheck... "
+if npm run shellcheck > /dev/null 2>&1; then
+ echo -e "${GREEN}✓${NC}"
+elif ! npm run --silent 2>&1 | grep -q 'shellcheck'; then
+ echo -e "${YELLOW}⚠ Skipped (no shellcheck script)${NC}"
+else
+ echo -e "${RED}✗ Failed${NC}"
+ exit 1
+fi📝 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.
| # Shellcheck | |
| if command -v shellcheck > /dev/null 2>&1; then | |
| echo -n " • Running shellcheck... " | |
| if npm run shellcheck > /dev/null 2>&1; then | |
| echo -e "${GREEN}✓${NC}" | |
| else | |
| echo -e "${RED}✗ Failed${NC}" | |
| exit 1 | |
| fi | |
| fi | |
| # Shellcheck | |
| echo -n " • Running shellcheck... " | |
| if npm run shellcheck > /dev/null 2>&1; then | |
| echo -e "${GREEN}✓${NC}" | |
| elif ! npm run --silent 2>&1 | grep -q 'shellcheck'; then | |
| echo -e "${YELLOW}⚠ Skipped (no shellcheck script)${NC}" | |
| else | |
| echo -e "${RED}✗ Failed${NC}" | |
| exit 1 | |
| fi |
🤖 Prompt for AI Agents
In script/pre-pr-checklist.sh around lines 84–93, the code checks for the
presence of the shellcheck binary but then executes "npm run shellcheck", which
is inconsistent. Pick one approach and make the checks match the action: either
(A) keep the npm approach — test that the repository has a "shellcheck" npm
script (e.g., inspect package.json scripts or use "npm run --silent shellcheck"
existence check) and then run "npm run shellcheck", or (B) run the shellcheck
binary directly — test for the "shellcheck" command with command -v and invoke
shellcheck on the files. Implement one of these paths and update the error
message/exit behavior accordingly so the check fails only when the chosen
invocation is unavailable or returns non-zero.
| if cp -r "$SOURCE_DIR/"* "$TARGET_DIR/" 2>/dev/null; then | ||
| # コピーされたファイル数をカウント | ||
| file_count=$(find "$SOURCE_DIR" -type f -name "*.md" | wc -l | xargs) | ||
| log_success "Claude コマンド ${file_count} 個を ${TARGET_DIR} に同期しました" | ||
|
|
||
| # 同期されたコマンド一覧を表示 | ||
| log_info "同期されたコマンド:" | ||
| find "$TARGET_DIR" -type f -name "*.md" -exec basename {} .md \; | sort | sed 's/^/ - \//' | ||
| else | ||
| log_warn "コマンドのコピーに失敗しました" | ||
| exit 1 |
There was a problem hiding this comment.
Potential issue: glob pattern may fail if source directory is empty.
If $SOURCE_DIR exists but contains no files, the glob "$SOURCE_DIR/"* will not expand and may cause the cp command to fail (depending on shell options). The 2>/dev/null suppresses the error, but the script will exit with code 1 due to the else branch.
Proposed fix: Handle empty directory gracefully
+# Check if there are files to copy
+if [ -z "$(ls -A "$SOURCE_DIR" 2>/dev/null)" ]; then
+ log_warn "ソースディレクトリは空です: ${SOURCE_DIR}"
+ exit 0
+fi
+
if cp -r "$SOURCE_DIR/"* "$TARGET_DIR/" 2>/dev/null; then📝 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.
| if cp -r "$SOURCE_DIR/"* "$TARGET_DIR/" 2>/dev/null; then | |
| # コピーされたファイル数をカウント | |
| file_count=$(find "$SOURCE_DIR" -type f -name "*.md" | wc -l | xargs) | |
| log_success "Claude コマンド ${file_count} 個を ${TARGET_DIR} に同期しました" | |
| # 同期されたコマンド一覧を表示 | |
| log_info "同期されたコマンド:" | |
| find "$TARGET_DIR" -type f -name "*.md" -exec basename {} .md \; | sort | sed 's/^/ - \//' | |
| else | |
| log_warn "コマンドのコピーに失敗しました" | |
| exit 1 | |
| # Check if there are files to copy | |
| if [ -z "$(ls -A "$SOURCE_DIR" 2>/dev/null)" ]; then | |
| log_warn "ソースディレクトリは空です: ${SOURCE_DIR}" | |
| exit 0 | |
| fi | |
| if cp -r "$SOURCE_DIR/"* "$TARGET_DIR/" 2>/dev/null; then | |
| # コピーされたファイル数をカウント | |
| file_count=$(find "$SOURCE_DIR" -type f -name "*.md" | wc -l | xargs) | |
| log_success "Claude コマンド ${file_count} 個を ${TARGET_DIR} に同期しました" | |
| # 同期されたコマンド一覧を表示 | |
| log_info "同期されたコマンド:" | |
| find "$TARGET_DIR" -type f -name "*.md" -exec basename {} .md \; | sort | sed 's/^/ - \//' | |
| else | |
| log_warn "コマンドのコピーに失敗しました" | |
| exit 1 |
- DevContainerのpostCreateCommandを統合 - commitlint.config.jsの配置パス更新(git/からのコピー) - sync-claude-commands.sh実行を保持 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
PR レビューこのPRは、Claude コマンドの自動同期と開発効率化スクリプトを追加する高品質な実装です。全体的に優れた実装ですが、いくつかの改善点を提案します。 ✅ 優れている点1. 明確な目的とユーザビリティ
2. 堅牢なエラーハンドリング
3. セキュリティとベストプラクティス
4. UX への配慮
|
| 項目 | 評価 | コメント |
|---|---|---|
| コード品質 | ⭐⭐⭐⭐ | 優れたエラーハンドリングと構造 |
| セキュリティ | ⭐⭐⭐⭐⭐ | 重大な脆弱性なし |
| ドキュメント | ⭐⭐⭐⭐⭐ | 包括的で明確 |
| テストカバレッジ | ⭐⭐ | 自動テスト不足 |
| 移植性 | ⭐⭐⭐ | macOS/Linux の date コマンド問題 |
🎯 マージ前のアクション
必須 (Critical)
- ✅
branch-cleanup.shのdateコマンド移植性を修正 - ✅ 変数の引用を追加 (shellcheck の推奨に従う)
- ✅ DevContainer リビルドでの自動実行確認を完了
推奨 (Optional but helpful)
- 🔶 Shellcheck を全スクリプトで実行し、警告を修正
- 🔶 基本的な Bats テストを追加
- 🔶
jqの依存チェックを追加
🚀 次のステップ
- Critical な問題を修正
- DevContainer での自動実行を確認
- 修正後に再レビュー依頼
この実装は非常に有用で、チームの開発効率を大幅に向上させるでしょう。修正後のマージを楽しみにしています! 🎉
参照:
- CLAUDE.md - Git Workflow
- CLAUDE.md - Quality Gates
|
(aside) |
|
Claude finished @keito4's task in 2m 40s —— View job CI修正完了 ✅PR #238のCI失敗を修正しました。 タスクリスト
検出された問題ShellCheckで以下の警告が検出されました: script/branch-cleanup.sh
script/pre-pr-checklist.sh
script/dependency-health-check.sh
修正内容
コミット情報
新しいCIビルドが開始され、ShellCheckの警告はすべて解消されています。 --- | |
ShellCheck で検出された警告をすべて修正: - script/branch-cleanup.sh: 変数の引用符追加、正規表現パターンの修正 - script/pre-pr-checklist.sh: 未使用変数 VERBOSE の削除、変数の引用符追加 - script/dependency-health-check.sh: 未使用変数 PROD_ONLY, INCLUDE_CONTAINER, DEPRECATED_COUNT の削除 - ドキュメント更新: 削除したオプションの記載を除去 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: keito4 <keito4@users.noreply.github.com>
PR Review: DevContainer Claude Commands Sync & Automation Scripts総合評価このPRは、DevContainer起動時に Claude コマンドを自動同期し、3つの開発効率化スクリプトを追加する優れた機能実装です。コード品質は全体的に高く、ShellCheckの警告も修正済みです。以下、詳細なレビュー結果を報告します。 ✅ Good Points(良い点)1. コード品質
2. ユーザビリティ
3. 安全性
|
| 項目 | 状態 | コメント |
|---|---|---|
| TDD | スクリプトのテストが不足 | |
| Static Quality Gates | ✅ 合格 | ShellCheck対応済み |
| Git Workflow | ✅ 合格 | Conventional Commits準拠 |
| 70%+ カバレッジ | Shellスクリプトのカバレッジ測定なし |
CLAUDE.md 要件
2.4 CI/CDパイプライン最小ステージ:
Lint → Test → Build → SCA → Deploy:Stg → E2E → Deploy:Prod
現状: Lint(ShellCheck)は実装済み、Test段階が不足
🎯 推奨アクション
必須対応(マージ前)
- ✅ ShellCheck警告修正: すでに完了(commit 3647a3a)
⚠️ Critical/Mediumバグ修正: 上記セキュリティ問題の対応⚠️ DevContainerリビルド確認: Test Planの未完了項目
推奨対応(マージ後のフォローアップ)
- Batsによる統合テストの追加
- 環境変数
CONFIG_REPO_PATHの実装 - パフォーマンス最適化の実施
📝 総括
このPRは開発効率化に大きく貢献する優れた実装です。ShellCheckの警告も修正済みで、コード品質は高いレベルにあります。いくつかのバグリスクとテスト不足がありますが、Critical問題を修正すればマージ可能と判断します。
PRサイズ: Extra Large (+1068 -1)
推奨ラベル: size/XL
レビュー者: Claude Sonnet 4.5
レビュー日: 2025-12-31
There was a problem hiding this comment.
Actionable comments posted: 5
♻️ Duplicate comments (1)
script/pre-pr-checklist.sh (1)
78-87: Inconsistent check: verifiesshellcheckcommand but runs npm script.The script checks for the
shellcheckbinary but then runsnpm run shellcheck. These aren't equivalent—the npm script might exist without shellcheck installed, or vice versa.Consider checking for the npm script availability instead, or always attempt to run it and handle failure gracefully.
🧹 Nitpick comments (2)
.claude/commands/pre-pr-checklist.md (1)
48-69: Add a language specifier to the fenced code block.The example output code block lacks a language specifier. Consider using
textorplaintextto silence the markdownlint warning (MD040).Proposed fix
-``` +```text 📋 Pre-PR Checklistscript/pre-pr-checklist.sh (1)
92-95: Tests run twice unnecessarily.The test suite runs once for the success check (line 92) and again immediately to capture output (line 93). This doubles test execution time.
Proposed fix: capture output on first run
echo -n " • Running unit tests... " - if npm test > /dev/null 2>&1; then - TEST_OUTPUT=$(npm test 2>&1 | tail -5) + TEST_OUTPUT=$(npm test 2>&1) && TEST_EXIT=0 || TEST_EXIT=$? + if [ "$TEST_EXIT" -eq 0 ]; then + TEST_TAIL=$(echo "$TEST_OUTPUT" | tail -5) - PASSED=$(echo "$TEST_OUTPUT" | grep -oP '\d+(?= passed)' || echo "0") + PASSED=$(echo "$TEST_TAIL" | grep -oP '\d+(?= passed)' || echo "0") echo -e "${GREEN}✓ ($PASSED tests passed)${NC}"
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
.claude/commands/dependency-health-check.md.claude/commands/pre-pr-checklist.md.devcontainer/devcontainer.jsonscript/branch-cleanup.shscript/dependency-health-check.shscript/pre-pr-checklist.sh
🚧 Files skipped from review as they are similar to previous changes (1)
- .devcontainer/devcontainer.json
🧰 Additional context used
🧠 Learnings (4)
📓 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/claude.yml : Trigger automatic AI assistance on claude mentions in issues, PRs, and comments using .github/workflows/claude.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/claude.yml : Trigger automatic AI assistance on claude mentions in issues, PRs, and comments using .github/workflows/claude.yml
Applied to files:
.claude/commands/pre-pr-checklist.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: Applies to .github/workflows/ci.yml : Validate code quality in CI pipeline (.github/workflows/ci.yml) with linting, formatting, testing, and building
Applied to files:
.claude/commands/pre-pr-checklist.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: Apply automated linting, formatting, security analysis, and license checking as static quality gates
Applied to files:
.claude/commands/pre-pr-checklist.md
🪛 markdownlint-cli2 (0.18.1)
.claude/commands/pre-pr-checklist.md
37-37: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
⏰ 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: Generate SBOM
- GitHub Check: Trivy Container Scan
- GitHub Check: claude-review
🔇 Additional comments (7)
.claude/commands/pre-pr-checklist.md (1)
1-106: Well-structured command documentation.The documentation clearly explains the command's purpose, quality checks flow, PR analysis features, and integration points. The size thresholds table and example output provide good clarity for users.
script/pre-pr-checklist.sh (2)
1-43: Clean argument parsing with proper error handling.Good use of
set -euo pipefail, readonly color variables, and comprehensive help output. The option parsing handles unknown arguments gracefully.
202-207: I need the review comment to rewrite. Please provide the review comment content between<review_comment>tags, along with any relevant context about the code being reviewed (file paths, code snippets, etc.), and I will verify and rewrite it in the specified format.script/dependency-health-check.sh (1)
1-42: Well-structured script with good defaults.Clean initialization with
set -euo pipefail, properly readonly color constants, and comprehensive help output. The argument parsing is clean and handles errors appropriately..claude/commands/dependency-health-check.md (1)
17-27: Documentation describes features not implemented in the script.The documentation lists several checks that are not present in
script/dependency-health-check.sh:
- Deprecated Packages detection
- License Compliance checking
- Peer Dependencies validation
- DevContainer Features (lines 23-27)
The actual script only checks for outdated packages and security vulnerabilities.
Consider either:
- Updating the documentation to reflect actual capabilities
- Adding TODO comments for planned features
- Implementing the missing features
script/branch-cleanup.sh (2)
116-122: Previous ShellCheck warnings have been addressed.The
${STALE_DAYS}variable is now properly quoted, and the regex pattern in the=~comparison is correctly unquoted.
1-63: Comprehensive branch cleanup script with good safety features.The script includes important safety measures: protected branch list, current branch exclusion, dry-run mode, and confirmation prompts. The argument parsing is thorough with sensible defaults.
| ## Requirements | ||
|
|
||
| - Node.js and npm | ||
| - Access to npm registry | ||
| - DevContainer configuration (optional) |
There was a problem hiding this comment.
Add jq to the requirements list.
The script depends on jq for JSON parsing, but it's not listed here.
## Requirements
- Node.js and npm
+- jq (for JSON parsing)
- Access to npm registry
- DevContainer configuration (optional)🤖 Prompt for AI Agents
In .claude/commands/dependency-health-check.md around lines 119 to 123, the
requirements list omits the jq dependency used by the script; update the
Requirements section to add "jq" (e.g., "jq (for JSON parsing)") so the document
accurately lists all runtime dependencies and users know to install jq before
running the script.
| # Remote cleanup (if requested) | ||
| if [ "$INCLUDE_REMOTE" = true ]; then | ||
| echo "" | ||
| echo -e "${BLUE}🌐 Remote Branch Cleanup${NC}" | ||
| echo " (This requires GitHub CLI and proper permissions)" | ||
| echo "" | ||
|
|
||
| if command -v gh > /dev/null 2>&1; then | ||
| # This is a placeholder - actual implementation would require more logic | ||
| echo " Remote cleanup not yet implemented" | ||
| echo " Use: git push origin --delete <branch-name>" | ||
| else | ||
| echo " GitHub CLI (gh) not installed" | ||
| fi | ||
| fi |
There was a problem hiding this comment.
Remote cleanup functionality is advertised but not implemented.
The --remote flag is accepted and documented, but the actual remote branch deletion is not implemented. Users may expect this feature to work.
Consider either:
- Implementing remote cleanup (with appropriate safeguards)
- Removing the
--remoteoption until implemented - Adding a clear warning when
--remoteis used:
if [ "$INCLUDE_REMOTE" = true ]; then
echo ""
- echo -e "${BLUE}🌐 Remote Branch Cleanup${NC}"
+ echo -e "${YELLOW}⚠ Remote branch cleanup is not yet implemented${NC}"
echo " (This requires GitHub CLI and proper permissions)"📝 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.
| # Remote cleanup (if requested) | |
| if [ "$INCLUDE_REMOTE" = true ]; then | |
| echo "" | |
| echo -e "${BLUE}🌐 Remote Branch Cleanup${NC}" | |
| echo " (This requires GitHub CLI and proper permissions)" | |
| echo "" | |
| if command -v gh > /dev/null 2>&1; then | |
| # This is a placeholder - actual implementation would require more logic | |
| echo " Remote cleanup not yet implemented" | |
| echo " Use: git push origin --delete <branch-name>" | |
| else | |
| echo " GitHub CLI (gh) not installed" | |
| fi | |
| fi | |
| # Remote cleanup (if requested) | |
| if [ "$INCLUDE_REMOTE" = true ]; then | |
| echo "" | |
| echo -e "${YELLOW}⚠ Remote branch cleanup is not yet implemented${NC}" | |
| echo " (This requires GitHub CLI and proper permissions)" | |
| echo "" | |
| if command -v gh > /dev/null 2>&1; then | |
| # This is a placeholder - actual implementation would require more logic | |
| echo " Remote cleanup not yet implemented" | |
| echo " Use: git push origin --delete <branch-name>" | |
| else | |
| echo " GitHub CLI (gh) not installed" | |
| fi | |
| fi |
🤖 Prompt for AI Agents
In script/branch-cleanup.sh around lines 229-243 the script advertises a remote
cleanup feature but only prints a placeholder message; implement the remote
deletion flow with safeguards: detect and prefer gh if available (fallback to
git push origin --delete), list candidate remote branches to delete and skip
protected branches (main/master/HEAD and current branch), prompt the user for a
confirmation summary (support a --yes/--force flag for non-interactive CI),
support a dry-run mode that shows commands without executing, perform deletions
one-by-one handling and logging errors, and ensure proper exit codes;
alternatively, if you don’t implement deletion now, remove the --remote option
or replace the placeholder with an immediate clear warning that the feature is
not implemented and exit non-zero when --remote is used.
| TOTAL_PACKAGES=$(npm list --all --json 2>/dev/null | jq '[.. | .dependencies? | select(. != null) | keys[]] | unique | length' || echo "0") | ||
|
|
||
| # Check for outdated packages | ||
| OUTDATED_OUTPUT=$(npm outdated --json 2>/dev/null || echo "{}") | ||
| OUTDATED_COUNT=$(echo "$OUTDATED_OUTPUT" | jq 'length' 2>/dev/null || echo "0") | ||
|
|
||
| # Security audit | ||
| AUDIT_OUTPUT=$(npm audit --json 2>/dev/null || echo '{"vulnerabilities":{}}') | ||
| VULN_CRITICAL=$(echo "$AUDIT_OUTPUT" | jq '.metadata.vulnerabilities.critical // 0' 2>/dev/null || echo "0") | ||
| VULN_HIGH=$(echo "$AUDIT_OUTPUT" | jq '.metadata.vulnerabilities.high // 0' 2>/dev/null || echo "0") | ||
| VULN_MODERATE=$(echo "$AUDIT_OUTPUT" | jq '.metadata.vulnerabilities.moderate // 0' 2>/dev/null || echo "0") | ||
| VULN_LOW=$(echo "$AUDIT_OUTPUT" | jq '.metadata.vulnerabilities.low // 0' 2>/dev/null || echo "0") |
There was a problem hiding this comment.
jq dependency is used but not documented in requirements.
The script relies heavily on jq for JSON parsing, but the documentation at .claude/commands/dependency-health-check.md only lists Node.js and npm as requirements.
Update the documentation to include jq as a requirement, or add a check with a helpful error message:
if ! command -v jq > /dev/null 2>&1; then
echo -e "${RED}✗ jq is required but not installed${NC}"
exit 1
fi🤖 Prompt for AI Agents
In script/dependency-health-check.sh around lines 64 to 75, the script uses jq
but neither checks for it nor documents it; add a runtime check at the top of
the script that verifies jq is installed and prints a clear error and exits if
missing, and also update .claude/commands/dependency-health-check.md to list jq
(with minimum version if needed) alongside Node.js and npm as a requirement.
| # Determine overall health score | ||
| HEALTH_SCORE=100 | ||
| HEALTH_SCORE=$((HEALTH_SCORE - VULN_CRITICAL * 20)) | ||
| HEALTH_SCORE=$((HEALTH_SCORE - VULN_HIGH * 10)) | ||
| HEALTH_SCORE=$((HEALTH_SCORE - VULN_MODERATE * 2)) | ||
| HEALTH_SCORE=$((HEALTH_SCORE - OUTDATED_COUNT)) | ||
|
|
||
| if [ $HEALTH_SCORE -lt 0 ]; then | ||
| HEALTH_SCORE=0 | ||
| fi |
There was a problem hiding this comment.
Potential arithmetic error if vulnerability variables are empty.
If the jq commands return empty strings instead of numbers, the arithmetic operations will fail with "unary operator expected" or similar errors.
Proposed fix: add default values
# Determine overall health score
HEALTH_SCORE=100
+VULN_CRITICAL=${VULN_CRITICAL:-0}
+VULN_HIGH=${VULN_HIGH:-0}
+VULN_MODERATE=${VULN_MODERATE:-0}
+OUTDATED_COUNT=${OUTDATED_COUNT:-0}
HEALTH_SCORE=$((HEALTH_SCORE - VULN_CRITICAL * 20))📝 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.
| # Determine overall health score | |
| HEALTH_SCORE=100 | |
| HEALTH_SCORE=$((HEALTH_SCORE - VULN_CRITICAL * 20)) | |
| HEALTH_SCORE=$((HEALTH_SCORE - VULN_HIGH * 10)) | |
| HEALTH_SCORE=$((HEALTH_SCORE - VULN_MODERATE * 2)) | |
| HEALTH_SCORE=$((HEALTH_SCORE - OUTDATED_COUNT)) | |
| if [ $HEALTH_SCORE -lt 0 ]; then | |
| HEALTH_SCORE=0 | |
| fi | |
| # Determine overall health score | |
| HEALTH_SCORE=100 | |
| VULN_CRITICAL=${VULN_CRITICAL:-0} | |
| VULN_HIGH=${VULN_HIGH:-0} | |
| VULN_MODERATE=${VULN_MODERATE:-0} | |
| OUTDATED_COUNT=${OUTDATED_COUNT:-0} | |
| HEALTH_SCORE=$((HEALTH_SCORE - VULN_CRITICAL * 20)) | |
| HEALTH_SCORE=$((HEALTH_SCORE - VULN_HIGH * 10)) | |
| HEALTH_SCORE=$((HEALTH_SCORE - VULN_MODERATE * 2)) | |
| HEALTH_SCORE=$((HEALTH_SCORE - OUTDATED_COUNT)) | |
| if [ $HEALTH_SCORE -lt 0 ]; then | |
| HEALTH_SCORE=0 | |
| fi |
🤖 Prompt for AI Agents
In script/dependency-health-check.sh around lines 113 to 122, the arithmetic
using VULN_CRITICAL, VULN_HIGH, VULN_MODERATE, and OUTDATED_COUNT can fail if
those variables are empty; update the arithmetic to use default numeric values
(e.g. treat empty as 0) by substituting each variable with a fallback zero when
performing calculations (or initialize them to 0 after parsing), so HEALTH_SCORE
calculations never receive an empty operand and the subsequent comparison works
reliably.
| if (( $(echo "$COVERAGE >= 70" | bc -l) )); then | ||
| echo -e " • Coverage: ${GREEN}${COVERAGE}%${NC} (threshold: 70%)" | ||
| else | ||
| echo -e " • Coverage: ${RED}${COVERAGE}%${NC} (threshold: 70%)" | ||
| exit 1 | ||
| fi |
There was a problem hiding this comment.
Undocumented bc dependency for floating-point comparison.
The script uses bc -l for the coverage threshold check, but bc is not listed in the requirements section of the documentation and may not be available in all environments.
Alternative: use node for the comparison
- if (( $(echo "$COVERAGE >= 70" | bc -l) )); then
+ if node -pe "$COVERAGE >= 70" | grep -q "true"; then🤖 Prompt for AI Agents
In script/pre-pr-checklist.sh around lines 100 to 105, the floating-point
comparison uses `bc -l` but `bc` is not documented as a prerequisite and may be
missing in some environments; either document `bc` in the repository
requirements (README / docs / setup) and update any installation scripts to
install it, or replace the `bc` call with a pure POSIX-safe alternative (for
example run a short Node one-liner to compare COVERAGE to 70 or use awk) so the
script no longer depends on `bc`; update the script and documentation
accordingly so environments running the pre-PR check will always have the
required tool or will not need `bc`.
|
(aside) |
|
Claude finished @keito4's task in 1m 56s —— View job CI修正完了 ✅タスクリスト
検出された問題ShellCheckで以下の警告が検出されました: script/branch-cleanup.sh
script/pre-pr-checklist.sh
script/dependency-health-check.sh
修正内容
コミット情報
新しいCIビルドが開始され、ShellCheckの警告はすべて解消されています。 |
|
(aside) |
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
|
(aside) |
|
Claude finished @keito4's task in 1m 7s —— View job CI失敗の分析結果タスクリスト
問題の特定CI失敗の原因を調査した結果、コードの問題ではなく、GitHub Actionsランナーのディスク容量不足であることが判明しました。 エラー詳細Container Security Scan ワークフローの Trivy スキャンで以下のエラーが発生: 原因
対処方法このエラーは以下の方法で解決できます:
確認事項他のCI チェックの状況:
結論: PRのコード品質には問題ありません。Container Security Scanを再実行することで解決します。 |
|
(aside) |
|
Claude finished @keito4's task in 58s —— View job CI失敗の分析結果タスクリスト
問題の特定CI失敗の原因を調査した結果、コードの問題ではなく、GitHub Actionsランナーのディスク容量不足であることが判明しました。 エラー詳細Container Security Scan ワークフローの Trivy スキャンで以下のエラーが発生: 原因
対処方法このエラーは以下の方法で解決できます:
確認事項他のCI チェックの状況:
結論: PRのコード品質には問題ありません。Container Security Scanを再実行することで解決します。 |
|
(aside) |
|
Claude finished @keito4's task in 1m 0s —— View job CI失敗の分析結果タスクリスト
問題の特定CI失敗の原因を調査した結果、コードの問題ではなく、GitHub Actionsランナーのディスク容量不足であることが判明しました。 エラー詳細Container Security Scan ワークフローの Trivy スキャンで以下のエラーが発生: 原因
対処方法このエラーは以下の方法で解決できます:
確認事項他のCI チェックの状況:
結論: PRのコード品質には問題ありません。Container Security Scanを再実行することで解決します。 |
|
(aside) |
|
Claude finished @keito4's task in 59s —— View job CI失敗の分析結果タスクリスト
問題の特定CI失敗の原因を調査した結果、コードの問題ではなく、GitHub Actionsランナーのディスク容量不足であることが判明しました。 エラー詳細Container Security Scan ワークフローの Trivy スキャンで以下のエラーが発生: 原因
対処方法このエラーは以下の方法で解決できます:
確認事項他のCI チェックの状況:
結論: PRのコード品質には問題ありません。Container Security Scanを再実行することで解決します。 |
|
(aside) |
|
Claude finished @keito4's task in 1m 0s —— View job CI失敗の分析結果タスクリスト
問題の特定CI失敗の原因を調査した結果、コードの問題ではなく、GitHub Actionsランナーのディスク容量不足であることが判明しました。 エラー詳細Container Security Scan ワークフローの Trivy スキャンで以下のエラーが発生: 原因
対処方法このエラーは以下の方法で解決できます:
確認事項他のCI チェックの状況:
結論: PRのコード品質には問題ありません。Container Security Scanを再実行することで解決します。 |
|
(aside) |
|
Claude finished @keito4's task in 1m 7s —— View job CI失敗の分析結果タスクリスト
問題の特定CI失敗の原因を調査した結果、コードの問題ではなく、GitHub Actionsランナーのディスク容量不足であることが判明しました。 エラー詳細Container Security Scan ワークフローの Trivy スキャンで以下のエラーが発生: 原因
対処方法このエラーは以下の方法で解決できます:
確認事項他のCI チェックの状況:
結論: PRのコード品質には問題ありません。Container Security Scanを再実行することで解決します。 |
|
(aside) |
|
Claude finished @keito4's task in 1m 7s —— View job CI失敗の分析結果タスクリスト
問題の特定CI失敗の原因を調査した結果、コードの問題ではなく、GitHub Actionsランナーのディスク容量不足であることが判明しました。 エラー詳細Container Security Scan ワークフローの Trivy スキャンで以下のエラーが発生: 原因
対処方法このエラーは以下の方法で解決できます:
確認事項他のCI チェックの状況:
結論: PRのコード品質には問題ありません。Container Security Scanを再実行することで解決します。 |
|
🎉 This PR is included in version 1.35.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
* feat: add user-level Claude commands sync and automation scripts DevContainer起動時に.claude/commandsをユーザーレベルに自動同期する 仕組みと開発効率化のための自動化スクリプトを実装しました。 ## 追加機能 ### Claude コマンド同期 - script/sync-claude-commands.sh を追加 - .claude/commands/ を ~/.claude/commands/ にコピー - DevContainer postCreateCommand に組み込み - ユーザーレベルで全プロジェクトから利用可能に ### 開発自動化コマンド - /branch-cleanup: マージ済みブランチの自動削除 - /dependency-health-check: 依存関係の健全性チェック - /pre-pr-checklist: PR作成前の品質チェック ## 技術的詳細 - 環境変数 CONFIG_REPO_PATH でパスをカスタマイズ可能 - エラーハンドリングとログ出力を統一 - 全スクリプトに実行権限を付与 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * fix: resolve ShellCheck warnings in automation scripts ShellCheck で検出された警告をすべて修正: - script/branch-cleanup.sh: 変数の引用符追加、正規表現パターンの修正 - script/pre-pr-checklist.sh: 未使用変数 VERBOSE の削除、変数の引用符追加 - script/dependency-health-check.sh: 未使用変数 PROD_ONLY, INCLUDE_CONTAINER, DEPRECATED_COUNT の削除 - ドキュメント更新: 削除したオプションの記載を除去 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: keito4 <keito4@users.noreply.github.com> --------- Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com> Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com> Co-authored-by: keito4 <keito4@users.noreply.github.com>
* feat: add comprehensive development and security tools 開発効率化とセキュリティ強化のための包括的なツールセットを追加。 ## 追加機能 ### 開発ツール #### 変更履歴生成 (/changelog-generator) - Git コミット履歴から変更ログを自動生成 - Conventional Commits 形式に対応 - バージョンごとのグルーピング - CHANGELOG.md の自動更新 #### コード複雑度チェック (/code-complexity-check) - JavaScript/TypeScript の循環的複雑度を測定 - 複雑度が高い関数を検出 - リファクタリングの優先順位付け - 技術的負債の可視化 #### テストカバレッジトレンド (/test-coverage-trend) - カバレッジの推移を追跡 - カバレッジ低下の自動検出 - レポート生成と履歴管理 - 品質トレンドの可視化 ### セキュリティツール #### 認証情報スキャン (/security-credential-scan) - ソースコード内の機密情報を検出 - API キー、パスワード、トークンの漏洩防止 - .gitignore との整合性チェック - セキュリティリスクの早期発見 #### コンテナヘルスチェック (/container-health) - DevContainer の健全性を診断 - リソース使用状況の監視 - 設定の妥当性検証 - パフォーマンス問題の検出 ### セットアップツール #### 新規リポジトリセットアップ (setup-new-repo.sh) - リポジトリの初期設定を自動化 - 必要なファイルとディレクトリの作成 - Git 設定の初期化 - ベストプラクティスの適用 ## 技術的詳細 - すべてのスクリプトに実行権限を付与 - エラーハンドリングとログ出力を統一 - カラー出力で視認性を向上 - CI/CD 環境での自動実行に対応 ## 使用例 ```bash # 変更履歴を生成 /changelog-generator # コード複雑度をチェック /code-complexity-check # テストカバレッジのトレンドを確認 /test-coverage-trend # 認証情報の漏洩をチェック /security-credential-scan # コンテナの健全性を確認 /container-health ``` 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * docs: update README with new commands documentation - pre-pr-checklist: PR準備自動化 - dependency-health-check: 依存関係ヘルスチェック - branch-cleanup: ブランチクリーンアップ - setup-new-repo: 新規リポジトリセットアップ - changelog-generator: CHANGELOG自動生成 - container-health: コンテナヘルスチェック - test-coverage-trend: カバレッジトレンド追跡 - code-complexity-check: 複雑度分析 - security-credential-scan: 認証情報スキャン 9つの新しいコマンドのドキュメントをREADMEに追加 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * fix: resolve shellcheck warnings in development tools - changelog-generator.sh: 正規表現のエスケープ修正 - container-health.sh: forループ削除、未使用変数にshellcheck disable追加 - code-complexity-check.sh: local変数宣言と代入を分離(SC2155対応) - test-coverage-trend.sh: 未使用変数にshellcheck disable追加 - setup-new-repo.sh: 未使用変数にshellcheck disable追加 - security-credential-scan.sh: 未使用変数とsedスタイル警告にshellcheck disable追加 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * fix: correct shellcheck directive placement - shellcheck disableコメントをコマンドの前の行に移動(SC1126対応) - changelog-generator.sh: 正規表現を変数に格納してパースエラー回避 すべてのshellcheck警告とエラーを解決 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * feat: Sync Claude settings from Elu-co-jp projects Elu-co-jp 配下の全プロジェクトから settings.local.json を収集し、 共通設定を抽出して DevContainer 設定に反映しました。 ## 収集元 - リポジトリ数: 19 件 - 共通設定: 21 件 ## 主な変更 ### 追加された許可設定 (21 件) **WebFetch ドメイン** (1 件) - ai-sdk.dev - AI SDK ドキュメント **Bash コマンド** (16 件) - wc, xargs, paste - テキスト処理 - jq, perl - データ処理 - python - Python実行 - similarity-ts, shellcheck, cloc - 開発ツール - command -v - コマンド存在確認 - op inject/vault/item list/get - 1Password CLI - zsh, zsh -n - Zシェル **MCP ツール** (1 件) - supabase__search_docs - Supabaseドキュメント検索 **Read パーミッション** (3 件) - //.codex/** - Codex設定 - //.claude/plugins/** - Claudeプラグイン - //home/vscode/** - DevContainer環境 ### コマンド改善 `/sync-claude-settings` コマンドを改善: - 前提条件を明記し、環境確認をスキップ - node_modules 自動除外 - セキュリティ配慮を強化(APIキー/トークン自動除外) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * docs: Add security check step to sync-claude-settings command Step 7.5 として秘匿情報チェックを追加し、 今後も自動的にセキュリティチェックを実施できるようにしました。 ## 変更内容 ### Step 7.5: Security Check 追加 - git diff で変更内容を確認 - APIキー、トークン、パスワードなどの秘匿情報をチェック - プロジェクト固有の識別子をチェック - 判定基準と対応方法を明記 ### PR本文とStep 9に追加 - セキュリティチェック結果セクション - pre-commit フック結果 - テスト結果 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * feat: Add create-pr command for automated PR creation 最新のベースブランチから変更を取り込み、PRを自動作成するコマンドを追加しました。 ## 新機能 ### /create-pr コマンド 最新のベースブランチから変更を取り込んでPRを作成します。 **主な機能:** - 最新のベースブランチ(main)を自動的にマージ - コンフリクトの自動解決(同一ファイルの場合) - PR タイトルと本文の自動生成 - ドラフトPRのサポート **引数:** - `--base BRANCH`: ベースブランチを指定(デフォルト: main) - `--title TITLE`: PR タイトルを指定 - `--draft`: ドラフトPRとして作成 **使用例:** ```bash # デフォルト設定でPR作成 /create-pr # カスタムタイトルでPR作成 /create-pr --title "feat: Add new feature" # ドラフトPRとして作成 /create-pr --draft ``` ## 実装詳細 - Step 1: 引数解析 - Step 2: 現在の状態を検証 - Step 3: 最新のベースブランチを取得してマージ - Step 4: PR タイトルと本文を生成 - Step 5: リモートブランチにプッシュ - Step 6: gh CLI を使用してPR作成 - Step 7: 完了レポート表示 ## コンフリクト自動解決 同一ファイルのコンフリクトは自動的に解決し、 異なる内容のコンフリクトは手動解決を要求します。 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * feat: Add auto-refactor and PR creation to similarity-analysis similarity-analysis コマンドに自動リファクタリングとPR分割作成機能を追加しました。 ## 新機能 ### --auto-refactor オプション 検出された類似コードに対して自動的にリファクタリングを実施し、 各類似ペアごとに別々のPRを作成します。 **主な機能:** - 類似ペアの優先度別分類(High/Medium/Low) - 各類似ペアごとに独立したブランチを作成 - 共通関数の自動抽出 - テスト実行とバリデーション - 個別PRの自動作成 ### 新しい引数 - `--auto-refactor`: 自動リファクタリングとPR作成を有効化 - `--base-branch BRANCH`: PRのベースブランチを指定(デフォルト: main) ### ワークフロー 1. **類似コードの検出**: similarity-ts を使用 2. **優先度別分類**: 類似度に応じて High/Medium/Low に分類 3. **各ペアごとにリファクタリング**: - ブランチ作成(refactor/similarity-{PAIR_ID}-{TIMESTAMP}) - 共通関数の抽出 - テスト実行 - コミットとPR作成 4. **サマリーレポート**: 全体の統計と作成されたPR一覧 ### 使用例 ```bash # 基本的な分析(レポートのみ) /similarity-analysis # 自動リファクタリングとPR作成 /similarity-analysis --auto-refactor # カスタム閾値と自動リファクタリング /similarity-analysis --threshold 0.85 --auto-refactor # 特定パスを対象に自動リファクタリング /similarity-analysis --path src/utils --auto-refactor # カスタムベースブランチでPR作成 /similarity-analysis --auto-refactor --base-branch develop ``` ## 利点 - **PR分離**: 各リファクタリングが独立しているため、個別にレビュー・マージ可能 - **段階的な改善**: 一度にすべてをマージする必要がない - **リスク軽減**: 各PRが小さいため、問題が発生しても影響範囲が限定的 - **並列レビュー**: 複数のレビュアーが同時に異なるPRをレビュー可能 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * chore: trigger CI rerun with updated main branch This empty commit triggers CI to rerun with the latest main branch. Previous CI failure was due to: 1. Formatting issue in merge commit (not in PR branch itself) 2. Trivy scan failure due to disk space (infrastructure issue) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: keito4 <keito4@users.noreply.github.com> * chore: trigger CI rerun with updated main branch * chore: trigger CI rerun with updated main branch * chore: trigger CI rerun with updated main branch * chore: trigger CI rerun with updated main branch * chore: trigger CI rerun with updated main branch * chore: trigger CI rerun with updated main branch * chore: trigger CI rerun with updated main branch * chore: trigger CI rerun with updated main branch * chore: trigger CI rerun with updated main branch * chore: trigger CI rerun with updated main branch * chore: trigger CI rerun with updated main branch * chore: trigger CI rerun with updated main branch * ci: bump docker/setup-qemu-action from 2 to 3 (#249) Bumps [docker/setup-qemu-action](https://github.com/docker/setup-qemu-action) from 2 to 3. - [Release notes](https://github.com/docker/setup-qemu-action/releases) - [Commits](docker/setup-qemu-action@v2...v3) --- updated-dependencies: - dependency-name: docker/setup-qemu-action dependency-version: '3' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * feat: Add pnpm:2 DevContainer feature recommendations (#260) - Add dedicated pnpm package manager subsection in Node.js/TypeScript projects - Document standalone pnpm:2 feature as recommended approach - Compare with node:1's pnpmVersion option - Highlight benefits: clearer version management, separation of concerns, flexible versioning Resolves #244 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com> Co-authored-by: keito4 <keito4@users.noreply.github.com> * ci: bump actions/setup-node from 4 to 6 (#250) Bumps [actions/setup-node](https://github.com/actions/setup-node) from 4 to 6. - [Release notes](https://github.com/actions/setup-node/releases) - [Commits](actions/setup-node@v4...v6) --- updated-dependencies: - dependency-name: actions/setup-node dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * ci: bump actions/upload-artifact from 4 to 6 (#248) Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4 to 6. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](actions/upload-artifact@v4...v6) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * feat: add user-level Claude commands sync and automation scripts (#238) * feat: add user-level Claude commands sync and automation scripts DevContainer起動時に.claude/commandsをユーザーレベルに自動同期する 仕組みと開発効率化のための自動化スクリプトを実装しました。 ## 追加機能 ### Claude コマンド同期 - script/sync-claude-commands.sh を追加 - .claude/commands/ を ~/.claude/commands/ にコピー - DevContainer postCreateCommand に組み込み - ユーザーレベルで全プロジェクトから利用可能に ### 開発自動化コマンド - /branch-cleanup: マージ済みブランチの自動削除 - /dependency-health-check: 依存関係の健全性チェック - /pre-pr-checklist: PR作成前の品質チェック ## 技術的詳細 - 環境変数 CONFIG_REPO_PATH でパスをカスタマイズ可能 - エラーハンドリングとログ出力を統一 - 全スクリプトに実行権限を付与 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * fix: resolve ShellCheck warnings in automation scripts ShellCheck で検出された警告をすべて修正: - script/branch-cleanup.sh: 変数の引用符追加、正規表現パターンの修正 - script/pre-pr-checklist.sh: 未使用変数 VERBOSE の削除、変数の引用符追加 - script/dependency-health-check.sh: 未使用変数 PROD_ONLY, INCLUDE_CONTAINER, DEPRECATED_COUNT の削除 - ドキュメント更新: 削除したオプションの記載を除去 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: keito4 <keito4@users.noreply.github.com> --------- Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com> Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com> Co-authored-by: keito4 <keito4@users.noreply.github.com> * ci: bump codecov/codecov-action from 4 to 5 (#246) * ci: bump codecov/codecov-action from 4 to 5 Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 4 to 5. - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](codecov/codecov-action@v4...v5) --- updated-dependencies: - dependency-name: codecov/codecov-action dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * Update ci.yml --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: keito4 <newton30000@gmail.com> * feat: Add Deno DevContainer feature (#263) * feat: Add Deno DevContainer feature Add Deno runtime support as a DevContainer feature for modern JavaScript/TypeScript development and Edge Functions. - Added ghcr.io/devcontainers-community/features/deno:1 - Enables Deno runtime with built-in TypeScript support - Provides deno fmt, deno lint, deno test commands - Essential for Supabase Edge Functions development Closes #255 Co-authored-by: keito4 <keito4@users.noreply.github.com> * docs: fix Prettier formatting in devcontainer-recommendations.md Add missing blank line before bullet list to comply with Prettier formatting rules. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: keito4 <keito4@users.noreply.github.com> * docs: Add Deno Runtime documentation to devcontainer recommendations - Add comprehensive Deno feature section after Supabase - Document TypeScript-first support and Edge Functions use case - Include built-in toolchain details (fmt, lint, test) - Add reference links to official documentation Co-authored-by: keito4 <keito4@users.noreply.github.com> * fix: Add disk cleanup step to container-security workflow GitHub Actionsのランナーでディスク容量不足によりTrivy Scanが失敗する問題を解決しました。 ## 問題 - Trivy Container Scanジョブがディスク容量不足で失敗 - GitHub Actionsの無料ランナーは14GBのディスク容量制限 ## 解決策 container-security.ymlワークフローに、各ジョブの最初にディスククリーンアップステップを追加: ### 削除対象 - Dockerの未使用イメージ/コンテナ/ボリューム - Android SDK (~8GB) - .NET SDKs (~2GB) - Haskell GHC (~1.5GB) - Boost libraries (~1GB) ### 効果 - クリーンアップ前: ~14GB使用 - クリーンアップ後: ~10GB以上の空き容量を確保 ## 変更内容 両方のジョブ(trivy-scan, sbom-generation)にディスククリーンアップステップを追加: - trivy-scan: スキャン前にディスク容量を確保 - sbom-generation: SBOM生成前にディスク容量を確保 ## 影響範囲 - container-security.ymlワークフローのみ - 実行時間が約10-20秒増加(クリーンアップ処理) - ディスク容量不足によるビルド失敗を防止 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * fix: remove vercel package to resolve container security vulnerabilities vercelパッケージとその依存関係(esbuild)にCRITICAL脆弱性が存在するため削除 - esbuild Go binary (stdlib v1.18.3)のCVE-2023-24538, CVE-2023-24540, CVE-2024-24790を解決 - vercelコマンドはリポジトリ内で使用されていないことを確認済み 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> --------- Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com> Co-authored-by: keito4 <keito4@users.noreply.github.com> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com> --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com> Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com> Co-authored-by: keito4 <keito4@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Summary
DevContainer起動時に
.claude/commands/をユーザーレベル(~/.claude/commands/)に自動同期する仕組みを追加し、開発効率化のための包括的な自動化スクリプトを実装しました。追加機能
Claude コマンド同期
script/sync-claude-commands.sh:.claude/commands/を~/.claude/commands/にコピーpostCreateCommandに組み込み、プロジェクト固有ではなくユーザーレベルで全プロジェクトからコマンドを利用可能にCONFIG_REPO_PATHでソースパスをカスタマイズ可能開発自動化コマンド
/branch-cleanup: マージ済みブランチの自動クリーンアップ/dependency-health-check: 依存関係の健全性チェック(脆弱性・ライセンス・更新状況)/pre-pr-checklist: PR作成前の品質チェックリスト実行Test Plan
技術的詳細
🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Documentation
Chores
✏️ Tip: You can customize this high-level summary in your review settings.