agentleFS
fritzprixfritzprix/libr-agent/.agents/skills/libr-tool-e2e-harness-loop/SKILL.md

libr-tool-e2e-harness-loop

Skill11 starsChanged 18 days agoMITView on GitHub

Run a repeatable LibrAgent builtin-tool E2E harness via libr-delegate: instruct a live Session API session, extract the transcript, write an evidence-backed postmortem, derive ranked tool-improvement tasks, optionally patch, then re-run. Use when the user asks for tool E2E harness loops, browser/userChrome extension E2E cycles, postmortem-driven tool fixes, or "E2E → 분석 → 과제 → 반복". Depends on a running LibrAgent and the Cursor-only libr-delegate skill. Not for Harbor/ATIF job analysis (use harbor-harness-improvement-loop) and not for in-app agent__* delegation.

  • Sends data out

The file

We split this skill into the rules it gives an agent

11 rules. About 0 are common, 1 is distinctive, and 10 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 10

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Verify a tool surface after a merge/rebuild (e.g.

    line 24
  2. Very specific:

    Always pass absolute workspacePath when the E2E needs the repo.

    line 41
  3. Very specific:

    Do not run pnpm refactor:validate unless the user explicitly asks.

    line 46
  4. Distinctive:

    Stop looping when acceptance criteria pass, max cycles hit, or user aborts.

    line 47
  5. Very specific:

    Default max cycles: 3 (override if user says).

    line 51
  6. Very specific:

    Follow libr-delegate. Brief template: references/e2e-brief.md.

    line 65
  7. Very specific:

    Create session → poll to Idle/Error/Paused → on Paused resume once.

    line 74
  8. Very specific:

    Write postmortem.md using references/postmortem.md.

    line 90
  9. Very specific:

    Write tasks.md using references/improvement-backlog.md.

    line 110
  10. Very specific:

    If user asked for planning only: stop after tasks.md and summarize.

    line 123
  11. Very specific:

    When a prior postmortem.md exists, write delta.md:

    line 127

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Libr Tool E2E Harness Loop

Cursor-owned loop for live builtin MCP tools against a running LibrAgent:

E2E instruct → transcript extract → postmortem → improvement tasks → (patch) → re-run

Optimize tool contracts (schema, handler, hints, bridge/backend), not model choice.

When to use

  • Verify a tool surface after a merge/rebuild (e.g. browser userChrome / sidecar)
  • Turn a failed/partial E2E into a ranked fix backlog
  • Drive short improvement cycles with measurable re-E2E

Dependencies

NeedSkill / precondition
Spawn/poll/cleanup sessionlibr-delegate (read + follow it)
Builtin design critique after root-causecritique-builtin-tool / refactor-builtin-tool as needed
Harbor job ATIF analysisNot this skill → harbor-harness-improvement-loop

LibrAgent must be up (GET /api/health). Prefer executionMode: yolo for unattended E2E.

Hard rules

  • Self-contained request text only — child session does not see Cursor chat.
  • Always pass absolute workspacePath when the E2E needs the repo.
  • Extract GET …/messages?limit=500 before terminate+delete.
  • Artifacts under .libragent/work/tool-e2e-harness/<cycle-id>/ only (unless user asks otherwise).
  • Separate fact (tool result text) / interpretation / hypothesis.
  • One primary causal patch per cycle when implementing; ask before large product edits.
  • Do not run pnpm refactor:validate unless the user explicitly asks.
  • Stop looping when acceptance criteria pass, max cycles hit, or user aborts.

Cycle

Default max cycles: 3 (override if user says). Freeze a cycle-id like 20261003-browser-userchrome-1.

0. Freeze the harness contract

Write .libragent/work/tool-e2e-harness/<cycle-id>/contract.md:

  • App version / branch / “fresh rebuild?” note
  • Target tools + backends (e.g. browser__createSession with browser=userChrome|sidecar)
  • Preconditions (extension Connected, bridge :3847, network)
  • Pass/fail matrix + contamination rules (no silent backend swap)
  • Out of scope

1. Instruct E2E via libr-delegate

Follow libr-delegate. Brief template: references/e2e-brief.md.

Requirements for every brief:

  • Explicit tool names and required args (browser=userChrome etc.)
  • Harmless fixtures only unless user authorizes otherwise
  • Mandatory final markdown: Verdict / Runtime / Tool matrix / Failures / Contamination
  • “No codebase archaeology” unless the cycle is analysis-only

Create session → poll to Idle/Error/Paused → on Paused resume once.

2. Extract transcript

PORT=$(cat ~/.libragent/http_port 2>/dev/null || echo 3030)
BASE="http://127.0.0.1:${PORT}"
curl -sS "$BASE/api/sessions/$SID/messages?limit=500" \
  > ".libragent/work/tool-e2e-harness/<cycle-id>/messages.json"
# save final assistant markdown as report-raw.md
curl -sS -X POST "$BASE/api/sessions/$SID/terminate"
curl -sS -X DELETE "$BASE/api/sessions/$SID"

3. Postmortem

Write postmortem.md using references/postmortem.md.

Rebuild intent → tool call → observation → next tool from messages (not memory).

Classify each failure:

ClassMeaning
preconditionEnv not ready (extension offline, app old build)
contract_lieSuccess/status disagrees with observed state
capability_gapDocumented unsupported path
schema_guidanceAgent mis-called due to description/schema
handler_bugWrong backend behavior
contaminationWrong backend/session identity
harnessBad brief / flake / timeout

Map owning layer (narrowest): schema → description/hints → MCP handler → service/bridge → extension/SW → docs/settings.

4. Derive improvement tasks

Write tasks.md using references/improvement-backlog.md.

Rank: blocker > major > nit. Prefer contract_lie / contamination / handler_bug over prompt-only tips.

Each task needs: evidence pointer, owning paths, proposed minimal change, re-E2E acceptance check, confidence.

5. Act (only if user approved patching this cycle)

  1. Smallest fix for the top task (or the user-named task).
  2. Focused tests (pnpm rust:test --test … / targeted lint).
  3. Note reload requirements (e.g. Chrome extension Reload).
  4. Bump cycle-id, return to step 0/1 with the same matrix + regression checks.

If user asked for planning only: stop after tasks.md and summarize.

6. Compare cycles

When a prior postmortem.md exists, write delta.md:

  • matrix cells that flipped PASS↔FAIL
  • new failures introduced
  • tasks closed / still open

Outputs (per cycle)

.libragent/work/tool-e2e-harness/<cycle-id>/
  contract.md
  messages.json
  report-raw.md          # final assistant deliverable
  postmortem.md
  tasks.md
  delta.md               # from cycle 2+

Cursor summary to user

Keep short:

  1. Verdict + contamination
  2. Top 1–3 tasks (severity + path)
  3. Whether another E2E cycle is warranted and what must be reloaded/rebuilt

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.