guide: Command for Claude Code

.github/workflows/generate-ai-rules/commands/fix-ci.md

fix-ci is a command for Claude Code from rios0rios0/guide. It costs 0 tokens per session (1,792 once invoked), scanned A, original, MIT.

A command that finds the current GitHub pull request, reads its failed CI logs, fixes the underlying problems, and pushes one commit. CI is the automated system that builds and tests code for a pull request.

In plain words
What is it for?
Use it when a pull request's automated checks fail and you want the command to inspect logs, implement fixes, verify them, commit, and push.
Why use it?
It brings the failure investigation and repair into one workflow instead of requiring manual log hunting and branch checks.

Command for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

This is rios0rios0/guide's own configuration. It tells Claude Code how to work on guide itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything guide configures →

Part of the engineering-standards plugin — 5 skills, 8 commands, 7 agents shipped together

Reuse

Borrowing it

Nothing to install: this file belongs to rios0rios0/guide. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/rios0rios0/guide/main/.github/workflows/generate-ai-rules/commands/fix-ci.md
Clone the repo
git clone --depth 1 https://github.com/rios0rios0/guide

Made for: Claude Code.

Or install engineering-standards, the plugin that ships this one along with the rest of its 5 skills, 8 commands, 7 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for fix-ci

README.md
[![agentmods](https://agentmods.dev/badge/commands/rios0rios0/guide/fix-ci/github.svg)](https://agentmods.dev/commands/rios0rios0/guide/fix-ci)
Your own site
<a href="https://agentmods.dev/commands/rios0rios0/guide/fix-ci"><img src="https://agentmods.dev/badge/commands/rios0rios0/guide/fix-ci/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for fix-ci

Your own site · 80×15
<a href="https://agentmods.dev/commands/rios0rios0/guide/fix-ci"><img src="https://agentmods.dev/badge/commands/rios0rios0/guide/fix-ci.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,792 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.01792
Opus 5.5 $0.00000 $0.00717
Sonnet 5.5 $0.00000 $0.00358
Haiku 4.5 $0.00000 $0.00179

Measured today against content hash 48a8deb216b9, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

fix-ci scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured today.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.github/workflows/generate-ai-rules/commands/fix-ci.md · 163 lines

How it starts

The opening of the file, as written. The whole thing — 163 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Detect the current branch's pull request, retrieve its failing CI workflow logs, fix the root causes, commit, and push. This command auto-detects the PR from the current Git branch, fetches check run statuses, downloads failure logs, classifies each failure, implements fixes, and pushes a single commit.

For commit conventions, refer to the Git Flow rule. For lint verification, refer to the CI/CD rule.

Pre-flight

Step 1 -- Verify GitHub CLI authentication

gh auth status

If this fails, report the error and stop. The gh CLI must be installed and authenticated.

Step 2 -- Detect repository context

gh repo view --json nameWithOwner -q '.nameWithOwner'

Split the result into {owner} and {repo}.

Step 3 -- Auto-detect PR from current branch

gh pr view --json number,headRefName -q '.number'

This returns the PR number associated with the current branch. If it fails (no PR exists for the current branch), report: "No pull request found for the current branch. Switch to a branch with an open PR or create one first." and stop.

Store the returned number as {PR_NUMBER}. Then ensure the local branch is up to date:

git pull --rebase

Procedure

Step 4 -- Fetch check run statuses

List all check runs for the PR and identify failures:

gh pr checks {PR_NUMBER}

Filter to checks with fail status. If no failing checks exist, report "All CI checks are passing on PR #{PR_NUMBER}." and stop.

Step 5 -- Retrieve failure logs

For each failing check, retrieve the workflow run ID and job ID from the check URL, then download the failed job logs:

gh run view {RUN_ID} --job {JOB_ID} --log-failed

If the log output is very large, use tail -100 to focus on the error section. Extract:

  • The specific error messages and file/line references
  • The tool or stage that failed (e.g., golangci-lint, make test, basic-checks)
  • Whether the failure is in code you can fix or an infrastructure/flaky issue

Read the full file on GitHub · 163 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. today Changed · +2 lines 48a8deb216b9
  2. 1mo ago First seen · 161 lines · 0 tokens per session scan A 8bbe03ff74fe

Subscribe to this mod's changes

fix-ci is a command published in the GitHub repository rios0rios0/guide (4 stars, last pushed yesterday), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,792 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.