self-fix-loop

An automated workflow that repeatedly commits changes, pushes them, checks CI, investigates failures, and applies fixes. CI means automated checks run by services such as GitHub Actions or GitLab CI.

In plain words
What is it for?
Use it when a branch or pull request has failing GitHub or GitLab checks and needs several fix-and-retry cycles.
Why use it?
It reduces the manual work of watching failed checks, finding their causes, and sending repeated fixes until the checks pass.

Skill for Claude CodeCodex

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 skills/d-oit/rust-2026-template/self-fix-loop
Any agent
npx skills add d-oit/rust-2026-template --skill self-fix-loop
Clone the repo
git clone --depth 1 https://github.com/d-oit/rust-2026-template

Made for: Claude Code, Codex.

Per session 81 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,160 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 $0.00081 $0.01160
Opus 5 $0.00041 $0.00580
Sonnet 5 $0.00016 $0.00232
Haiku 4.5 $0.00008 $0.00116

Measured 2d ago against content hash 3ffcd360bd26, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

self-fix-loop 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 2d 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.

.agents/skills/self-fix-loop/SKILL.md · 141 lines

How it starts

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

Self-Fix Loop Skill

When to Use

  • User asks for this skill's functionality

Automated self-learning cycle: commit → push → monitor → analyze failures → fix → retry until all CI checks pass.

Self-Fix Threshold: If 2+ similar errors occur during the loop, pause and diagnose the root cause before attempting another fix.

Overview

Continuous improvement loop that:

  1. Commits all changes atomically
  2. Pushes to feature branch
  3. Creates/updates PR/MR
  4. Monitors CI (GitHub Actions or GitLab CI)
  5. On failure: diagnoses and fixes
  6. Repeats until ALL checks pass

Platform Detection

Auto-detect from git remote:

REMOTE=$(git remote get-url origin)
if echo "$REMOTE" | grep -qi "github"; then
  PLATFORM="github"; CLI="gh"
elif echo "$REMOTE" | grep -qi "gitlab"; then
  PLATFORM="gitlab"; CLI="glab"
fi

CLI Command Mapping

Action GitHub (gh) GitLab (glab)
Check CI gh pr checks glab ci status
Create PR/MR gh pr create glab mr create
View logs gh run view --log-failed glab ci view

Arguments

Argument Description Default
--max-retries N Maximum fix iterations 5
--platform github|gitlab Force platform auto-detect
--auto-research Use web research on failures true
--fix-issues Attempt automatic fixes true
--strict-validation ALL checks must pass true
--timeout SECONDS Per-iteration timeout 1800
--dry-run Simulate without pushing false

Loop Phases

[Start]
   ↓
Phase 1: COMMIT & PUSH
   - Stage all changes
   - Run quality gate
   - Atomic commit
   - Push to feature branch
   ↓
Phase 2: CREATE/UPDATE PR/MR
   - Create new PR/MR or update existing
   ↓
Phase 3: MONITOR CI
   - Poll GitHub Actions / GitLab CI
   - Wait for all checks complete
   ↓
Phase 4: ANALYZE FAILURES
   - Identify failed checks
   - Extract error messages
   - Categorize failure type
   ↓
Phase 5: FIX (if failures)
   - Diagnose root cause
   - Apply fixes
   - Commit fix
   ↓
Phase 6: RETRY LOOP
   - If retries remaining → Phase 1
   - If max retries → FAIL
   - If all pass → SUCCESS

Read the full file on GitHub · 141 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 2d ago First seen · 141 lines · 81 tokens per session scan A 3ffcd360bd26

Subscribe to this mod's changes

self-fix-loop is a skill published in the GitHub repository d-oit/rust-2026-template (10 stars, last pushed 3d ago), licensed MIT. It adds 81 tokens to every session and 1,160 once invoked, about $0.0004 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 skills, from other repositories

jamjet-durability-patterns

Production durability patterns for AI agents on the JVM — crash recovery, audit trails, human-in-the-loop, and replay testing using JamJet runtime.

jamjet-labs/jamjet · 36 tokens

review-backend

Performs a strict code review of Rust backend code (files, diffs, or snippets). Trigger whenever the user shares backend code (Rust, SQL) and asks for a review, feedback, or says "review this" — including partial snippets.

AndreiBozantan/svelte-axum-template · 54 tokens

yada-yada-yada

Enter Seinfeld Mode. Explain programming, debugging, architecture, and code reviews through observational comedy inspired by Seinfeld. Trigger when the user says "what's the deal", festivus, serenity, yada, soup, shrinkage, sponge-worthy, master of my domain, double dip, newman, vandelay, nostrand, constanza or…

AndreiBozantan/svelte-axum-template · 81 tokens

fix-issue

Fixes a bug, implements a missing feature, or implements one slice of a larger feature, starting from a GitHub issue link, number, or direct text description. Trigger when the user gives a GitHub issue URL/reference/description and asks to fix, implement, resolve, or work on it.

AndreiBozantan/svelte-axum-template · 65 tokens

review-frontend

Performs a strict code review of the Svelte 5 frontend code (files, diffs, or snippets). Trigger whenever the user shares frontend code (Svelte, TypeScript, CSS) and asks for a review, feedback, or says "review this" — including partial snippets.

AndreiBozantan/svelte-axum-template · 62 tokens

make-it-so

Enter Star Trek command mode. Use Star Trek terminology naturally while remaining a highly competent engineering officer. Trigger when the user mentions Star Trek, Picard, make it so, engage, stardate, number one, federation, borg, warp, enterprise.

AndreiBozantan/svelte-axum-template · 55 tokens