Guide for using Arthas to debug live Java applications.

Install

mkdir -p .claude/skills/arthas && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/18022" && unzip -o skill.zip -d .claude/skills/arthas && rm skill.zip

Installs to .claude/skills/arthas

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

arthas 诊断 java应用,jvm问题 skill
28 charsno explicit “when” trigger
Advanced

Key capabilities

  • View CPU, thread, and GC overview using `dashboard`
  • Locate busy threads and their stack traces with `thread` (topN)
  • Determine the cause of CPU spikes (CPU-intensive computation, lock contention, GC)
  • Confirm hotspot method call paths using `stack`, `trace`, or `watch`
  • Obtain EagleEye traceId for online requests without code modification
  • Troubleshoot Spring ApplicationContext, Bean, and configuration injection issues

How it works

The skill uses Arthas, a Java application online diagnostic tool, to systematically troubleshoot JVM and Spring issues. It guides through steps like monitoring CPU/threads, tracing method calls, and inspecting Spring context, always prioritizing low-risk commands.

Inputs & outputs

You give it
Java application issues (e.g., CPU spike, slow response, Spring context problem)
You get back
Diagnostic conclusions with evidence, next steps, or EagleEye traceId

When to use arthas

  • Debug CPU spike issues
  • Analyze thread stacks
  • Inspect Spring Bean configuration

About this skill

Arthas 诊断 Skill

Overview

Arthas 是 Java 应用在线诊断工具,本 Skill 包含多个子场景的诊断指南。使用时请根据用户描述的问题匹配对应场景,按指南中的步骤逐步排查。

通用原则:

  • 先用低风险、只读的命令收集信息,再按需使用有侵入性的命令。
  • 所有 watch / trace / tt / stack 等命令必须设置 -n(执行次数限制),避免对线上应用造成压力。
  • 输出结论时附上关键证据(命令输出摘要),并给出明确的下一步建议。

子场景索引

1. CPU 飙高排查

文件: cpu-high/SKILL.md

适用场景:机器 CPU 飙高、应用响应变慢、负载异常升高。

核心步骤:

  1. dashboard 查看 CPU / 线程 / GC 概况
  2. thread(topN)定位最忙线程及堆栈
  3. 根据堆栈判断方向(CPU 密集计算 / 锁竞争 / GC 等)
  4. 按需用 stack / trace / watch 进一步确认热点方法调用路径
  5. 输出诊断结论(现象、证据、初步结论、下一步建议)

2. 获取 EagleEye traceId

文件: eagleeye-traceid/SKILL.md

适用场景:需要在不改代码的情况下,获取线上请求的 EagleEye traceId,用于关联日志 / 链路分析。

核心步骤:

  1. sc -d com.taobao.eagleeye.EagleEye 确认类存在
  2. 选择合适的观察点(Controller / RPC Provider / Filter 等入口方法)
  3. 方案 Awatch + OGNL 表达式 @com.taobao.eagleeye.EagleEye@getTraceId() 直接打印 traceId
  4. 方案 Btrace 输出中自动带出 traceId,同时可看调用链耗时
  5. 拿到 traceId 后去日志 / 链路系统查询对应请求

3. Spring Context / Bean 排查

文件: spring-context/SKILL.md

适用场景:排查 Spring ApplicationContext / Bean / 配置注入等问题。

核心步骤:

  1. vmtool --action getInstances 获取 AbstractApplicationContext 实例(注意通过 ClassLoader 区分正确的 Context)
  2. 获取配置项的值与来源(getEnvironment().getProperty(...) / findConfigurationProperty(...)
  3. containsBean / containsLocalBean / containsBeanDefinition 验证 Bean 是否存在(不触发初始化)
  4. 按关键词过滤搜索 Bean(getBeanDefinitionNames + OGNL 过滤)
  5. 按类型查找 Bean(getBeanNamesForType / getBeansOfType
  6. 查看 BeanDefinition 确认 Bean 注册来源(@Bean 工厂方法 / XML / 自动扫描)

注意: 先只读查询,避免直接 getBean() 触发 Bean 初始化产生副作用;若遇到 ClassNotFound,通常是类加载器不对,需先用 classloader 命令找到正确的 classLoaderHash

When not to use it

  • When using high-risk, intrusive commands without prior information gathering
  • When `watch`, `trace`, `tt`, or `stack` commands are used without `-n` (execution count limit)
  • When directly calling `getBean()` for Spring Beans without prior read-only queries

Limitations

  • All `watch` / `trace` / `tt` / `stack` commands must set `-n` (execution times limit)
  • Prioritize low-risk, read-only commands before intrusive ones
  • Avoid direct `getBean()` calls for Spring Beans to prevent side effects

How it compares

This approach provides a structured, step-by-step diagnostic guide for Java applications using Arthas, offering targeted commands and principles to avoid system impact, unlike ad-hoc debugging or relying solely on logs.

Compared to similar skills

arthas side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
arthas (this skill)04moNo flagsAdvanced
langsmith-observability46moReviewIntermediate
debugging-toolkit-smart-debug43moNo flagsIntermediate
jaeger-analysis65moReviewIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

agent-session-monitor

alibaba

Real-time agent conversation monitoring - monitors Higress access logs, aggregates conversations by session, tracks token usage. Supports web interface for viewing complete conversation history and costs. Use when users ask about current session token consumption, conversation history, or cost statistics.

26

higress-auto-router

alibaba

Configure automatic model routing using the get-ai-gateway.sh CLI tool for Higress AI Gateway. Use when: (1) User wants to configure automatic model routing, (2) User mentions 'route to', 'switch model', 'use model when', 'auto routing', (3) User describes scenarios that should trigger specific models, (4) User wants to add, list, or remove routing rules.

14

higress-clawdbot-integration

alibaba

Deploy and configure Higress AI Gateway for Clawdbot/OpenClaw integration. Use when: (1) User wants to deploy Higress AI Gateway, (2) User wants to configure Clawdbot/OpenClaw to use Higress as a model provider, (3) User mentions 'higress', 'ai gateway', 'model gateway', 'AI网关', (4) User wants to set up model routing or auto-routing, (5) User needs to manage LLM provider API keys, (6) User wants to track token usage and conversation history.

11

higress-daily-report

alibaba

生成 Higress 项目每日报告,追踪 issue/PR 动态,沉淀问题处理经验,驱动社区问题闭环。用于生成日报、跟进 issue、记录解决方案。

13

higress-wasm-go-plugin

alibaba

Develop Higress WASM plugins using Go 1.24+. Use when creating, modifying, or debugging Higress gateway plugins for HTTP request/response processing, external service calls, Redis integration, or custom gateway logic.

12

nginx-to-higress-migration

alibaba

Migrate from ingress-nginx to Higress in Kubernetes environments. Use when (1) analyzing existing ingress-nginx setup (2) reading nginx Ingress resources and ConfigMaps (3) installing Higress via helm with proper ingressClass (4) identifying unsupported nginx annotations (5) generating WASM plugins for nginx snippets/advanced features (6) building and deploying custom plugins to image registry. Supports full migration workflow with compatibility analysis and plugin generation.

11

Search skills

Search the agent skills registry