com um clique
mozconfig
// Generate or modify Firefox mozconfig build configuration files. Use when the user asks to create a mozconfig, configure a build, set up ASan/TSan/debug builds, or match try server configurations.
// Generate or modify Firefox mozconfig build configuration files. Use when the user asks to create a mozconfig, configure a build, set up ASan/TSan/debug builds, or match try server configurations.
Help prepare a Firefox security approval request by analyzing local commits/changes and drafting answers to the sec-approval questionnaire. Use when setting sec-approval? on a Bugzilla bug.
Help prepare a Firefox uplift approval request (Beta, Release, and/or ESR) by checking whether patches are already on the bug, auditing sanitization once for sec-* bugs, and drafting the approval comment per https://wiki.mozilla.org/Release_Management/Uplift_rules. Use after a fix is ready and needs to ride into a stabilization branch. May or may not follow sec-approval (sec-moderate typically skips sec-approval but may still need uplift).
Firefox bug triage assistant for media, web conferencing, and graphics related issues.
Generate technical documentation for a specified technology domain with optional customization.
Firefox bug triage assistant for determining if a bug severity rating of S1 or S2 is warranted, and to gather information for triaging and prioritization.
Launch a local web server and open a browser page listing all bug triage reports in ./reports, with live JS text filtering.
| name | mozconfig |
| description | Generate or modify Firefox mozconfig build configuration files. Use when the user asks to create a mozconfig, configure a build, set up ASan/TSan/debug builds, or match try server configurations. |
| argument-hint | [preset-name or description] |
This skill generates correct, complete Firefox mozconfig files for various build configurations. Mozconfigs control build options like debug mode, sanitizers (ASan/TSan), optimization levels, and more.
Use this skill when the user:
Follow these steps in order. This skill is interactive - use AskUserQuestion to gather requirements and preferences from the user.
Detect the user's operating system and architecture.
Run these commands to detect the platform:
uname -s # Operating system
uname -m # Architecture
Map the results:
Report to user: Tell them what platform was detected and any limitations:
Note any special platform constraints for later steps.
Ask the user how they want to configure their build.
Use AskUserQuestion to present three options:
Question: "How would you like to configure your Firefox build?"
Header: "Config mode"
Options:
1. "Common preset" - "Pre-built configurations for common use cases (debug, ASan, TSan, etc.)"
2. "Try server match" - "Replicate a CI/try server configuration locally"
3. "Custom configuration" - "Interactive guided configuration for specific needs"
Based on their choice, proceed to Step 3A, Step 3B, or Step 3C.
For users who selected "Common preset".
Use AskUserQuestion to show available presets. Filter by platform - don't show TSan on macOS/Windows, for example.
Question: "Which preset configuration do you want?"
Header: "Build preset"
Options (filter by platform):
1. "Debug" - "Standard debug build with assertions and symbols"
2. "Debug (no optimization)" - "Debug build with --disable-optimize (very slow but best for debugging)"
3. "ASan optimized" - "Address Sanitizer with optimization (recommended for testing)"
4. "ASan debug" - "Address Sanitizer with debug mode (better for debugging ASan findings)"
5. "TSan" - "Thread Sanitizer (Linux only)" [only show on Linux]
6. "Non-unified build" - "Disable unified compilation (slower build, finds hidden dependencies)"
7. "Artifact build" - "Frontend-only development (downloads pre-built C++/Rust)"
8. "Code coverage" - "Instrumented build for code coverage analysis (Linux)" [only show on Linux]
9. "Fuzzing + ASan" - "Combined fuzzing and ASan support (for fuzzing workflows)"
10. "Valgrind" - "Optimized for running under Valgrind (Linux)" [only show on Linux]
Read the reference file: Open .claude/skills/mozconfig/references/build-options-reference.md
Find the preset section: Look for the preset they selected in section "1. Preset Mozconfigs"
Extract the mozconfig: Copy the complete mozconfig for that preset
Apply platform-specific adjustments:
--enable-valgrind line--enable-valgrind and --enable-gczealProceed to Step 4 to write the file.
For users who selected "Try server match".
Use AskUserQuestion to determine the target configuration:
Question: "Which try server configuration do you want to replicate?"
Header: "Target platform"
Options:
1. "Current machine" - "Match a try config for my detected platform (recommended)"
2. "linux64" - "Linux 64-bit configuration"
3. "win64" - "Windows 64-bit configuration"
4. "macosx64" - "macOS x86_64 configuration"
5. "macosx64-aarch64" - "macOS ARM64 configuration"
Then ask for build type:
Question: "Which build type from try server?"
Header: "Build type"
Options (examples, adjust based on platform):
1. "debug" - "Standard debug build"
2. "debug-asan" - "Debug with Address Sanitizer"
3. "nightly-asan" - "Optimized Address Sanitizer build"
4. "tsan" - "Thread Sanitizer (Linux only)"
5. "code-coverage" - "Code coverage instrumentation"
6. "debug-fuzzing" - "Debug with fuzzing support"
7. "nightly" - "Nightly release configuration"
8. "plain-opt" - "Plain optimized build"
Now you need to read and flatten the try server mozconfig files.
Start with the base file: Read browser/config/mozconfigs/<platform>/<type>
browser/config/mozconfigs/linux64/debug-asanFollow all includes recursively: When you see . $topsrcdir/path/to/file or . "$topsrcdir/path/to/file", read that file too
Build a complete mozconfig by concatenating all the files in order
Strip CI-only lines: Remove lines that reference:
$MOZ_FETCHES_DIR (CI artifact fetches)$topsrcdir/browser/config/mozconfigs/common (CI-only base)$topsrcdir/build/mozconfig.common (contains CI exports)$topsrcdir/build/mozconfig.automation (CI-only)$topsrcdir/build/mozconfig.cache (CI-only)$topsrcdir/build/mozconfig.common.override (CI-only)AUTOCLOBBER=1 (CI auto-clobber)MOZ_AUTOMATION_* exportsMOZ_PKG_SPECIAL exports (optional)MOZ_PACKAGE_JSSHELL (optional, but CI-specific)MOZ_INCLUDE_SOURCE_INFO (CI-only)MOZILLA_OFFICIAL=1 (CI-only)--with-*-keyfile)LLVM_SYMBOLIZER to $MOZ_FETCHES_DIR pathsKeep important lines:
ac_add_options (except keyfiles and automation paths)RUSTFLAGS exportsunset RUSTFMTReplace CI paths with local equivalents:
$MOZ_FETCHES_DIR/llvm-symbolizer/bin/llvm-symbolizer, use a comment suggesting to set ASAN_SYMBOLIZER_PATH or TSAN_SYMBOLIZER_PATH environment variableAdd helpful comments: Explain what each section does
Proceed to Step 4 to write the file.
For users who selected "Custom configuration".
Use AskUserQuestion iteratively to build the configuration. Read the reference file first to understand available options.
Question: "What optimization level do you want?"
Header: "Optimization"
Options:
1. "Default optimization" - "Standard -O2/-O3 (fast, production-like)"
2. "Minimal optimization (-O1)" - "Useful for debug+opt builds"
3. "No optimization" - "Slowest, but easiest to debug"
Question: "Enable debug mode with assertions?"
Header: "Debug mode"
Options:
1. "Yes" - "Enable debug assertions and runtime checks"
2. "No" - "Optimized build without debug checks"
Question: "What level of debug symbols?"
Header: "Debug symbols"
Options:
1. "Line tables only" - "Minimal symbols (smaller binaries, good for sanitizers)"
2. "Default symbols" - "Standard debug symbols"
3. "Full symbols (-g)" - "Maximum debug info (large binaries)"
4. "No symbols" - "Strip all debug symbols"
Question: "Which sanitizer (if any)?"
Header: "Sanitizer"
Options:
1. "None" - "No sanitizer"
2. "ASan" - "Address Sanitizer (memory errors)"
3. "TSan" - "Thread Sanitizer (data races, Linux only)" [only on Linux]
4. "MSan" - "Memory Sanitizer (uninitialized memory, rarely used)"
5. "UBSan" - "Undefined Behavior Sanitizer"
If ASan or TSan is selected, automatically add required options:
--disable-jemalloc--disable-crashreporter--disable-elf-hack (Linux)--disable-profiling--disable-install-stripIf TSan is selected, also add:
--disable-sandboxexport RUSTFLAGS="-Zsanitizer=thread"unset RUSTFMT--disable-warnings-as-errorsAllow multiple selections:
Question: "Select any additional features you need:"
Header: "Features"
Multi-select: true
Options:
1. "Fuzzing support" - "Enable libFuzzer integration"
2. "Code coverage" - "Enable coverage instrumentation"
3. "Valgrind support" - "Valgrind compatibility (Linux)"
4. "Disable unified build" - "Build files separately (slower, finds hidden deps)"
5. "Artifact build mode" - "Download pre-built binaries (frontend-only)"
Based on all answers:
Start with MOZ_OBJDIR: Generate an appropriate object directory name based on the config
obj-debug, obj-asan, obj-tsan, obj-debug-asanAdd optimization flags based on Question 1
Add debug flags based on Question 2
Add debug symbol flags based on Question 3
Add sanitizer flags and required options based on Question 4
Add feature flags based on Question 5
Add platform-specific options:
--enable-valgrindAdd helpful comments explaining each section
Proceed to Step 4 to write the file.
Final step: create the mozconfig file with user confirmation.
Add a header comment to the generated mozconfig:
# Firefox mozconfig
# Generated by Claude Code mozconfig skill
# Configuration: [describe the config - e.g., "Debug + ASan optimized build"]
# Platform: [detected platform]
# Generated: [current date]
Organize the content into commented sections:
Add usage notes at the end as comments:
# Build instructions:
# 1. Save this file as 'mozconfig' in your mozilla-central directory
# 2. Run: ./mach clobber && ./mach build
# 3. Run Firefox: ./mach run
#
# [Add sanitizer-specific notes if applicable]
Use AskUserQuestion:
Question: "Where should I save the mozconfig file?"
Header: "Output path"
Options:
1. "./mozconfig (recommended)" - "Standard location in repository root"
2. "./mozconfig-[configname]" - "Named config file (e.g., mozconfig-asan)"
3. "Custom path" - "Specify a different location"
If the file already exists:
Read the existing mozconfig
Show a diff: Display what would change (you can describe the changes textually)
Ask for confirmation:
Question: "A mozconfig already exists. How should I proceed?"
Header: "File exists"
Options:
1. "Overwrite" - "Replace the existing mozconfig"
2. "Write to different path" - "Save with a different name"
3. "Cancel" - "Don't write the file"
Write the mozconfig to the chosen path using the Write tool
Confirm to user: Report success with the path
After writing, always warn the user about:
Clobber requirement:
⚠️ Important: Run `./mach clobber && ./mach build` after creating or changing your mozconfig.
Sanitizer-specific warnings if applicable:
For ASan:
ASan Notes:
- Set ASAN_SYMBOLIZER_PATH environment variable to your llvm-symbolizer location
- On macOS, set MOZ_DISABLE_CONTENT_SANDBOX=1 to symbolize content process crashes
For TSan:
TSan Notes:
- TSan requires a special Rust toolchain. Run:
./mach artifact toolchain --from-build linux64-rust-dev
rm -rf ~/.mozbuild/rustc-sanitizers
mv rustc ~/.mozbuild/rustc-sanitizers
rustup toolchain link gecko-sanitizers ~/.mozbuild/rustc-sanitizers
rustup override set gecko-sanitizers
- Set TSAN_SYMBOLIZER_PATH to your llvm-symbolizer location (required)
- On NVIDIA with proprietary drivers, you may need to disable GPU acceleration
Build time estimate if appropriate:
Ask if they want to customize the object directory name:
Question: "The object directory is set to [current value]. Would you like to change it?"
Header: "Object dir"
Options:
1. "Keep default" - "Use [current value]"
2. "Use config-based name" - "Use a name based on the config (e.g., obj-asan)"
3. "Custom name" - "Specify a custom object directory name"
If they choose option 2, suggest names like:
obj-debugobj-asanobj-tsanobj-debug-asanobj-artifactProvide a clear summary of what was created.
Tell the user:
✅ What was created: "Created [config type] mozconfig at [path]"
Next steps:
Next steps:
1. Run: ./mach clobber && ./mach build
2. After build completes: ./mach run
3. [If sanitizer: Set environment variables as noted above]
Offer additional help:
Need help?
- Modify the mozconfig file directly to adjust options
- Run /mozconfig again to create a different configuration
- Check .claude/skills/mozconfig/references/build-options-reference.md for all options
This skill uses the following reference files:
.claude/skills/mozconfig/references/build-options-reference.md - Comprehensive reference of all mozconfig options, presets, and platform notesAlways read the reference file when you need to:
If something goes wrong:
You've successfully completed this skill when: