Logo Chrome Trace

Chrome Trace

Tổ chức
layoutit
chrome-trace

Capture and analyze Chrome/Chromium performance traces with Playwright around a concrete browser interaction. Use when Codex needs to answer where frame time is spent during an update, drag, rotation, scroll, animation, camera movement, light movement, DOM/CSS render change, or other performance-sensitive UI action; especially when the right answer requires per-frame Chrome trace evidence instead of FPS-only guesses.

Tổng quan

Nhà phát hànhlayoutit
Kho mãpolycss
Tên kỹ năngchrome-trace
Sao
768
Bản fork
22
Tệp đi kèm
5
Giấy phépMIT
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI là Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • 5 tệp đi kèm

    Các tập lệnh, mẫu và tài liệu tham khảo mà mô hình có thể đọc khi làm việc. Các tệp chỉ cho phép đọc và không bao giờ được thực thi.

  • Mã nguồn mở

    Được layoutit công bố trên GitHub. Hãy đọc nội dung nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Chrome Trace trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL thư mục kỹ năng bên dưới và xác nhận.
    https://github.com/layoutit/polycss/tree/main/.agents/skills/chrome-trace
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/layoutit/polycss.git /tmp/polycss
mkdir -p .claude/skills
cp -r /tmp/polycss/.agents/skills/chrome-trace .claude/skills/chrome-trace
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Chrome Trace trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự tải Chrome Trace ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên Chrome Trace không bị giới hạn ở mô hình mà kỹ năng này được viết cho. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên kỹ năng chưa dùng không tốn chi phí.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

Chrome Trace

Core Workflow

Use Playwright with Chromium and the Chrome DevTools Protocol Tracing domain to capture the exact interaction under investigation.

  1. Start from a reproducible page and action.
  2. Warm up the page until app-specific readiness is true.
  3. Start Chrome tracing and a requestAnimationFrame sampler immediately before the action.
  4. Mark the action window with performance.mark() and console.timeStamp().
  5. Perform the action with real Playwright input when the user is asking about input-driven behavior.
  6. Stop tracing after a short settle window.
  7. Align trace event timestamps to performance.now() using the start/end marks.
  8. Report where time went: Scripting, Style, Layout, PrePaint, Paint, compositor main-thread work, compositor impl-thread work, raster, GPU/viz events, and the slowest frame windows.

Do not draw conclusions from FPS alone. Use FPS/frame-time summaries only as the symptom; use trace groups and top events as the explanation.

PolyCSS Trace Runners

Use scripts/trace.mjs as the front door:

bash
pnpm bench:build
node .agents/skills/chrome-trace/scripts/trace.mjs motion --page nonvoxel --mesh glb:Elephant.glb --variant baseline --dom-samples --label elephant-baseline
node .agents/skills/chrome-trace/scripts/trace.mjs motion --page nonvoxel --mesh teapot --variant baseline --dom-samples --frame-details --layer-details --gpu-details --trace-out bench/results/teapot.trace.json --label teapot-enriched --report
node .agents/skills/chrome-trace/scripts/trace.mjs motion --page nonvoxel --mesh teapot --variant baseline --gpu-details full --trace-out bench/results/teapot-full-gpu.trace.json --label teapot-full-gpu
node .agents/skills/chrome-trace/scripts/trace.mjs drag --mesh teapot --mode baked --frame-details --label teapot-drag
node .agents/skills/chrome-trace/scripts/trace.mjs motion --mesh garden --report --markdown-out bench/results/garden-trace.md
node .agents/skills/chrome-trace/scripts/trace.mjs compare bench/results/before.json bench/results/after.json --markdown-out bench/results/trace-compare.md

Use trace.mjs motion for steady bench motion across perf and nonvoxel pages, cadence buckets, DOM samples, render stats, and tag counts.

Add --frame-details to motion traces when you need slowest/fastest frame attribution instead of only bucket averages. On nonvoxel pages this also enables page-work samples for camera.update, scene.applyCamera, and input/control callbacks when available. Add --layer-details when compositor/layer shape is part of the question; it records LayerTree counts, layer aggregates by DOM tag/class (leaf:b, leaf:u, polycss-camera, etc.), largest layers, and compositing reasons. Add --trace-out when the raw Chrome trace should be preserved for DevTools.

Add --gpu-details when render pass timing is the current question and the trace still needs to stay reasonably sized. Light mode keeps the normal GPU/viz timeline categories and adds only disabled-by-default-viz.gpu_composite_time; render-pass attribution still comes from base events such as DirectRenderer::DrawFrame and DirectRenderer::DrawRenderPass. It intentionally avoids per-quad, Skia command, and GPU service spam.

Use --deep-gpu or --gpu-details full only for rare forensic runs that truly need per-quad/Skia/overdraw detail. Full mode also enables disabled-by-default-viz.quads, disabled-by-default-viz.triangles, disabled-by-default-viz.overdraw, disabled-by-default-gpu.debug, and disabled-by-default-skia.gpu; raw traces can become hundreds of MB and timing can be heavily perturbed.

Use trace.mjs drag for real PolyOrbitControls pointer-drag traces on nonvoxel-vanilla.html. This runner knows the non-voxel readiness hooks, camera state, interaction stats, and per-frame page-work samples.

Use trace.mjs generic for arbitrary pages and interactions that are not covered by a polycss bench page.

When interpreting PolyCSS traces, map the result back to the render model:

  • FunctionCall, EventDispatch, FireAnimationFrame: JS/input work. Unexpected sustained per-frame work is suspicious outside imported skeletal animation.
  • UpdateLayoutTree, RecalculateStyles: style recalculation, often CSS variable or selector invalidation cost.
  • Layout: layout; should stay low for transform/CSS-var-driven motion.
  • PrePaint, Paint, PaintArtifactCompositor::Update, Layerize: paint/compositing setup.
  • LayerTreeImpl::UpdateDrawProperties, draw_property_utils::ComputeDrawPropertiesOfVisibleLayers, LayerTreeHostImpl::PrepareToDraw, MainFrame.Draw, SubmitCompositorFrame: compositor-side cost.
  • Graphics.Pipeline, DisplayScheduler::DrawAndSwap, DirectRenderer::DrawFrame, DirectRenderer::DrawRenderPass: GPU/viz drawing pipeline. Treat these as browser output work, and compare them against layer details before changing app JS.
  • gpuVizRenderPass, gpuVizTiles, gpuVizGpuService: opt-in --gpu-details attribution buckets for render pass, coarse tile/raster playback, and GPU service events.
  • gpuVizQuads and gpuVizSkia: usually require --gpu-details full / --deep-gpu; treat them as high-overhead forensic signals.
  • RasterTask, image decode events: raster/bitmap work, usually atlas or tile work.

Trace event durations are inclusive and often nested, especially GPU/viz and scheduler events. Use group ms/frame as attribution evidence and for before/after deltas, not as exclusive slices that must add up to frame time.

Generic Capture

For arbitrary pages, use trace.mjs generic:

bash
node .agents/skills/chrome-trace/scripts/trace.mjs generic \
  --url http://127.0.0.1:3000 \
  --ready-js "window.appReady === true" \
  --action drag \
  --selector "#viewport" \
  --drag "480,0" \
  --duration 1200 \
  --steps 90 \
  --summary-out trace-summary.json \
  --trace-out trace.json

Useful alternatives:

bash
node .agents/skills/chrome-trace/scripts/trace.mjs generic --url http://127.0.0.1:3000 --action wait --sample 3000
node .agents/skills/chrome-trace/scripts/trace.mjs generic --url http://127.0.0.1:3000 --action eval --eval "window.rotateScene?.(Math.PI / 2)"
node .agents/skills/chrome-trace/scripts/trace.mjs generic --url http://127.0.0.1:3000 --action scroll --scroll "0,900"

Comparing Runs

Use --report on a runner to generate a Markdown report after capture, or use trace.mjs report on an existing summary JSON:

bash
node .agents/skills/chrome-trace/scripts/trace.mjs report bench/results/garden.json --markdown-out bench/results/garden.md

Use trace.mjs compare on summary JSON files from any runner:

bash
node .agents/skills/chrome-trace/scripts/trace.mjs compare before.json after.json --markdown-out trace-compare.md

Read positive deltas in frame_time_*_ms and trace group ms/frame as more expensive after the change. Read positive FPS deltas as better. Reports include a Quick Read section that calls out p95 frame time and the dominant trace group.

Reporting

Keep the report evidence-led and compact:

  • State the exact command, page, viewport, action, warmup, and sample/settle windows.
  • Include frame-time p50/p95/p99 and slowest-frame count.
  • Identify the dominant trace groups in the action window.
  • Name the top Chrome events, not only broad categories.
  • For polycss, explicitly say whether the trace supports or violates the "no JS in the render loop" expectation.
  • Mention artifacts written, especially the raw trace JSON that can be opened in Chrome DevTools Performance.

If trace markers are missing, say that alignment is weaker and rerun with marks before making a firm claim.

Tệp đi kèm

Mô hình đọc các tệp này khi cần trong lúc kỹ năng được tải. Các tệp được cung cấp ở dạng có thể đọc và không bao giờ được thực thi.

Câu hỏi thường gặp

Kỹ năng AI Chrome Trace làm được gì?

Capture and analyze Chrome/Chromium performance traces with Playwright around a concrete browser interaction. Use when Codex needs to answer where frame time is spent during an update, drag, rotation, scroll, animation, camera movement, light movement, DOM/CSS render change, or other performance-sensitive UI action; especially when the right answer requires per-frame Chrome trace evidence instead of FPS-only guesses.

Vì sao nên dùng Chrome Trace trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Chrome Trace là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Chrome Trace trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/layoutit/polycss/tree/main/.agents/skills/chrome-trace. TypingMind đọc tệp SKILL.md, đóng gói các tệp đi kèm và cài đặt thành một kỹ năng mà bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Chrome Trace?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Bạn có thể dùng Chrome Trace với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Chrome Trace với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Chrome Trace có miễn phí không?

Có. Kỹ năng này được layoutit phát hành trên GitHub theo giấy phép MIT. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp cho mô hình các công cụ mới để gọi — mã được chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và tiêu chí của đầu ra tốt. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇