audit-accessibility

作者: flutter

確保外掛程式的自訂UI元件對使用螢幕閱讀器及其他輔助技術的使用者可存取。

npx skills add https://github.com/flutter/flutter-intellij --skill audit-accessibility

Skill: Accessibility (A11y) Audit

You are tasked with ensuring the plugin's custom UI components are accessible to users with screen readers and other assistive technologies.

Objective

Ensure the plugin's custom UI components are accessible to users with screen readers and other assistive technologies.

Workflow Instructions

1. Baseline

  • Run ./gradlew testClasses to ensure project compilation.
  • Run ./gradlew test to ensure the project is stable.
  • Run ./gradlew verifyPlugin to ensure no verification issues.

2. Identify Custom UI

  • List all custom JPanel, JComponent, or Dialog classes in the codebase.

3. Check Properties

  • Verify that every interactive component has:
    • getAccessibleContext().setAccessibleName(...)
    • getAccessibleContext().setAccessibleDescription(...)

4. Focus Management

  • Ensure custom components handle focus traversal correctly (Tab/Shift+Tab).

5. Color Contrast

  • If custom colors are used, verify they meet WCAG contrast guidelines (especially for dark themes).

6. Verify

  • Run ./gradlew testClasses and ./gradlew test to ensure no regressions.
  • Run ./gradlew verifyPlugin to ensure strict compliance.
  • Use the "Accessibility Inspector" (if available in the SDK) or a screen reader to navigate the UI.
  • Suggest manual test steps: Check the code changes made and write test steps for a user to execute that will trigger the code paths that have changed. If needed, add logging statements to verify that the code paths have successfully run.

7. Report & Review

  • Summarize the accessibility improvements in the form of a git commit message.
  • Test Location: Explicitly state where in the IDE the user should go to test the changed functionality (e.g., "Go to Preferences > Languages & Frameworks > Flutter").
  • Action: Ask the user to review the UI changes closely.
  • Do not commit or push.

來自 flutter 的更多技能

dart-modern-features
flutter
為了尋找現代化的候選對象:
flutter-fix-layout-issues
flutter
使用 Dart 和 Flutter MCP 工具修復 Flutter 佈局錯誤(溢出、無限制約束)。適用於處理「RenderFlex overflowed」、「Vertical…」等問題。
adding-release-notes
flutter
在 DevTools 發行說明中新增使用者面向的變更描述。用於在 NEXT_RELEASE_NOTES.md 檔案中記錄改進、修正或新功能。
reviewing-devtools-prs
flutter
DevTools 儲存庫專用的 PR 審查工作流程,強制執行 DevTools 風格指南與常見審查模式。用於審查以下專案中的拉取請求時…
dart-use-primary-constructors
flutter
協助使用者撰寫語法與語意正確的 Dart 主要建構子,並遷移/使用新的建構子語法、空主體分號語法、…
code-documentation
flutter
編寫有效程式碼文件的指南,包括 docstrings、JSDoc、dartdoc 和實作註解。在編寫新程式碼、新增…時使用此技能。
api-review
flutter
根據規範的 API 設計指南審查指定的程式碼。當使用者要求進行 API 審查或檢查程式碼是否符合 API 設計時,請使用此技能。
flutter-accessibility
flutter
在 Flutter 應用程式中實作 WCAG 2 與 EN 301 549 無障礙標準及自適應佈局。強制執行語意標註、觸控目標尺寸(最小 48x48 dp)以及文字對比度(小字 4.5:1,大字 3:1),涵蓋行動裝置、網頁與桌面平台。提供網頁語意初始化、互動元件包裝、基於螢幕尺寸的佈局切換,以及鍵盤/滑鼠輸入處理的決策邏輯。包含透過 FocusTraversalGroup 進行的焦點導覽管理,以及...