factory-ci-doctor

factory-ci-doctor is an agent for Claude Code from watt-mind/factory. It costs 108 tokens per session (1,107 once invoked), scanned A, original, Apache-2.0.

An agent that diagnoses one failed GitHub Actions run, where GitHub Actions is the service that builds and tests code automatically. It identifies the failing job or step and returns focused evidence for deciding what to do next.

In plain words
What is it for?
Use it after a run has failed, providing the repository and run ID or pull request number, to classify the failure and recommend fixing, stopping dispatches, or rerunning.
Why use it?
It keeps large CI logs out of the main conversation and distinguishes code failures from situations where dispatching should stop or a run should simply be retried.

Agent for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: model in frontmatter; names the NotebookEdit tool.

Part of the core plugin — 2 skills, 13 commands, 4 agents shipped together

Good fit Use it after a run has failed, providing the repository and run ID or pull request number, to classify the failure and recommend fixing, stopping dispatches, or rerunning.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/watt-mind/factory/factory-ci-doctor
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.

Clone the repo
git clone --depth 1 https://github.com/watt-mind/factory

Made for: Claude Code.

Or install core, the plugin that ships this one along with the rest of its 2 skills, 13 commands, 4 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 factory-ci-doctor

README.md
[![agentmods](https://agentmods.dev/badge/agents/watt-mind/factory/factory-ci-doctor.svg)](https://agentmods.dev/agents/watt-mind/factory/factory-ci-doctor)
Your own site
<a href="https://agentmods.dev/agents/watt-mind/factory/factory-ci-doctor"><img src="https://agentmods.dev/badge/agents/watt-mind/factory/factory-ci-doctor.svg" alt="Measured on agentmods" height="20"></a>
Per session 108 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,107 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.00108 $0.01107
Opus 5 $0.00054 $0.00553
Sonnet 5 $0.00022 $0.00221
Haiku 4.5 $0.00011 $0.00111

Measured 8d ago against content hash 62c6c8ed0d2a, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

factory-ci-doctor 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 8d 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.

plugins/core/agents/factory-ci-doctor.md · 45 lines

How it starts

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

You are a CI doctor. You diagnose exactly one failed GitHub Actions run and return a classification with minimal evidence. The caller is deciding one of three things — fix the code, stop dispatching (circuit breaker), or re-run — and your report must make that decision possible without them ever opening the logs.

Inputs you should expect in your prompt

  • The repo (path or owner/name) and a run ID or PR number.
  • Optionally: the ticket ID and what changed (the diff or its summary), and how many recent runs have failed — context that sharpens the classification.

Given a PR number, find its latest failed run yourself (gh pr checks, gh run list --branch <branch>). Never wait on a run that is still in progress — report that it is still running and stop; waiting is the caller's job.

How to diagnose

Work from the outside in, reading as little log as possible:

  1. gh run view <id> — which jobs failed, how long they ran, whether they started at all. A job that died in seconds fails differently from one that timed out at the cap.
  2. gh run view <id> --log-failed — but grep it, don't read it: pipe through grep -n -iE 'error|fail|✗|✖|FATAL|ENO|exit code' | head first, then read a window around the first real failure. The first error is usually the cause; everything after is often cascade.
  3. Compare against history when flake is plausible: gh run list --workflow <wf> --limit 10 — did this same workflow pass recently on the same or near-identical code? Did a re-run of this very run already pass once?

Classify

  • TICKET — the change under test broke it: compile error in changed files, a test asserting the old behavior, lint/typecheck on new code. The diff explains the failure.
  • ENV — the failure would have happened to any diff: runner setup, action version, cache corruption, missing/expired secrets, quota or rate limits, disk space, registry outages, base branch already red. This is the classification the dispatch circuit breaker consumes — be precise about it, because two consecutive ENV verdicts stop the whole queue on purpose.
  • FLAKE — intermittent, and you have evidence: the same code passed this workflow before or on re-run, the failure is a known-flaky shape (timeout in a network test, port already in use, race in a UI test) unrelated to the diff. No evidence → it is not FLAKE; pick TICKET or ENV and say the flake suspicion out loud instead.

Read the full file on GitHub · 45 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. 8d ago First seen · 45 lines · 108 tokens per session scan A 62c6c8ed0d2a

Subscribe to this mod's changes

factory-ci-doctor is an agent published in the GitHub repository watt-mind/factory (14 stars, last pushed 2d ago), licensed Apache-2.0. It adds 108 tokens to every session and 1,107 once invoked, about $0.0005 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.

Related

Other agents, from other repositories

ci-fixer

Staged CI failure hunter and fixer for opencode-swarm. Triages GitHub Actions failures layer-by-layer (quality → unit → integration/dist/security/php → smoke), diagnoses root causes, applies minimal targeted fixes, verifies each fix does not mask downstream failures, and never guesses — only acts on evidence from…

ZaxbyHub/opencode-swarm · 72 tokens

performance-engineer

Panel judge for runtime performance, auditing memory (allocation, leaks, footprint, retention) and speed (throughput, hot-path cost, algorithmic complexity, over-fetching) under realistic load.

gbotev1/cc-autopilot · 43 tokens

observability-steward

Panel judge for production operability. Audits structured logging, error reporting, metrics and tracing, health checks, and graceful degradation under failure.

gbotev1/cc-autopilot · 34 tokens

issue-tracer2

Takes any GitHub Issue, traces root cause through the codebase, and drives it to full resolution (fix + tests + PR).

ZaxbyHub/opencode-swarm · 33 tokens

ap-depth-prober

L4 terminal leaf - G3.5 DEPTH-LOCK. Independently derives the bug's deepest-cause function from the ISSUE TEXT alone, blind to the proposed fix layer; default-FAIL. Emits D1-D5. depth-miss REJECTs to G1.

Spielewoy/autoprompt-skill · 62 tokens

issue-tracer

Use proactively when the user asks to trace, investigate, root-cause, plan, close, or prepare a PR for a GitHub issue or bug report. Produces an evidence-backed root cause and critic-reviewed fix plan before implementation.

ZaxbyHub/opencode-swarm · 51 tokens