Generated banner for Anr Audit And Fix
Generated logo for Anr Audit And Fix

Anr Audit And Fix

Android (Google)OfficialCreated by Google LLCDistributed by Android (Google)

  • Skill
  • Review and audit
  • Software development
  • Apache-2.0
  • No issues found

From the author

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.
— the description by Google LLC

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

The anr-audit-and-fix skill provides a structured methodology for identifying and remediating Application Not Responding (ANR) issues in Android applications. It supports two primary workflows: a static analysis path for auditing source code to detect potential thread-blocking operations or sync barrier leaks, and a trace-driven path for analyzing existing ANR stack dumps to determine root causes and propose fixes.

What it does

  • Performs static analysis on Android source code to identify potential main-thread blocking operations.
  • Detects Sync Barrier Leak risks caused by off-main-thread mutations of attached Views.
  • Systematically diagnoses ANR stack dumps and trace files.
  • Categorizes ANR findings into application defects, resource overloads, or external bottlenecks.
  • Provides a standardized reporting template for ANR trace analysis.
  • Offers guidance on distinguishing between actual ANR risks and non-blocking operations.

When to use it

  • When auditing Android source code to proactively find potential ANR-causing code patterns.
  • When investigating a reported ANR to determine if it is caused by application code or external factors.
  • When analyzing stack dumps to identify specific blocking chains or thread contention issues.
  • When verifying if off-main-thread UI access is creating a Sync Barrier Leak risk.

Advantages

  • Enforces a rigorous proof-based approach to identifying thread-blocking candidates.
  • Distinguishes between critical ANR risks and minor frame drops.
  • Provides a clear framework for differentiating between application-level defects and external system bottlenecks.
  • Standardizes the documentation and reporting of ANR investigations.

Usage examples

“Audit this Activity for potential ANR risks.”
The agent will scan the provided code, verify the executing thread for blocking primitives, and report any confirmed ANR risks or Sync Barrier Leaks.
“Analyze this ANR stack dump and suggest a fix.”
The agent will process the trace, identify the unresponsive thread and blocking mechanism, and provide a structured report with a recommended code fix if the issue is an application defect.

Install

  1. Download the skill as a ZIP:

    https://mp-staging.autogineer.com/agent-skills/android/anr-audit-and-fix/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip anr-audit-and-fix.zip -d .agents/skills

Documentation by Google LLC

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:

Files

SKILL.md

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:

Requirements and compatibility

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

Security

No issues found by our static scan· No issues found

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

Created by
Google LLC
Publisher
Android (Google) (Official)
Distributed by
Android (Google)
Source
android/skills · performance/anr-audit-and-fix · commit bf68e2d
Licence
Apache License 2.0 (redistribution allowed)
  • LICENSE (added by AutoGineer from LICENSE.txt)
  • ATTRIBUTION.md (written by AutoGineer)
Synced

AutoGineer is not affiliated with or endorsed by Google LLC or Android (Google).

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download anr-audit-and-fix.zip