About anr-audit-and-fix
anr-audit-and-fix is a skill for Android ANR risk audits and trace-driven diagnosis, aimed at developers inspecting source code or stack dumps. It requires evidence for thread ownership and blocking behavior, and distinguishes app defects, resource overload, and external bottlenecks from logs.
Key features
- 01Screen candidate thread-blocking operations
- 02Trace callers to establish execution threads
- 03Verify whether calls block
- 04Assess off-main mutations of attached Views
- 05Diagnose ANR traces from log evidence
Use cases
- 01Audit source code for ANR risks
- 02Assess sync barrier leak risks from attached View mutations
- 03Classify issues from ANR traces
- 04Propose fixes for app defects or resource overload
Install
Copy the command and run it in a terminal.
$
npx skills add https:/ / github.com/ android/ skills --skill anr-audit-and-fixAfter installing, type/anr-audit-and-fixin Claude Code to confirm it loaded.
Bundled files
References and scripts installed along with SKILL.md.
references/anr_trace_report_template.mdrisk_analysis_guide.mdtrace_analysis_guide.mdDetails
From the project READMESelect 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:
- Diagnose systematically using references/trace_analysis_guide.md and format the report with references/anr_trace_report_template.md.
- Base findings strictly on log evidence. Propose application fixes only for
APP_DEFECTorAPP_RESOURCE_OVERLOAD(never forEXTERNAL_BOTTLENECK).
Comments
Markdown supported