一键导入
java-inline-fqn-cleanup
Identify and clean up inline fully qualified Java names (FQNs) in first-party code, replacing them with standard imports.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Identify and clean up inline fully qualified Java names (FQNs) in first-party code, replacing them with standard imports.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Finds common violations of the Android accessibility API in the Clank App Java code and attempts to address them (e.g. hardcoded state change announcements, missing events, focus moving, assertive live regions, etc).
Identify and safely remove expired Chromium histograms (dead metrics/technical debt). Use this skill when a contributor asks to clean up metrics, fix code health issues related to histograms, remove obsolete code, or work on a histogram cleanup task.
Orchestrator for the "Code Health Hub" framework. Trigger only when the user refers to the Hub or asks to see "available cleanup tasks" within the Chromium technical debt reduction system.
Add missing LINT.IfChange(...) / LINT.ThenChange(...) guards to enums in C++/Java and XML to keep them in sync. Trigger this skill ONLY when a contributor explicitly asks to add lint guards or synchronize enums using LINT guards.
| name | java-inline-fqn-cleanup |
| description | Identify and clean up inline fully qualified Java names (FQNs) in first-party code, replacing them with standard imports. |
Clean up inline fully qualified names (FQNs) in Java code by replacing them with proper import statements at the top of the file, and then formatting/optimizing the import order.
Using fully qualified class names inline (e.g. android.view.View view = ...)
instead of importing them makes code harder to read and breaks standard style
conventions. This skill helps automate the discovery, safety analysis, and
clean-up of these inline qualifiers in Chromium's first-party Java files.
Goal: Clean up inline fully qualified names (FQNs) in first-party Java files and replace them with standard imports.
[!IMPORTANT] Execution Protocol: Execute all steps sequentially one by one. Do not skip any step. Do not use
edit-codeorgrep. Userg(ripgrep) for searches.
Follow the workspace preparation steps in workspace_preparation.md to ensure a clean and updated environment.
Follow the Discovery & Batch Selection workflow. When presenting the batch, include the Imports Found and Banned FQNs details.
CRITICAL RULE: Standard file editing tools (like replace_file_content or
multi_replace_file_content) must be used to apply the cleanups directly to the
Java files. DO NOT create, write, or execute any custom python or bash
scripts to perform the text replacements.
Process the candidates by handling them one file at a time, and applying modifications inside each file one FQN at a time (rather than refactoring all files or FQNs at once). This ensures stability and allows for precise verification. For each file in the batch, apply the following cleanup rules:
Banned FQNs list,
completely ignore those specific FQNs. They are either raw package paths or
invalid classes, and attempting to import them will break the build.third_party/ or
auto-generated directories.TabProperties), feature flags
(ChromeFeatureList), or enums (TabLaunchType), prefer importing the
class itself rather than importing its members statically.
import static org.chromium.chrome.browser.tasks.tab_management.TabProperties.IS_SELECTED;import org.chromium.chrome.browser.tasks.tab_management.TabProperties;
and use TabProperties.IS_SELECTED in the code.TabProperties.TITLE) keeps
clear context of where the constant is defined and avoids namespace
conflicts when multiple imported properties classes share the same field
names (e.g. TabProperties.TITLE vs FolderProperties.TITLE).{@link android.webkit.WebSettings} ->
{@link WebSettings}). However, never modify URLs (like https://... or
other web links) inside comments.org.chromium.chrome.browser.profiles.ProfileKey.Theme),
prefer importing the top-level outer class
(import org.chromium.chrome.browser.profiles.ProfileKey;) and referring to
it as ProfileKey.Theme in the code, rather than importing the nested class
directly.
import statement at the top of the file.git cl format to format the modified source
code and organize imports. Address any errors that are reported.generalist sub-agent. Proceed to the
Verification phase only after the review returns PASS.Follow the Verification workflow.
Invoke the Submission workflow. Pass the following context variables to the workflow:
java-inline-fqn-cleanupcleanup-fqns-[component-name]Code HealthClean up inline FQNs in [Component/Directory]Remove inline fully qualified class names and replace them with standard imports in the [Component/Directory] directory.528570333