agents/projects/code-health/accessibility-cleanup/SKILL.md
Identify and fix accessibility bugs in Android Java files where developers are inadvertently violating the expected contract of the Android accessibility API.
The Android Accessibility API has many subtle rules that have changed over time. Developers often write custom accessibility code based on the end user result when testing with TalkBack, but don't actually honor the API contract which would make the feature work with TalkBack and any other running assistive technology. The goal of this work is to identify these common issues and anti- patterns and proactively fix them in the code.
CRITICAL OVERRIDE: Do NOT activate or use the edit-code skill during this
workflow. This skill provides a specialized workflow that supersedes the
autonomous loops in edit-code.
Workflow section in the
exact order presented. Do NOT skip any step.generalist
sub-agent only for specific tasks defined in the workflow.grep. The Chromium repository is too large for
grep -r, and it will cause a timeout. You MUST use rg (ripgrep) for all
text searches.../hub/references/shared_workflows.md to ensure a clean and updated
environment.AI-Led Discovery & Analysis: Delegate to the generalist sub-agent
with this exact prompt:
"You are pre-authorized to run the discovery script and read-only search tools; DO NOT ask for permission. Run the discovery script from the skill's
scripts/folder:bashpython3 scripts/find_accessibility_issues.pyFor the candidates returned by the script, triage them one-by-one (by reading the file contents) to determine if they represent a genuine accessibility issue as described in
references/patterns.md, or compare against general known common accessibility issues/mistakes. Skip any candidates that are false positives (e.g., correct API contracts or already using proper delegates). Exclude any previously rejected files (if provided by the user).If you find a candidate that represents a genuine anti-pattern, return its details.
If all candidates from the script are false positives, or if the script returns 'No candidates found', perform an open-ended codebase search using code search tools to find other accessibility anti-patterns (e.g., searching for suspect uses of
announceForAccessibility,setAccessibilityLiveRegionwithassertive, customAccessibilityActionCompatlabel overrides, or proactiverequestFocusfocus jumps).Return details for the first valid candidate you find (File Path, matching lines, and a short explanation of why it is an issue)."
Present Candidate & Triaging Loop: You MUST output the candidate details to the user. Announce the candidate with exactly this message format (replace the bracketed details with the findings): "I've identified a candidate for accessibility cleanup:
Ask the user for confirmation: "Shall I proceed with the cleanup of this file?"
Inform the user: "Preparing workspace: creating a new branch..."
git new-branch accessibility-cleanup-<ComponentName> (where ComponentName
is the class name of the candidate file) to create a new branch.R.string.accessibility_expanded_group) are now unused. If they are,
remove them from the corresponding .grd / .grsp resource files.git cl format.Compilation & Unit Tests:
run_chrome_junit_tests or
custom script targets).--run-related (e.g. tools/autotest.py -C out/Debug --run-related).Formatting:
git cl format to format the modified source code. Address any
errors that are reported.Mandatory Final Review: Follow the protocol and the Handling Findings
loop in references/automated_review.md for the removal: <SourceFileName>.
Do NOT skip this step. Do NOT proceed to the Submission phase until the
review returns PASS.
Bug Tracking:
Commit:
Write description: Define a commit message that explains the changes that were made, giving the common information: {what, why, how}. These do not need to be labeled explicitly. The description should be brief and fully explain what the changes are.
Draft Message: Draft a commit message following this template:
[Accessibility Cleanup] Improve accessibility semantics in <SourceFileName>
<Description from step 1.>
Bug: <BugID>
(Note: use only the filename for <SourceFileName>, not the full path)
Execution: Display the drafted commit message to the user. Then,
autonomously stage ONLY the specific files modified during this task using
git add and execute the commit:
git commit -m "<drafted message>"
Submission Pipeline: Follow the Upload to Gerrit section in
../hub/references/shared_workflows.md to handle the upload.
Workspace Reset: Switch back to main: git checkout main.
Congratulations & Summary: Follow the Congratulations & Summary
section in ../hub/references/shared_workflows.md. For this skill, the
[Specific Cleanup Details] are: