Agent skill

Modularize Chrome Browser

by nwjs in nwjs/chromium.src

Modularize a chrome/browser/ subfolder by splitting its sources out of the monolithic //chrome/browser:browser target into dedicated sourceset targets in the subfolder's own BUILD.gn.

BSD-3-ClauseAuto-check passedTesting & QA

Install Modularize Chrome Browser

skills CLI
$ npx skills add nwjs/chromium.src --skill modularize-chrome-browser -a claude-code

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

GitHub CLI
$ gh skill install nwjs/chromium.src modularize-chrome-browser --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/bedrock/modularize-chrome-browser .claude/skills/modularize-chrome-browser && 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
modularize-chrome-browser
GitHub stars
160
Token cost
~3k tokens
SKILL.md length
1,022 words
Files
1
Skills in repo
64
Repo updated
First seen
Licence
BSD-3-Clause

At a glance

Modularize a chrome/browser/ subfolder by splitting its sources out of the monolithic //chrome/browser:browser target into dedicated sourceset targets in the subfolder's own BUILD.gn.

  • Works in 6 steps: Inventory → Choose a target pattern → Write the new BUILD.gn → …
  • The user asks to modularize
  • SKILL.md covers Goal, Phase 1: Inventory, Phase 2: Choose a target pattern and Phase 3: Write the new BUILD.gn, plus 4 more sections
  • Calls python3, bash and git

What it does

Modularize Chrome Browser is an agent skill from nwjs/chromium.src. Modularize a chrome/browser/ subfolder by splitting its sources out of the monolithic //chrome/browser:browser target into dedicated sourceset targets in the subfolder's own BUILD.gn. Use when the user asks to modularize, extract, or create BUILD targets for a chrome/browser/ subfolder, or mentions "Project Bedrock", "//chrome/browser modularization", or wants to split a subfolder into header/impl/test targets. Also use when the user says "modularize chrome/browser/X" for any X.

Its SKILL.md is about 3k 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 Testing & QA. 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

  • The user asks to modularize
  • Create BUILD targets for a chrome/browser/ subfolder
  • Mentions Project Bedrock
  • //chrome/browser modularization

Example prompts

  • “Project Bedrock”
  • “//chrome/browser modularization”
  • “modularize chrome/browser/X”
  • “/modularize-chrome-browser”

Requirements

  • Python 3
  • Pre-approved tools (allowed-tools): Read

Workflow steps

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

  1. Inventory
  2. Choose a target pattern
  3. Write the new BUILD.gn
  4. Update parent BUILD files
  5. Fix GN include errors
  6. Format, verify, and commit

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 these tools, so the agent can use them without asking each time:

    • Read

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • python3
    • bash
    • git

    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

Modularize Chrome Browser loads about 3k tokens when it runs. Until then it costs about 128 tokens; SKILL.md has 1,022 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~128
When it runs · the whole SKILL.md, loaded when a task matches
~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 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). 1,022 words, ~3,020 tokens.

Download SKILL.mdSave it as .claude/skills/modularize-chrome-browser/SKILL.md (or your agent's skills folder).
name
modularize-chrome-browser
description
Modularize a chrome/browser/ subfolder by splitting its sources out of the monolithic //chrome/browser:browser target into dedicated source_set targets in the subfolder's own BUILD.gn. Use when the user asks to modularize, extract, or create BUILD targets for a chrome/browser/ subfolder, or mentions "Project Bedrock", "//chrome/browser modularization", or wants to split a subfolder into header/impl/test targets. Also use when the user says "modularize chrome/browser/X" for any X.
allowed-tools
Read

Modularize chrome/browser/ Subfolder

Extract sources for a chrome/browser/<subfolder>/ from the monolithic //chrome/browser:browser target into well-defined source_set targets in the subfolder's own BUILD.gn. Changes must conform to //docs/chrome_browser_design_principles.md.

Goal

The end state is: - chrome/browser/<subfolder>/BUILD.gn defines ::<subfolder> (headers), ::impl (.cc files), ::unit_tests, and ::browser_tests as needed. - chrome/browser/BUILD.gn no longer lists the subfolder's .cc/.h files directly; instead it deps on ::impl. - chrome/test/BUILD.gn no longer lists the subfolder's test files directly; instead it deps on ::unit_tests / ::browser_tests. - Build verification passes.

Important: Do not make any changes unless explicitly instructed by the user. When asked to plan, produce a numbered list of steps only.

Phase 1: Inventory

Check if modularization is actually needed

An existing BUILD.gn in the subfolder does not mean the subfolder is already modularized. Verify by checking whether the files are still listed in chrome/browser/BUILD.gn:

bash
grep -n "<subfolder>/" chrome/browser/BUILD.gn | head -60
grep -n "<subfolder>/" chrome/test/BUILD.gn | head -60

If files appear there, modularization is needed regardless of whether a BUILD.gn already exists.

Determine if the subfolder is platform-specific or hybrid
bash
ls chrome/browser/<subfolder>/

| Subfolder layout | Classification | Action | | ------------------------ | ----------------- | ---------------------------- | | Only an android/ (or | Platform-specific | Skip — nothing to modularize | | : other platform) : : at the root level : | : sub-subfolder, no : : : | : .cc/.h at root : : : | Has .cc/.h files at | Hybrid | Modularize the root | | : root AND a platform : : .cc/.h files; leave the : | : sub-subfolder : : platform subfolder alone : | Has .cc/.h files, no | Standard | Modularize normally | | : platform subfolder : : :

Categorize every file

| Category | Files | | ------------------------------------ | ------------------------------------ | | Public headers (.h that form the | → ::<subfolder> target | | : API surface) : : | Implementation (.cc + paired .h) | → ::impl target | | *_unittest.cc | → ::unit_tests target | | *_browsertest.cc or | → ::browser_tests target | | : *_browser_test.cc : : | Fuzzer (*_fuzzer.cc) | → separate fuzzer_test() (leave in | | : : place) :

Also read each header to understand which deps are actually required at the header level vs. only in .cc files.

Phase 2: Choose a target pattern

Pattern A: Two-source-set (header + impl) — preferred for most cases

Use when there are meaningful .h files that consumers depend on independently of the .cc files, or when circular dependencies need to be broken.

gn
source_set("<subfolder>") {
  sources = [
    "foo.h",
    "foo_factory.h",
  ]
  public_deps = [
    # Only deps whose types appear in the public header signatures.
    "//base",
    "//chrome/browser/profiles:profile",
    "//components/keyed_service/core",
  ]
  # Deps used only by .cc files belong in ::impl, not here.
  # Keep public_deps minimal — they are transitive and leak to all consumers.
}

source_set("impl") {
  sources = [
    "foo.cc",
    "foo_factory.cc",
  ]
  public_deps = [ "//chrome/browser:browser_public_dependencies" ]
  deps = [
    ":<subfolder>",
    "//base",
    # Deps only needed in .cc files go here as private deps.
    "//content/public/browser",
  ]
}
Pattern B: Single target with public + sources split

Use for smaller or simpler components where the header/impl split doesn't add meaningful value. Declare public headers explicitly using the public variable:

gn
source_set("<subfolder>") {
  public = [
    "foo.h",
  ]
  sources = [
    "foo.cc",
    "foo_factory.cc",
    "foo_factory.h",  # internal header, not part of public API
  ]
  public_deps = [
    "//base",
  ]
  deps = [
    "//content/public/browser",
  ]
}
Choosing between patterns
  • Prefer Pattern A when the component has a significant public API surface or when there are downstream circular-dependency constraints.
  • Prefer Pattern B for simple, self-contained components with few consumers.
  • In either case, keep public_deps to the strict minimum — they are transitive and increase the risk of circular dependencies for all downstream consumers. Move implementation-only deps to private deps.

Phase 3: Write the new BUILD.gn

gn
# Copyright 20XX The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

# (import any needed buildflags, e.g.)
# import("//extensions/buildflags/buildflags.gni")

source_set("<subfolder>") {
  # ... (Pattern A or B from above)
}

source_set("impl") {
  # ... (Pattern A only)
}

source_set("unit_tests") {
  testonly = true
  sources = [ "foo_unittest.cc" ]
  deps = [
    ":<subfolder>",
    ":impl",
    "//base/test:test_support",
    "//chrome/test:test_support",
    "//testing/gtest",
  ]
}

source_set("browser_tests") {
  testonly = true
  defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
  sources = [ "foo_browsertest.cc" ]
  deps = [
    ":<subfolder>",
    ":impl",
    "//base/test:test_support",
    "//chrome/test:test_support",
    "//content/test:test_support",
    "//testing/gtest",
  ]
}

Key rules:

  • Omit targets that have no files (e.g., skip ::browser_tests if there are no browser test files).
  • ::browser_tests always sets defines = ["HAS_OUT_OF_PROC_TEST_RUNNER"].
  • Preserve all platform-specific if (is_android), if (is_chromeos), if (enable_extensions) guards exactly as they appear in the original chrome/browser/BUILD.gn.
  • Factory .h files belong in the interface/public target even when the .cc is in ::impl.
  • Platform-specific dependencies: Ensure that dependencies are wrapped in the same platform conditional blocks (e.g., if (is_chromeos)) as the files that use them.
Platform-agnostic interface design

If a class uses an interface pattern (e.g., a delegate or checker injected via constructor), do not add BUILDFLAG(IS_ANDROID) build guards around the code just to skip it on desktop. Instead, pass nullptr on platforms that don't have an implementation and add a null-check in the method body. This keeps the code testable on all platforms and avoids ifdef fragmentation.

cpp
// Good: platform-agnostic, null-safe
bool Foo::IsInteractable() {
  if (!interactability_checker_) return true;
  return interactability_checker_->Check();
}

Phase 4: Update parent BUILD files

chrome/browser/BUILD.gn
  1. Remove each .h and .cc file from the monolithic sources list.
  2. Add a dep on the new impl target: gn "//chrome/browser/<subfolder>:impl", (For Pattern B, dep on "//chrome/browser/<subfolder>" instead.)
  3. If there was already a dep on "//chrome/browser/<subfolder>", keep or replace it with :impl as appropriate.
chrome/test/BUILD.gn

Remove *_unittest.cc files from chrome_unit_tests sources and add: gn "//chrome/browser/<subfolder>:unit_tests",

Remove *_browsertest.cc files from browser test sources and add: gn "//chrome/browser/<subfolder>:browser_tests",

Show full SKILL.md (405 more words)Show less

Phase 5: Fix GN include errors

Run build verification first (Phase 6), then resolve any errors.

Strict Rules
  • Never use // nogncheck to bypass header check failures. Fix the dependency graph instead.
    • Exception: The only acceptable case for nogncheck is to bypass conditional includes that are not currently supported by GN. In such cases, the added pragma MUST be exactly // nogncheck crbug.com/40147906.
  • Headers in Monolithic Targets: If a file in your new module includes a header from another folder that is still part of a monolithic target (like //chrome/test:unit_tests), you cannot move that file to the module without violating header checks. In this case, leave the file in the monolith until the other folder is also modularized.
Error type 1: "Include not allowed" — header not reachable at all

Add an explicit dep to the failing target: gn deps += [ "//chrome/browser/<subfolder>" ]

Or, if //chrome/browser:browser already depends on ::impl and the cycle is intentional, use allow_circular_includes_from on ::impl: gn allow_circular_includes_from = [ "//chrome/browser:browser_public_dependencies" ]

Error type 2: "Can't include this header from here" — reachable only via private dep

Add the dep directly to the failing target, or promote it to public_deps on the target that owns the header.

allow_circular_includes_from rules
  • Set it on the target that owns the headers you want to expose through the cycle.
  • The dep cycle must already exist in the dep graph.
  • It only covers headers in that target's own sources, not headers from its transitive deps.
  • Standard pattern: ::impl sets allow_circular_includes_from = ["//chrome/browser:browser_public_dependencies"].

Phase 6: Format, verify, and commit

Format

Always run after every edit: bash git cl format

Verify the build
bash
# Desktop Linux (primary — always run this):
python3 tools/mb/mb.py gen -m tryserver.chromium.linux -b linux-rel \
  --config-file tools/mb/mb_config.pyl out/Default

# Android arm64 (run if the subfolder has Android-specific code):
python3 tools/mb/mb.py gen -m tryserver.chromium.android -b android-arm64-rel \
  --config-file tools/mb/mb_config.pyl out/Default

Fix any include errors and re-run until clean.

Commit

Wrap the commit message at 72 characters:

Modularize chrome/browser/<subfolder>/BUILD.gn targets

The monolithic `chrome/browser` target leads to long compilation
times and potential circular dependencies. This change extracts
the C++ and header files from `chrome/browser/<subfolder>/` into
dedicated `source_set` targets:

- `:<subfolder>` — header-only interface target
- `:impl` — implementation (.cc files)
- `:unit_tests` — unit tests (moved from chrome/test:unit_tests)
- `:browser_tests` — browser tests (moved from
  chrome/test:browser_tests)

Platform-specific conditions and dependencies were preserved
identically to the original `chrome/browser` configuration.
Missing dependencies implicit to the monolithic target were
explicitly declared.

Bug: <bug-id>

Common pitfalls

  • Existing BUILD.gn ≠ modularized: Always grep chrome/browser/BUILD.gn to confirm files have actually been moved out.

  • Over-broad public_deps: Every entry in public_deps is transitive — all downstream consumers pull it in. Audit each one; if a type is only used in .cc files, move it to private deps.

  • Missing allow_circular_includes_from: If a .h in ::impl is still

  • Missing platform guards: Copy if (is_android), if (is_chromeos), if (enable_extensions) verbatim from the original.

  • Unnecessary BUILDFLAG guards: If a class uses a platform-specific delegate, prefer passing nullptr on other platforms and null-checking at runtime instead of build-guarding the whole file.

  • scoped_mock_* headers: Keep in the interface target if used by tests outside the folder; move .cc to ::impl or a test-only target.

  • Forgetting git cl format: Always format after changes before verifying or committing.

© 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/projects/bedrock/modularize-chrome-browser of nwjs/chromium.src.

Open the folder on GitHubat commit a9e8946

Compare with similar skills

Modularize Chrome Browser 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.

Modularize Chrome Browser compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Modularize Chrome Browser this skillnwjs/chromium.src160—~3kAutomated safety check: PassBSD-3-Clause
Web Application Testinganthropics/skills180k51 repos~966Automated safety check: PassApache-2.0
Diagnosing Bugsfossasia/eventyay-interpretation1.6k32 repos~2.1kAutomated safety check: PassApache-2.0
TDDpietheinstrengholt/rssmonster56430 repos~906Automated safety check: PassMIT
TDD WorkflowhellangleZ/burn-in-cceverywhere-ralph11211 repos~2.4kAutomated safety check: PassNone
TDDsanity-io/sanity6.4k20 repos~1kAutomated safety check: PassMIT

Similar skills

  • Web Application Testing

    anthropics/skills

    Official

    Tests local web applications with Python Playwright scripts, checking frontend behavior, capturing screenshots and reading browser console logs.

    180k GitHub starsUsed in 51 repos~966 tokens
    Testing & QAAuto-check passed
  • Diagnosing Bugs

    fossasia/eventyay-interpretation

    Diagnosis loop for hard bugs and performance regressions. An agent skill from fossasia/eventyay-interpretation.

    1.6k GitHub starsUsed in 32 repos~2.1k tokens
    Testing & QAAuto-check passed
  • TDD

    pietheinstrengholt/rssmonster

    Test-driven development. An agent skill from pietheinstrengholt/rssmonster.

    564 GitHub starsUsed in 30 repos~906 tokens
    Testing & QAAuto-check passed
  • TDD Workflow

    hellangleZ/burn-in-cceverywhere-ralph

    A skill your agent uses when writing new features, fixing bugs, or refactoring code.

    112 GitHub starsUsed in 11 repos~2.4k tokens
    Testing & QAAuto-check passed
  • TDD

    sanity-io/sanity

    Official

    Test-driven development with red-green-refactor loop. An agent skill from sanity-io/sanity.

    6.4k GitHub starsUsed in 20 repos~1k tokens
    Testing & QAAuto-check passed
  • Context Driven Development

    Ibrahim-3d/orchestrator-supaconductor

    A skill your agent uses when working with Conductor's context-driven development methodology, managing project context artifacts, or understanding the relationship between product.md, tech-stack.md…

    380 GitHub starsUsed in 9 repos~2.9k tokens
    Testing & QAAuto-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 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 Modularize Chrome Browser

What does Modularize Chrome Browser do?

Modularize a chrome/browser/ subfolder by splitting its sources out of the monolithic //chrome/browser:browser target into dedicated sourceset targets in the subfolder's own BUILD.gn. src.gn.

When should I use Modularize Chrome Browser?

Modularize Chrome Browser fits situations like: the user asks to modularize; create BUILD targets for a chrome/browser/ subfolder; mentions Project Bedrock; //chrome/browser modularization.

How do I install Modularize Chrome Browser in Claude Code?

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

How do I install Modularize Chrome Browser in Codex?

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

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

What does Modularize Chrome Browser need to run?

Going by SKILL.md and its folder, Modularize Chrome Browser needs the command-line tools its instructions call (python3, bash and git). Our summary lists: Python 3. Its frontmatter pre-approves these tools: Read.

Does Modularize Chrome Browser 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 Modularize Chrome Browser 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 Modularize Chrome Browser use?

Modularize Chrome Browser 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 Modularize Chrome Browser use?

About 3k tokens (SKILL.md is roughly 12k 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 Modularize Chrome Browser?

Skills that share tags, products or a category with Modularize Chrome Browser: Web Application Testing (anthropics/skills, 180k stars), Diagnosing Bugs (fossasia/eventyay-interpretation, 1.6k stars), TDD (pietheinstrengholt/rssmonster, 564 stars) and TDD Workflow (hellangleZ/burn-in-cceverywhere-ralph, 112 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Modularize Chrome Browser?

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.