Skip to content

feat: PR作成後のCI失敗対応ルールを追加 - #344

Merged
keito4 merged 1 commit into
mainfrom
feat/add-ci-failure-handling-instructions
Jan 14, 2026
Merged

feat: PR作成後のCI失敗対応ルールを追加#344
keito4 merged 1 commit into
mainfrom
feat/add-ci-failure-handling-instructions

Conversation

@keito4

@keito4 keito4 commented Jan 14, 2026

Copy link
Copy Markdown
Owner

概要

PR作成後にCIが失敗した場合、そのブランチで解決できる問題は必ず修正するよう指示するルールを追加しました。

変更内容

  • .claude/CLAUDE.md: セクション2.5としてCI失敗対応ルールを追加
  • .claude/commands/create-pr.md: Step 8としてCI失敗時のフォローアップ手順を追加

追加された指示

状況 対応
直接的な変更によるCI失敗 即座に修正してプッシュ
間接的な影響によるCI失敗 原因を特定し、そのブランチで修正可能なら修正
ベースブランチの問題によるCI失敗 ベースブランチを更新後、再マージして修正
環境・インフラ起因のCI失敗 再実行を試みる、解決しない場合は報告

原則:

  • CIが緑になるまでPRを放置しない
  • 修正可能な問題は自分のブランチで解決する
  • 解決不能な場合は原因と状況を明記してレビュアーに報告

テスト

  • pre-commit フック: Format, Lint, Test 通過
  • commitlint: 通過

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation
    • Added CI failure handling guidelines to the development handbook, including failure scenario classification, decision rules, and standardized response patterns for common CI failure types.
    • Enhanced PR creation guide with mandatory CI follow-up procedures and troubleshooting workflows for post-PR CI failures.

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

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

coderabbitai Bot commented Jan 14, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

Added 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

Cohort / File(s) Summary
Handbook CI Failure Guidance
.claude/CLAUDE.md
Added section 2.5 "PR作成後のCI失敗対応" with failure scenario table (direct changes, indirect impacts, base branch issues, environment/infra failures) and core principles for handling CI failures
PR Creation Command Guide
.claude/commands/create-pr.md
Added Step 8 "CI失敗時のフォローアップ(必須)" with CI diagnostic commands, standardized fix workflows for lint/format/tests/types/conflicts/dependencies/infra, and post-fix reporting patterns

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~4 minutes

Possibly related PRs

Suggested labels

released

Poem

🐰 A rabbit hops through code with care,
Adding wisdom, debugging flair,
When CI fails, fear not the sight—
Our guidebook shows the path to right!
Green pipelines bloom when wisdom flows. ✨

🚥 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 pull request title directly and clearly summarizes the main change: adding CI failure handling rules after PR creation, which is reflected in both file modifications.
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.


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.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 67ebd97 and e3ccbee.

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

Comment on lines +279 to +289
### 修正完了後の報告

```
✅ CI修正完了!

修正内容:
- [修正した内容の概要]

修正コミット: ${COMMIT_HASH}
CI状態: 緑
```

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

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.

Suggested change
### 修正完了後の報告
```
✅ 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.

@claude

claude Bot commented Jan 14, 2026

Copy link
Copy Markdown
Contributor

PR Review: CI失敗対応ルールの追加

概要

PR作成後のCI失敗時に、適切に対応するためのルールとガイドラインを追加する良い改善です。開発者がCIの失敗を放置せず、責任を持って対応する文化を醸成する重要な変更と評価します。


✅ 評価できる点

1. 明確な対応フロー

  • 失敗原因の分類(直接的/間接的/ベースブランチ/環境起因)が適切
  • 各状況に対する具体的な対応方法が明示されている
  • 対応パターン表が実用的で参考にしやすい

2. 文書構成

  • .claude/CLAUDE.md: 組織全体のポリシーとして明記(セクション2.5)
  • .claude/commands/create-pr.md: 実務者向けの詳細な手順書(Step 8)
  • 階層的に整理されており、参照しやすい構成

3. 実践的な内容

  • 具体的なコマンド例(gh pr checks, gh run view)を提示
  • 修正完了後の報告テンプレートも用意

📝 改善提案

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`

🔒 セキュリティ・品質面

問題なし

  • 文書の変更のみで、コードやスクリプトの追加なし
  • セキュリティリスクなし
  • プロセス改善によって品質向上が期待できる

🧪 テストカバレッジ

適切

  • 文書変更のため、テストコードは不要
  • pre-commit フックとcommiblintが通過していることを確認

🎯 総合評価

Approve推奨

この変更は組織全体の開発文化とCI/CD品質を向上させる重要な改善です。上記の改善提案は必須ではなく、将来的なブラッシュアップとして検討いただければと思います。

次のステップ

  1. ✅ CI状態確認(check-ci-status: SUCCESS)
  2. マージ後、実際の運用で効果を測定
  3. 必要に応じて上記提案を反映

レビュアー: Claude Sonnet 4.5
レビュー日: 2026-01-14

🤖 Generated with Claude Code

@keito4
keito4 merged commit 97dda46 into main Jan 14, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant