npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

playwright-ai-debugger

v1.0.0

Published

CLI tool to debug Playwright tests at scale with LLMs

Readme

Playwright AI Debugger

Playwright AI Debugger is a CLI tool to help debug Playwright test failures at scale using LLMs. It analyzes Playwright trace files and generates human-readable insights and an interactive agent to quickly identify root causes.

Note: If you want to help, see the Contributions section below and choose what features you would like to take on.

How it works

Usage Flow:

  1. Run the CLI by givig it the ZIP trace files that Playwright generated.
  2. It returns a list of results for each test with analyses of what went wrong, why and what to do about it.
  3. They can be read in terminal, but for better UX, a HTML page is generated to more easily read them.
  4. User has the ability to enter AI Agent mode where he directly interacts with a certain test and get more debugging info in natural language.
  5. Can loop with a chat-like interface on the same test or choose others to interact with.
Usage: playwright-ai-debugger [options] <zipFiles...>

Arguments:
  zipFiles              ZipFiles with the trace logs from Playwright

Options:
  --api-key             OpenAI API Key

Install

npm install -g playwright-ai-debugger

Note: You will be required for an OpenAI API Key. One can be obtained at: https://platform.openai.com/account/api-keys

Contributions

There are a couple of things that need to be done to be able to use this CLI in a more scalable way:

  1. Most traces will exceed the context window of the LLM. LLMs with bigger context windows can be used, but a strategy to chunk the traces and get responses on them should be implemented.
  2. It needs the option to be given a folder with multiple zips, rather than giving them one by one.
  3. Though the error handling is ok, it should be improved for edge cases, especially if the traces might be corrupted (that happens sometimes with Playwright).
  4. Retry mechanisms with exponential backoff for transient errors (e.g., network issues when calling the LLM API).
  5. If the amount of tests to be analyzed is very high, they need to be added to a queue and provided to the LLMs sequentially so that we stay below the LLM's rate limit. (OpenAI's is relatively high, but for other providers it can be lower).
  6. Add a one-shot or two-shot example to the system prompt with failed playwright tests (traces) and what would be a desirable output from the LLM.
  7. For future: let's use the ink library with React rendering for better UI in the terminal.
  8. Persist the results from previous analyses and have them accessible from the CLI (if the user wants to revisit them).
  9. Some optimization algorithms should be implemented to check if some trace contents are not needed (like in network.trace). The purpose for this is only to minimize the context window for the LLMs and make it cheaper to make runs at scale.
  10. Better normalization should be implemented (the current one is trivial) so that it could be easier to work with traces (group, filter), depending on future features.