Add case study: Playwright MCP best practices for Claude Code CLI#1285
Add case study: Playwright MCP best practices for Claude Code CLI#1285
Conversation
Adding CLAUDE.md with task information for AI processing. This file will be removed when the task is complete. Issue: #1284
This case study investigates the best practices for using Playwright with Claude Code CLI, comparing two primary approaches: - MCP (Model Context Protocol): claude mcp add playwright npx @playwright/mcp@latest - CLI + Skills: playwright-cli install --skills Key findings: - MCP approach is recommended for most users (simplest setup) - CLI + Skills offers ~33% token savings for high-throughput scenarios - Both approaches are valid and can be used together - No --tool claude flag exists (commands work independently) Includes: - Comparative analysis with feature table - Configuration examples and best practices - Security recommendations and troubleshooting guide - Comprehensive research sources with 15+ external references Resolves #1284 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This reverts commit 5dbe9b8.
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
Now working session is ended, feel free to review and add any feedback on the solution draft. |
|
In latest versions of Claude Code there new plugins suggestions. Are they are better than Playwright MCP, how it all work? I know plugin uses playwright-cli, instead of MCP server of Are these commands are correct? Can we support both Give me summary of current situation and proposed solutions. |
|
🤖 AI Work Session Started Starting automated work session at 2026-03-14T13:59:21.342Z The PR has been converted to draft mode while work is in progress. This comment marks the beginning of an AI work session. Please wait for the session to finish, and provide your feedback. |
Address PR feedback about Claude Code plugins vs Playwright MCP: - Document three approaches: MCP server, official plugin, community skill - Clarify frontend-design plugin is NOT related to Playwright - Correct plugin install command syntax - Analyze MCP and plugin coexistence options - Add updated recommendations for 2026-03 - Add new research sources for plugin ecosystem Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary: Claude Code Plugins vs Playwright MCP (2026-03)Answering your questions:1. Are Claude Code plugins better than Playwright MCP? The official Playwright plugin ( The community Playwright Skill (lackeyjb/playwright-skill) takes a different approach — Claude writes and executes Playwright code directly instead of using MCP tools. It's more token-efficient (~314 lines of instructions) but designed for "scriptable manual testing", not CI/CD. 2. The 3. Correct plugin install commands:
Syntax: 4. Can both Playwright MCP and Playwright Plugin coexist?
5. Recommended setup: # Simplest: official plugin
/plugin install playwright@claude-plugins-official
npx playwright install
# Optional: add community skill for script-based testing
/plugin marketplace add lackeyjb/playwright-skill
/plugin install playwright-skill@playwright-skillAll findings have been added to the case study in Sources: Claude Code Plugins Docs · Discover Plugins Docs · Official Playwright Plugin Source · Frontend Design Plugin · Playwright Skill HN |
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
Now working session is ended, feel free to review and add any feedback on the solution draft. |
🔄 Auto-restart triggered (attempt 1)Reason: CI failures detected Starting new session to address the issues. Auto-restart-until-mergeable mode is active. Will continue until PR becomes mergeable. |
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
🔄 Auto-restart-until-mergeable Log (iteration 1)This log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
Now working session is ended, feel free to review and add any feedback on the solution draft. |
✅ Ready to mergeThis pull request is now ready to be merged:
Monitored by hive-mind with --auto-restart-until-mergeable flag |
Explain me in detail how it works, what it contains. Do we source code of it? |
|
🤖 AI Work Session Started Starting automated work session at 2026-03-19T08:50:09.432Z The PR has been converted to draft mode while work is in progress. This comment marks the beginning of an AI work session. Please wait for the session to finish, and provide your feedback. |
Add detailed section on the frontend-design plugin requested in PR comment, covering source code, file structure, how the Skills primitive works, SKILL.md contents, and correct install commands for both claude-code-plugins and claude-plugins-official marketplaces. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
| Marketplace Name | GitHub Repo | Pre-configured? |
|---|---|---|
claude-code-plugins |
anthropics/claude-code (demo plugins dir) |
❌ Must add first |
claude-plugins-official |
anthropics/claude-plugins-official |
✅ Yes |
The command /plugin install frontend-design@claude-code-plugins works, but requires first running:
/plugin marketplace add anthropics/claude-code
/plugin install frontend-design@claude-code-plugins
The simpler alternative (no setup):
/plugin install frontend-design@claude-plugins-official
Both install the same plugin from the same Anthropic authors (Prithvi Rajasekaran & Alexander Bricken).
Source Code
Open source in two locations:
anthropics/claude-code/plugins/frontend-designanthropics/claude-plugins-official/plugins/frontend-design
File Structure
plugins/frontend-design/
├── .claude-plugin/
│ └── plugin.json ← metadata (name, version, author)
├── skills/
│ └── frontend-design/
│ └── SKILL.md ← the actual instructions
├── LICENSE
└── README.md
This is a skills-only plugin — zero MCP servers, zero slash commands, zero hooks. Just one SKILL.md file.
How It Works Technically
Claude Code has a Skills primitive: when a plugin contains a SKILL.md, Claude Code reads the description field in its YAML frontmatter and automatically injects the skill into Claude's context when that description matches the task. No slash command is needed.
SKILL.md frontmatter:
---
name: frontend-design
description: Create distinctive, production-grade frontend interfaces with high design quality.
Use this skill when the user asks to build web components, pages, or applications.
Generates creative, polished code that avoids generic AI aesthetics.
---When you ask Claude to "build a web component" or "create a page", Claude Code detects the match and loads the SKILL.md into the system context automatically.
What SKILL.md Instructs Claude
The skill instructs Claude to commit to a bold aesthetic direction before writing any code. Specifically:
-
Aesthetic archetype (pick one): brutally minimal, maximalist chaos, retro-futuristic, organic/natural, luxury/refined, playful/toy-like, editorial/magazine, brutalist/raw, art deco/geometric, soft/pastel, industrial/utilitarian
-
Typography: No Inter, Roboto, Arial, Space Grotesk, system defaults. Use distinctive display/body font pairings
-
Color: Dominant palette with sharp accents. No timid evenly-distributed palettes
-
Motion: CSS-only animations for HTML; Motion library for React. One orchestrated page-load animation beats scattered micro-interactions
-
Layout: Asymmetry, overlap, diagonal flow, grid-breaking elements
-
Backgrounds: Gradient meshes, noise textures, geometric patterns, grain overlays — never plain solid colors
-
Hard rule: NEVER use purple gradients on white or predictable cookie-cutter layouts
Summary
| Aspect | Detail |
|---|---|
| Plugin type | Skills-only (no MCP, no commands) |
| Core file | SKILL.md (auto-injected by context matching) |
| Authors | Prithvi Rajasekaran & Alexander Bricken (Anthropic) |
| Installs | 277,000+ |
| Related to Playwright | ❌ No — pure UI design aesthetics |
| Source available | ✅ Yes, open source on GitHub |
The full analysis has been added to docs/case-studies/issue-1284/README.md.
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
🤖 Models used:
Now working session is ended, feel free to review and add any feedback on the solution draft. |
🔄 Auto-restart triggered (attempt 1)Reason: CI failures detected Starting new session to address the issues. Auto-restart-until-mergeable mode is active. Will continue until PR becomes mergeable. |
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
🔄 Auto-restart-until-mergeable Log (iteration 1)This log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
🤖 Models used:
Now working session is ended, feel free to review and add any feedback on the solution draft. |
✅ Ready to mergeThis pull request is now ready to be merged:
Monitored by hive-mind with --auto-restart-until-mergeable flag |
Summary
This PR adds a comprehensive case study investigating Playwright MCP best practices for Claude Code CLI (Issue #1284).
Key Findings
Three Approaches to Playwright in Claude Code (2026):
claude mcp add playwright npx @playwright/mcp@latest/plugin install playwright@claude-plugins-official(wraps the same MCP server)lackeyjb/playwright-skill(Claude writes and executes Playwright code directly)The
frontend-designplugin is NOT related to Playwright — it's an Anthropic design aesthetics skill (324K+ installs)Correct plugin install commands:
claude plugin install @anthropic/frontend-design/plugin install frontend-design@anthropics-claude-code/plugin install frontend-design@claude-plugins-official/plugin install playwright@claude-plugins-officialMCP and Plugin can coexist — the official plugin wraps the same MCP server, so choose one. The community Playwright Skill (approach 3) IS complementary and can be used alongside either.
Files Changed
docs/case-studies/issue-1284/README.md- Comprehensive case study with:docs/case-studies/issue-1284/research-sources.md- All 20+ research sources consulted.changeset/playwright-mcp-best-practices.md- Changeset for version bumpRecommendations
For most Claude Code CLI users (simplest path):
For advanced users wanting both MCP tools AND efficient scripted testing:
Test Plan
docs/case-studies/.mcp.jsonsource)SKILL.mdsource)Fixes #1284
🤖 Generated with Claude Code