feat: PR作成後のCI失敗対応ルールを追加 - #344
Conversation
PR作成後にCIが失敗した場合、そのブランチで解決できる問題は 必ず修正するよう指示するルールを追加しました。 ## 変更内容 - `.claude/CLAUDE.md`: セクション2.5としてCI失敗対応ルールを追加 - `.claude/commands/create-pr.md`: Step 8としてCI失敗時のフォローアップ手順を追加 ## 追加された指示 - CIが緑になるまでPRを放置しない - 修正可能な問題は自分のブランチで解決する - 解決不能な場合は原因と状況を明記してレビュアーに報告 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
📝 WalkthroughWalkthroughAdded CI failure handling guidance to development documentation. Section 2.5 in the handbook covers failure scenarios and actions. Step 8 in the PR creation guide details mandatory follow-up procedures for CI failures, including diagnostic commands, remediation workflows, and response patterns. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~4 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. 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.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In @.claude/commands/create-pr.md:
- Around line 279-289: Add a language specifier to the Markdown code fence for
the post-fix reporting template: change the opening triple-backtick for the
block containing "✅ CI修正完了!" to include "text" (i.e., use ```text) so
markdownlint no longer flags the fence; leave the rest of the block and the
closing triple-backtick unchanged.
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.claude/CLAUDE.md.claude/commands/create-pr.md
🧰 Additional context used
🧠 Learnings (6)
📓 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: 2026-01-12T10:08:03.062Z
Learning: Follow the GitHub Issues workflow: create issues with clear requirements and acceptance criteria, mention claude for AI assistance, ensure quality checks pass, and conduct human code review in PRs
Learnt from: CR
Repo: keito4/config PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-12T10:08:03.062Z
Learning: Use GitHub Actions and Claude Code integration for automated issue resolution, PR review support, quality checks, and documentation synchronization
📚 Learning: 2026-01-12T10:08:03.062Z
Learnt from: CR
Repo: keito4/config PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-12T10:08:03.062Z
Learning: Follow the GitHub Issues workflow: create issues with clear requirements and acceptance criteria, mention claude for AI assistance, ensure quality checks pass, and conduct human code review in PRs
Applied to files:
.claude/commands/create-pr.md.claude/CLAUDE.md
📚 Learning: 2026-01-12T10:08:03.062Z
Learnt from: CR
Repo: keito4/config PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-12T10:08:03.062Z
Learning: Use GitHub Actions and Claude Code integration for automated issue resolution, PR review support, quality checks, and documentation synchronization
Applied to files:
.claude/commands/create-pr.md.claude/CLAUDE.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/claude.yml : Trigger automatic AI assistance on claude mentions in issues, PRs, and comments using .github/workflows/claude.yml
Applied to files:
.claude/commands/create-pr.md.claude/CLAUDE.md
📚 Learning: 2026-01-12T10:08:03.062Z
Learnt from: CR
Repo: keito4/config PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-12T10:08:03.062Z
Learning: Follow the development quality standards defined in `CLAUDE.md`
Applied to files:
.claude/CLAUDE.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: Use structured approach for AI prompt design with clear separation between requirements gathering and code generation phases, emphasizing test-first development practices
Applied to files:
.claude/CLAUDE.md
🪛 markdownlint-cli2 (0.18.1)
.claude/commands/create-pr.md
281-281: 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). (1)
- GitHub Check: check-ci-status
🔇 Additional comments (6)
.claude/commands/create-pr.md (5)
238-240: LGTM! Clear mandate for CI failure handling.The introduction properly emphasizes the mandatory nature of CI follow-up and sets clear expectations that fixable issues must be resolved on the branch.
242-251: LGTM! Effective CI debugging commands.The provided GitHub CLI commands offer a clear path for diagnosing CI failures, from high-level status checks to detailed failure logs.
253-267: LGTM! Well-structured remediation workflow.The three-step process (identify → fix → verify) provides a clear, actionable path for handling CI failures, with appropriate emphasis on monitoring until resolution.
268-278: LGTM! Comprehensive failure scenario coverage.The response patterns table provides clear, actionable remediation steps for common CI failure types, from lint errors to infrastructure issues.
291-295: LGTM! Clear and actionable principles.The three core principles effectively reinforce the mandatory nature of CI remediation and provide clear guidance on ownership and escalation.
.claude/CLAUDE.md (1)
63-79: LGTM! Well-integrated CI failure policy.Section 2.5 effectively establishes the CI failure handling policy, providing clear scenarios and actions that complement the operational procedures in
.claude/commands/create-pr.md. The placement after section 2.4 (CI/CD pipeline) is logical and the content aligns well with the overall development philosophy.
✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.
| ### 修正完了後の報告 | ||
|
|
||
| ``` | ||
| ✅ CI修正完了! | ||
|
|
||
| 修正内容: | ||
| - [修正した内容の概要] | ||
|
|
||
| 修正コミット: ${COMMIT_HASH} | ||
| CI状態: 緑 | ||
| ``` |
There was a problem hiding this comment.
Add language specifier to satisfy linter.
The post-fix reporting template is useful, but the code block is missing a language specifier, triggering a markdownlint warning.
🔧 Proposed fix
-```
+```text
✅ CI修正完了!
修正内容:Based on learnings, static analysis hints from markdownlint-cli2.
📝 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.
| ### 修正完了後の報告 | |
| ``` | |
| ✅ CI修正完了! | |
| 修正内容: | |
| - [修正した内容の概要] | |
| 修正コミット: ${COMMIT_HASH} | |
| CI状態: 緑 | |
| ``` | |
| ### 修正完了後の報告 | |
🧰 Tools
🪛 markdownlint-cli2 (0.18.1)
281-281: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
🤖 Prompt for AI Agents
In @.claude/commands/create-pr.md around lines 279 - 289, Add a language
specifier to the Markdown code fence for the post-fix reporting template: change
the opening triple-backtick for the block containing "✅ CI修正完了!" to include
"text" (i.e., use ```text) so markdownlint no longer flags the fence; leave the
rest of the block and the closing triple-backtick unchanged.
PR Review: CI失敗対応ルールの追加概要PR作成後のCI失敗時に、適切に対応するためのルールとガイドラインを追加する良い改善です。開発者がCIの失敗を放置せず、責任を持って対応する文化を醸成する重要な変更と評価します。 ✅ 評価できる点1. 明確な対応フロー
2. 文書構成
3. 実践的な内容
📝 改善提案1. 原則の一貫性 (.claude/CLAUDE.md:65-78)現在の記述: **そのブランチで解決できる問題は必ず修正する**提案:この原則をより明確にするため、「解決できる問題」の定義を追加することを推奨します。 **そのブランチで解決できる問題は必ず修正する**。
※ 「解決できる問題」とは:
- 自分の変更が直接的に引き起こした失敗
- 自分のブランチ内で完結する修正が可能な失敗
- ベースブランチの更新で解決する競合2. 対応時間の目安 (.claude/CLAUDE.md:74-78)現在:「CIが緑になるまでPRを放置しない」という原則がありますが、時間的な期待値が不明確です。 提案:セクション2.1の「24h以内修正」と整合性を持たせる。 **原則**:
- CIが緑になるまでPRを放置しない(24時間以内の対応を目標)
- 修正可能な問題は自分のブランチで解決する
- 解決不能な場合は原因と状況を明記してレビュアーに報告3. エスカレーションパス (.claude/commands/create-pr.md:238-296)現在の記述には「解決不能な場合は報告」とありますが、誰に報告するかが不明確です。 提案:エスカレーション先を明記。 ### エスカレーション
以下の場合は速やかにエスカレーション:
- 24時間以内に解決できない問題
- インフラ・環境起因で再現性が不明
- ベースブランチに起因する問題
**エスカレーション先**:
1. プロジェクトオーナー(Issues)
2. Slack #ci-alerts チャンネル(セクション2.1参照)4. CI再実行の判断基準 (.claude/commands/create-pr.md:270-278)「環境・インフラ起因」のケースで「CI を再実行」とありますが、何回まで再実行すべきかの基準がありません。 提案: | 環境・インフラ起因 | CI を再実行(最大2回)、解決しない場合は報告 |5. コミットメッセージのガイドライン (.claude/commands/create-pr.md:279-289)CI修正のコミットメッセージについて、Conventional Commits との整合性を確保。 提案: ### 修正コミットのメッセージ
CI修正コミットは以下の形式を推奨:
- Lint/Format修正: `style: Fix lint errors in [file]`
- テスト修正: `test: Fix failing test in [test-name]`
- 実装バグ修正: `fix: Resolve CI failure in [feature]`
- 型エラー修正: `fix: Add missing type definitions`🔒 セキュリティ・品質面✅ 問題なし
🧪 テストカバレッジ✅ 適切
🎯 総合評価Approve推奨 この変更は組織全体の開発文化とCI/CD品質を向上させる重要な改善です。上記の改善提案は必須ではなく、将来的なブラッシュアップとして検討いただければと思います。 次のステップ
レビュアー: Claude Sonnet 4.5 🤖 Generated with Claude Code |
概要
PR作成後にCIが失敗した場合、そのブランチで解決できる問題は必ず修正するよう指示するルールを追加しました。
変更内容
.claude/CLAUDE.md: セクション2.5としてCI失敗対応ルールを追加.claude/commands/create-pr.md: Step 8としてCI失敗時のフォローアップ手順を追加追加された指示
原則:
テスト
🤖 Generated with Claude Code
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.