strocs/.dotfiles/playwright-cli-hygiene
Claude Code and agent skill by strocs/.dotfiles
- community
Checking that the SKILL.md file is still in the repository.
Trigger: playwright-cli, browser instance, close browser, pwcli close, session cleanup. Enforce lifecycle hygiene: close every instance the agent opened; ask before closing pre-existing ones.
Install
npx vskill@latest install strocs/.dotfiles/playwright-cli-hygieneSKILL.md
The same SKILL.md was published earlier as strocs/.dotfiles/playwright-cli-hygiene.
Skill: playwright-cli-hygiene
Activation Contract
Load whenever work drives a real browser through playwright-cli (or its wrapper) and any lifecycle decision arises: opening, reusing, closing, or managing browser instances and named sessions. Complements the base playwright CLI skill; do not replace it.
Hard Rules
- CLOSE WHAT YOU OPENED: every browser instance or named session the agent opened MUST be closed when the work ends (
pwcli closeorpwcli --session <name> close). No exceptions. - NEVER close an instance or session that pre-existed the agent's work without asking the user first. If the agent only reused it, closing is optional: ask whether it should be closed or kept.
- Never touch the default session when the user may be using it. Isolate agent work in a named session:
pwcli --session <label> open <url>. - Cleanup applies on failure too: an aborted or failed flow still requires closing agent-opened instances.
- Verify closure: after closing, confirm no agent-owned session or instance remains. Never close the same instance twice.
- Use
--headedonly when a visual check genuinely helps; default to headless. - Report final state: what was opened, what was closed, what remains open and why.
Decision Gates
| Who owns the instance or session? | Action | |
|---|---|---|
| Agent opened it this work | Close it, no question needed | |
| Pre-existing (user or other process) | Ask: close or keep? Never close silently | |
| Ownership unknown | Ask: close or keep? | |
| User explicitly asked to close | Close it |
Execution Steps
- Before starting, record which instances and sessions already exist (
pwcli --session <name> tab-listor session listing) so ownership is known. - Open agent work in its own named session:
pwcli --session <work-label> open <url>(headless unless a visual check is needed). - Work with the base CLI loop: open, snapshot, interact, re-snapshot.
- On completion (success or failure): close every session or instance the agent opened and verify closure.
- Ask about pre-existing instances only when closure is relevant; never close them silently.
- Report the final lifecycle state.
Output Contract
Return: the sessions and instances the agent opened and closed; any pre-existing instance left open and why; any user decision requested and its outcome.
References
../playwright/SKILL.md— base playwright CLI skill (wrapper, workflow, guardrails).../playwright/references/cli.md—close,--session, and session commands.../playwright/references/workflows.md— practical flows and troubleshooting.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/.agents/skills/playwright-cli-hygiene/SKILL.md
Popularity
- 7-day trend score
- 5
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/strocs/.dotfiles/playwright-cli-hygiene)