fixing-ci

GitHub

用于诊断和修复 CI 流水线失败。通过 GitHub CLI 获取日志,本地复现并定位根因,按原子提交逐个修复,最终验证全量通过后推送。

.agents/skills/fixing-ci/SKILL.md ReviewStage/stage-cli

Trigger Scenarios

CI 构建或测试失败 需要修复分支上的持续集成问题

Install

npx skills add ReviewStage/stage-cli --skill fixing-ci -g -y
More Options

Non-standard path

npx skills add https://github.com/ReviewStage/stage-cli/tree/main/.agents/skills/fixing-ci -g -y

Use without installing

npx skills use ReviewStage/stage-cli@fixing-ci

指定 Agent (Claude Code)

npx skills add ReviewStage/stage-cli --skill fixing-ci -a claude-code -g -y

安装 repo 全部 skill

npx skills add ReviewStage/stage-cli --all -g -y

预览 repo 内 skill

npx skills add ReviewStage/stage-cli --list

SKILL.md

Frontmatter
{
    "name": "fixing-ci",
    "metadata": {
        "internal": true
    },
    "description": "Use when CI is failing on a branch and you need to diagnose failures from GitHub, fix them locally with iterative verification, and re-push clean commits."
}

Fixing CI

Overview

Diagnose failing CI from GitHub logs, fix each issue with an atomic commit, and iterate locally until the full suite is green — then push once.

Principle: One fix, one commit. Never push until all checks pass locally.

Workflow

1. DIAGNOSE      → Pull failure logs from GitHub, list all failures
2. For each failure:
   a. REPRODUCE  → Run the failing check locally to confirm you see it
   b. FIX        → Fix root cause (not downstream symptoms)
   c. VERIFY FIX → Re-run the check to confirm it passes
   d. COMMIT     → Atomic commit for this fix
3. VERIFY ALL    → Run the full suite locally
   ↳ If anything fails → go back to step 2
   ↳ All green → proceed
4. PUSH          → Push all commits

Step 1: Diagnose

# See recent CI runs on current branch
gh run list --branch $(git branch --show-current) --limit 5

# View failing run (find run-id from above)
gh run view <run-id>

# Stream logs from only the failed steps
gh run view <run-id> --log-failed

Read top-to-bottom and list all distinct failures before fixing any of them. Find the first error in each job — not symptoms that cascade from it.

Step 2: Fix Loop (repeat per failure)

a. Reproduce

Check the project's AGENTS.md for exact commands. Common mappings:

CI Job Typical Local Command
Lint pnpm lint
Typecheck pnpm typecheck
Tests pnpm test
Build pnpm build

Run the failing check and confirm you see the same error locally before touching code.

b. Fix

  • Fix the root cause — lint errors often cascade from a single type error upstream
  • Don't fix just to silence the error; understand why it's wrong
  • If the fix is unclear, read the relevant library docs or AGENTS.md before guessing

c. Verify the Fix

Re-run the specific check to confirm it passes before committing.

d. Commit

git add -p                          # Review every hunk before staging
git commit -m "fix: <what broke>"   # Specific message, not "fix CI"

Use git add -p to catch accidental debug code or unrelated changes. Then loop back to the next failure.

Step 3: Verify All Checks (gate before push)

After all individual fixes are committed, run the full suite:

# Run all checks (adapt to project — check AGENTS.md)
pnpm lint && pnpm typecheck && pnpm test && pnpm build

If anything fails here, go back to step 2. A fix in one area can break another. Do not push until this full pass is clean.

Step 4: Push

Only push once the full suite is green locally:

git push

STOP here. Do not poll GitHub to check if CI passed remotely. Local verification is sufficient — if all checks pass locally, the push is done. Only revisit if the user explicitly reports CI is still failing, then start from Step 1 with the new run ID.

Common Mistakes

  • Polling GitHub after pushing — do NOT run gh run list, gh run watch, or any GitHub polling after pushing. Local green = done.
  • Pushing before the full suite passes — the verify-all step is a hard gate, not optional
  • One giant commit — commit after each fix; atomic history is easier to bisect
  • Pushing without reproducing locally — if you can't reproduce it, you can't verify the fix
  • Fixing symptoms not root cause — a cascade of 10 lint errors is often one bad import
  • Vague commit messages — "fix CI" is useless; "fix: remove unused import breaking typecheck" is not
  • Staging with git add . — use git add -p to review and avoid committing debug code

Version History

  • bbd0b9a Current 2026-07-24 16:05

Same Skill Collection

.agents/skills/deslop-ui/SKILL.md
.agents/skills/fixing-pr-comments/SKILL.md
.agents/skills/iterate-pr/SKILL.md
.agents/skills/linear-issue/SKILL.md
.agents/skills/quality-review/SKILL.md
.agents/skills/rebase-origin-main/SKILL.md
skills/stage-chapters/SKILL.md
.agents/skills/trade-off/SKILL.md

Metadata

Files
0
Version
eabf305
Hash
43ef23f4
Indexed
2026-07-24 16:05

inicio - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-16 19:58
浙ICP备14020137号-1 $mapa de visitantes$