agentleFS
Crawlio-appCrawlio-app/crawlio-browser/skills/robot-training/SKILL.md

robot-training

Skill8 starsChanged 4 months agoApache-2.0View on GitHub

Use this skill when the user wants to train an agent or robot from a real browser demonstration, record a full human-guided web flow, infer button-to-API contracts, build replay recipes, synthesize OpenAPI from captured traffic, or prepare timed automation runs.

The file

Show its rules and text

We split this skill into the rules it gives an agent

18 rules. About 0 are common, 8 are distinctive, and 10 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈8

    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. Distinctive:

    Use this when speed and repeatability matter.

    line 17
  2. Distinctive:

    Start with a fresh run:

    line 21
  3. Very specific:

    Call observe with action: "training_start" before the user begins.

    line 35
  4. Very specific:

    Call observe with action: "training_stop" and the same runId after the demonstration.

    line 46
  5. Very specific:

    If MCP disconnects during the demonstration, do nothing in the page.

    line 64
  6. Distinctive:

    After the canonical files have been verified, delete the extension-retained record only when the user asks to remove it:

    line 67
  7. Very specific:

    Read state-log.json to identify what changed after each click.

    line 84
  8. Very specific:

    Read recording.json to align user interactions with page URLs and timestamps.

    line 85
  9. Very specific:

    Read network.json and bodies.json to map each button to its request/response contract.

    line 86
  10. Very specific:

    Read api.openapi.yaml as a captured-endpoint draft and validate it against network.json before promotion.

    line 87
  11. Very specific:

    Prefer API replay when the contract is known.

    line 93
  12. Very specific:

    Use bridge.send({ type: "agent_session_action", action: "evaluate", ...

    line 96
  13. Distinctive:

    Verify every response body or page state transition.

    line 97
  14. Very specific:

    Use bridge.send({ type: "agent_session_batch", ...

    line 98
  15. Distinctive:

    Avoid primary mouse actions.

    line 99
  16. Distinctive:

    sync phase: create session, read current task, capture session tokens

    line 105
  17. Distinctive:

    fast path: call discovered endpoints directly

    line 106
  18. Distinctive:

    verification phase: check state every N tasks or after mismatched responses

    line 107

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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

Robot Training

Robot training turns one real browser demonstration into durable artifacts:

  • interaction timeline from Crawlio session recording
  • DOM/storage state snapshots streamed into extension-owned IndexedDB
  • CDP network entries and response bodies
  • portable request/response traces in flows.jsonl
  • replay inputs for agent_session_* background sessions

Use this when speed and repeatability matter. The human can teach the flow once; agents later replay by API contract or semantic browser actions instead of primary mouse events.

Capture Protocol

Start with a fresh run:

{
  "action": "training_start",
  "url": "https://target.example/",
  "outputDir": "/absolute/path/to/runs/target-take-1",
  "maxDurationSec": 600,
  "maxInteractions": 500,
  "active": true,
  "captureStorageValues": false
}

Call observe with action: "training_start" before the user begins. The extension opens a fresh tab, starts network capture and recording, installs an event-driven monitor for the current and future documents, and retains the run locally. The MCP server writes manifest.json, but it does not own collection.

During the demonstration, poll with:

{ "action": "training_status", "runId": "rt_..." }

Call observe with action: "training_stop" and the same runId after the demonstration. The extension fetches bounded/redacted response bodies before stopping Network, returns its resident export, and the server materializes:

  • raw-dump.json
  • recording.json
  • network.json
  • bodies.json
  • state-log.json
  • state.json
  • flows.jsonl
  • causal-graph.json
  • CAUSAL.md
  • recipe.json
  • REGISTRY.md
  • api.openapi.yaml
  • manifest.json

If MCP disconnects during the demonstration, do nothing in the page. The extension continues collecting. Reconnect, query training_status, and stop with the original runId.

After the canonical files have been verified, delete the extension-retained record only when the user asks to remove it:

{ "action": "training_clear", "runId": "rt_...", "confirm": true }

training_clear rejects active runs and never deletes files under outputDir; call training_stop first. The confirmation and exact run id make retention deletion deliberate.

Storage keys are retained by default, not values. Only set captureStorageValues: true when the user explicitly requests it; password-, token-, and secret-shaped fields remain redacted.

Analysis Protocol

After capture:

  1. Read state-log.json to identify what changed after each click.
  2. Read recording.json to align user interactions with page URLs and timestamps.
  3. Read network.json and bodies.json to map each button to its request/response contract.
  4. Read api.openapi.yaml as a captured-endpoint draft and validate it against network.json before promotion; keep flows.jsonl as the replay/synthesis input.
  5. Produce a button registry: label, selector, endpoint, method, request shape, response shape, and success signal.

Replay Protocol

Prefer API replay when the contract is known. Use agent_session_* when browser state, cookies, or client-side signing must be preserved:

  1. In execute, send bridge.send({ type: "agent_session_create", url: targetURL, active: false }).
  2. Use bridge.send({ type: "agent_session_action", action: "evaluate", ... }) to call fetch() inside the page context using existing cookies/session.
  3. Verify every response body or page state transition.
  4. Use bridge.send({ type: "agent_session_batch", ... }) for timed multi-step runs.
  5. Avoid primary mouse actions. Only use DOM/contract actions or semantic background-session actions.

Timing Strategy

For timed tasks, split the run into:

  • sync phase: create session, read current task, capture session tokens
  • fast path: call discovered endpoints directly
  • verification phase: check state every N tasks or after mismatched responses
  • recovery phase: snapshot page, infer current task, resume from the nearest known state

For 60 tasks in 240 seconds, target sub-second contract calls and keep visual/DOM snapshots off the hot path unless recovery is needed.

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.