When you need external documentation about a library, framework, or API, use the
playwright-cli skill (or
) and apply these techniques in order — stop as soon as you have what you need:
Persist useful findings to : When you fetch a document worth keeping for future sessions (API references, SDK guides, troubleshooting docs), save it to
research/web/<YYYY-MM-DD>-<kebab-case-topic>.md
with a short header noting the source URL and fetch date. Check this directory first before re-fetching.
-
Code Context Analysis
- Identify the programming language and framework
- Understand the broader context and purpose of the code
- Identify the file location and its role in the project
- Review related imports, dependencies, and configurations
-
High-Level Overview
- Provide a summary of what the code does
- Explain the main purpose and functionality
- Identify the problem the code is solving
- Describe how it fits into the larger system
-
Code Structure Breakdown
- Break down the code into logical sections
- Identify classes, functions, and methods
- Explain the overall architecture and design patterns
- Map out data flow and control flow
-
Line-by-Line Analysis
- Explain complex or non-obvious lines of code
- Describe variable declarations and their purposes
- Explain function calls and their parameters
- Clarify conditional logic and loops
-
Algorithm and Logic Explanation
- Describe the algorithm or approach being used
- Explain the logic behind complex calculations
- Break down nested conditions and loops
- Clarify recursive or asynchronous operations
-
Data Structures and Types
- Explain data types and structures being used
- Describe how data is transformed or processed
- Explain object relationships and hierarchies
- Clarify input and output formats
-
Framework and Library Usage
- Explain framework-specific patterns and conventions
- Describe library functions and their purposes
- Explain API calls and their expected responses
- Clarify configuration and setup code
- Use the playwright-cli skill (following the Web Fetch Strategy above) to look up external library documentation when needed
-
Error Handling and Edge Cases
- Explain error handling mechanisms
- Describe exception handling and recovery
- Identify edge cases being handled
- Explain validation and defensive programming
-
Performance Considerations
- Identify performance-critical sections
- Explain optimization techniques being used
- Describe complexity and scalability implications
- Point out potential bottlenecks or inefficiencies
-
Security Implications
- Identify security-related code sections
- Explain authentication and authorization logic
- Describe input validation and sanitization
- Point out potential security vulnerabilities
-
Testing and Debugging
- Explain how the code can be tested
- Identify debugging points and logging
- Describe mock data or test scenarios
- Explain test helpers and utilities
- Use to reproduce browser interactions and validate frontend behavior when applicable
-
Dependencies and Integrations
- Explain external service integrations
- Describe database operations and queries
- Explain API interactions and protocols
- Clarify third-party library usage
-
Common Patterns and Idioms
- Identify language-specific patterns and idioms
- Explain design patterns being implemented
- Describe architectural patterns in use
- Clarify naming conventions and code style
-
Potential Improvements
- Suggest code improvements and optimizations
- Identify possible refactoring opportunities
- Point out maintainability concerns
- Recommend best practices and standards
-
Related Code and Context
- Reference related functions and classes
- Explain how this code interacts with other components
- Describe the calling context and usage patterns
- Point to relevant documentation and resources
-
Debugging and Troubleshooting
- Explain how to debug issues in this code
- Identify common failure points
- Describe logging and monitoring approaches
- Suggest testing strategies