mcpField
A
anr-audit-and-fix

anr-audit-and-fix

github.com/androidTesting & quality10.0k155 installsUpdated 2d ago
Repository

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

  1. 01Screen candidate thread-blocking operations
  2. 02Trace callers to establish execution threads
  3. 03Verify whether calls block
  4. 04Assess off-main mutations of attached Views
  5. 05Diagnose ANR traces from log evidence

Use cases

  1. 01Audit source code for ANR risks
  2. 02Assess sync barrier leak risks from attached View mutations
  3. 03Classify issues from ANR traces
  4. 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-fix

After 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.md
risk_analysis_guide.md
trace_analysis_guide.md

Details

From the project README

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:

Comments

Markdown supported