A set of skills for solving problems related to CI/CD pipelines.
Trigger Conditions
- "CI failed" "GitHub Actions failed"
- "Build error" "Tests don't pass"
- "Fix the pipeline"
Feature Details
| Feature | Details | Trigger |
|---|---|---|
| Failure Analysis | See references/analyzing-failures.md | "Look at the logs" "Investigate the cause" |
| Test Fixes | See references/fixing-tests.md | "Fix the test" "Provide a fix proposal" |
Execution Steps
- Test vs Implementation Determination(Step 0)
- Classify the user's intent (analysis or fix)
- Determine complexity (see below)
- Read the appropriate reference file from the above "Feature Details," or launch the ci-cd-fixer subagent
- Check the results, and re-run as necessary
Step 0: Test vs Implementation Determination (Quality Determination Gate)
When CI fails, first isolate the cause:
CI 失敗報告
↓
┌─────────────────────────────────────────┐
│ テスト vs 実装判定 │
├─────────────────────────────────────────┤
│ エラーの原因を分析: │
│ ├── 実装が間違い → 実装を修正 │
│ ├── テストが古い → ユーザーに確認 │
│ └── 環境問題 → 環境修正 │
└─────────────────────────────────────────┘
Prohibited Actions (Tampering Prevention)
⚠️ CI 失敗時の禁止事項
以下の「解決策」は禁止です:
| 禁止 | 例 | 正しい対応 |
|------|-----|-----------|
| テスト skip 化 | `it.skip(...)` | 実装を修正 |
| アサーション削除 | `expect()` を消す | 期待値を確認 |
| CI チェック迂回 | `continue-on-error` | 根本原因修正 |
| lint ルール緩和 | `eslint-disable` | コードを修正 |
Decision Flow
🔴 CI が失敗しています
**判断が必要です**:
1. **実装が間違い** → 実装を修正 ✅
2. **テストの期待値が古い** → ユーザーに確認を求める
3. **環境の問題** → 環境設定を修正
⚠️ テストの改ざん(skip化、アサーション削除)は禁止です
どれに該当しますか?
When Approval Is Required
When changes to tests/settings are unavoidable:
## 🚨 テスト/設定変更の承認リクエスト
### 理由
[なぜこの変更が必要か]
### 変更内容
[差分]
### 代替案の検討
- [ ] 実装の修正で解決できないか確認した
ユーザーの明示的な承認を待つ
Utilizing Git log extended flags (CC 2.1.49+)
Use structured logs to identify the cause commit when CI fails.
Identifying the Cause Commit
# 構造化フォーマットでコミット分析
git log --format="%h|%s|%an|%ad" --date=short -10
# トポロジカル順序で時系列分析
git log --topo-order --oneline -20
# 変更ファイルと原因の紐付け
git log --raw --oneline -5
Main Use Cases
| Use | Flag | Effect |
|---|---|---|
| Identifying the cause of failure | `--format="%h | %s"` |
| Tracking in chronological order | --topo-order |
Tracking that takes merge order into account |
| Understanding the impact of changes | --raw |
Displaying file change details |
| Merge exclusion analysis | --cherry-pick --no-merges |
Extracting only actual commits |
Output Example
🔍 CI 失敗原因分析
最近のコミット(構造化):
| Hash | Subject | Author | Date |
|------|---------|--------|------|
| a1b2c3d | feat: update API | Alice | 2026-02-04 |
| e4f5g6h | test: add tests | Bob | 2026-02-03 |
変更ファイル(--raw):
├── src/api/endpoint.ts (Modified) ← 型エラー発生
├── tests/api.test.ts (Modified)
└── package.json (Modified)
→ a1b2c3d のコミットが原因の可能性大
型エラー: src/api/endpoint.ts:42
Subagent Coordination
If the following conditions are met, launch ci-cd-fixer with the Task tool:
- A loop of 2 or more times of fix → re-run → failure occurs
- Or, a complex case where the error spans multiple files
Launch pattern:
Task tool:
subagent_type="ci-cd-fixer"
prompt="CI失敗を診断・修正してください。エラーログ: {error_log}"
ci-cd-fixer operates with safety first (default dry-run mode).
For details, refer to agents/ci-cd-fixer.md .
For VibeCoder
🔧 CI が壊れたときの言い方
1. **「CI が落ちた」「赤くなった」**
- 自動テストが失敗している状態
2. **「なんで失敗してるの?」**
- 原因を調べてほしい
3. **「直して」**
- 自動で修正を試みる
💡 重要: テストを「ごまかす」修正は禁止です
- ❌ テストを消す、スキップする
- ⭕ コードを正しく直す
「テストが間違ってそう」と思ったら、
まず確認してから対応を決めましょう