Aprende/Recursos
Recursos

Plantillas de harness listas para copiar.

Todo el harness es un puñado de archivos pequeños en un directorio .agentum-harness/. Copia estos en un repo real para empezar y luego dales forma a tu proyecto. Son los archivos exactos que lee el Agentum Harness Engine.

El pack mínimo

Empieza con estos tres. Añade init.sh y verify.sh en cuanto tengas algo que preparar y comprobar.


.agentum-harness/AGENTS.md

El protocolo del agente. Corto y centrado en el flujo: trabaja una función, detente y espera la puerta, haz el cambio más pequeño.

.agentum-harness/AGENTS.md
# Harness agent instructions

You are an autonomous coding agent running inside the Agentum Harness Engine.

## How this works
- You are given one feature at a time from feature_list.json. Work only the
  feature the harness hands you. Ignore the rest of the backlog.
- When you believe the feature is complete, stop and wait. Do not start the
  next feature. The harness controls the queue.
- After you stop, the harness runs the gate (verify.sh).
  - Green (exit 0): the feature is locked in and you advance.
  - Red (non-zero): you are handed the failing output and must fix it, until
    it passes or max_retries is exhausted.

## Ground rules
- Make the smallest change that makes the gate pass.
- Do not edit anything under .agentum-harness/. That is the harness state.
- Keep your work scoped to the repository you were launched in.

.agentum-harness/feature_list.json

El backlog. Cada función lleva un estado que el motor avanza: pending, coding, verifying, ready_to_test, done o blocked.

.agentum-harness/feature_list.json
{
  "agent_tool": "claude",
  "agent_yolo": true,
  "max_retries": 3,
  "features": [
    {
      "id": "example-feature",
      "name": "One sentence describing the feature",
      "description": "What the agent must build, specific enough that verify.sh can check it.",
      "state": "pending"
    }
  ]
}

.agentum-harness/init.sh

El smoke test del entorno. Corre una vez antes de toda función; un exit distinto de cero aborta la corrida antes de lanzar un agente.

.agentum-harness/init.sh
#!/usr/bin/env bash
# Environment smoke test, run once before any feature.
# A non-zero exit aborts the whole run. Keep it fast and cheap.
set -euo pipefail

command -v git >/dev/null 2>&1 || { echo "FAIL: git not found"; exit 1; }
# install deps, start services, then prove the world is healthy:
# make setup && make check

echo "OK, environment is ready"
exit 0

.agentum-harness/verify.sh

La puerta. Corre tras cada función con el id en $HARNESS_FEATURE_ID. Exit 0 avanza; distinto de cero bloquea y reintenta.

.agentum-harness/verify.sh
#!/usr/bin/env bash
# The gate. Run after each feature, with the feature id in $HARNESS_FEATURE_ID.
#   exit 0  -> green: feature passes, the harness advances and writes handoff.md
#   exit !0 -> red:   advancement is blocked; the agent gets this output, retries
set -uo pipefail

feature="${HARNESS_FEATURE_ID:-unknown}"
echo "gate running for feature: ${feature}"

case "${feature}" in
  example-feature)
    test -f GREETING.md || { echo "FAIL: GREETING.md missing"; exit 1; }
    ;;
  *)
    echo "no checks for ${feature}, passing"
    ;;
esac

exit 0

.agentum-harness/handoff.md

La nota de continuidad. El motor la sobrescribe tras cada función en verde, así la siguiente sesión arranca del último estado.

.agentum-harness/handoff.md
# Handoff

No feature has passed the gate yet.

The Agentum Harness Engine overwrites this file after each feature is verified
green, so the next session always has the latest state.
Esta lección reformula para Agentum el capítulo equivalente del curso abierto de Walking Labs. Lee el original ↗