use-profiles
Skill34 starsChanged 7 months agoMITView on GitHub
Load saved Playwright storageState authentication profiles before browser automation. Activates when `.playwright/profiles.json` exists and browser work begins on authenticated pages. Trigger phrases include "use profile", "load profile", "browser as [role]", "authenticated browser", "logged in browser session".
In this repository13 other files it gives its agents.
- adversarial-auditSkill
- desktop-workflow-generatorSkill
- desktop-workflow-to-playwrightSkill
- keyword-wedgeSkill
- mobile-workflow-generatorSkill
- mobile-workflow-to-playwrightSkill
- multi-user-workflow-generatorSkill
- multi-user-workflow-to-playwrightSkill
- playwright-runnerSkill
- resilience-auditSkill
- review-learningsSkill
- submit-learningsSkill
- trust-builderSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
20 rules. About 0 are common, 6 are distinctive, and 14 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
14
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 21
Check for .playwright/profiles.json at the project root.
- Distinctive: line 41
If the user mentions a specific role (e.g., "test the admin dashboard", "check the speaker view"), match it to a profile name from the …
- Distinctive: line 42
If the user does not specify a role and only one profile exists, use it automatically.
- Distinctive: line 43
If the user does not specify a role and multiple profiles exist, ask which one to use.
- Very specific: line 47
Before navigating to any authenticated page, load the profile using playwright-cli via the Bash tool.
- Very specific: line 49
Verify the storageState file exists at .playwright/profiles/<role-name>.json.
- Very specific: line 59
If the profile JSON contains a sessionStorage field (not part of standard storageState — added by /setup-profiles), restore it separately …
- Very specific: line 73
After loading a profile, check whether it has a files array and/or acceptance object in profiles.json.
- Very specific: line 77
If the profile has files, inform the caller with a summary:
- Very specific: line 96
Do not fail or block on missing files — just warn.
- Very specific: line 100
If the profile has acceptance, include a human-readable summary of the configured criteria.
- Very specific: line 110
If individual files have acceptance overrides, note which files override the profile defaults:
- Distinctive: line 116
After loading a profile and navigating to the target page, check whether the session is still valid using these heuristics in order:
- Very specific: line 118
URL redirect: If the browser is redirected to a URL matching the loginUrl from the profile config, the session has likely expired.
- Very specific: line 119
Auth-provider redirect: If the final URL is on a different domain (e.g., accounts.google.com, auth0.com), the app redirected to an OAuth …
- Very specific: line 120
Page content check: Run playwright-cli -s={session} snapshot via Bash and look for login-related elements: sign-in forms, "Log in" / "Sign …
- Distinctive: line 122
If expiry is detected:
- Distinctive: line 125
Do not attempt to log in automatically
- Very specific: line 131
If .playwright/profiles.json exists but references profiles whose storageState files are missing (e.g., after a fresh clone), inform the …
- Very specific: line 137
If .playwright/profiles.json does not exist, this skill does not apply.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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.
Files
Using Playwright Authentication Profiles
Purpose
Load saved Playwright storageState authentication profiles before browser automation work. This eliminates the need to log in manually at the start of every browser session.
When This Applies
This skill applies when ALL of the following are true:
- The current project has a
.playwright/profiles.jsonfile - Browser automation work is about to begin (using Playwright CLI via Bash)
- The target page requires authentication
Profile Discovery
Check for .playwright/profiles.json at the project root. Read it to discover available profiles. The file contains entries like:
{
"profiles": {
"admin": {
"loginUrl": "https://example.com/login",
"description": "Full permissions",
"createdAt": "2026-03-31T12:00:00Z"
}
}
}Each profile has a corresponding storageState file at .playwright/profiles/<role-name>.json.
Profile Selection
Determine which profile to use based on conversation context:
- If the user mentions a specific role (e.g., "test the admin dashboard", "check the speaker view"), match it to a profile name from the config.
- If the user does not specify a role and only one profile exists, use it automatically.
- If the user does not specify a role and multiple profiles exist, ask which one to use. Present the available profiles with their descriptions.
Loading a Profile
Before navigating to any authenticated page, load the profile using playwright-cli via the Bash tool. The {session} placeholder below refers to the current named session (e.g., runner-desktop, qa-ux — set by the invoking skill or command).
- Verify the storageState file exists at
.playwright/profiles/<role-name>.json. If it does not exist, inform the user and suggest running/setup-profilesto create it. Load the profile's cookies and localStorage into the browser session:
playwright-cli -s={session} state-load ".playwright/profiles/<role-name>.json"This restores all cookies and per-origin localStorage from the storageState JSON — the same format used by Playwright's
storageState().If the profile JSON contains a
sessionStoragefield (not part of standard storageState — added by/setup-profiles), restore it separately after navigating to the target origin:playwright-cli -s={session} goto "<origin>"Then for each sessionStorage entry:
playwright-cli -s={session} sessionstorage-set "<name>" "<value>"- Navigate to the target authenticated page. Cookies are sent with the request, localStorage is already populated, and sessionStorage is restored — so server-side, client-side, and SPA auth libraries (Supabase, Firebase, Auth0) will recognize the session.
Test Data Files & Acceptance Criteria
After loading a profile, check whether it has a files array and/or acceptance object in profiles.json. These are optional fields — many profiles will not have them.
Surfacing available files
If the profile has files, inform the caller with a summary:
This profile has N test data file(s) available:
- valid-deck.pptx — Clean deck, passes all checks
- profanity-deck.pptx — Profanity in notes, should flag
- (cloud) oversized-deck.pptx — 200MB deck, tests size limit
Profile acceptance criteria: upload accepted, processing completes
Mark cloud-hosted files (those with url instead of path) with (cloud) for clarity.
This information is surfaced but not acted on by this skill — the consumer (workflow generator, runner, agent) decides whether and how to use it.
File path validation
For each file entry with a path field, verify the file exists at the given path relative to the project root. If a file is missing, warn:
Profile "speaker" references test file "test-fixtures/valid-deck.pptx" which does not exist. The file may have been moved or deleted.
Do not fail or block on missing files — just warn. Files with url are not validated (they may require authentication or be on private networks).
Acceptance criteria summary
If the profile has acceptance, include a human-readable summary of the configured criteria. Map the fields as follows:
| Field | Summary text |
uploadAccepted: true | upload accepted |
processingCompletes: true | processing completes |
resultDownloadable: true | result downloadable |
errorExpected: true | error expected |
expectedStatus: "clear" | expected status: "clear" |
If individual files have acceptance overrides, note which files override the profile defaults:
File "corrupted.pptx" overrides profile acceptance: upload rejected, error expected
Session Expiry Detection
After loading a profile and navigating to the target page, check whether the session is still valid using these heuristics in order:
- URL redirect: If the browser is redirected to a URL matching the
loginUrlfrom the profile config, the session has likely expired. Check the URL in the snapshot output'sPage URLline. - Auth-provider redirect: If the final URL is on a different domain (e.g.,
accounts.google.com,auth0.com), the app redirected to an OAuth provider — the session has expired. - Page content check: Run
playwright-cli -s={session} snapshotvia Bash and look for login-related elements: sign-in forms, "Log in" / "Sign in" buttons, or "session expired" text. If the target page was expected to show authenticated content but instead shows a login UI, the session has expired.
If expiry is detected:
- Inform the user that the session for the profile appears to have expired
- Suggest running
/setup-profilesto refresh it - Do not attempt to log in automatically
These heuristics are best-effort. The user can always run /setup-profiles manually to refresh any profile.
Missing Profiles
If .playwright/profiles.json exists but references profiles whose storageState files are missing (e.g., after a fresh clone), inform the user:
"This project has Playwright profiles configured but the authentication state files are missing (they are gitignored and need to be created locally). Run
/setup-profilesto authenticate."
No Profile Config
If .playwright/profiles.json does not exist, this skill does not apply. Do not suggest creating profiles unless the user is explicitly asking about authenticated browser automation.
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
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.

