Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .claude/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,23 @@
Lint → Test → Build → SCA → Deploy:Stg → E2E → Deploy:Prod
デプロイは Blue-Green もしくは Canary + Auto-Rollback を推奨。

### 2.5 PR作成後のCI失敗対応

PR作成後にCIが失敗した場合、**そのブランチで解決できる問題は必ず修正する**。

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

**原則**:

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

---

## 3. AI Prompt Design Baseline
Expand Down
59 changes: 59 additions & 0 deletions .claude/commands/create-pr.md
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,65 @@ PR URL: ${PR_URL}
4. マージ準備完了後、レビュアーに通知
```

## Step 8: CI失敗時のフォローアップ(必須)

**重要**: PR作成後にCIが失敗した場合、そのブランチで解決できる問題は必ず修正する。

### CI結果の確認

```bash
# PRのCI状態を確認
gh pr checks

# 失敗したチェックの詳細を確認
gh run list --limit 5
gh run view <run-id> --log-failed
```

### 失敗時の対応フロー

1. **失敗原因の特定**
- CIログを確認して失敗原因を特定
- 直接的な変更によるものか、間接的な影響かを判断

2. **修正の実施**
- そのブランチで修正可能な場合は即座に修正
- 修正をコミットしてプッシュ
- CIが再実行されることを確認

3. **再確認**
- CIが緑になるまで監視
- 必要に応じて追加修正を実施

### 対応パターン

| 失敗原因 | 対応 |
| ---------------------- | -------------------------------------------- |
| Lint/Format エラー | `npm run lint:fix` / `npm run format` で修正 |
| テスト失敗 | テストコードまたは実装を修正 |
| 型エラー | TypeScript の型定義を修正 |
| ベースブランチとの競合 | 最新のベースブランチをマージして解決 |
| 依存関係の問題 | package-lock.json を更新 |
| 環境・インフラ起因 | CI を再実行、解決しない場合は報告 |

### 修正完了後の報告

```
✅ CI修正完了!

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

修正コミット: ${COMMIT_HASH}
CI状態: 緑
```
Comment on lines +279 to +289

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.


**原則**:

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

---

## Progress Reporting
Expand Down