Skills

Save a verified browser workflow, supply new inputs, and check each replay.


A Skill gives your Agent instructions for a task. A saved script performs the browser operations you have already specified. Use both when a task repeats: keep the goal, inputs and stopping conditions in the Skill, and keep stable interactions in a script you can rerun and inspect.

This guide covers saving and replaying a script manually. The Agent checks the account, page state and result on each run; saving this script does not establish automatic learning or a model-call guarantee.

Load the browser Skill

Install ego(lite), finish onboarding, and restart an Agent that was already running. In Claude Code or Codex, choose the installed ego-browser Skill and give it the task. The Agent needs to execute commands on the computer running ego(lite).

If the Skill is missing, check whether onboarding installed it in the directory used by that Agent. Claude Code and Codex do not necessarily read the same Skill directory. Run ego-browser skill to retrieve the guide that matches the installed browser. Claude Code and Codex explain their connection steps.

Save the working procedure

Finish one real task before turning it into a reusable workflow. Keep the target application, expected account, input fields, result format and stopping conditions with the script. Replace temporary refs with selectors checked against the application, and use stable record IDs rather than row positions.

For a read-only research task, a minimal Skill can say:

Read the requested records from the approved application.
Before reading, verify the account and organization shown on the page.
Use the supplied record IDs. Preserve the source URL for each result.
If login, page structure or access differs from the saved procedure, stop
and report the affected record. Do not infer missing values.
Return the output file and any blocked records.

The description is an instruction to the Agent. It is not an application permission system.

Separate inputs from interactions

Download the optional local task lab (ZIP), extract it and run lab.py with Python 3, and keep the server running on the same computer. Save the complete script below as workflow.mjs. Change config.query to supply the next input.

const fs = await import('node:fs/promises');
const { tmpdir } = await import('node:os');
const { join } = await import('node:path');
const config = { query: 'Alpha' };
const task = await taskSpace('Read demo records');
const page = task.page('p1');
await page.goto('http://127.0.0.1:48763/lab');
await page.fill('#query', config.query);
await page.click('#search');
await page.waitForFunction(
  query => document.querySelector('#search-result').textContent === 'Search: ' + query,
  config.query,
  { timeout: 5000 }
);
const rows = await page.evaluate(() =>
  [...document.querySelectorAll('#rows tr')]
    .filter(row => !row.hidden)
    .map(row => ({ id: row.dataset.id, name: row.cells[1].textContent }))
);
if (rows.length !== 1) throw new Error('Expected one demo record');
const output = join(tmpdir(), 'ego-record-' + encodeURIComponent(config.query) + '.json');
await fs.writeFile(output, JSON.stringify({ query: config.query, rows }, null, 2));
console.log({ query: config.query, rows, output });
await task.finish({ keep: [] });

These selectors come from our task lab. In the tested replay, changing only the input from Alpha to Beta returned demo-101 and demo-102 respectively, using the same saved script in two separate runtime invocations.

Replay the script

Save JavaScript as a local file and run it through the browser runtime:

ego-browser nodejs < /absolute/path/workflow.mjs

The script must create or resume its task Space and select the intended Page. Local configuration paths must be absolute. The runtime does not inherit environment variables you set before the command, so load configuration explicitly instead of assuming it will arrive through process.env.

Run a read-only check with the new input before enabling writes. For a batch, return a status for each record rather than one overall success message. Reuse of a working script saves rediscovery; it does not remove the need to verify the new result.

Read configuration from a file

Use a local .mjs file for the code and a separate JSON file for values that change. The file paths are absolute because the runtime does not use your shell's working directory or inherit its environment variables.

// /absolute/path/read-report.mjs
const fs = await import("node:fs/promises");
const config = JSON.parse(await fs.readFile("/absolute/path/report-config.json", "utf8"));
const task = await taskSpace(config.spaceId);
const page = task.page("p1");
await page.goto(config.url);
console.log(await page.snapshot());
{
  "spaceId": 123,
  "url": "https://example.com"
}

Replace the example ID with the ID of your active task. For a new independent task, create a fresh task with a meaningful name and record its returned ID. Do not reuse the handle of a task that has already finished.

ego-browser nodejs < /absolute/path/read-report.mjs

Add the selectors and output verification for the actual website after observing it. Keep credentials out of this configuration. Browser state supplies the authorized session. The script supplies the steps.

Update a changed procedure

If the account, page layout, field meaning or required permission changes, stop the affected work and inspect the current page. Update the saved procedure from that observation, then check it with the same success and failure conditions used for the original task. Keep the previous script and its test date so a later result can be traced to the procedure that produced it.

Repeated tasks still need a computer or hosted environment that is running. Saving a script does not schedule it or keep it running after the computer shuts down.

Keep current features separate from Experience

WorkflowCurrent meaning
Installed ego-browser SkillThe Agent reads instructions and runs browser operations.
Your saved script or Agent SkillYou maintain reusable code, parameters, and result verification.
Automatic Experience accumulationThe product documentation describes a limited beta. Do not assume every successful run becomes a reusable workflow.

These examples use the Page API guide 2.2.1. ego-browser contains the current command patterns, and Space explains account state and task control.