agents/projects/code-health/replace-anonymous-runnables/SKILL.md
Replace Java anonymous classes implementing Single Abstract Method (SAM) interfaces with lambdas to leverage Lambda Grouping and reduce binary size.
Goal: Clean up all occurrences of this pattern in the codebase.
[!IMPORTANT] Execution Protocol: Execute all steps sequentially one by one. Do not skip any step. Use
rg(ripgrep) for searches.
Follow the workspace preparation steps in workspace_preparation.md to ensure a clean and updated environment.
self subagent.Process the candidates by handling them one file at a time, and applying modifications inside each file one instance at a time. This ensures stability and allows for precise verification.
Refactoring Guidelines:
@JavascriptInterface or @SuppressLint). Do not attempt to move @SuppressLint to the field or enclosing method to bypass this, as it may not suppress the warning on the lambda.this to refer to itself.View.OnTouchListener to lambdas. These often trigger ClickableViewAccessibility lint warnings if they do not call View#performClick(), and converting them can break existing lint baselines.git cl format to format changes.PASS.Follow the Verification workflow.
Invoke the Submission workflow. Pass the following context variables:
cleanup-replace-anonymous-runnables-[component-name]Code HealthReplace anonymous classes with lambdas in [Component]541671762"none""true"