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.
git clone --depth 1 https://github.com/d-oit/rust-2026-templatenpx agentmods add skills/d-oit/rust-2026-template/self-fix-loopWrote 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.
[](https://agentmods.dev/skills/d-oit/rust-2026-template/self-fix-loop)<a href="https://agentmods.dev/skills/d-oit/rust-2026-template/self-fix-loop"><img src="https://agentmods.dev/badge/skills/d-oit/rust-2026-template/self-fix-loop/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.
<a href="https://agentmods.dev/skills/d-oit/rust-2026-template/self-fix-loop"><img src="https://agentmods.dev/badge/skills/d-oit/rust-2026-template/self-fix-loop.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector warn
SkillSpector: 2 findings, up to high
These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →
- high Tool Misuse · line 124 Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).Fix: Validate all tool parameters against an allowlist. Reject dangerous parameter values (shell=True, --force, -rf /) and use safe defaults.
- high Tool Misuse · line 140 Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).Fix: Validate all tool parameters against an allowlist. Reject dangerous parameter values (shell=True, --force, -rf /) and use safe defaults.
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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00083 | $0.01381 |
| Opus 5.5 | $0.00033 | $0.00552 |
| Sonnet 5.5 | $0.00017 | $0.00276 |
| Haiku 4.5 | $0.00008 | $0.00138 |
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 19d 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.
How it starts
The opening of the file, as written. The whole thing — 145 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Self-Fix Loop Skill
When to Use
Automated self-learning cycle: commit → push → monitor → analyze failures → fix → retry until all CI checks pass.
Self-Fix Threshold: If 2+ identical or near-identical failures occur, stop fixing and diagnose the root cause. Transient flaps are not a license to loop.
Before the first fix: capture the baseline. Record the failing check names, the head commit of the branch, and whether the failures also exist on main at the merge base. Without this you cannot tell "my fix worked" from "the flake moved".
Overview
Continuous improvement loop that:
- Commits all changes atomically
- Pushes to feature branch
- Creates/updates PR/MR
- Monitors CI (GitHub Actions or GitLab CI)
- On failure: diagnoses and fixes
- 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 changes (pick the files for this fix; never blanket-stage)
- Run quality gate: bash scripts/quality-gates.sh --only <failed-area>
(it is `cargo xtask quality run` under the hood; full gate = no --only)
- Atomic commit (Conventional Commits format — commitlint enforces it)
- 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
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.
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.
- 19d ago Changed · +3 lines · +2 tokens per session 5b5109fcef25
- 2mo ago Changed · -1 lines 436194302537
- 2mo ago Changed · +2 lines c21fc0376a5d
- 3mo ago First seen · 141 lines · 81 tokens per session scan A 3ffcd360bd26
self-fix-loop is a skill published in the GitHub repository d-oit/rust-2026-template (15 stars, last pushed 3d ago), licensed MIT. It adds 83 tokens to every session and 1,381 once invoked, about $0.0003 per session on Opus 5.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.
self-fix-loop compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| self-fix-loopd-oit/rust-2026-template | Skill | 15 | 3d ago | MIT | A | 83 | Claude Code, Codex |
| publish-rustOpen-Agent-Tools/General-OAT-Skills | Skill | 3 | 2mo ago | Apache-2.0 | A | 33 | Claude Code |
| obsidian-mobile-synckevinnft/ai-agent-skills | Skill | 15 | 4mo ago | MIT | B | 45 | Claude Code, Codex |
| fix-issueAndreiBozantan/svelte-axum-template | Skill | 2 | 2mo ago | MIT | A | 65 | Claude Code, Codex |
| update-v8-versionopeninterpreter/openinterpreter | Skill | 69k | yesterday | Apache-2.0 | A | 86 | Codex |
| worktreeget-bb/bb | Skill | 6.3k | today | MIT | A | 33 | Claude Code, Codex |
| dwsPinvou/pinvou-agent | Skill | 3.0k | yesterday | MIT | A | 193 | Claude Code, Codex |