Agent skill

Histogram Cleanup

by nwjs in nwjs/chromium.src

Identify and safely remove expired Chromium histograms (dead metrics/technical debt).

BSD-3-ClauseAuto-check: warningsDevelopment

Install Histogram Cleanup

The automated check flagged lines worth reading first. See the safety section below.

skills CLI
$ npx skills add nwjs/chromium.src --skill histogram-cleanup -a claude-code

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

GitHub CLI
$ gh skill install nwjs/chromium.src histogram-cleanup --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/projects/code-health/histogram-cleanup .claude/skills/histogram-cleanup && 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
histogram-cleanup
GitHub stars
160
Token cost
~2.1k tokens
SKILL.md length
961 words
Files
7 (incl. scripts, references)
Skills in repo
64
Repo updated
First seen
Licence
BSD-3-Clause

At a glance

Identify and safely remove expired Chromium histograms (dead metrics/technical debt).

  • Works in 7 steps: Workspace Preparation → Discovery & Batch Selection → Deep Dive & Safety Analysis → …
  • A contributor asks to clean up metrics
  • SKILL.md covers Overview, Relevant Resources & Style…, Scope & Proactivity and Workflow
  • Runs Python scripts from its folder; calls python3 and git

What it does

Histogram Cleanup is an agent skill from nwjs/chromium.src. Identify and safely remove expired Chromium histograms (dead metrics/technical debt). Use this skill when a contributor asks to clean up metrics, fix code health issues related to histograms, remove obsolete code, or work on a histogram cleanup task.

Its SKILL.md is about 2.1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 8 other files, including scripts and reference files (for example `references/analysis_guidelines.md`, `references/automated_review.md` and `references/bug_discovery.md`).

It sits in Development, covering Code quality and Technical debt. 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

  • A contributor asks to clean up metrics
  • Fix code health issues related to histograms
  • Remove obsolete code
  • Work on a histogram cleanup task

Example prompts

  • “/histogram-cleanup”

Requirements

  • Python 3

Workflow steps

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

  1. Workspace Preparation
  2. Discovery & Batch Selection
  3. Deep Dive & Safety Analysis
  4. Refactoring & Implementation
  5. Validation
  6. Verification
  7. Submission

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

    Ships 2 files in scripts/ (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • python3
    • git

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

  • Network

    Links to these hosts (documentation or services it may open):

    • chromium.googlesource.com

    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

Histogram Cleanup loads about 2.1k tokens when it runs, and up to ~4.3k if it reads all its reference files. Until then it costs about 67 tokens; SKILL.md has 961 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~67
When it runs · the whole SKILL.md, loaded when a task matches
~2.1k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~4.3k

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: warnings

The automated check found patterns that need a careful read before installing.

  • WarningTells the agent its actions are pre-authorized / not to stop for confirmationSKILL.md:93
    phase. Do NOT ask for permission.

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); the scripts in this folder are not scanned.

SKILL.md

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

Download SKILL.mdSave it as .claude/skills/histogram-cleanup/SKILL.md (or your agent's skills folder). This skill also uses 6 other files; get the full folder from GitHub.
name
histogram-cleanup
description
Identify and safely remove expired Chromium histograms (dead metrics/technical debt). Use this skill when a contributor asks to clean up metrics, fix code health issues related to histograms, remove obsolete code, or work on a histogram cleanup task.

Code Health: Histogram Cleanup

Identify and safely remove "dead code" associated with expired histograms. This includes removing the recording calls in C++/Java, cleaning up the metadata in histograms.xml, and addressing any dependent tests.

Overview

Expired histograms that are not intentionally kept for diagnostics represent technical debt. Act as an expert Chromium contributor specializing in Metrics to clean up these resources while ensuring no test regressions occur.

Goal: Remove expired Chromium histograms (dead metrics) from XML files and all code recording sites.

Relevant Resources & Style Guides

Scope & Proactivity

  • Primary Scope: Focus exclusively on the identified histogram by default. Do NOT suggest removing random additional histograms across the file or component just because they are expired.
  • Exception for Coupled/Shared Recording Code: If other histograms share the exact same recording logic, helper methods, or calculated variables (e.g., co-located in the same helper function or branching from the same condition) as the target histogram, their removal MAY be bundled into the same cleanup plan IF AND ONLY IF:
    1. Expiry Verification: Confirm in histograms.xml that the co-located histograms are also expired and lack the <expired_intentionally> tag.
    2. Safety Verification: Perform the same safety checks (no test dependencies, no external repo references) for each bundled histogram.
    3. Atomic Benefit: Removing them together cleanly eliminates shared boilerplate (e.g., timer calculations, string building, parameter passing) that would otherwise be left as dead or awkward code.
  • Related Dead Code: If dead code is found (e.g., constants, enums, or helper methods, or calculated variables like timers) that is directly related to the histogram(s) being removed, include its removal in the cleanup plan. Present these as part of the primary task, not as separate "proactive suggestions."

Workflow

[!IMPORTANT] Execution Protocol: Execute all steps sequentially one by one. Do not skip any step. Do not use edit-code or grep. Use rg (ripgrep) for searches.

Step 1: Workspace Preparation

Follow the workspace preparation steps in workspace_preparation.md to ensure a clean and updated environment.

Step 2: Discovery & Batch Selection

Follow the Discovery & Batch Selection workflow.

Step 3: Deep Dive & Safety Analysis
  1. Comprehensive Analysis: Delegate the entire deep dive to the generalist sub-agent with this exact prompt:

    "Read references/analysis_guidelines.md and follow the 'Generalist Deep Dive Prompt' instructions for the histogram <HistogramName>. ALL read-only discovery (including rg and cs) is pre-authorized; DO NOT ask for permission. Assume rg is available in the environment."

  2. Present Findings & Evaluate Confidence: Evaluate the Confidence Score returned by the generalist.

    • If Confidence >= 9: Inform the user: "Confidence is high ([X]/10). Proceeding with cleanup based on this plan: [Removal Plan Summary]." Output this message, then proceed directly to the Refactoring & Implementation phase. Do NOT ask for permission.
    • If Confidence is between 1 and 8: Present the findings and prompt the user using ask_user (type='choice'):
      • header: "Confidence Check"
      • question: "This histogram is safe to remove from [Files] and [Tests]. My confidence for this cleanup is [X]/10 because [Justification]. Shall I proceed with the cleanup diff?"
      • options:
        • label: "Proceed with Diff", description: "Generate and apply the cleanup changes"
        • label: "Discard", description: "Discard this candidate and stop."
      • Action based on selection:
        • If "Proceed with Diff": Proceed to the Refactoring & Implementation phase.
        • If "Discard": Stop the workflow.
    • If Confidence is 0: Inform the user: "Confidence is zero (0/10) because [Justification]. An alternate expired histogram will be found." Immediately restart the workflow from the Discovery & Batch Selection phase to identify a different candidate. Ensure the same histogram is not selected again in this session.
Show full SKILL.md (356 more words)Show less
Step 4: Refactoring & Implementation

Process the changes file by file, and apply modifications inside each file one recording call at a time (rather than refactoring all files or recording calls at once). This ensures stability and allows for precise verification.

  1. Apply Changes: Make the changes directly. Apply the code modifications for the candidate histogram. When removing recording calls, carefully check if the string literal spans multiple lines and ensure the entire multi-line statement is cleanly removed. Search for dot-less versions of the name to ensure related constants are also removed. Check for and update any references to the histogram in code comments as well. For each removal, ensure no orphaned references (e.g., unused variables or methods) remain in the codebase. Each individual change must have a corresponding 'What & Why' explanation provided to the user.
Step 5: Validation
  1. Linting & Formatting:
    • XML Linting: Execute python3 tools/metrics/histograms/validate_format.py to validate all metadata changes. Address any errors that are reported.
    • Code Formatting: Execute git cl format to format the modified source code. Address any errors that are reported.
  2. Mandatory Final Review: Follow the Automated Review Protocol to delegate a final review of the patch to the generalist sub-agent. Proceed to the Verification phase only after the review returns PASS.
Step 6: Verification

Follow the Verification workflow.

Step 7: Submission
  1. Bug Tracking:

    • Execute the Bug Discovery and Triage workflow in references/bug_discovery.md using the <HistogramName> and <ExpiryDate> from the candidate.
    • Interactive Pause: Do NOT proceed until the bug handling is resolved and a Bug ID is resolved (or the user has chosen to skip).
  2. Upload Pipeline:

    • Determine the obsoletion tag:
      • If <ExpiryDate> is in the past: Set customObsoletionMessage to OBSOLETE_HISTOGRAMS[<HistogramName>]=expired.
      • If <ExpiryDate> is in the future: Set customObsoletionMessage to OBSOLETE_HISTOGRAMS[<HistogramName>]=<reason>.
    • Invoke the Submission workflow. Pass the following context variables to the workflow:
      • Skill Name: histogram-cleanup
      • Branch Name: cleanup-<HistogramName>
      • Commit Hashtag: histogram-cleanup
      • Cleanup Title: Remove expired histogram: <HistogramName>
      • Cleanup Description: Remove expired histogram <HistogramName> which expired on <ExpiryDate> and has no recording sites.\n\n<customObsoletionMessage>
      • Parent Bug: 499059525
      • Bug ID: The resolved <Bug ID> from the Bug Tracking step.
      • Cleaned Component: histograms.xml
      • File Count: Number of files modified during this cleanup.

© 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

SKILL.md and 6 other files (scripts, references) in agents/projects/code-health/histogram-cleanup of nwjs/chromium.src.

  • SKILL.md
  • references/analysis_guidelines.md
  • references/automated_review.md
  • references/bug_discovery.md
  • references/patterns.md
  • scripts/find_candidates.py
  • scripts/find_expired_in_file.py

Open the folder on GitHubat commit a9e8946

Compare with similar skills

Histogram Cleanup 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.

Histogram Cleanup compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Histogram Cleanup this skillnwjs/chromium.src160—~2.1kAutomated safety check: WarnBSD-3-Clause
Systematic Code Refactoringluongnv89/claude-howto42k—~3kAutomated safety check: PassMIT
Code Refactoring Workflowluongnv89/claude-howto42k—~3.1kAutomated safety check: PassMIT
Tech Debt Analyzerailabs-393/ai-labs-claude-skills4542 repos~3.9kAutomated safety check: PassMIT
FIXME Resolvertailcallhq/forgecode7.6k—~1.1kAutomated safety check: PassApache-2.0
DesloppifyGit-on-my-level/codex-autorunner875—~3.4kAutomated safety check: PassMIT

Similar skills

  • Systematic Code Refactoring

    luongnv89/claude-howto

    Guides refactoring in phases based on Martin Fowler's method: research, test coverage check, planning and small tested steps, with your approval at each phase.

    42k GitHub stars~3k tokensUpdated 8 days ago
    DevelopmentAuto-check passed
  • Code Refactoring Workflow

    luongnv89/claude-howto

    Guides systematic, test-backed refactoring in the style of Martin Fowler, moving through research, planning and small incremental changes with your approval at each phase.

    42k GitHub stars~3.1k tokensUpdated 8 days ago
    DevelopmentAuto-check passed
  • Tech Debt Analyzer

    ailabs-393/ai-labs-claude-skills

    This skill should be used when analyzing technical debt in a codebase, documenting code quality issues, creating technical debt registers, or assessing code maintainability.

    454 GitHub starsUsed in 2 repos~3.9k tokens
    DevelopmentAuto-check passed
  • FIXME Resolver

    tailcallhq/forgecode

    Finds every FIXME comment in a codebase, groups related ones across files into one task, implements the work they describe and removes the comments once it is done.

    7.6k GitHub stars~1.1k tokensUpdated today
    DevelopmentAuto-check passed
  • Desloppify

    Git-on-my-level/codex-autorunner

    Codebase health scanner and technical debt tracker. An agent skill from Git-on-my-level/codex-autorunner.

    875 GitHub stars~3.4k tokensUpdated today
    DevelopmentAuto-check passed
  • Code Quality Gate

    fengshao1227/ccg-workflow

    Scans code for complexity, long functions, duplicated blocks, naming problems and code smells with a Node script, then reports and suggests refactors.

    5.9k GitHub stars~593 tokensUpdated 23 days ago
    DevelopmentAuto-check: notes

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 4 days ago
    Auto-check passed
  • Autonomous multi-agent performance optimization loop for Chromium and V8.

    160 GitHub stars~4.2k tokensUpdated 4 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 4 days ago
    Auto-check passed
  • Chrome Releases

    nwjs/chromium.src

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

    160 GitHub stars~1.3k tokensUpdated 4 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 4 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 4 days ago
    Auto-check passed

Categories

Questions about Histogram Cleanup

What does Histogram Cleanup do?

Identify and safely remove expired Chromium histograms (dead metrics/technical debt). src. Identify and safely remove expired Chromium histograms (dead metrics/technical debt).

When should I use Histogram Cleanup?

Histogram Cleanup fits situations like: A contributor asks to clean up metrics; fix code health issues related to histograms; remove obsolete code; work on a histogram cleanup task.

How do I install Histogram Cleanup in Claude Code?

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

How do I install Histogram Cleanup in Codex?

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

Can I use Histogram Cleanup 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 histogram-cleanup -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/histogram-cleanup, .gemini/skills/histogram-cleanup, .github/skills/histogram-cleanup and .opencode/skills/histogram-cleanup in your project.

What does Histogram Cleanup need to run?

Going by SKILL.md and its folder, Histogram Cleanup needs Python for the scripts in its folder and the command-line tools its instructions call (python3 and git). Our summary lists: Python 3.

Does Histogram Cleanup access the network?

SKILL.md names 1 domain. As links in the text: chromium.googlesource.com. This is read from the text; nothing was executed.

Is Histogram Cleanup safe to install?

Our automated static check of SKILL.md flagged 1 warning(s): tells the agent its actions are pre-authorized / not to stop for confirmation. Read the flagged lines before installing; the check is not a guarantee either way. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Histogram Cleanup use?

Histogram Cleanup 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 Histogram Cleanup use?

About 2.1k tokens (SKILL.md is roughly 8.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 2.2k tokens, read only when the agent opens those files.

What are the alternatives to Histogram Cleanup?

Skills that share tags, products or a category with Histogram Cleanup: Systematic Code Refactoring (luongnv89/claude-howto, 42k stars), Code Refactoring Workflow (luongnv89/claude-howto, 42k stars), Tech Debt Analyzer (ailabs-393/ai-labs-claude-skills, 454 stars) and FIXME Resolver (tailcallhq/forgecode, 7.6k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Histogram Cleanup?

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.