Production Error Sweep Loop

Triages production errors, finds the root cause, ships a verified fix, and repeats until the error budget is clean.

WorkflowengineeringMIT1 source files

Before you use this component

This is a third-party source bundle, not an installation into your account. UI Discovery has checked the available redistribution license evidence; runtime behavior has not been tested. Review all files, use a disposable project first, and do not enable scripts or hooks until you understand their permissions.

Some integrations require separately installed software, API keys or paid services. Credentials and subscriptions are not included. These are Claude Code resources; other clients may require adaptation.

Extract the ZIP into a temporary folder, inspect its entry file and supporting resources, then follow the original instructions. Do not overwrite an existing project configuration blindly. Keep the bundled license and attribution notices.

Source publisher
Claude Code Templates
Creator supplied by source
Not listed in source
Pinned source version
a344359459263d73d8948651c789244093c02e4e
License evidence
LICENSE

Source preview

cli-tool/components/loops/engineering/production-error-sweep-loop.md

---
name: production-error-sweep-loop
description: Triages production errors, finds the root cause, ships a verified fix, and repeats until the error budget is clean.
category: engineering
interval: 15m
stop-condition: No unresolved high-severity production errors remain and each fix is verified in tests.
components: [agent:expert-advisors/debug, agent:security/incident-responder, command:git-workflow/create-pr]
tags: [debugging, incidents, reliability, loop]
---

# Production Error Sweep Loop

> **Loop Engineering** — keep an autonomous responder working the error queue, one root cause at a time, until production is quiet.

## 🎯 Goal
Continuously pull the top production error, find its **root cause** (not just the symptom), ship a tested fix, and verify the error stops recurring.

## ⏱️ Schedule
Suggested interval: `15m` (or trigger on new error alerts).

## ▶️ Run it
```
/loop 15m "Take the highest-impact unresolved production error. Reproduce it, find the root cause, write a regression test, fix it, and open a PR. Continue until no high-severity errors remain."
```

## 🔁 Iteration steps
1. **Perceive** — read the top error by impact (frequency × severity).
2. **Reason** — reproduce and trace to the true root cause with the `debug` agent.
3. **Plan** — design a minimal fix plus a regression test that fails first.
4. **Act** — implement the fix; the `incident-responder` agent documents impact and mitigation.
5. **Observe** — confirm the regression test passes, then open a PR with `/create-pr`.

## 🛑 Stopping condition
The high-severity error queue is empty and every fix is covered by a passing regression test.

## 🧩 Referenced components
- `agent:expert-advisors/debug` — root-cause analysis.
- `agent:security/incident-responder` — impact assessment and mitigation notes.
- `command:git-workflow/create-pr` — ships each fix for review.

## 💡 Example
A recurring null-pointer crash is traced to an unvalidated webhook payload; the loop adds a failing regression test, fixes the validation, verifies, and opens `fix: validate webhook payload before parse`.

Preview capped at 60,000 characters. Download the bundle for every original file and notice.

Read the redistribution license
MIT License

Copyright (c) 2025 Daniel (San) Ávila

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Bundle SHA-256: e51ded58da15aa6f490960902cc6245c61cb16358de65660f4d75182e5bc1074. Files are served as downloads and are never executed by this page.