fix-ci-issue

fix-ci-issue is a command for Claude Code from alifanov/darkflow. It costs 29 tokens per session (1,335 once invoked), scanned A, original, MIT.

A command that takes one approved continuous-integration failure task, fixes the failing lint or test, and pushes the change. Continuous integration, or CI, automatically checks code after changes.

In plain words
What is it for?
Use it to select the oldest open CI task, repair its failing check, retry bounded fixes, or hand the task to a person after repeated failure.
Why use it?
It limits retries to three attempts and leaves task closure to the workflow that confirms CI is green, preventing endless repair loops.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/alifanov/darkflow/fix-ci-issue
Clone the repo
git clone --depth 1 https://github.com/alifanov/darkflow

Made for: Claude Code.

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-issue

README.md
[![agentmods](https://agentmods.dev/badge/commands/alifanov/darkflow/fix-ci-issue.svg)](https://agentmods.dev/commands/alifanov/darkflow/fix-ci-issue)
Your own site
<a href="https://agentmods.dev/commands/alifanov/darkflow/fix-ci-issue"><img src="https://agentmods.dev/badge/commands/alifanov/darkflow/fix-ci-issue.svg" alt="Measured on agentmods" height="20"></a>
Per session 29 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,335 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00029 $0.01335
Opus 5 $0.00015 $0.00668
Sonnet 5 $0.00006 $0.00267
Haiku 4.5 $0.00003 $0.00134

Measured 5d ago against content hash 57e8d5a359cd, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

fix-ci-issue 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 5d ago.

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.

templates/.claude/commands/darkflow/fix-ci-issue.md · 79 lines

How it starts

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

Pick up one CI-failure task (source:ci), fix the failing lint/test, and push — with bounded retries. The same task is retried up to 3 times; only after the third failed attempt is it handed to a human. This prevents an endless red-CI → task → fix → red-CI loop.

The task itself is not closed here — the darkflow-ci-gate workflow closes it automatically once CI goes green again (close-on-green, via the Dark Flow task store). That is what makes the retry counter reliable: one open task per failing branch, attempts accumulate on it as comments.

Step 1 — Read project config

Load the project config (contract in .darkflow.d/claude.mdProject config). Uses: branch, mergeStrategy, language.

Step 2 — Pick the next CI task

Pick exactly one open task with source:ci and status:approved (a task already parked for a human carries status:needs-human, so it is out of this list by construction). Take the oldest (smallest number) — one open task per failing branch, FIFO:

n=$(~/.darkflow/df task list --source ci --status approved --state open | jq -r '
      [ .[].number ] | min // empty')

If $n is empty, stop — nothing to do this run.

Step 3 — Count prior attempts (the retry gate)

Each attempt this command makes leaves a marker comment containing <!-- darkflow:ci-attempt -->. Count them from the task's comments (df task view returns the full comment array, or null when there are none):

attempts=$(~/.darkflow/df task view "$n" | jq '
  [ (.comments // [])[] | select(.body | contains("<!-- darkflow:ci-attempt -->")) ] | length')
  • MAX_ATTEMPTS = 3.
  • If attempts >= 3escalate to a human and STOP (see Step 6). Do not attempt another fix.
  • Otherwise this run is attempt attempts + 1 of 3 — continue to Step 4.

Step 4 — Reproduce and fix

Read the task with ~/.darkflow/df task view "$n" — the body lists the failing checks (e.g. lint, test) and the captured error output, plus the CI run link and commit SHA.

Read the full file on GitHub · 79 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. 5d ago First seen · 79 lines · 29 tokens per session scan A 57e8d5a359cd

Subscribe to this mod's changes

fix-ci-issue is a command published in the GitHub repository alifanov/darkflow (2 stars, last pushed 6d ago), licensed MIT. It adds 29 tokens to every session and 1,335 once invoked, about $0.0001 per session on Opus 5. 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.