Agent skill

fix-github-actions-ci

GitHub Actions CI の失敗を調査して修正するためのスキルです。CI ログを分析して失敗箇所・原因を特定し、そのまま修正作業まで行います。

Stars 15
Forks 0

Install this agent skill to your Project

npx add-skill https://github.com/sushichan044/dotfiles/tree/main/.agents/skills/fix-github-actions-ci

SKILL.md

fix-github-actions-ci

Tips

  • gh pr checks --watchgh run watch <run-id> を使うと、CI の再実行後の状況をリアルタイムで確認できますが、 結構時間がかかるので background に移譲して非同期実行してください。
  • すべての gh コマンドについて、--repo でリポジトリを明確にすることをおすすめします
    • 現在いるリポジトリの owner/repo 形式: !gh repo view --json owner,name --jq '.owner.login+"/"+.name'
  • 調査完了後は、そのまま修正作業まで続けて、完了条件を満たしたら push して PR に反映させるところまで行うことを目指してください。

Steps

Step 1: PR コンテキストの確認

現在のブランチに関連する PR を確認する:

!gh pr view --json url,number 2>/dev/null || echo "No PR found for current branch"

PR が見つからない場合はユーザーにどの PR を修正するか確認し、以降の操作でその PR を指定する。 PR コンテキストとして受け付けられる形式: PR 番号、URL、ブランチ名

Step 2: Check ステータスの確認

失敗している check と workflow name を特定し、失敗した run の ID をメモする:

bash
gh pr checks <PR> --json name,state,bucket,workflow --jq '[.[] | select(.bucket == "fail")]'

Step 3: 失敗ログの取得

失敗した run ID のログを確認する:

bash
gh run view <run-id> --log-failed

run ID が不明な場合は gh run list --branch <branch> で探す。

ログからファイル名・行番号・エラーメッセージを特定する。

Step 4: workflow からローカル確認コマンドを特定する

Step 2 で取得した workflow name から workflow の YAML ファイルを取得する。 なお、workflow name は space を含む可能性があるので quote すること。

bash
gh workflow view "<workflow-name>" --yaml

ログと照合しながら、fail-fast により実行されなかった可能性のある step を特定する。 自動テスト系の時間がかかるチェック以外の静的解析 step をすべてリストアップする。

テストと判断する基準: step 名やコマンドに test, spec, e2e, coverage, vrt などのキーワードが含まれるもの。

Step 5: main agent に返すための修正方針をまとめる

次の形式で簡潔に整理して返す。 修正方針は「どのようなエラーが出ており、どのコードや設定を修正すべきか」を明記すること。

markdown
## CI failure summary

- PR context: <PR number/url/branch>
- Failed check: <check name>
- Workflow: <workflow name>
- Run ID: <run id>

## Error location

- File: <path or unknown>
- Line: <line or unknown>
- Message: <error message>
- Why it is failing: <root cause hypothesis based on log>

## How to verify locally

- <command 1>
- <command 2>

## Suggested fix location

- <file or component to modify based on error location and workflow steps>
- <additional risk or fail-fast note if relevant>

## Done condition

- <what output or command result should indicate the error is resolved>

Step 6: 修正を実施する

Step 5 のサマリをもとに、実際にコードを修正する。修正後は Done condition に記載したコマンドでローカル確認を行い、エラーが解消されたことを確認し、修正内容を commit して PR に push する。

Expand your agent's capabilities with these related and highly-rated skills.

sushichan044/dotfiles

terraform-style-guide

Generate Terraform HCL code following HashiCorp's official style conventions and best practices. Use when writing, reviewing, or generating Terraform configurations.

15 0
Explore
sushichan044/dotfiles

dd-logs

Log management - search, pipelines, archives, and cost control.

15 0
Explore
sushichan044/dotfiles

golang-safety

Defensive Golang coding to prevent panics, silent data corruption, and subtle runtime bugs. Use whenever writing or reviewing Go code that involves nil-prone types (pointers, interfaces, maps, slices, channels), numeric conversions, resource lifecycle (defer in loops), or defensive copying. Also triggers on questions about nil panics, append aliasing, map concurrent access, float comparison, or zero-value design.

15 0
Explore
sushichan044/dotfiles

resolve-merge-conflict

現在の branch を分岐元の最新に rebase するときに使う。まず rebase を実行し、止まった conflict を順番に解消して前に進める。長い事前調査を避けて、必要な file だけ見て片付けたいときに使う。

15 0
Explore
sushichan044/dotfiles

golang-data-structures

Golang data structures — slices (internals, capacity growth, preallocation, slices package), maps (internals, hash buckets, maps package), arrays, container/list/heap/ring, strings.Builder vs bytes.Buffer, generic collections, pointers (unsafe.Pointer, weak.Pointer), and copy semantics. Use when choosing or optimizing Go data structures, implementing generic containers, using container/ packages, unsafe or weak pointers, or questioning slice/map internals.

15 0
Explore
sushichan044/dotfiles

smart-compact

セッションのコンテキストを分析し、重要な情報を保持するためのプロンプトを生成して /compact コマンドの実行を支援するスキル。コンテキストウィンドウが逼迫してきた時や、セッションを整理したい時に使用。

15 0
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results