ワンクリックで
android-new-module
Guide for creating new Android gradle modules in the android-components project.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Guide for creating new Android gradle modules in the android-components project.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
You MUST use this skill when working with HTML, JS, CSS and other front-end code.
Analyze Firefox performance profiles using the profiler-cli CLI tool. Trigger when given a profiler.firefox.com or share.firefox.dev link, a local profile path, or when the user wants to investigate an issue in a Firefox profile. Always use this skill instead of WebFetch for Firefox profiler URLs; WebFetch only retrieves the profiler UI's HTML shell and cannot access profile data, whereas profiler-cli downloads and parses the actual profile into a local daemon that supports structured queries over stacks, markers, threads, and samples.
Reviews dom/media code changes ONLY — not any other component. Fans out the in-tree dom/media review checklists (dom/media/docs/review/*.md) against a patch, one opus reviewer per checklist, then collects the findings. Temporary local tool until bugbug's /patch_review loads these docs directly. Triggers on: "media-patch-review", "/media-patch-review".
Manage Redash queries and dashboards on Mozilla's STMO (sql.telemetry.mozilla.org) using stmo-cli. Use when the user wants to explore telemetry data on STMO, write, deploy, or execute Redash queries, manage dashboards, or discover data sources. Also trigger on mentions of STMO, Redash, sql.telemetry.mozilla.org, or when the user wants to query Mozilla telemetry data (as opposed to probe/metric discovery, which is mozdata territory).
Find the right reviewer for a Firefox/Gecko change so the user does not have to. Use this primarily when committing changes, to fill in the `r=` part of the commit message automatically instead of leaving it blank or guessing. Also use it when the user asks directly who should review a patch or what reviewer group to use.
Use this skill when working with Firefox documentation, including building documentation with `./mach doc`, fixing Sphinx build errors or warnings, modifying existing documentation, or adding new docs.
| name | android-new-module |
| description | Guide for creating new Android gradle modules in the android-components project. |
This skill helps you create new Android gradle modules following Mozilla's conventions and structure. Components are organized into categories: browser, concept, feature, lib, service, support, ui, and compose.
Create a plan to execute the steps. The plan should include all nine steps below.
Ask the user:
my-component)publish: true, examples are publish: false)mkdir -p mobile/android/android-components/components/{category}/{name}/src/main/java/mozilla/components/{category}/{name}
mkdir -p mobile/android/android-components/components/{category}/{name}/src/test/java/mozilla/components/{category}/{name}
mkdir -p mobile/android/android-components/components/{category}/{name}/src/test/resources
Reference the example at mobile/android/android-components/components/feature/example/build.gradle for the standard structure.
Key elements:
com.android.library plugin in the plugins {} blockmozilla.components.{category}.{name}androidx.core, kotlinx.coroutinesjunit.bom, junit4, robolectric, kotlinx.coroutines.testAdd dependencies as needed:
implementation project(':components:support-base')libs.androidx.lifecycle.runtimeplatform(libs.androidx.compose.bom) and compose dependenciesimplementation project(':components:lib-state')implementation project(':components:browser-state')implementation project(':components:{category}:{component-name}')File: src/main/AndroidManifest.xml
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<manifest />
File: src/main/java/mozilla/components/{category}/{name}/{ComponentName}.kt
Reference the example at mobile/android/android-components/components/feature/example/src/main/java/mozilla/components/feature/example/ExampleFeature.kt.
Key elements for a feature component:
mozilla.components.{category}.{name}LifecycleAwareFeature for lifecycle-aware featuresCoroutineDispatcher)start(), stop())For simpler library components, a basic class with the necessary methods is sufficient.
File: src/test/java/mozilla/components/{category}/{name}/{ComponentName}Test.kt
Reference the example at mobile/android/android-components/components/feature/example/src/test/java/mozilla/components/feature/example/ExampleFeatureTest.kt.
Key elements:
StandardTestDispatcher from kotlinx.coroutines.test for testing coroutinesrunTest(testDispatcher) to run tests with coroutine supporttestDispatcher.scheduler.advanceUntilIdle() to advance virtual time`start triggers onUpdate callback`)File: src/test/resources/robolectric.properties
sdk=35
This configures Robolectric to use Android SDK 35 for unit tests.
File: README.md
Reference the example at mobile/android/android-components/components/feature/example/README.md.
Key elements:
# [android-components](../../../README.md) > {Category} > {Name}Add the component to .buildconfig.yml in alphabetical order within its category:
components:{category}-{name}:
description: {Brief description}
path: components/{category}/{name}
publish: true
Find the correct insertion point by searching for the category (e.g., components:feature- for feature modules) and inserting in alphabetical order.
Then update the upstream_dependencies for the new buildconfig with this mach command:
./mach android update-buildconfig android-components
Also update taskcluster/config.yml to add the new module's display name to treeherder.group-names. Without this step, CI will fail with a buildconfig mismatch error.
mozilla.components.{category}.{name}mozilla.components.feature.examplemy-component → MyComponentapi - For interfaces and contracts (concept modules)implementation - For internal dependenciestestImplementation - For testing dependenciesandroidTestImplementation - For instrumented tests@VisibleForTesting for test-only visibilityAfter creating the component, verify it builds with the debug variant:
./mach gradle :components:{category}-{name}:buildDebug
Run tests:
./mach gradle :components:{category}-{name}:testDebug
Format and lint:
./mach lint --fix mobile/android/android-components/components/{category}/{name}
./mach gradle instead of gradlew to ensure the build system is executed in its entirety.publish: false for example/sample components because we do not want them to be distributed through the maven mirrors..buildconfig.yml.