Best use case
Playwright is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Use MCP Playwright for automated browser testing and web automation.
Teams using Playwright should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/playwright/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How Playwright Compares
| Feature / Agent | Playwright | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Use MCP Playwright for automated browser testing and web automation.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
<!-- PLAYWRIGHT:START -->
# Playwright MCP Instructions
**CRITICAL**: Use MCP Playwright for automated browser testing and web automation.
## Core Operations
### Navigation & Screenshots
```typescript
await playwright.navigate({ url: "https://example.com" });
await playwright.takeScreenshot({ fullPage: true, filename: "page.png" });
```
### Interaction
```typescript
// Click
await playwright.click({ element: "Submit Button", ref: "button[type='submit']" });
// Type
await playwright.type({ element: "Search", ref: "#search", text: "query" });
// Fill form
await playwright.fillForm({
fields: [
{ name: "Email", type: "textbox", ref: "#email", value: "user@example.com" },
{ name: "Password", type: "textbox", ref: "#password", value: "secret" }
]
});
```
### DOM & Monitoring
```typescript
// Get accessibility tree
const snapshot = await playwright.snapshot();
// Console errors
const errors = await playwright.getConsoleMessages({ onlyErrors: true });
// Network requests
const requests = await playwright.getNetworkRequests();
```
## Common Patterns
### Login Flow
```typescript
1. navigate to login page
2. fillForm with credentials
3. click submit button
4. waitFor dashboard text
5. verify success via snapshot
```
### Error Detection
```typescript
const errors = await playwright.getConsoleMessages({ onlyErrors: true });
if (errors.length > 0) {
await playwright.takeScreenshot({ filename: "error-state.png" });
}
```
## Best Practices
✅ **DO:**
- Wait for specific conditions (not time delays)
- Use descriptive element names
- Handle dialogs (`handleDialog`)
- Check console errors after actions
- Take screenshots at critical points
❌ **DON'T:**
- Use hard-coded delays
- Use generic element selectors
- Ignore console errors
- Use relative file paths (uploads)
## Configuration
```json
{
"mcpServers": {
"playwright": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-playwright"]
}
}
}
```
<!-- PLAYWRIGHT:END -->Related Skills
Vectorizer
Use MCP Vectorizer as primary data source for project information instead of file reading.
Synap
Use MCP Synap for persistent task and data storage across context windows.
Supabase
Use MCP Supabase for database operations, authentication, and storage.
Serena
Use MCP Serena for AI-powered development assistance, code analysis, and intelligent automation.
Notion
Use MCP Notion for documentation, task tracking, and knowledge management.
Memory
The rulebook memory system provides persistent context across AI sessions using hybrid search (BM25 keyword + HNSW vector) with zero native dependenci
Grafana
Use MCP Grafana for metrics visualization, alerting, and observability dashboards.
GitHub MCP
Monitor CI/CD workflows after every `git push` using GitHub MCP.
Figma
Use MCP Figma for design system integration, asset export, and design-to-code workflows.
Context7
Use MCP Context7 to access up-to-date library documentation before adding dependencies.
Atlassian
Use MCP Atlassian for Jira issues, Confluence documentation, and Bitbucket repositories.
Zig
Execute these commands after EVERY implementation (see AGENT_AUTOMATION module for full workflow).