Loads, merges, and validates layered application config (defaults + user file) so miswired or misspelled keys fail loudly. Use when adding a config key, reviewing a loader, or debugging a setting that "has no effect".
Ships in browser-extensions. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Configuration bugs are quiet because every layer on the path has a fallback. A value travels defaults → user file → merge → consumer, and each hop can drop it without raising anything. The result is an application that starts cleanly, reports success, and runs on values the user did not choose.
Use a typed settings model when you can. pydantic-settings, a tagged
struct, or any schema-first loader collapses most of this page into one class:
unknown keys and wrong types fail at construction, and every consumer gets
attribute access instead of config["a"]["b"]. Reach for the hand-rolled merge
below only when you genuinely need a layered file surface the typed model
doesn't cover — and then port the guarantees, don't skip them.
The reader indexes one section; the defaults declare another:
# consumer
cache_cfg = config["cache"] # section name that exists nowhere
store = ResultStore(cache_cfg)
# defaults.py
DEFAULT_CONFIG = {"storage": {"backend": "...", "max_entries": 512, ...}}
Nothing fails at load. Nothing fails at startup. Every request through that path
returns {"error": "Request failed: 'max_entries'"} — a KeyError caught by a
broad except several frames away and folded into a normal-shaped result. That
can ship for months, because tests that assert on the result's shape pass.
So make this the first check on any config lookup you write or review: does the section this code reads actually exist in the defaults? It is a grep, not an inspection:
# every section name the code reads
grep -rhoE 'config(\.get\(|\[)"[a-z_]+"' src/ | grep -oE '"[a-z_]+"' | sort -u
# each one must appear in the defaults module
Run it in the other direction too. A section that appears only in the defaults and the schema is inert: the user sets it, validation accepts it, and nothing reads it. Separate the two causes before "fixing" it —
The same config dict is routinely consumed at two strictness levels: the loader
or manager uses cfg.get("backend", DEFAULT), and a deeper function
hard-indexes cfg["max_entries"]. A partial config then loads fine, constructs
objects fine, and explodes deep inside a request — where the broad except
turns it into an error-shaped response.
Pick one place to be strict — the load boundary — and validate there. After
that, missing keys shouldn't be possible, so [...] indexing downstream is
correct and self-documenting. .get(key, default) scattered through consumers
is what makes a typo survive to production: it silently supplies a plausible
value for a key that was never spelled correctly anywhere.
A recursive merge that accepts whatever the YAML contained has two failure modes, both silent:
storage.max_entires: 1024 is retained under the misspelled name while the
real max_entries keeps its default. The user sees their key in the file and
concludes it works.storage: redis — a scalar where a mapping belongs — survives the load and
fails only when something treats it as a mapping.Declare the surface, validate before merging, and warn with the full dotted path so the message is actionable:
CONFIG_SCHEMA = {
"storage": {"backend": STRING, "max_entries": INTEGER, "batch_size": INTEGER},
"logging": {"level": STRING, "format": STRING},
}
def _validate(node, schema, path=""):
clean = {}
for key, value in node.items():
dotted = f"{path}.{key}" if path else key
expected = schema.get(key)
if expected is None:
logger.warning("Unknown config key %r — ignored", dotted)
elif isinstance(expected, dict):
if isinstance(value, dict):
clean[key] = _validate(value, expected, dotted)
else:
logger.warning("Config key %r must be a mapping — ignored", dotted)
elif _matches_kind(value, expected):
clean[key] = value
else:
logger.warning("Config key %r has wrong type — ignored", dotted)
return clean
Exclude bool explicitly in any numeric type check. isinstance(True, int)
is True in Python, and the same widening bites in most dynamic languages, so
batch_size: true sails through a naive integer check and becomes 1 deep in an
arithmetic path. _matches_kind must short-circuit on isinstance(value, bool)
before the integer branch.
Once unknown keys are dropped, the schema is load-bearing in a new direction: anything you add to the defaults, or to the config file you ship, must also be added to the schema or it is silently discarded at load. The warning goes to a log nobody is reading during development.
Two cheap guards, both worth having:
def test_defaults_are_declared():
assert leaf_paths(DEFAULT_CONFIG) <= leaf_paths(CONFIG_SCHEMA)
def test_shipped_config_validates_without_warnings(caplog):
load_config("config.example.yaml")
assert [r for r in caplog.records if r.levelno >= logging.WARNING] == []
Declare the documented surface, not just the consumed subset. Keys that ship in your own example config belong in the schema even if nothing reads them yet — otherwise every load of your own file emits warnings. Tightening the schema down to the consumed subset is fine, but it has to edit the shipped file in the same change.
Deep-merge helpers usually recurse into dicts and copy everything else by reference. Every list, set, or nested object in the defaults is then shared with the loaded config, and a later mutation of the loaded config reaches back into a module-level global that the rest of the process — and every other test in the run — reads from.
The same bug wears a different hat in JS: {...DEFAULTS, lastIndex: i} copies
the top level and aliases every nested object. Merge nested keys explicitly, or
deep-copy the defaults before merging:
merged = copy.deepcopy(DEFAULT_CONFIG) # not {**DEFAULT_CONFIG}
It costs nothing at startup and removes a whole class of cross-test bleed.
timeout = cfg.get("timeout") or 30 # a configured 0 becomes 30
start_hour = settings.get("start") or 9 # midnight becomes 9am
0, "", False, and [] are all legitimate configured values. Use
cfg.get(key, default) in Python and ?? in JavaScript, never or/||, for
any setting whose valid range includes a falsy value — hours, counts,
thresholds, retry limits, feature flags.
Writing back a spread of whatever you just read is fine until the read returns nothing:
// Bad — if `settings` was absent, this persists an object missing every other key
await storage.set({ settings: { ...settings, lastIndex: i } });
A missing config self-heals: settings ?? DEFAULTS catches it. A partial
one does not — it is truthy, so the reader keeps it and throws on the first
nested key, and the corruption is sticky across restarts. Read-modify-write
rules:
Validate user-entered values before they reach storage, too. A field parsed with
a bare int()/parseInt() yields None/NaN, serializes to null, and is
silently replaced by the default on the next read — while the UI says "saved".
Declarative constraints that nothing evaluates (an HTML min/max on a form
that is never submitted) are inert; enforce the range in code.
An allowlist serializer may omit inactive optional settings. That is useful for portable exports, but unsafe for a reset passed through a merge-based writer: omitted means preserve the stored value, not restore the default. Resetting with an export of the defaults can therefore leave an optional feature enabled while the UI reports success.
Keep patch, replacement, and reset semantics explicit. If the writer preserves
omitted keys, send the schema's explicit clearing value for every setting the
reset promises to clear. null is suitable only when the schema accepts it as
disabled; otherwise use the declared default or the writer's deletion operation.
For example, a nullable pair of schedule boundaries must both be cleared:
stored = {"theme": "dark", "quiet_start": "22:00", "quiet_end": "07:00"}
compact_defaults = {"theme": "system"} # serializer omits inactive boundaries
assert {**stored, **compact_defaults}["quiet_start"] == "22:00" # still active
reset_payload = {**compact_defaults, "quiet_start": None, "quiet_end": None}
assert {**stored, **reset_payload} == {
"theme": "system", "quiet_start": None, "quiet_end": None,
}
Test the real reset entry point with non-default state already stored, then reload through the normal reader and assert the feature is disabled. An empty store cannot expose this bug. Separately confirm that an ordinary partial update still preserves omitted settings; making every omission clear a key would fix reset by breaking patch semantics.
When config configures logging, the order is fixed:
basicConfig with hardcoded defaults, before load_config() — the
loader emits the "unknown key / wrong type" warnings, and they must land
somewhere.Two details that bite:
basicConfig(level="LOUD", force=True) removes the existing handlers before raising on the bad level,
so an invalid value can leave the process with no logging at all. Look the
level up first, fall back to the default with a warning, and never let a bad
config value raise out of the logging setup.config_path parameter and write a real file into a
temp directory. That is far cheaper and truer than stacking patches on open,
Path.exists, and yaml.safe_load, and it lets you assert on the returned
values and the warning text in one test.load_config() in a test reads the
repo's own shipped file — so editing that file changes the outcome of
unrelated tests. The single exception is the test that deliberately validates
the shipped file."error" not in result in tests that exercise a config-consuming
code path. Where a broad except wraps the consumer, that assertion is the
only thing separating a mis-wired key from a working one.bool short-circuit from the type check —
exactly one test should fail..get(key, default)-ing a required keybool excluded before any integer/number type checkget(key, default) / ?? rather than or / || for any falsy-valid valueload_config(); stream pinned in both;
an unknown level falls back with a warning instead of raisingRelated: reporting-derived-metrics for how a broad except disguises a
mis-wired key as a normal-shaped result, verifying-external-behavior for
confirming what a permissive client does with an argument it doesn't recognise,
and shipping-across-surfaces for keeping a documented config key in step with
the code that reads it.
What SKILL.md sets; muted values are Claude Code's defaults
/browser-extensions:wiring-application-configfrom browser-extensions
npx claudepluginhub wdm0006/python-skills --plugin browser-extensions10 skills in this plugin
/building-accessible-interfacesMakes web and app UIs usable by keyboard, screen-reader, low-vision and motion-sensitive users — semantic HTML before ARIA, labelled controls, visible focus, WCAG AA contrast measured rather than eyeballed, touch targets, reduced motion, and automated axe checks plus a manual keyboard pass in CI or before every UI PR. Use when building or restyling a screen, adding a form, modal, menu or custom control, choosing colors, or reviewing a UI change./building-browser-extensionsBuilds and tests Manifest V3 browser extensions — service-worker message channels that survive teardown, chrome.storage read-modify-write safety, settings validation in the popup, and a Jest chrome mock that can actually fail. Use when writing or reviewing a background service worker, a popup that reads/writes chrome.storage, an extension's Jest suite, or debugging an extension whose UI silently stops responding./shipping-build-artifactsMake the build step a real gate on what you actually distribute — build scripts that warn and exit 0 on a missing input, size checks with only an upper bound, hand-maintained file lists that drift from the entrypoints they must cover, committed bundles that go stale when only the source changes, GNU-only shell in release scripts that aborts on the other OS, and verification that runs against the source tree instead of the artifact. Use when writing or reviewing a build/package script, a `dist/` copy step, a release workflow that uploads a zip or installer, or a committed compiled asset./running-github-actions-efficientlyCut GitHub Actions minutes and wall-clock time without losing coverage — the OS billing multiplier (macOS 10x / Windows 2x / Linux 1x), trigger hygiene that stops push+pull_request double-firing, concurrency that cancels superseded runs, dependency caching keyed on lockfiles, matrix discipline, and auditing scheduled crons that bill 24/7. Use when CI is burning included minutes, when runs feel slow, when setting up a new repo's workflows, or when reviewing an existing workflow for waste./keeping-git-repos-cleanPrevents, detects, and remediates files that should never be committed — secrets (.env, API tokens, hardcoded credentials) and dev artifacts (build output, scratch databases, editor/OS files). Covers .gitignore (and why it does not untrack), git rm --cached, auditing tracked files, history scrubbing, and credential rotation. Use when a repo has committed secrets or junk, when setting up a new repo's ignore rules, or when reviewing what a repo actually tracks./designing-interaction-statesDesigns the states screens actually spend their time in — first-run and empty states, loading and skeletons, inline validation and error messages, success feedback, destructive confirmations, and the microcopy for each — so a product feels finished instead of only working on the happy path. Use when building a form, list, dashboard, upload, checkout or settings screen, adding an async action, writing error or empty-state copy, or reviewing a UI that shows blank pages, raw errors or spinners forever.Other plugins' skills for the same job