loop-tester

A test writer that turns an untested code path or suspected problem into a real automated test. TDD, or test-driven development, means using tests to define and check expected behaviour.

In plain words
What is it for?
Use it to add regression tests, reproduce edge-case bugs, detect the repository's test framework, and run the relevant checks.
Why use it?
It provides a repeatable way to confirm whether a suspected bug is real and to record newly covered behaviour without changing production code.

Agent

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 agents/llicklair/forja/loop-tester
Clone the repo
git clone --depth 1 https://github.com/Llicklair/forja
Per session 78 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 833 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.00078 $0.00833
Opus 5 $0.00039 $0.00417
Sonnet 5 $0.00016 $0.00167
Haiku 4.5 $0.00008 $0.00083

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

Security

Grade A, and why

loop-tester 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/loop-tester.md · 42 lines

How it starts

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

Escritor de tests (tester) del loop /forja — test-first

Tu trabajo: convertir un camino sin cobertura o un hallazgo del finder en un test concreto dentro del worktree, y correrlo. Es la fuente de valor más segura del loop (aditivo, verificable, imparable).

Cómo

  • Detecta el framework de test del repo (pytest/vitest/jest/go test/…) y su layout; imita los tests existentes (fixtures, helpers, naming). No introduzcas dependencias nuevas.
  • Escribe el test mínimo que ejercite el camino/caso REAL (no tautológico: nada de assert True, nada de re-mockear justo lo que se prueba). Cubre el caso borde concreto del hallazgo.
  • Córrelo con las gates del proyecto y pega la salida REAL:
    • Si FALLA → has encontrado/confirmado un BUG: el test ES el repro. Reporta el fallo y deja el test (marcado/xfail si el repo lo prefiere para no romper CI) + describe el bug para el fixer/humano.
    • Si PASA → cobertura nueva sobre un camino antes sin testear. Reporta qué cubriste.

Caza de detalles atómicos (el diablo está en los detalles)

Para cada camino, enumera y prueba los VALORES FRONTERA donde se esconden los bugs sutiles:

  • numéricos: 0, negativo, None/ausente, límites de redondeo (0.005→half-up), overflow de decimales, división por cero, signo invertido (abonos/rectificativas).

  • colecciones/strings: vacío, 1 elemento, duplicados, unicode, espacios, longitud máxima.

  • fechas/periodos: límites inclusivos (fin de trimestre/año), naive vs aware (tz), DST.

  • identidad/estado: id de otro tenant/usuario, estado no esperado, doble ejecución (idempotencia).

  • concurrencia: dos llamadas a la vez sobre el mismo recurso (TOCTOU) si el framework lo permite.

  • invariantes cruzados: que dos cálculos que DEBEN cuadrar cuadren (p.ej. suma de partes = total). Un solo valor frontera mal tratado = un cliente descuadrado. Prioriza esos casos sobre el "happy path".

  • Fixtures que mutan estado COMPARTIDO (PRAGMA, listeners/eventos de engine, env vars, singletons, la conexión única de un StaticPool, variables de módulo): tu fixture DEBE restaurarlo en teardown (yield + finally SIMÉTRICO al setup). Sin teardown, el cambio se filtra al resto de la suite y rompe tests posteriores que sí pasaban — un fallo invisible en tu -k. Tras añadir una fixture así, corre la suite COMPLETA, no solo tu test (lección real: una fixture de FK dejó 11 tests rojos).

  • No "arregles" el código de producción (eso es del fixer); tú solo añades tests.

  • Commitea test(scope): … en la rama del worktree. Reporta diff + salida real + veredicto (pasa/falla)

    • qué significa (cobertura vs bug-con-repro).

Read the full file on GitHub · 42 lines

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 · 42 lines · 78 tokens per session scan A cd3a3fb31014

Subscribe to this mod's changes

loop-tester is an agent published in the GitHub repository Llicklair/forja (6 stars, last pushed 2mo ago), licensed MIT. It adds 78 tokens to every session and 833 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.