Producer loop

From fritzprix/libr-agent · View interactive version

Producer loop is an AI agent skill from the GitHub repository fritzprix/libr-agent. Periodic issue producer for LibrAgent. Runs scheduled read-only checks (security, e2e, uiux, regression, usage-logs, doc-drift, cleanup, e2e-plan) and files GitHub issues for the problems it finds, with fingerprint dedup and a per-run cap. Producers never change code. A gatekeeper validates each iss

How to use this skill

Skill file

Producer Loop

worker-loop and gatekeeper-loop consume issues and PRs. This loop produces issues. It finds problems, files them, and stops. It never fixes them.

Pipeline: producer-loop files an issue (auto:producer) -> gatekeeper-loop validates it against the code (validated or rejected) -> a human adds approved -> worker-loop takes it.

Commands

Same grammar as worker-loop. Arming and disarming use the adapters in ../worker-loop/references/scheduling.md; use the prompt shown below instead of /worker-loop, and record the scheduler under scheduler in this loop's state.json.

| Command | Behavior |

| --- | --- |

| /producer-loop | Run one tick: the task that is most overdue. Print NOOP if no task is due. |

| /producer-loop 1h | Arm a recurring tick (prompt /producer-loop), then run one tick now. |

| /producer-loop security | Run that task now, due or not. |

| /producer-loop security 6h | Arm that task (prompt /producer-loop security), then run it now. |

| /producer-loop status | Run producer_gate.py --status. Do no work. |

| /producer-loop stop | Disarm the recurring loop. |

Tasks: security, e2e, uiux, regression, usage-logs, doc-drift, cleanup, e2e-plan. See references/tasks.md.

State

<repo>.worktrees/.producer-loop/state.json, next to the shared .worker-loop state root (resolved like worker_state.py: git rev-parse --git-common-dir, or the parent of $LOOP_STATE_DIR).

{
  "scheduler": { "kind": "scheduled_task", "id": "task-123" },
  "lastRun": { "security": 1761900000 },
  "periods": { "e2e": 43200, "e2e-plan": 43200 },
  "maxNewIssues": { "security": 5 },
  "fingerprints": { "3fa9c1d2e4b50a77": 2430 },
  "e2ePlanCursor": "2026-11-04T07:13:48Z"
}

Tick procedure

  1. Gate and lock: python3 .agents/skills/producer-loop/scripts/producer_gate.py --lock (or --task <task> --lock). When .agents/skills differs from origin/<dev base>, the gate fast-forwards the checkout if it is on the dev base, clean, and fast-forwardable. Exit 5 means it could not (dirty, other branch, or diverged); stop and report the printed cause.
  1. Run the task as written in references/tasks.md. Collect findings as a JSON list of {key, title, body}. key is a stable id of the problem (for example path:rule), never prose. Write bodies from references/issue-template.md.
  2. Dry run first, then create:

```bash

python3 .agents/skills/producer-loop/scripts/file_issue.py --task <task> --findings <file>

python3 .agents/skills/producer-loop/scripts/file_issue.py --task <task> --findings <file> --create

```

Run the dry run and read its output. Use --create only after it shows the expected results. Put the findings file in a scratch directory outside the repository.

  1. Release: python3 .agents/skills/producer-loop/scripts/producer_gate.py --done <task> --unlock. On error or a stopped tick, run --unlock only.
  2. Report in one or two sentences: the task, the issues created (links), and the number skipped.

Tests

cd .agents/skills/producer-loop/scripts && python3 -m unittest discover

Hard rules

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.