AGENTS.md #
Purpose #
This repository is a Firefox custom CSS collection. It is not an application with a build pipeline. Agents working here should think in terms of:
- CSS modules
@import-based feature toggles- Firefox profile installation
- manual verification in Firefox
The goal is to make small, precise, low-risk changes that fit the repository's existing structure and style.
Required First Step #
Before making any change, read:
README.md- the relevant entry file:
current/userChrome.cssfor browser UI workcurrent/userContent.cssfor built-in page or content work
Do not assume this repo behaves like a normal web app, extension, or packaged theme project.
Repository Model #
Primary active work happens in current/:
current/userChrome.css: main browser chrome entry pointcurrent/userContent.css: main content / internal-page entry pointcurrent/config/: shared variables and common settingscurrent/css/: feature CSS files organized by areacurrent/image/: images and icons used by CSS
Historical and compatibility material lives in legacy/:
legacy/fx60-90legacy/fx91-100legacy/fx101-108legacy/fx109-127legacy/protonlegacy/previews
Default assumption:
- If the user does not explicitly mention an older Firefox version, edit only
current/.
Core Behavior Rules #
- Prefer the smallest change that solves the request.
- Preserve existing file layout, comments, grouping, and formatting style.
- Do not refactor unrelated CSS while touching a file.
- Do not reorganize directories unless explicitly requested.
- Do not introduce tooling, package manifests, build scripts, or lint configs unless explicitly requested.
- Do not modify
legacy/for convenience when the request is really about current Firefox behavior. - Do not remove comments or section banners just to "clean up" the file.
Import Toggle Convention #
This project enables and disables features through @import lines.
Enabled form:
@import "./css/buttons/buttons_on_navbar_classic_appearance.css"; /**/
Disabled form:
/* @import "./css/buttons/buttons_on_navbar_classic_appearance.css"; /**/
Rules:
- Preserve this exact pattern.
- Do not replace it with another commenting style.
- Keep imports under the existing section where they logically belong.
- Respect comments like "only use one option at a time".
- If a section offers mutually exclusive visual variants, do not enable multiple variants together unless the user explicitly asks for that.
File Placement Rules #
Use this mapping when deciding where to edit:
- browser tabs, toolbars, buttons, app button, url bar, menubar, bookmark toolbar:
current/userChrome.cssand files undercurrent/css/ about:addons,about:preferences,about:newtab,about:home,about:logins,about:config:current/userContent.cssand files undercurrent/css/- theme variables, color presets, shared sizing:
current/config/ - icons and image-backed styling:
current/image/
When adding a new tweak:
- prefer adding a focused CSS file in the relevant
current/css/<area>/directory - then add a matching
@importentry in the correct entry file if the feature should be selectable
Custom User Code: my_userChrome.css #
userChrome.css imports my_userChrome.css at the very end (if the file exists).
This is the designated location for user-specific CSS overrides that are not part
of any existing project module.
Decision criteria for where to place a change:
| Situation | Edit location |
|---|---|
| Toggle an existing feature on/off | userChrome.css (flip @import comment) |
| Adjust variables in an existing module (colors, sizes, etc.) | Corresponding config/*.css file |
| New custom styling not covered by any existing module | my_userChrome.css |
| Bug fix in an existing module | Small fix: my_userChrome.css; larger fix: edit the module directly |
Key properties of my_userChrome.css:
- Loaded last, so it has the highest cascade priority and can override all modules above.
- Not tracked by upstream, so it survives project updates.
What Agents Must Not Assume #
Do not assume this repository can:
- create entirely new Firefox UI primitives
- depend on WebExtensions for equivalent browser UI control
- rely on a bundler or transpiler
- be validated through a normal web preview server
This repo modifies Firefox's existing UI with CSS only.
Strong Editing Constraints #
When editing CSS in this repository:
- keep selectors as narrow as practical
- avoid broad global overrides unless the existing file already uses them intentionally
- reuse existing naming and path conventions
- keep image paths relative in the same style as surrounding code
- avoid adding
@namespace - avoid mass-changing whitespace or indentation in large files
- avoid renaming assets unless every reference is intentionally updated
If a request can be solved by:
- toggling an existing import
- adjusting an existing module
- creating a new module
prefer that order.
Entry File Rules #
current/userChrome.css and current/userContent.css are configuration-oriented entry files.
Agents should:
- treat them as organized menus of features
- keep the section headings intact
- add new imports near similar features
- avoid scattering imports into unrelated sections
Agents should not:
- convert these files into monolithic style sheets
- inline large feature implementations into the entry files
- reorder large sections unless explicitly asked
Legacy Rules #
legacy/ is version-specific compatibility material.
Do not edit legacy/ unless one of these is true:
- the user explicitly asks for an older Firefox branch
- the relevant bug or feature is clearly isolated to a legacy folder
- you are intentionally backporting a change and the user asked for it
If work spans both current/ and legacy/, call that out explicitly in your response.
Validation Rules #
There is no guaranteed automated test or lint workflow here. Validation should focus on correctness and compatibility:
- verify CSS syntax by careful inspection
- verify import paths and asset paths
- verify mutually exclusive imports were not accidentally enabled together
- verify the change is placed in the correct entry file or module directory
- if practical, describe the expected Firefox manual verification path
Manual verification model from the README:
- set
toolkit.legacyUserProfileCustomizations.stylesheetstotrue - copy
userChrome.css,userContent.css,config/,css/, andimage/into the Firefox profilechrome/folder - restart Firefox
- use Browser Toolbox to inspect ids and attributes when needed
If you cannot run Firefox for validation, say so clearly instead of implying the change was runtime-tested.
Decision Defaults For Agents #
If the user request is underspecified, prefer these defaults:
- target
current/ - make the feature opt-in instead of enabled by default, unless the request is to change default behavior
- place code beside the closest existing feature family
- preserve existing visual style rather than inventing a new organization
If the request would require broad stylistic redesign or cross-version restructuring, pause and ask before proceeding.
Safe Workflow #
Recommended workflow for Claude/Codex-style agents:
- read
README.md - inspect the relevant entry file and nearby CSS modules
- identify the smallest correct edit location
- make a minimal change
- confirm import paths and surrounding conventions
- report exactly what changed and whether Firefox runtime verification was performed
README Localization Rules #
README.mdis the source README for repository documentation updates.- When
README.mdis added to or changed, updateREADME.zh-CN.mdandREADME.ja.mdin the same task unless the user explicitly asks not to. - Keep the language-navigation links at the top of all README variants consistent.
- For localized README updates, use a two-step translation workflow: make a faithful direct translation first, then polish it into natural target-language prose.
Response Expectations #
When reporting work back to the user:
- mention the files changed
- summarize the behavioral effect
- mention if validation was manual, structural only, or not performed
- mention assumptions when the request did not specify Firefox version or whether a tweak should be enabled by default