# Pr CI

> Fix failing CI/GitHub Actions checks. Triggers: 'fix CI', 'fix GHA', 'build failing', 'tests failing in CI', 'checks red'.

- Skill: `luan/pr-ci` (Agent Skill)
- Install (CLI): `npx skillmds@latest add luan/pr-ci`
- Raw SKILL.md: https://api.skillmd.com/api/skills/luan/pr-ci/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: luan (https://skillmd.com/u/luan)
- Updated: 2026-09-10
- Page: https://skillmd.com/skills/luan/pr-ci

---


# PR GHA Fixer

Fix failed GitHub Actions checks.

**Safety: never rebases. Push requires confirmation (unless `--auto`).**

## Steps

1. **Detect PR**: `gh pr view --json number -q '.number'` or ask user
2. **Verify branch** (if PR specified manually)

3. **Fetch failed checks**:

   ```bash
   gh pr checks <PR> --json name,state,bucket,link
   ```

   `--auto` → fix all failed checks. Without `--auto` → display as numbered list, ask "Which to fix?"

4. **Fetch logs**:

   ```bash
   gh run list --branch <BRANCH> --json databaseId,name,conclusion --limit 20
   gh run view <RUN_ID> --log-failed
   ```

5. **Plan fixes**: Identify root cause, create concise plan. `--auto` → proceed. Without `--auto` → ask "Ready to execute?"

6. **Execute**: Apply fixes, summarize changes.

7. **Commit**: Use `Skill(commit)` to generate message and commit. `--auto` → commit directly. Without `--auto` → ask first.

8. **Push** (optional): `--auto` → push automatically. Without `--auto` → ask first. Detect stack tool: `gh stack view --json 2>/dev/null` succeeds → `Skill(gh-stack:submit)`. Otherwise `gt log --stack 2>/dev/null` succeeds → `Skill(gt:submit)`. Otherwise `git push`.

## Common Failures & Remediation

- **Build** — missing imports, type errors, syntax → read error output, fix source directly
- **Test** — outdated assertions, missing fixtures → update expectations or add missing test data
- **Lint** — formatting, unused imports/vars → run the project formatter, remove dead code
- **Infra** — secrets, rate limits, runner issues → can't fix locally; inform user to check repo/org settings

