Agent skill

Latency Instrumentation

by nwjs in nwjs/chromium.src

Surgically injects trace macros (TRACEEVENT) into Chromium C++ files to expose "black box" latency gaps, resolves headers, and compiles the browser using a self-healing loop.

BSD-3-ClauseAuto-check passedDevelopment

Install Latency Instrumentation

skills CLI
$ npx skills add nwjs/chromium.src --skill latency-instrumentation -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install nwjs/chromium.src latency-instrumentation --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/nwjs/chromium.src.git skills-src && mkdir -p .claude/skills && cp -r skills-src/agents/skills/latency-instrumentation .claude/skills/latency-instrumentation && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
latency-instrumentation
GitHub stars
160
Token cost
~1.2k tokens
SKILL.md length
498 words
Files
1
Skills in repo
64
Repo updated
First seen
Licence
BSD-3-Clause

At a glance

Surgically injects trace macros (TRACEEVENT) into Chromium C++ files to expose "black box" latency gaps, resolves headers, and compiles the browser using a self-healing loop.

  • Works in 3 steps: Prerequisites & Input Context → Workflow → Output Contract
  • Tasks that involve Performance optimization
  • SKILL.md covers ⚠️ CRITICAL DESIGN CONSTRAINT:…, 1. Prerequisites & Input Context, 2. Workflow and 3. Output Contract
  • Calls git and rg

What it does

Latency Instrumentation is an agent skill from nwjs/chromium.src. Surgically injects trace macros (TRACEEVENT) into Chromium C++ files to expose "black box" latency gaps, resolves headers, and compiles the browser using a self-healing loop. Strictly no performance optimizations or refactoring.

Its SKILL.md is about 1.2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development, covering Performance optimization and Refactoring. It works with C++. The repository describes itself as: Chromium codebase with NW.js modifications. Based on https://chromium.googlesource.com/chromium/src.git. The licence is BSD-3-Clause.

When your agent uses it

  • Tasks that involve Performance optimization
  • Tasks that involve Refactoring

Example prompts

  • “black box”
  • “/latency-instrumentation”

Workflow steps

3 steps, taken from the step headings in SKILL.md.

  1. Prerequisites & Input Context
  2. Workflow
  3. Output Contract

What it can do on your machine

Read from SKILL.md and the folder at commit a9e8946. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • git
    • rg

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Latency Instrumentation loads about 1.2k tokens when it runs. Until then it costs about 63 tokens; SKILL.md has 498 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~63
When it runs · the whole SKILL.md, loaded when a task matches
~1.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from nwjs/chromium.src at commit a9e8946, republished under its BSD-3-Clause licence (© nwjs). 498 words, ~1,168 tokens.

Download SKILL.mdSave it as .claude/skills/latency-instrumentation/SKILL.md (or your agent's skills folder).
name
latency-instrumentation
description
Surgically injects trace macros (TRACE_EVENT) into Chromium C++ files to expose "black box" latency gaps, resolves headers, and compiles the browser using a self-healing loop. Strictly no performance optimizations or refactoring.

Latency Instrumentation & Self-Healing Compile Loop

This skill guides the agent through surgically injecting TRACE_EVENT macros into Chromium C++ files to break down uninstrumented main-thread blocking gaps ("black boxes") and verifying the changes via an automated compilation loop.

⚠️ CRITICAL DESIGN CONSTRAINT: NO OPTIMIZATIONS

This skill is strictly for data collection and instrumentation. You MUST NOT make any performance optimization or refactoring changes (such as caching, background-thread offloading, or logic restructuring). Your sole purpose is to add instrumentation to help the Trace Analyzer drill down into untraced gaps.


1. Prerequisites & Input Context

Before executing this skill, you must have:

  • target_method: The fully qualified C++ method name (e.g. LocationIconView::Update).
  • category: The trace category (e.g., "omnibox", "navigation").
  • instructions: Step-by-step C++ trace injection instructions (e.g., identifying loops or blocks to wrap).
  • parent_session_id: The unique session ID.
Sandbox & Safety (Zero-Grant Rule)
  • ALWAYS format all modified C++ files using git cl format immediately after editing.
  • ALWAYS commit successful changes locally on the active E2E branch to checkpoint progress. Never create a CL or push to remote.
  • If compilation fails after the self-healing loop, ALWAYS revert all uncommitted changes using git reset --hard HEAD to cleanly restore the last successful iteration's checkpoint.

2. Workflow

Step 1: Locate target files

Use the codesearch tool to find the .cc and .h files declaring the target_method. Example:

query
lang:cpp "LocationIconView::Update"

If remote search yields zero results (common for unsubmitted local edits), run local ripgrep:

bash
rg -n --type cpp "LocationIconView::Update"

Read the files using view_file.

Step 2: Identify Method Boundaries

Analyze the C++ source file to find the exact start and end lines of the target_method. Take care to match namespace scope, class qualifiers, and specific overloads.

Show full SKILL.md (242 more words)Show less
Step 3: Surgically Inject Trace Macros
  1. Parse the code within the identified method boundaries to locate internal sub-operations (e.g., heavy loops, helper function calls, or large nested blocks).
  2. Wrap these blocks in scoped trace macros:
    cpp
    {
      TRACE_EVENT0("category", "ParentMethodName::SubBlockName");
      // original code block
    }
  3. Verify if #include "base/trace_event/trace_event.h" is present at the top of the C++ file. If missing, inject it programmatically inside the include section.
  4. CRITICAL: Use file content modificatio tools for all modifications. NEVER use command-line tools like sed or cat << 'EOF'.
  5. Run git cl format <modified_files> via run_command to format the code.
Step 4: Rebuild & Self-Healing Loop (Max 3 Attempts)

You are allowed up to 3 total compilation attempts to resolve any syntax, missing include, or structural errors:

  1. Trigger Build: Run autoninja to compile:
    bash
    autoninja -C out/Default chrome
  2. Success & Checkpoint: If it compiles successfully:
    • Run git add <modified_files> (add files manually, avoid wildcards).
    • Run git commit -m "feat(e2e-nla): Instrument [target_method]" to checkpoint your progress.
    • Report success and stop.
  3. Failure & Repair Heuristics:
    • Parse the compiler stderr output.
    • Identify the compilation error (e.g., namespace collision, undeclared identifier, missing header).
    • Apply a targeted code repair using code editing tools.
    • Re-run autoninja.
  4. Revert on Hard Failure: If all 3 attempts fail, run git reset --hard HEAD to revert all uncommitted modifications back to the last successful checkpoint (preserving previous successful iterations), and report failure.

3. Output Contract

Report back with a JSON payload matching this structure:

json
{
  "status": "SUCCESS" | "FAILED",
  "modified_files": ["chrome/browser/...cc"],
  "compile_output": "Compiler logs or error details"
}

© nwjs, BSD-3-Clause. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in agents/skills/latency-instrumentation of nwjs/chromium.src.

Open the folder on GitHubat commit a9e8946

Compare with similar skills

Latency Instrumentation next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Latency Instrumentation compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Latency Instrumentation this skillnwjs/chromium.src160—~1.2kAutomated safety check: PassBSD-3-Clause
Svelte5 Best PracticesSikandarJODD/cnblocks4301 repos~810Automated safety check: PassMIT
ExecuTorch Binary Size Reductionpytorch/executorch5.1k—~793Automated safety check: PassCustom licence
React Best Practicesshapeshift/web2061 repos~2kAutomated safety check: PassMIT
Cppcrazyguitar/cppcheatsheet290—~1.8kAutomated safety check: PassMIT
Embedded Cpp14 MisraBlueAndi/Pixelix443—~2kAutomated safety check: PassMIT

Similar skills

  • Svelte5 Best Practices

    SikandarJODD/cnblocks

    Svelte 5 runes, snippets, SvelteKit patterns, and modern best practices for TypeScript and component development.

    430 GitHub starsUsed in 1 repo~810 tokens
    DevelopmentAuto-check passed
  • Measures and shrinks the ExecuTorch runtime binary by building a size test, analyzing it with bloaty and landing each reduction as its own pull request.

    5.1k GitHub stars~793 tokensUpdated today
    DevelopmentAuto-check passed
  • React Best Practices

    shapeshift/web

    Comprehensive React and Next.js performance optimization guide with 40+ rules for eliminating waterfalls, optimizing bundles, and improving rendering.

    206 GitHub starsUsed in 1 repo~2k tokens
    DevelopmentAuto-check passed
  • Cpp

    crazyguitar/cppcheatsheet

    Comprehensive C/C++ programming reference covering everything from C11-C23 and C++11-C++23, system programming, CUDA GPU computing, debugging tools, Rust interop, and advanced topics.

    290 GitHub stars~1.8k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Embedded Cpp14 Misra

    BlueAndi/Pixelix

    A skill your agent uses when writing, reviewing, or refactoring C/C++ firmware code in this repository (src/, lib/, test/) — creating or editing .h/.hpp/.cpp files, applying MISRA-oriented and…

    443 GitHub stars~2k tokensUpdated today
    DevelopmentAuto-check passed
  • Nuxt Best Practices

    vinayakkulkarni/nxui

    Nuxt 4 performance optimization and architecture guidelines (current through Nuxt 4.5) for building fast, maintainable full-stack applications.

    212 GitHub stars~1.5k tokensUpdated today
    DevelopmentAuto-check passed

More from nwjs/chromium.src

All 64 skills in this repo
  • Analyzing SQL Traces

    nwjs/chromium.src

    Extracts raw trace data from Perfetto traces, runs arbitrary SQL queries for custom follow-up analysis, and applies expert cognitive principles (Tiered Flow Analysis, Semantic Mismatch, Redundancy)…

    160 GitHub stars~2.9k tokensUpdated 5 days ago
    Auto-check passed
  • Autonomous multi-agent performance optimization loop for Chromium and V8.

    160 GitHub stars~4.2k tokensUpdated 5 days ago
    Auto-check passed
  • Automated Tracing

    nwjs/chromium.src

    Automated Tracing & Performance Telemetry in Chromium using Perfetto and Telemetry benchmarks.

    160 GitHub stars~1.5k tokensUpdated 5 days ago
    Auto-check passed
  • Chrome Releases

    nwjs/chromium.src

    Queries Chrome commit, version, release, and milestone metadata.

    160 GitHub stars~1.3k tokensUpdated 5 days ago
    Auto-check passed
  • Chromium Docs

    nwjs/chromium.src

    Search and reference Chromium documentation from the local docs index, including design docs, APIs, and development guides.

    160 GitHub stars~1.2k tokensUpdated 5 days ago
    Auto-check passed
  • Gn Deps Debugging

    nwjs/chromium.src

    Diagnose Chromium GN dependency and include-visibility failures, including BUILD.gn deps/publicdeps, DEPS include rules, private headers, and circular dependencies.

    160 GitHub stars~1.5k tokensUpdated 5 days ago
    Auto-check passed

Works with

Categories

Questions about Latency Instrumentation

What does Latency Instrumentation do?

Surgically injects trace macros (TRACEEVENT) into Chromium C++ files to expose "black box" latency gaps, resolves headers, and compiles the browser using a self-healing loop. src. Surgically injects trace macros (TRACEEVENT) into Chromium C++ files to expose "black box" latency gaps, resolves headers, and compiles the browser using a self-healing loop.

When should I use Latency Instrumentation?

Latency Instrumentation fits situations like: tasks that involve Performance optimization; tasks that involve Refactoring.

How do I install Latency Instrumentation in Claude Code?

Run `npx skills add nwjs/chromium.src --skill latency-instrumentation -a claude-code`. Or copy the skill folder (agents/skills/latency-instrumentation in nwjs/chromium.src) into .claude/skills/latency-instrumentation in your project. Claude Code loads it when a task matches its description.

How do I install Latency Instrumentation in Codex?

Run `npx skills add nwjs/chromium.src --skill latency-instrumentation -a codex`. Or copy the skill folder (agents/skills/latency-instrumentation in nwjs/chromium.src) into .agents/skills/latency-instrumentation in your project. Codex loads it when a task matches its description.

Can I use Latency Instrumentation in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add nwjs/chromium.src --skill latency-instrumentation -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/latency-instrumentation, .gemini/skills/latency-instrumentation, .github/skills/latency-instrumentation and .opencode/skills/latency-instrumentation in your project.

What does Latency Instrumentation need to run?

Going by SKILL.md and its folder, Latency Instrumentation needs the command-line tools its instructions call (git and rg).

Does Latency Instrumentation access the network?

SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Latency Instrumentation safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Latency Instrumentation use?

Latency Instrumentation is published under the BSD-3-Clause licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Latency Instrumentation use?

About 1.2k tokens (SKILL.md is roughly 4.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Latency Instrumentation?

Skills that share tags, products or a category with Latency Instrumentation: Svelte5 Best Practices (SikandarJODD/cnblocks, 430 stars), ExecuTorch Binary Size Reduction (pytorch/executorch, 5.1k stars), React Best Practices (shapeshift/web, 206 stars) and Cpp (crazyguitar/cppcheatsheet, 290 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Latency Instrumentation?

nwjs (a GitHub organization) maintains it in nwjs/chromium.src, which has 160 GitHub stars. The repository holds 64 skills in this directory. The repository was last updated on October 3, 2026.

Source: nwjs/chromium.src on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.