ci-diagnose

ci-diagnose is a command for Claude Code from atretyak1985/swarmery. It costs 25 tokens per session (1,567 once invoked), scanned A, original, Apache-2.0.

A diagnostic tool for failed GitLab CI pipelines, which are automated checks and deployments run by GitLab. It collects failed job logs, identifies likely causes, and suggests recovery commands.

In plain words
What is it for?
Use it to investigate a failed pipeline, inspect job traces, identify likely root causes, and choose commands to recover the build or deployment.
Why use it?
It reduces the time spent manually reading long build and deployment logs. It helps connect common error messages with the configuration or command that caused them.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is Recovery: bash scripts/check-chart-sync.sh in the chart repo.

Part of the infra-pack plugin — 11 skills, 1 command, 3 agents shipped together

Good fit Use it to investigate a failed pipeline, inspect job traces, identify likely root causes, and choose commands to recover the build or deployment.

Compare 6 commands from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/atretyak1985/swarmery
agentmods
npx agentmods add commands/atretyak1985/swarmery/ci-diagnose

Made for: Claude Code.

Or install infra-pack, the plugin that ships this one along with the rest of its 11 skills, 1 command, 3 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 ci-diagnose

README.md
[![agentmods](https://agentmods.dev/badge/commands/atretyak1985/swarmery/ci-diagnose/github.svg)](https://agentmods.dev/commands/atretyak1985/swarmery/ci-diagnose)
Your own site
<a href="https://agentmods.dev/commands/atretyak1985/swarmery/ci-diagnose"><img src="https://agentmods.dev/badge/commands/atretyak1985/swarmery/ci-diagnose/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 ci-diagnose

Your own site · 80×15
<a href="https://agentmods.dev/commands/atretyak1985/swarmery/ci-diagnose"><img src="https://agentmods.dev/badge/commands/atretyak1985/swarmery/ci-diagnose.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 25 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,567 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.00025 $0.01567
Opus 5 $0.00013 $0.00783
Sonnet 5 $0.00005 $0.00313
Haiku 4.5 $0.00003 $0.00157

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

Security

Grade A, and why

ci-diagnose 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 6d 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/infra-pack/commands/ci-diagnose.md · 149 lines

How it starts

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

/ci-diagnose — GitLab pipeline failure forensics

Given a failed pipeline ID (or auto-detect the most recent failed pipeline on main), produce a diagnostic report: which jobs failed, the full trace of each, pattern-matched root-cause hypothesis, and specific recovery commands.

Usage

/ci-diagnose                  # auto-find most recent failed pipeline on main
/ci-diagnose <pipeline-id>    # inspect a specific pipeline
/ci-diagnose -R <repo>        # non-default repo

What it does

  1. Pipeline overviewglab ci get to map job states.
  2. Failed-job tracesglab ci trace <job> for each job with state failed. Tail of each (last ~100 lines is usually enough).
  3. Pattern match against known failure modes (if the project keeps a curated failure-modes taxonomy in its docs, consult it first):
Pattern in log Root-cause hypothesis Recovery
[ERROR] Required secret '<app>-*' not found in namespace '<namespace>' Missing bootstrap secret Run the project's bootstrap-secrets script/command
Save error occurred: can't get a valid version for dependency Chart.yaml / Chart.lock drift bash scripts/check-chart-sync.sh in the chart repo; helm dependency update .
ERROR: remote payload exited 1 without other context Remote deploy wrapper swallowed stderr — look at stdout in the remote-output capture SSH to the VM and re-run the failing script manually; check the preceding [ERROR] lines
helm rollback failure or --atomic rollback triggered Pod readiness probe failing; likely env-var missing or config broken Check deployment env block; check pod logs
FAILED_PRECONDITION: Secret Version is in DESTROYED state GCP Secret Manager destroyed-version Repopulate the secret version via the project's bootstrap-secrets flow
Too many authentication failures SSH agent crowded with keys Ensure IdentitiesOnly=yes -o IdentityAgent=none in the SSH call (the project's SSH wrapper should set this)
yaml Errors: non-empty in pipeline metadata CI YAML parse error Open .gitlab-ci.yml / ci/includes/*.yml; glab ci lint locally
IMAGE_DIGEST missing or malformed publish-metadata artefact didn't propagate Retry build+publish; check build.env artefact
[ERROR] Drift check from rollback Cluster-vs-versions drift (live digest ≠ version-pinning repo) Run helm rollback <release> -n <namespace> on the VM first, then retry the staging rollback job

Read the full file on GitHub · 149 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. 6d ago First seen · 149 lines · 25 tokens per session scan A d60a9db8d31e

Subscribe to this mod's changes

ci-diagnose is a command published in the GitHub repository atretyak1985/swarmery (5 stars, last pushed today), licensed Apache-2.0. It adds 25 tokens to every session and 1,567 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-09-03.