con un clic
manage-commits
// A skill for creating, amending, formatting, and uploading commits in the AndroidX frameworks/support project
// A skill for creating, amending, formatting, and uploading commits in the AndroidX frameworks/support project
Ensure KDocs are high quality, concise, active, and explicitly linked to API components.
Use this skill to find Compose feature flags introduced by a specific git user or email and map them to the library version in which they were added.
A skill for building instrumented tests in Remote Compose using GridScreenshotUI.
A skill for building instrumented screenshot tests in Remote Compose using RemoteScreenshotTestRule.
Scaffold a new RemoteCompose wear material3 component with test, sample, and preview
Scaffold a new RemoteCompose remote creation component with test, sample, and preview
| name | manage_commits |
| description | A skill for creating, amending, formatting, and uploading commits in the AndroidX frameworks/support project |
Enforces AndroidX conventions for formatting, updating APIs, drafting commit messages, and uploading changes in frameworks/support. Follow steps in order.
AndroidX development in the frameworks/support directory uses Git and the Repo tool.
frameworks/support/).repo start <branch_name> ..Identify modified or added files to know what needs formatting and API updates.
git status
.kt, .ktx, .java files, and potential public API changes.Format modified files and update public APIs using the list from Step 1.
Kotlin Formatting:
ktfmt on modified .kt/.ktx files to auto-correct style violations:
./gradlew :ktCheckFile --format --file <file_path>
Repeat --file <file_path> for multiple files.Java Formatting:
javaFormat on the affected module (e.g., :appcompat:appcompat-resources):
./gradlew :appcompat:appcompat-resources:javaFormat
Markdown Files:
.md) files..md files before committing.sed -i '' 's/[[:space:]]*$//' <file_path>
sed -i 's/[[:space:]]*$//' <file_path>
Public API Tracking:
current.txt files in the api/ directory by running updateApi on the affected module (e.g., :appcompat:appcompat-resources):
./gradlew :appcompat:appcompat-resources:updateApi
Or globally (takes longer): ./gradlew updateApiReview the final clean state of the changes (including formatting and API updates) before drafting the commit message.
git diff
Or for staged changes: git diff --stagedWrite a clear commit message adhering to conventions based on the final diff, and group all tags in a contiguous block at the very end.
Subject: Concise imperative summary (e.g., "Fix Popup positioning offset bugs"), <100 characters.
Body: Explain why changes were made (rationale/background), not just what changed. Separate from subject with a blank line.
Test: tag (REQUIRED):
Test: stanza detailing how it was verified. This should describe the test that validates the behavior changed.Test: ./gradlew :compose:ui:ui:connectedAndroidTest -Pandroid.testInstrumentationRunnerArguments.class=androidx.compose.ui.window.PopupTestTest: markdown file change onlynone or N/A.Bug: or Fixes: tag:
Fixes: <bug_id> for full resolution.Bug: <bug_id> for partial/tracking.484057256). Do not include the b/ prefix.Relnote: tag:
src/main/, src/commonMain/, or src/androidMain/, excluding buildSrc/).Relnote: "Developer-friendly release note" (quotes recommended if it has special characters).Relnote: N/A only to bypass presubmits for minor source-only changes that don't need a public note.Change-Id: tag:
Change-Id line.Change-Id LINE. Altering it will break Gerrit tracking for patchsets.Here is an example of a complete, correctly formatted commit message:
Fix: Avoid redundant recomposition in LazyColumn animations
This change optimizes LazyColumn to prevent unnecessary recompositions
when item animations are playing. Previously, even if only the offset
of an item was changing due to animation, a full recomposition was
triggered. By separating the animated offset from the layout pass,
we can achieve smoother animations with less overhead.
Test: ./gradlew :compose:foundation:foundation:connectedAndroidTest -Pandroid.testInstrumentationRunnerArguments.class=androidx.compose.foundation.lazy.LazyColumnAnimationTest
Relnote: Improved performance of LazyColumn animations by reducing redundant recompositions.
Fixes: 298765432
Change-Id: Iabcdef1234567890abcdef1234567890abcdef12345
CRITICAL: NEVER upload or push a CL without explicitly asking the user for permission first.
Gerrit & Commit Best Practices:
git commit --amend: Always apply fixes directly to the existing commit using git commit --amend. This keeps the Gerrit patchset history clean and keeps all iterations grouped under a single Gerrit Change.Change-Id: When amending, ensure the Change-Id line at the very end of the commit message is never altered or removed. This is crucial for Gerrit to group your updates as a new patchset under the same CL.Change-Id.Commit Commands:
git commit -m "{commit_message}"git commit --amend (ensure message is updated but retains the exact Change-Id).Upload:
repo upload --cbr -t .
Note: --cbr uploads the current branch, -t sets the Gerrit topic to the branch name, and . specifies the project in the current directory.repo upload.Once uploaded successfully, present the Gerrit URL to the user and explain that Treehugger presubmit checks will run automatically on the Gerrit change page.