Agent Skills

Long-Running Agent (LRA) Workflow

Load this skill when you are about to work on a large project that will span multiple sessions / context windows and you need continuity, atomic handoffs, and recovery from broken states.

The skill gives you a tiny CLI (scripts/lra_cli.py) that maintains a .lra/ directory: a machine-readable feature-list.json (atomic features with acceptance criteria and status) and a human/agent-readable progress.txt (session log). The protocol turns “one big vague task” into a sequence of small, fully-tested, check-pointed features.


Overview — the problem

AI agents working across many context windows hit three failure modes:

LRA fixes this with: structured init, one atomic feature per session, an explicit test gate before done, and a checkpoint after every feature so the next session can recover.


When to use

If the task is small and finishes in one session, you do not need this skill — just do the work.


Prerequisites


Instructions

Phase 1 — Init

python3 scripts/lra_cli.py init "Short project description"

Creates .lra/feature-list.json ({"project": ..., "features": [], "created": <date>}) and .lra/progress.txt with a header. Refuses (exit 1) if .lra/ already exists, so you never clobber an in-progress project.

Phase 2 — Plan features

Add atomic, testable features. Each gets an id (f1, f2, …), a name, a priority (high/medium/low), and criteria (acceptance criteria).

python3 scripts/lra_cli.py add "User registration endpoint" --priority high \
  --criteria "POST /api/auth/register accepts email+password; validates email; hashes password; returns JWT"

Rule: a feature must be completable in one session and have concrete acceptance criteria. “Build the user system” is too big — split it.

Phase 3 — Session protocol (repeat every session)

  1. Read contextstatus and read .lra/progress.txt to see where you are.
  2. Pick ONE feature — the highest-priority todo (or wip you abandoned).
  3. Implement it.
  4. Test it against its acceptance criteria (unit + integration + manual).
  5. Mark donemark f<N> done only after verification passes.
  6. Checkpointcheckpoint "Implemented X and Y; tests green".
python3 scripts/lra_cli.py mark f1 done
python3 scripts/lra_cli.py checkpoint "User registration: endpoint + validation + tests"

Phase 4 — Checkpoint / recover

Phase 5 — Status

status prints a table of all features (id, name, priority, status) sorted todo → wip → done, so you always know the current state at a glance.


Best practices


Constraints and warnings


Files

Installation

# For opencode
cp -r skills/long-running-agent-workflow ~/.config/opencode/skills/

# For other agents: copy the folder to your skills directory; requires Python 3.

Key principle: leave the codebase in a testable, working state at the end of every session. The next session (and the next agent) picks up from the last checkpoint, not from amnesia.

Boundaries