Analyze Ci Logsのロゴ

Analyze Ci Logs

コミュニティ
dykyi-roman
analyze-ci-logs

Analyzes CI/CD pipeline logs to identify failure causes. Parses error messages, detects common failure patterns, and provides fix recommendations.

概要

公開者dykyi-roman
リポジトリawesome-claude-code
スキル名analyze-ci-logs
スター
98
フォーク
25
同梱ファイル
指示のみ
ライセンスMIT
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 指示だけで完結

    モデルに必要なものはすべて指示に含まれているため、別途同期するファイルはありません。

  • オープンソース

    dykyi-romanがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキル「Analyze Ci Logs」をTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/dykyi-roman/awesome-claude-code/tree/master/skills/analyze-ci-logs
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/dykyi-roman/awesome-claude-code.git /tmp/awesome-claude-code
mkdir -p .claude/skills
cp -r /tmp/awesome-claude-code/skills/analyze-ci-logs .claude/skills/analyze-ci-logs
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでAnalyze Ci Logsを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあるとすぐに、モデルが自動的にAnalyze Ci Logsを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Analyze Ci Logsは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

CI Log Analyzer

Analyzes CI/CD pipeline logs to diagnose failures and suggest fixes.

Failure Categories

1. Dependency Failures

┌─────────────────────────────────────────────────────────────────┐
│  DEPENDENCY FAILURE PATTERNS                                    │
├─────────────────────────────────────────────────────────────────┤
│                                                                 │
│  composer install:                                              │
│  • "Your requirements could not be resolved"                   │
│  • "Package not found"                                          │
│  • "Allowed memory exhausted"                                   │
│                                                                 │
│  npm/yarn:                                                      │
│  • "ERESOLVE unable to resolve dependency tree"                │
│  • "npm ERR! 404 Not Found"                                    │
│  • "ENOMEM: not enough memory"                                 │
│                                                                 │
└─────────────────────────────────────────────────────────────────┘

2. Test Failures

PHPUnit Test Failures:
• "Failed asserting that..."
• "Error: Call to undefined method..."
• "Exception: ..."
• "PHPUnit\Framework\MockObject\RuntimeException"

Common Causes:
• Missing test fixtures
• Database connection issues
• Timing-dependent tests
• Mock configuration errors

3. Static Analysis Failures

PHPStan Errors:
• "Parameter $x has no type specified"
• "Method .+::.+ has no return type specified"
• "Call to an undefined method"
• "Access to an undefined property"

Psalm Errors:
• "MixedAssignment"
• "UndefinedClass"
• "InvalidReturnType"

4. Infrastructure Failures

Docker Errors:
• "Cannot connect to the Docker daemon"
• "pull access denied"
• "no space left on device"

Service Errors:
• "Connection refused" (database/redis)
• "ECONNRESET"
• "Timeout exceeded"

Log Pattern Matching

PHPUnit Failure Parser

Pattern: /FAILURES!\nTests: (\d+), Assertions: (\d+), Failures: (\d+)/
Pattern: /1\) (.+)::(.+)\n(.+)\nFailed asserting that (.+)/
Pattern: /Error: (.+)\n(.+):(\d+)/

Example:
FAILURES!
Tests: 45, Assertions: 120, Failures: 2, Errors: 1

1) App\Tests\Unit\OrderTest::test_calculate_total
Failed asserting that 100 matches expected 99.

/app/tests/Unit/OrderTest.php:45

Parsed:
{
  "type": "test_failure",
  "test_class": "App\\Tests\\Unit\\OrderTest",
  "test_method": "test_calculate_total",
  "assertion": "Failed asserting that 100 matches expected 99",
  "file": "/app/tests/Unit/OrderTest.php",
  "line": 45
}

PHPStan Error Parser

Pattern: /------ (.+) ------\n\s*Line\s+(.+\.php)\n\s+(\d+)\s+(.+)/
Pattern: /\[ERROR\] Found (\d+) errors/

Example:
 ------ ----------------------------------------
  Line   src/Domain/Order/Order.php
 ------ ----------------------------------------
  45     Method Order::getTotal() has no return type specified.
  67     Parameter $discount has no type specified.
 ------ ----------------------------------------

 [ERROR] Found 2 errors

Parsed:
{
  "type": "phpstan_errors",
  "count": 2,
  "errors": [
    {"file": "src/Domain/Order/Order.php", "line": 45, "message": "Method Order::getTotal() has no return type specified."},
    {"file": "src/Domain/Order/Order.php", "line": 67, "message": "Parameter $discount has no type specified."}
  ]
}

Composer Error Parser

Pattern: /Your requirements could not be resolved to an installable set of packages./
Pattern: /Problem (\d+)\n\s+- (.+)/
Pattern: /- (.+) requires (.+) -> (.+)/

Example:
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - symfony/framework-bundle v6.0.0 requires php >=8.0.2 -> your php version (7.4.33) does not satisfy that requirement.

Parsed:
{
  "type": "dependency_conflict",
  "problems": [
    {
      "package": "symfony/framework-bundle",
      "requires": "php >=8.0.2",
      "actual": "7.4.33",
      "message": "PHP version mismatch"
    }
  ]
}

Analysis Output Format

markdown
# CI Pipeline Failure Analysis

**Pipeline:** #12345
**Branch:** feature/new-checkout
**Commit:** abc1234
**Failed Job:** test-unit
**Duration:** 5m 32s

## Failure Summary

| Category | Count | Severity |
|----------|-------|----------|
| Test Failures | 3 | 🔴 Critical |
| PHPStan Errors | 0 | - |
| Infrastructure | 0 | - |

## Root Cause Analysis

### Primary Failure: Test Assertion Error

**Test:** `OrderTest::test_calculate_total_with_discount`
**File:** `tests/Unit/Domain/OrderTest.php:45`

**Error:**

Failed asserting that 90.0 matches expected 90.


**Analysis:**
The test expects an integer `90` but receives a float `90.0`. This is likely due to:
1. Changed calculation in `Order::calculateTotal()` now returns float
2. Test assertion uses strict comparison

**Suggested Fix:**
```php
// Option 1: Update test to expect float
self::assertSame(90.0, $order->calculateTotal());

// Option 2: Use assertEquals for loose comparison
self::assertEquals(90, $order->calculateTotal());

// Option 3: Use Money value object (recommended)
self::assertTrue($order->calculateTotal()->equals(Money::EUR(90)));

Secondary Failure: Mock Configuration

Test: PaymentServiceTest::test_process_payment File: tests/Unit/Application/PaymentServiceTest.php:78

Error:

Expectation failed for method name is "charge" when invoked 1 time(s).
Method was expected to be called 1 times, actually called 0 times.

Analysis: Mock expectation not met. The charge method was never called, indicating:

  1. Conditional logic preventing the call
  2. Early return before reaching the charge
  3. Exception thrown before charge

Suggested Fix: Review the test setup and ensure conditions are met for charge to be called.

Timeline

00:00 - Job started
00:15 - Composer install (cached)
00:45 - PHPStan passed
01:30 - PHPUnit started
04:45 - Test failure: OrderTest::test_calculate_total_with_discount
05:00 - Test failure: PaymentServiceTest::test_process_payment
05:32 - Job failed

Recommendations

  1. Immediate: Fix type mismatch in OrderTest
  2. Short-term: Add type declarations to prevent float/int confusion
  3. Long-term: Use Money value object for financial calculations

Related Changes

Recent commits that may have caused this failure:

  • abc1234 - Refactor calculateTotal to return float
  • def5678 - Update discount calculation logic

## Common Fixes Database

### Dependency Issues

| Error Pattern | Cause | Fix |
|---------------|-------|-----|
| `memory exhausted during composer` | Low memory limit | Add `COMPOSER_MEMORY_LIMIT=-1` |
| `package not found` | Private repo or typo | Check package name and auth |
| `requirements not resolved` | Version conflict | Run `composer why-not package` |

### Test Issues

| Error Pattern | Cause | Fix |
|---------------|-------|-----|
| `Connection refused 127.0.0.1:3306` | MySQL not ready | Add service health check |
| `Mock expectation failed` | Mock not configured | Review mock setup |
| `Class not found` | Autoloader issue | Run `composer dump-autoload` |

### Infrastructure Issues

| Error Pattern | Cause | Fix |
|---------------|-------|-----|
| `no space left on device` | Disk full | Clear Docker cache |
| `Cannot connect to Docker daemon` | DinD not running | Check Docker service |
| `pull access denied` | Auth issue | Add registry credentials |

## Analysis Instructions

1. **Extract log content:**
   - Identify job that failed
   - Get full log output
   - Note timestamps

2. **Identify failure type:**
   - Parse error messages
   - Categorize (test/lint/infra)
   - Determine severity

3. **Root cause analysis:**
   - Trace error to source
   - Check recent changes
   - Identify patterns

4. **Generate recommendations:**
   - Specific fixes
   - Prevention strategies
   - Related improvements

## Usage

Provide:
- CI log output (full or relevant section)
- Pipeline context (branch, commit)
- Recent changes (optional)

The analyzer will:
1. Parse log for errors
2. Categorize failures
3. Identify root cause
4. Suggest specific fixes
5. Provide prevention tips

よくある質問

AIスキル「Analyze Ci Logs」では何ができますか?

Analyzes CI/CD pipeline logs to identify failure causes. Parses error messages, detects common failure patterns, and provides fix recommendations.

TypingMindでAnalyze Ci Logsを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Analyze Ci Logsはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにAnalyze Ci Logsをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/dykyi-roman/awesome-claude-code/tree/master/skills/analyze-ci-logsを貼り付けてください。TypingMindがSKILL.mdを読み込み、チャットごとに有効にできるスキルとしてインストールします。

Analyze Ci Logsを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストの内容がこのスキルの用途に合ったときに、このスキルを読み込めます。

Analyze Ci Logsで使えるAIモデルの数に制限はありますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもAnalyze Ci Logsを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Analyze Ci Logs」は無料ですか?

はい。dykyi-romanがMITライセンスのもとでGitHubに公開しています。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇