@waynest/polarizer
v0.1.0
Published
Transform playwright-cli snapshots into compact, LLM-friendly text
Maintainers
Readme
polarizer
CLI to transform playwright-cli snapshot YAML into compact, LLM-friendly text (or JSON).
Install
npm install -g @waynest/polarizer
# or (no install)
npx -y @waynest/polarizer --helpQuick start
Prereqs:
- Node.js (>= 20)
playwright-cliinstalled and working
Run on a saved snapshot:
polarizer --input path/to/page.yml --filter interactive --text context --format textCLI usage
polarizer --helpCommon options:
--input <file>: snapshot YAML file (default: stdin)--format <text|compact|json>: output format--filter <all|interactive>: keep everything or interactive elements only--text <none|context|all>: control non-interactive text inclusion--max-tokens <n>: approximate token budget (adds a truncation marker when used)--base-url <url>: resolve relative/url:values to absolute URLs
Diff two snapshots:
polarizer diff --prev before.yml --curr after.yml --format compactEnd-to-end (real page) validation
Hacker News:
npm run e2e:hnThis writes artifacts under artifacts/e2e/hn-*/, including:
raw.yml(playwright snapshot)polarized.txt(full output)polarized.llm.txt(token-limited output)
Standalone quality judge (Codex):
npm run judge:hnThe judge report is saved to artifacts/e2e/hn-*/judge.md.
GitHub repo (microsoft/playwright):
npm run e2e:github-playwright
npm run judge:github-playwrightWSJ homepage (may return an anti-bot interstitial depending on network conditions):
npm run e2e:wsj
npm run judge:wsjDiff validation (controlled page mutation via TodoMVC):
npm run e2e:diffTests / checks
npm test
npm run typecheck
npm run lintDevelopment
npm install
npm run build