Agent Skills › android/skills › anr-audit-and-fix

anr-audit-and-fix

GitHub

用于审计Android代码库中的ANR风险及诊断ANR堆栈转储。涵盖静态代码扫描与基于日志的根因分析,提供修复建议,排除非ANR异常场景。

performance/anr-audit-and-fix/SKILL.md android/skills

Trigger Scenarios

扫描Android代码以识别潜在ANR风险 分析并诊断ANR堆栈转储或跟踪日志

Install

npx skills add android/skills --skill anr-audit-and-fix -g -y
More Options

Non-standard path

npx skills add https://github.com/android/skills/tree/main/performance/anr-audit-and-fix -g -y

Use without installing

npx skills use android/skills@anr-audit-and-fix

指定 Agent (Claude Code)

npx skills add android/skills --skill anr-audit-and-fix -a claude-code -g -y

安装 repo 全部 skill

npx skills add android/skills --all -g -y

预览 repo 内 skill

npx skills add android/skills --list

SKILL.md

Frontmatter
{
    "name": "anr-audit-and-fix",
    "license": "Complete terms in LICENSE.txt",
    "metadata": {
        "author": "Google LLC",
        "keywords": [
            "Android",
            "ANR",
            "Application Not Responding",
            "responsiveness",
            "main thread",
            "ANR stack dump",
            "Sync Barrier Leak"
        ],
        "last-updated": "2026-10-16"
    },
    "description": "Audits Android codebases for ANR risks and diagnoses ANR stack dumps. Use this skill when scanning Android code for ANR risks or triaging ANR stack dumps. Don't use for non-ANR crashes, dropped frames, general CPU profiling, or Perfetto system traces."
}

Select the execution path matching the user's request:

1. Path A: Static codebase ANR risk audit

When auditing source files or scanning for thread-blocking operations:

  • Follow references/risk_analysis_guide.md step by step: list candidates, prove the executing thread (trace callers when the thread depends on them), prove the call blocks, then attribute and grade. Report only candidates that pass these checks; list the dismissed ones separately with a one-line reason.
  • Evaluate off-main-thread mutations of attached Views not merely as crash risks (CalledFromWrongThreadException), but as Sync Barrier Leak ANR risks with their own proof (off-main execution plus an attached View).

2. Path B: Trace-driven diagnosis and remediation

When analyzing ANR traces or stack dumps:

Version History

  • 6daa53e Current 2026-11-02 23:10

Same Skill Collection

build-system/agp/agp-9-upgrade/SKILL.md
camera/camerax/SKILL.md
device-ai/ml-kit-genai-prompt-api/SKILL.md
devtools/android-cli/SKILL.md
identity/restore-credentials/SKILL.md
identity/verified-email/SKILL.md
jetpack-compose/jetpack-compose-performance/SKILL.md
jetpack-compose/migration/migrate-xml-views-to-jetpack-compose/SKILL.md
jetpack-compose/theming/styles/SKILL.md
media/media3-cast-integration/SKILL.md
navigation/navigation-3/SKILL.md
navigation/navigation-event/SKILL.md
performance/r8-analyzer/SKILL.md
play/engage-sdk-integration/SKILL.md
play/play-billing-library-version-upgrade/SKILL.md
play/play-policy-insights/SKILL.md
profilers/perfetto-sql/SKILL.md
profilers/perfetto-trace-analysis/SKILL.md
security/android-intent-security/SKILL.md
security/android-permissions-security/SKILL.md
system/edge-to-edge/SKILL.md
system/glance-canonical-layouts/SKILL.md
testing/testing-setup/SKILL.md
wear/wear-compose-m3/SKILL.md
xr/display-glasses-with-jetpack-compose-glimmer/SKILL.md
xr/projected-hardware/SKILL.md
cars/android-for-cars-parked-apps/SKILL.md
device-ai/appfunctions/SKILL.md
device-ai/litert/litert-lm/SKILL.md
device-ai/litert/litert-runtime/SKILL.md
device-ai/mlkit-agent-api/SKILL.md
jetpack-compose/adaptive/SKILL.md
jetpack-compose/ink/ink-app-builder/SKILL.md
jetpack-compose/ink/ink-custom-brush-builder/SKILL.md
profilers/android-profiler/SKILL.md
system/glance-appwidget-updates-and-memory/SKILL.md
tv/leanback-to-compose-tv-migration/SKILL.md
wear/wear-widgets/SKILL.md

Metadata

Files
0
Version
6daa53e
Hash
0ea6c5ab
Indexed
2026-11-02 23:10

Accueil - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-11-03 19:20
浙ICP备14020137号-1