Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add ttdazi/AndroidAISkills --skill parsing-android-anrgit clone --depth 1 https://github.com/ttdazi/AndroidAISkillsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/ttdazi/androidaiskills/parsing-android-anr)<a href="https://agentmods.dev/skills/ttdazi/androidaiskills/parsing-android-anr"><img src="https://agentmods.dev/badge/skills/ttdazi/androidaiskills/parsing-android-anr/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/ttdazi/androidaiskills/parsing-android-anr"><img src="https://agentmods.dev/badge/skills/ttdazi/androidaiskills/parsing-android-anr.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00064 | $0.02260 |
| Opus 5.5 | $0.00026 | $0.00904 |
| Sonnet 5.5 | $0.00013 | $0.00452 |
| Haiku 4.5 | $0.00006 | $0.00226 |
Grade A, and why
parsing-android-anr-expert scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 151 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Android ANR 深度解析(通用核心 + Thunder 适配)
核心原则
- 结论必须基于证据链:
内核等待态 -> 线程栈 -> 业务帧/系统交互。 - 不能仅凭单一关键词下结论(例如看到
epoll_wait就判死锁)。 - 输出时必须给出“置信度”和“不足证据说明”。
- 首要异常点优先:整份结论必须以「证据等级最高、且与 ANR 类型/主线程最相关」的那一条作为第一节焦点;禁止把低置信猜测放在最前面。
仓库联动(在 Cursor 工程内分析时的强约束)
当用户把 ANR 放在当前可访问的工作区/仓库中分析时,凡栈里出现可定位符号(例如 com.thunder.*、com.xxx 业务类、本仓库模块路径),必须:
- 先在本仓库内自行检索:用文件名/类名 grep、语义搜索、按包路径浏览,定位对应类与方法,再对照栈判断是否存在主线程阻塞、同步 I/O、过大锁域等问题。
- 禁止默认让用户「贴类源码」:只有在满足下列任一条件时,才可请用户补充材料,且须写明「已在仓库内检索未果」:
- 符号被混淆/裁剪,仓库内无匹配;
- 栈帧落在闭源三方 SDK(仅有 aar,无 Java/Kotlin 源码);
- 栈中只有 native 符号且无映射表,无法对应业务模块。
- 用户口头指定也要验证:即使用户说「去看某某类」,仍应先打开/搜索仓库确认实现,再结合 trace 判断,避免复述用户猜测。
不在仓库场景(仅有纯文本 trace、无代码)时:只做 trace 级结论,并明确「无法做代码侧验证」。
输入契约(先判定再分析)
最小可分析输入(满足其一)
----- pid N at ...+Cmd line: ...+ 至少一段线程栈;或DALVIK THREADS+"main"线程块;或Waiting Channels+ 可匹配到同 pid 的线程信息。
可选增强输入
Subject:/Reason:/ANR inLoad:/CPU usage from ...- Binder transaction 或 lock 文本(
waiting to lock/held by tid) - Perfetto 系统 trace(
.perfetto-trace):与栈文本 互补(调度、log、时间线);采集流程见本仓库android-perfetto-capture(含 ANR 不定时 的长看守配置);本 skill 仍以 bugreport /traces.txt栈与锁链 为主证据。
降级策略
- 缺
Reason/CPU:允许分析,但必须在结论中标注“仅基于 stack 证据”。 - 缺主线程块:只输出候选根因,不输出确定性根因。
- 无法完成 pid 对齐:先输出“输入不足”,列出需补充字段。
通用分析流程(必须按顺序)
-
锁定目标进程
- 先从
ANR in/Subject/Reason(若存在)找目标包名或 pid。 - 再用
----- pid N at与Cmd line交叉确认,避免误把system_server当主因进程。
- 先从
-
定位主线程与状态
- 在目标 pid 范围内找
"main"或主线程对应sysTid。 - 提取状态:
Runnable/Native/Blocked/Waiting。 - 记录栈顶 5~15 帧中的关键调用路径(框架层 + 业务层)。
- 在目标 pid 范围内找
-
建立阻塞链
- 锁链:
waiting to lock <obj>->held by tid-> 持锁线程栈。 - Binder 链:
binder_thread_read/IPCThreadState-> 对端进程/服务线程。 - I/O 链:
read/write/open/ioctl+ JNI/业务方法,判断是否在主线程路径。
- 锁链:
-
环境压力校验
- 若有
Load/CPU usage,区分“系统级算力饥饿”与“业务线程阻塞”。 - 无 CPU 段时,不得给出“CPU 饱和”确定结论。
- 若有
-
根因归类
Input:输入分发/绘制/主线程消息循环路径被阻塞。Broadcast/Service:ActivityThread的 receiver/service 处理超时路径。Watchdog:系统关键线程长时间无响应(常见于系统进程)。- 类型判断若证据不足,输出
Unknown(证据不足)。
What ships with it
2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2mo ago First seen · 151 lines · 64 tokens per session scan A fdc62e4711f2
parsing-android-anr-expert is a skill published in the GitHub repository ttdazi/AndroidAISkills (5 stars, last pushed 5mo ago), licensed Apache-2.0. It adds 64 tokens to every session and 2,260 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
parsing-android-anr-expert compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| parsing-android-anr-expertttdazi/AndroidAISkills | Skill | 5 | 5mo ago | Apache-2.0 | A | 64 | Claude Code, Codex |
| ios-fixgarrytan/gstack | Skill | 140k | yesterday | MIT | A | 15 | Claude Code |
| node-connectopenclaw/openclaw | Skill | 394k | yesterday | MIT | A | 39 | Claude Code, Codex |
| google-mobile-ads-validategoogle/skills | Skill | 22k | yesterday | Apache-2.0 | A | 84 | Claude Code, Codex |
| jetpack-compose-performanceandroid/skills | Skill | 10k | yesterday | Apache-2.0 | A | 41 | Claude Code |
| android-tombstone-symbolicationdotnet/skills | Skill | 5.8k | yesterday | MIT | A | 176 | Claude Code |
| swiftui-performance-auditsteipete/agent-scripts | Skill | 7.5k | 7d ago | MIT | A | 24 | Claude Code, Codex |