agentleFS
nathwn12nathwn12/gladius/skills/sessions/SKILL.md

sessions

Skill1 starsChanged 3 days agoMITView on GitHub

Attach and ensure lifecycle for the gladius browser session, one session per target, and when to use visual versus layout checks.

32 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use tool-rename-deprecation, add-policy and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • gitpod-ioSkill

    tool-rename-deprecation

    Ensure renamed built-in tool references preserve backward compatibility. Use when renaming a toolReferenceName, tool set referenceName, or any tool identifier. Run on ANY change to tool registration code. Covers legacyToolReferenceFullNames for tools and legacyFullNames for tool sets.

    Also in 5 projects that use this

  • OpenCortexIDESkill

    add-policy

    Use when adding, modifying, or reviewing VS Code configuration policies. Covers the full policy lifecycle from registration to export to platform-specific artifacts. Run on ANY change that adds a `policy:` field to a configuration property.

    Also in 4 projects that use this

  • gitpod-ioSkill

    agent-sessions-layout

    Agent Sessions workbench layout — covers the fixed layout structure, grid configuration, part visibility, editor modal, titlebar, sidebar footer, and implementation requirements. Use when implementing features or fixing issues in the Agent Sessions workbench layout.

    Also in 3 projects that use this

  • slopusSkill

    control-flow

    Analyze and design control flows and data structures. Produces compact ASCII tree diagrams showing triggers, call chains, payload shapes, state mutations, and re-render effects. Use when user asks to diagram, trace, visualize, or design a flow or data structure.

    Also in 3 projects that use this

  • slopusSkill

    metrics-graphana

    Query and manage Grafana dashboards and Prometheus metrics for Happy infrastructure. Covers grafanactl CLI usage, direct Prometheus queries through Grafana proxy, and dashboard-as-code workflows. Use when user asks about metrics, dashboards, monitoring, Grafana, Prometheus, or wants to add/modify panels.

    Also in 3 projects that use this

  • TheKREATORSSkill

    refactor-clean

    No description

    Also in 3 projects that use this

  • +2 more from gitpod-io

The file

We split this skill into the rules it gives an agent

5 rules. 0 are common, 4 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 28 edited versions we read keep these.

  • 4

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

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

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

    If GLADIUS_CDP_URL is set, gladius attaches to that engine.

    line 14
  2. Distinctive:

    Only one page target is active at a time.

    line 37
  3. Distinctive:

    Use targets and tabs to inspect.

    line 39
  4. Distinctive:

    Always call close (or end the stdio session) so the owned browser tree and private profile are reaped.

    line 61
  5. Distinctive:

    No PDF generation and no fleet/cloud operation is provided.

    line 64

“Common” is measured: kept by at least 6 in 10 of the 28 edited versions of this file we could read. “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

gladius sessions

gladius drives one browser over CDP. A session is the single page target the server is currently attached to; every tool call either reuses it or re-attaches. Treat the session as a scarce resource: one target at a time.

Attach vs owned engine

  • If GLADIUS_CDP_URL is set, gladius attaches to that engine. close detaches only the session it opened; your process keeps running and nothing of yours is deleted.
  • Otherwise gladius launches its owned pinned chrome-headless-shell on the first browser-touching tool call, creates one fresh private profile, and reaps the whole tree on close or stdio EOF.
  • An explicit GLADIUS_CHROMIUM path wins over the cache.

Session lifecycle

  • The server starts no process during initialize; launch happens on the first tool that needs the browser.
  • ensure_session attaches to an existing page target when one exists, else creates about:blank. A dead session is never reused: the next call re-attaches and may create a page.
  • On a send failure of class session-death, the cached session is dropped and the call returns stale session: ...; the command is not retried automatically. Repeat it only by choice.
  • close terminates the owned tree through the Windows job object and sweeps the private profile; on an attached engine it detaches only.

One session per target

  • Only one page target is active at a time. Switching targets invalidates the cached session and re-attaches.
  • Use targets and tabs to inspect; do not assume a target survives navigation or close.
  • engine_dead means the connection died: for an owned engine there is one automatic relaunch attempt; an attached engine is never restarted by gladius.

Visual vs layout checks

  • assert_layout / layout prove geometry (boxes, visibility, overflow, computed styles) without pixels. Use them for structural assertions.
  • screenshot (deterministic) and visual prove pixels. Use them for appearance and regression baselines.
  • A deterministic capture freezes CSS/WAAPI/SMIL/media in the main document and same-process frames; canvas, WebGL and cross-process iframes are sampled, not frozen.
  • screenshot with deterministic: true fixes metrics and restores them; byte-identity assumes gladius own PNG encoder.
  • dom-only backend caps make screenshot and visual refuse with capability_gated; geometry checks still work.

Cleanup

  • Always call close (or end the stdio session) so the owned browser tree and private profile are reaped.
  • On an attached engine, close leaves your process running.
  • No PDF generation and no fleet/cloud operation is provided.

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.