ReferencesAnti-Patterns

Anti-Patterns

The triage agent runs this checklist against every emitted plan.yml before dispatch. A matching anti-pattern either triggers an automatic fix or surfaces a question to the user.

The 10 anti-patterns

1. Same agent implements and verifies

worker-dev writes code. verifier audits it. These must always be separate sub-agents with separate system prompts and model assignments.

Flag: any phase where the same agent_id both writes artifacts and runs verification.


2. No attempt cap

Retry budgets must always be bounded. loop-self-healing enforces max_retries_per_file: 3 by default. Values can be reduced but never set to unlimited.

Flag: any phase missing a max_retries_per_* cap.


3. Vague triage output

Every worker in a plan must have a narrow, explicit scope, a save path, and a rationale. Generic filler phrases are forbidden.

Flag: plan contains "handle appropriately", "as needed", "if relevant", or "reasonable defaults".


4. L3 before L1 quality

The readiness level must match the project’s run history. L3 (unattended) is only appropriate for ticket archetypes the plugin has successfully completed before.

Flag: no state.md history for this ticket type, but the plan requests L3. Downshift to L1 and surface the reason.


5. Shared state without schema

Two phases must never write to the same artifact path without a schema agreement. Each phase owns a distinct output file.

Flag: duplicate artifact paths across phases in the same plan.


6. MCP with write-everything scope

Each worker’s tools list must be the minimum scope needed for that worker’s task. Wildcard grants (* or “all tools”) are forbidden.

Flag: any worker declaring a wildcard tool grant, or requesting new MCP permissions mid-run without surfacing them before planning.


7. No kill switch

Any plan with readiness_level >= L2 or estimated_cost_usd > $1.00 must include an explicit budget cap and approval gate. The orchestrator must also honor SIGINT cleanly for lower-cost plans.

Flag: budget cap or gate threshold missing from the plan.


8. Fixing flakes with code

A test that fails 1 of 3 reruns is a flake, not a bug. loop-self-healing must classify failures before retrying. Persistent inconsistent failures are quarantined and escalated — not patched.

Flag: retry policy lacks flake classification logic.


9. Auto-merge without allowlist

The plugin produces a branch and a PR description. It never runs git push --force, gh pr merge, or any merge-equivalent command. Tool grants for all sub-agents must exclude merge-on-main capabilities.

Flag: any sub-agent tool grant includes gh pr merge, git push origin main, or equivalent.


10. No run log

Every run must append an entry to .loop/run-log.md. Triage reads it at the start of every run; the spec-writer appends to it at the end.

Flag: plan’s final phase does not include a loop-state-append step.


How triage handles matches

Anti-patternResolution
Auto-fixable (e.g. missing retry cap)Fix in place and continue
Requires judgment (e.g. L3 without history)Surface via AskUserQuestion
Still fails after 1 retryEmit plan with explicit warnings; runtime decides