histogram-cleanup
Skill by chromium
Finds and removes expired Chromium histograms, including recording calls, histograms.xml entries and dependent tests. Built for Chromium contributors working on metrics cleanup and code health.
Install histogram-cleanup
Built from the published package, never by AI.
git clone --depth 1 https://github.com/chromium/chromium /tmp/chromium && mkdir -p ~/.claude/skills && cp -r /tmp/chromium/agents/projects/code-health/histogram-cleanup ~/.claude/skills/histogram-cleanupRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/chromium/chromium /tmp/chromium && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/chromium/agents/projects/code-health/histogram-cleanup ~/.gemini/antigravity-cli/skills/histogram-cleanupAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Skills can run scripts on your machine. Some need an API key: check the README.
About
The histogram-cleanup skill helps a Chromium contributor find and remove expired histograms, which the source describes as dead metrics or technical debt. It removes recording calls in C++ and Java, cleans up the matching entries in histograms.xml, and addresses dependent tests. Work is limited to the histograms.xml files listed in safe_dirs.md.
The workflow prepares a workspace, selects candidates, runs a deep dive with a confidence score, and applies changes one recording call at a time. It then runs format, lint and automated review steps, checks for open expiry bugs in Buganizer, and generates a commit message. It is written for Chromium contributors doing metrics cleanup or code health tasks.
Written from the project's SKILL.md and checked against it.
What it can do
- Workspace preparationRuns a script to prepare the workspace and stops if the tree is dirty or diverged.
- Discovery and batch selectionFinds expired candidate histograms within the allowlisted histograms.xml files.
- Deep dive and safety analysisDelegates analysis to a sub-agent that returns a removal plan and a confidence score.
- Code removalRemoves recording calls, related constants, comments and orphaned code, file by file.
- Formatting and automated reviewRuns a format and lint script and an automated review using cleanup rules.
- VerificationFollows a shared verification workflow after the changes are made.
- Expiry bug lookupSearches Buganizer for open expiry tracking bugs for each cleaned histogram.
- Commit message generationBuilds a commit message with an OBSOLETE_HISTOGRAMS line and validates it.
- Reviewer selectionSuggests a reviewer from the histogram's XML owners in their listed order.
What you need
- Python 3
- ripgrep (rg)
- Buganizer access for expiry bug lookup
Try asking
- Find an expired histogram to clean up in an allowlisted histograms.xml
- Remove the recording calls and XML entry for an expired histogram
- Generate a commit message for a histogram cleanup change
Good to know
- Only histograms.xml files listed in safe_dirs.md can be examined or edited.
- Focuses on one histogram by default and bundles others only when recording code is shared.
- Asks the user for input when confidence is between 1 and 8 or the out directory is missing.
- Does not file new bugs or prompt for expiry bug IDs.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: agents/projects/code-health/histogram-cleanup/SKILL.md, agents/projects/code-health/histogram-cleanup/scripts/find_candidates.py, agents/projects/code-health/histogram-cleanup/scripts/find_candidates_test.py, agents/projects/code-health/histogram-cleanup/scripts/find_expired_in_file.py, agents/projects/code-health/histogram-cleanup/scripts/find_expired_in_file_test.py, agents/projects/code-health/histogram-cleanup/scripts/pick_histogram_reviewer.py, agents/projects/code-health/histogram-cleanup/scripts/pick_histogram_reviewer_test.py. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
-
SKILL.md12 KB -
references/analysis_guidelines.md5 KB -
references/patterns.md713 B -
references/review_rules.md982 B -
references/safe_dirs.md6 KB
Show all 11 files
-
scripts/find_candidates.py7 KB -
scripts/find_candidates_test.py11 KB -
scripts/find_expired_in_file.py6 KB -
scripts/find_expired_in_file_test.py16 KB -
scripts/pick_histogram_reviewer.py30 KB -
scripts/pick_histogram_reviewer_test.py53 KB
Alternatives to histogram-cleanup
All alternatives →Runs a 7-stage workflow for auditing, cleaning up and reviewing GitHub repositories, plus competitor analysis. Written for developers who want a repo checked for secrets, junk files and documentation gaps.
Teaches an AI assistant to build, debug and explain Gradio web UIs and ML demos in Python. It covers the core API, components, event listeners, layouts and the MCP server option. Aimed at Python developers who work with Gradio.
Recommends menus, buttons, toolbars and disclosure controls for Apple platforms using Human Interface Guidelines conventions. Built for developers and designers making iOS, iPadOS, macOS or visionOS interfaces. Checks existing project design context before asking questions.
Creates production-ready FastAPI project structures with async patterns, dependency injection, and error handling. It is for developers starting new FastAPI applications or backend API projects.
Analyzes Android apps to find user workflows to expose as AppFunctions, so AI agents and system shortcuts can run them without opening the app UI. Generates Kotlin code and refines KDoc for Android developers.
Creates, edits, validates and runs Agent QA tests, suites and hooks through MCP or CLI. It keeps canonical IDs and schema contracts intact, for developers and QA teams using Agent QA.
Compare with openclaw-github-repo-commander, gradio or hig-components-menus
histogram-cleanup: common questions
Which histograms can this skill change?
Only histograms defined in the histograms.xml files listed in references/safe_dirs.md. The source says it must never run discovery on or edit any other histograms.xml.
Does it remove every expired histogram it finds?
No. By default it focuses on one identified histogram and does not suggest removing unrelated expired histograms. Other histograms are bundled only if they share the same recording logic and pass the checks in the source.
How does it pick a reviewer?
It runs pick_histogram_reviewer.py with the XML owner entries recorded earlier, in their listed order. The source says not to run find_owners.py for this skill.
How do I install histogram-cleanup?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is histogram-cleanup free?
The code is published under the BSD-3-Clause licence. The service it connects to may have its own pricing.
Is histogram-cleanup safe to use?
It scores 89 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to histogram-cleanup?
Similar skills: openclaw-github-repo-commander, gradio, hig-components-menus, fastapi-templates.
