Skip to content

refactor: keep Pi's Ardia guide to what every task needs - #34

Merged
YishenTu merged 3 commits into
mainfrom
refactor/slim-ardia-guide
Nov 28, 2026
Merged

YishenTu merged 3 commits into
mainfrom
refactor/slim-ardia-guide

Conversation

@YishenTu

Copy link
Copy Markdown
Owner

Summary

The Ardia browser guide went into every request at about 20k characters. This keeps what nearly every task needs in the guide, and moves the rest into reference files the agent reads only when a task calls for them. Upstream's skill works the same way: a short SKILL.md plus references.

Guide (guide.ts), now about 10.6k characters

  • Kept: choosing a tab, look then act (selectors, form, change reports, refs that fix themselves), reading (read, read-urls, query, --scroll, scope lines, output caps), a simple loop, the Finish rules, site notes, and the common failures (remedies, unknown outcomes, dialogs, Stop).
  • It opens with a list of the references by absolute path, each with when to read it. guide.ts resolves the paths at bundle depth, so source and dist/ agree.

References (agent/references/)

  • script.md: the full page.* API, frames, recipes, saving and resuming with state, timeouts, a site's public API.
  • flows.md: request flows, and flows that replay page actions (record --save, --replay --yes, flow heal).
  • troubleshooting.md: input and element errors, refs, tabs and sessions, older-Ardia refusals, sites the ad blocker blocks.
  • browse.md (rewritten): selectors and lines, grid cells, drag, one-time codes, viewport size, read options, eval --isolated and cdp, the page's own tools, signing in, debugging a page.

CAPTCHAs: system-prompt.md and the guide now have the agent solve a CAPTCHA itself, using a screenshot it reads, instead of stopping. Logins and one-time codes still go to the user.

index.ts: ardia_exec's description no longer names browse.md; the guide names all browse references. ardia-app.md stays in the description.

Testing

  • bun run lint, bun test --randomize and bun run build pass.
  • The distribution test now collects the prompt sections the extension adds and checks every reference path they name. It fails both when a named file is missing and when the guide resolves to the wrong directory (both checked by breaking it on purpose).
  • Every backticked term in the old guide still appears in the guide or a reference.
  • Neon (Gemini 4 Neon) and Astra (GPT-6.2-Astra) reviewed the split. Every finding was checked against the CLI's --help and fixed.
  • Still to do: the user's live test of the built extension in Ardia, before merge.

The browser guide went into every request at about 20k characters. Keep what nearly every task needs (tabs, look and act, reading, simple loops, finishing, notes, the common failures and dialogs) and move the rest into topical references that mirror the CLI's own skill: script.md, flows.md, troubleshooting.md and browse.md. The guide names each by its absolute path with the situation to read it in, and the distribution test checks that every path a prompt section names ships with the build.
Name here/tab active where open opens its own tab, warn that read-urls uses the user's tab when the chat has none, point recording and replaying flows at flows.md, restore query's row limit, the scope line's condition, selectors and the script evaluate rule, generalize where remedies run, and make the distribution test fail when the guide's references resolve to the wrong directory.
A CAPTCHA no longer blocks a task: the agent solves it in the page, using a screenshot it reads to see the challenge. Logins and verification such as one-time codes still go to the user.
@YishenTu
YishenTu merged commit 3ad876e into main Nov 28, 2026
2 checks passed
@YishenTu
YishenTu deleted the refactor/slim-ardia-guide branch November 28, 2026 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant