Skip to content

feat: repo-maintenance に複数の品質チェックを追加 - #541

Merged
keito4 merged 1 commit into
mainfrom
feat/repo-maintenance-improvements
Mar 7, 2026
Merged

feat: repo-maintenance に複数の品質チェックを追加#541
keito4 merged 1 commit into
mainfrom
feat/repo-maintenance-improvements

Conversation

@keito4

@keito4 keito4 commented Mar 7, 2026

Copy link
Copy Markdown
Owner

概要

repo-maintenance スキルに 5 つの新しい品質チェックを追加しました。

追加内容

Step 3.6 Renovate / Dependabot 設定チェック

  • .github/renovate.json または .github/dependabot.yml の存在確認
  • full モード時に renovate.json テンプレートを自動生成
  • 依存関係の自動更新が保証される

Step 3.7 commitlint 設定チェック

  • commitlint.config.* の存在確認
  • Husky commit-msg フックとの連携確認
  • 未設定時は /setup-husky を提案

Step 3.8 .editorconfig 設定チェック

  • .editorconfig の存在確認
  • full モード時に標準テンプレートを自動生成(indent=2, LF, UTF-8)

Step 3.9 package.json scripts 標準チェック

  • test, lint, format:check, typecheck など Quality Gates 必須スクリプトの存在確認
  • 未定義スクリプトをリストアップ

ni(antfu/ni)パッケージマネージャー統合

  • Step 5.2 のインストールコマンドを ni 対応に更新
  • ni が利用可能な場合は優先使用、ロックファイル(pnpm-lock.yaml / yarn.lock / bun.lockb)で自動判定
  • npm / pnpm / yarn / bun / ni に対応した detect_pm() 関数を追加

サマリーレポート

新規チェック項目をサマリーレポートと Related Commands テーブルに追記しました。

🤖 Generated with Claude Code

Summary by CodeRabbit

Release Notes

  • New Features
    • Added automatic verification and template generation for Renovate/Dependabot configurations when missing.
    • Enhanced package manager detection to automatically identify and support multiple package managers during audits.
    • Updated maintenance summaries and reports to display configuration status and detection results.

## 追加したチェック項目

### Step 3.6 Renovate / Dependabot 設定チェック
- .github/renovate.json または .github/dependabot.yml の存在確認
- full モード時に renovate.json テンプレートを自動生成

### Step 3.7 commitlint 設定チェック
- commitlint.config.* の存在確認
- Husky commit-msg フックとの連携確認
- 未設定時は /setup-husky を提案

### Step 3.8 .editorconfig 設定チェック
- .editorconfig の存在確認
- full モード時に標準テンプレートを自動生成

### Step 3.9 package.json scripts 標準チェック
- test, lint, format:check, typecheck など Quality Gates 必須スクリプトの存在確認
- 未定義スクリプトをリストアップ

### ni(antfu/ni)パッケージマネージャー統合
- Step 5.2 のインストールコマンドを ni 対応に更新
- ni が利用可能な場合は優先使用、ロックファイルで自動判定

### サマリーレポート更新
- 新規チェック項目をサマリーに追加
- Related Commands テーブルを更新

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Mar 7, 2026

Copy link
Copy Markdown

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

Added Renovate/Dependabot configuration check under Setup category with conditional template generation in full mode. Extended Discovery/Package Audit flow to include automatic package manager detection via ni (antfu/ni). Updated summary and report outputs to reflect new configuration status and enhanced detection results.

Changes

Cohort / File(s) Summary
Renovate & Package Manager Detection
.claude/commands/repo-maintenance.md
Added new Renovate/Dependabot settings check with conditional .github/renovate.json generation. Extended package audit flow to auto-detect package managers via ni, supporting npm, pnpm, yarn, bun. Updated summary and report sections to reflect new checks and detection capabilities.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

Poem

🐰 Hops of joy through the maintenance flow,
Renovate checks in a steady glow,
Package managers dance via ni's call,
Templates bloom when configs fall—
A rabbit's realm, now complete and bright!

🚥 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 the main change: adding multiple quality checks to repo-maintenance, which aligns with the PR objectives of introducing 5 new configuration checks.
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 feat/repo-maintenance-improvements

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.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 54df4c10cc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +749 to +752
check_script "test" "test" "test:unit"
check_script "lint" "lint" "lint:check"
check_script "format:check" "format:check"
check_script "typecheck" "typecheck" "type-check" "tsc"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Validate build/dev scripts in standard script check

This logic only validates test, lint, format:check, and typecheck, even though the same section defines dev and build as required (and marks build as used by CI). Repositories missing build or dev will still be reported as having all standard scripts, which creates a false pass and can hide a CI-breaking script gap.

Useful? React with 👍 / 👎.

@keito4
keito4 merged commit 490972c into main Mar 7, 2026
5 of 6 checks passed
@claude

claude Bot commented Mar 7, 2026

Copy link
Copy Markdown
Contributor

PR レビュー

全体的によく構造化された追加で、repo-maintenance スキルの充実度が大きく向上しています。いくつか気になる点をフィードバックします。


バグ: Shell 演算子の優先順位(Step 3.6)

最も重要な問題です。

Step 3.6 の Renovate チェックロジックにシェルの演算子優先順位バグがあります:

[ -f ".github/renovate.json" ] || [ -f ".github/renovate.json5" ] || \
  [ -f "renovate.json" ] || [ -f "renovate.json5" ] && HAS_RENOVATE=true

Shell では &&|| より優先順位が高いため、実際の評価は次のようになります:

[...] || [...] || [...] || ([ -f "renovate.json5" ] && HAS_RENOVATE=true)

つまり HAS_RENOVATE=truerenovate.json5 が存在する場合にしかセットされません。修正案:

if [ -f ".github/renovate.json" ] || [ -f ".github/renovate.json5" ] || \
   [ -f "renovate.json" ] || [ -f "renovate.json5" ]; then
  HAS_RENOVATE=true
fi

懸念点: package.json 不在時のガード(Step 3.9)

SCRIPTS=$(jq -r '.scripts | keys[]' package.json 2>/dev/null)

package.json が存在しない場合、SCRIPTS が空文字列になり check_script がすべてのスクリプトを "未定義" と誤報告する可能性があります。スキップ条件は記載されていますが、実際のガードロジックを明示することを推奨します:

[ -f "package.json" ] || { echo "⏭️ スキップ(package.json なし)"; return; }

提案: detect_pm() の配置について

detect_pm() 関数が Step 5.2 内にのみ登場しています。他のステップでも利用できる汎用関数のため、ドキュメント冒頭の共通関数セクションへの配置を検討してください。


良い点

  • ni 対応: ロックファイルからの自動判定ロジックが明確で実用的
  • bun.lock / bun.lockb 両対応: 新旧 Bun バージョンの互換性を考慮
  • Renovate テンプレート品質: devDependencies の automerge など実践的なデフォルト設定
  • .editorconfig テンプレート: Makefile のタブインデント対応など細部まで考慮
  • サマリーレポートの更新: 新チェック項目が既存フォーマットと一貫している

Step 3.6 のシェルバグはAIエージェントが実行した際に誤動作を引き起こす可能性があるため、マージ前に修正を推奨します。その他は提案レベルです。

🤖 Reviewed by Claude Sonnet 4.6

@github-actions

github-actions Bot commented Mar 7, 2026

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 1.89.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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