From agentcorp
Sets up a persistent authenticated Chrome/Chromium browser session with DevTools Protocol for debugging, API probes, E2E verification, and internal web apps requiring real logged-in state.
How this skill is triggered — by the user, by Claude, or both
Slash command
/agentcorp:authenticated-browser-sessionThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Use this behavior when a task needs real logged-in browser state, but the agent should not read cookie stores or ask the user to paste tokens. It is a general AgentCorp action surface, not a tester role: E2E, API contract, regression, debugging, incident triage, and exploratory verification can all use it.
Use this behavior when a task needs real logged-in browser state, but the agent should not read cookie stores or ask the user to paste tokens. It is a general AgentCorp action surface, not a tester role: E2E, API contract, regression, debugging, incident triage, and exploratory verification can all use it.
The core rule: operate inside a real page and let the browser attach credentials naturally. Never read cookie databases, password stores, local storage dumps, or session files.
fetch proves the behavior of same-origin authenticated requests from that browser session.State the limits every time they matter: API-only page-context checks do not prove UI layout, full user interaction, or external notifications unless those are separately observed.
Use a dedicated profile that is separate from the user's daily browser. The profile persists across tasks so the user usually logs in once per machine/account.
./scripts/browser-session.sh 'https://example.com'
If running from another directory, call the script by absolute path from this skill folder:
/path/to/authenticated-browser-session/scripts/browser-session.sh 'https://example.com'
If the site shows a login page, explain plainly:
I opened a separate browser profile for agent work. Please log in there; I will not read your cookies or passwords. After you confirm the page is logged in, I can run page-local checks that use the browser session naturally.
Then continue only after the user confirms login.
Configuration knobs:
AGENTCORP_BROWSER_PROFILE="$HOME/.agentcorp/browser-session-profile"
AGENTCORP_BROWSER_HOST="127.0.0.1"
AGENTCORP_BROWSER_PORT="9222"
AGENTCORP_BROWSER_BIN="/Applications/Google Chrome.app"
Use a different port if one is occupied:
AGENTCORP_BROWSER_PORT=9333 ./scripts/browser-session.sh 'https://example.com'
The scripts also accept legacy CHROME_COOKIE_JS_PROFILE/HOST/PORT variables as fallback, only for compatibility with older local setups.
Use page-js.mjs to run JavaScript in the authenticated page:
node ./scripts/page-js.mjs --url 'https://example.com/app' --eval 'document.title'
For larger checks, write a task-local script under the task workspace or /tmp and run it:
node ./scripts/page-js.mjs --url 'https://example.com/app' --file /tmp/auth-check.js
Use async IIFEs for request probes:
(async () => {
const response = await fetch('/api/status', { credentials: 'include' });
const text = await response.text();
let body = text;
try { body = JSON.parse(text); } catch {}
return JSON.stringify({
url: response.url,
status: response.status,
contentType: response.headers.get('content-type'),
body,
});
})();
Prefer a read-only probe first:
node ./scripts/page-js.mjs --url 'https://example.com/app' --eval 'location.href'
Before any page JS that writes data, triggers workflow, sends notifications, starts jobs, or mutates remote state, announce:
Do not proceed with a write unless the user has clearly authorized that kind of action in the current task.
Never print secrets. Redact URL auth parameters, tokens, temporary credentials, cookies, and sensitive response fields before saving evidence.
For verification/debugging artifacts, record enough for replay:
If the page-context request succeeds but the user-visible outcome is outside the browser, pause and ask for the missing observation instead of inferring success.
Check whether CDP is available:
curl -sS --max-time 3 http://127.0.0.1:9222/json/version
curl -sS --max-time 3 http://127.0.0.1:9222/json/list
Common cases:
/json/version fails: start the dedicated profile with browser-session.sh./json/version is not Chrome CDP: choose another port.#/route.Whole-repo audit for over-engineering: finds dead code, unnecessary abstractions, stdlib-replaceable dependencies. Outputs ranked findings and net line/dep savings.
npx claudepluginhub ylxmf2005/agentcorp --plugin agentcorp