playwriter skill
Print the complete Playwriter usage instructions and best practices guide. This outputs the full content of the skill.md file which contains comprehensive guidance for AI agents on using Playwriter effectively.Output
Prints the complete skill.md content to stdout, including:- CLI usage patterns and session management
- Context variables available in code execution (
state,page,context,require) - Best practices for browser automation
- Interaction feedback loop (observe → act → observe)
- Common mistakes to avoid
- Quoting rules for shell commands
- Working with pages, iframes, and frames
- Snapshot vs screenshot guidelines
- Network interception patterns
- Debugging and troubleshooting tips
Exit Codes
0- Always succeeds
Examples
Use Cases
For AI agents
For documentation
For reference
Content Sections
The skill output includes these major sections:CLI Usage
CLI Usage
- Installation options (npm/pnpm/yarn/bunx)
- Session management commands
- Execute code with
-eflag - Quoting rules and multiline code
- Debugging with logfile command
Context Variables
Context Variables
state- Session-isolated persistent storagepage- Default page referencecontext- Browser contextrequire- Node.js module loader- Global variables available
Best Practices
Best Practices
- Initialize state.page first
- Use multiple execute calls for complex logic
- Never close browser/context
- Check state after actions
- Clean up listeners
- Snapshot before screenshot
- Use proper wait strategies
Interaction Feedback Loop
Interaction Feedback Loop
- The observe → act → observe pattern
- Complete workflow examples
- When to wait and retry
- Verifying action results
- Common mistakes to avoid
Advanced Topics
Advanced Topics
- Working with iframes and frames
- Network request interception
- File uploads and downloads
- Authentication patterns
- Debugging with breakpoints
- Live code editing
Related Commands
playwriter logfile- View log file paths for debuggingplaywriter session new- Create a new sessionplaywriter -e- Execute code with the patterns from skill
Notes
The skill.md file is the authoritative source for Playwriter usage. It’s updated with each release to reflect the latest best practices and features.