Agent skill

Jvm Live Debug

by Coooolfan in Coooolfan/XiaomiAlbumSyncer

在无 GUI 调试器的 CLI 环境中,对运行中的 XAS 服务端(Solon,./gradlew run 启动)做交互式断点调试。通过 JDWP + jdb + tmux 组合:run 任务暴露 5005 端口,jdb 跑在持久 tmux session 里,由 send-keys/capture-pane 跨调用读写 REPL 状态。适用于:(1) 设断点观察请求现场;(2)…

GPL-3.0Auto-check passed

Install Jvm Live Debug

skills CLI
$ npx skills add Coooolfan/XiaomiAlbumSyncer --skill jvm-live-debug -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install Coooolfan/XiaomiAlbumSyncer jvm-live-debug --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/Coooolfan/XiaomiAlbumSyncer.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/jvm-live-debug .claude/skills/jvm-live-debug && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
jvm-live-debug
GitHub stars
420
Token cost
~1.3k tokens
SKILL.md length
279 words
Files
1
Skills in repo
3
Repo updated
First seen
Licence
GPL-3.0

At a glance

在无 GUI 调试器的 CLI 环境中,对运行中的 XAS 服务端(Solon,./gradlew run 启动)做交互式断点调试。通过 JDWP + jdb + tmux 组合:run 任务暴露 5005 端口,jdb 跑在持久 tmux session 里,由 send-keys/capture-pane 跨调用读写 REPL 状态。适用于:(1) 设断点观察请求现场;(2)…

  • Works in 6 steps: 启动后端(带 JDWP) → 用 tmux 启动 jdb → 设断点 → cont → …
  • SKILL.md covers 适用场景, 完整流程, jdb 常用命令速查 and 关键技巧, plus 2 more sections
  • Calls yarn

What it does

Jvm Live Debug is an agent skill from Coooolfan/XiaomiAlbumSyncer. 在无 GUI 调试器的 CLI 环境中,对运行中的 XAS 服务端(Solon,./gradlew run 启动)做交互式断点调试。通过 JDWP + jdb + tmux 组合:run 任务暴露 5005 端口,jdb 跑在持久 tmux session 里,由 send-keys/capture-pane 跨调用读写 REPL 状态。适用于:(1) 设断点观察请求现场;(2) 在断点处求值/调用方法;(3) 排查只能在运行时复现的问题(如同步流水线、小米云接口交互)。

Its SKILL.md is about 1.3k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It works with tmux. The repository describes itself as: 全量/增量/定时 下载小米云服务中的 相册/录音 到本地. The licence is GPL-3.0.

Example prompts

  • “/jvm-live-debug”

Workflow steps

6 steps, taken from the step headings in SKILL.md.

  1. 启动后端(带 JDWP)
  2. 用 tmux 启动 jdb
  3. 设断点 → cont
  4. 等待服务启动完成
  5. 命中后取现场
  6. 放行 + 清理

What it can do on your machine

Read from SKILL.md and the folder at commit b3c030f. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • yarn

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use yarn, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Jvm Live Debug loads about 1.3k tokens when it runs. Until then it costs about 64 tokens; SKILL.md has 279 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~64
When it runs · the whole SKILL.md, loaded when a task matches
~1.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from Coooolfan/XiaomiAlbumSyncer at commit b3c030f, republished under its GPL-3.0 licence (© Coooolfan). 279 words, ~1,285 tokens.

Download SKILL.mdSave it as .claude/skills/jvm-live-debug/SKILL.md (or your agent's skills folder).
name
jvm-live-debug
description
在无 GUI 调试器的 CLI 环境中,对运行中的 XAS 服务端(Solon,`./gradlew run` 启动)做交互式断点调试。通过 JDWP + jdb + tmux 组合:run 任务暴露 5005 端口,jdb 跑在持久 tmux session 里,由 send-keys/capture-pane 跨调用读写 REPL 状态。适用于:(1) 设断点观察请求现场;(2) 在断点处求值/调用方法;(3) 排查只能在运行时复现的问题(如同步流水线、小米云接口交互)。

适用场景

当需要在运行中的 server 进程上设断点、看变量、调方法,而没有 IDEA 等 GUI 可用时使用本流程。不适合长时间多线程 step 调试——那种场景效率远不如让用户开 IDEA。

完整流程

1. 启动后端(带 JDWP)

服务端使用 Gradle application 插件,主类 com.coooolfan.xiaomialbumsyncer.App。

bash
mkdir -p /tmp/xas-debug
cd server && ./gradlew run --debug-jvm > /tmp/xas-debug/server.log 2>&1

工具调用上放到后台执行。然后等待日志出现 Listening for transport dt_socket at address: 5005,再做下一步。

--debug-jvm 默认 suspend=y,JVM 会等调试器附加后才真正启动 Solon。不想 suspend 时改用:

bash
./gradlew run -PjvmArgs='-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005'

但 suspend=y 更好用——延迟断点能在类加载前就挂上。

2. 用 tmux 启动 jdb
bash
tmux kill-session -t jdb 2>/dev/null
tmux new-session -d -s jdb -x 200 -y 50 'jdb -attach localhost:5005'
sleep 3
tmux capture-pane -t jdb -p -S -50

attach 成功后看到 VM 已启动 和 main[1] 提示符,说明 JVM 已经从 suspend 状态接管。

3. 设断点 → cont
bash
tmux send-keys -t jdb 'stop at com.coooolfan.xiaomialbumsyncer.service.AssetService:120' Enter
sleep 1
tmux send-keys -t jdb 'cont' Enter

类还没加载时 jdb 会显示 正在延迟断点 ... 将在加载类后设置,正常现象。

4. 等待服务启动完成

等服务端日志出现 Solon 的启动完成行(Started: / started ... ms)或端口监听信息即可。

5. 命中后取现场

请求把断点打中后,tmux pane 会出现 Breakpoint hit: 和当前栈,提示符变成 <thread-name>[1]。

bash
tmux send-keys -t jdb 'locals' Enter         # 局部变量
tmux send-keys -t jdb 'print someVar' Enter  # 求值表达式
tmux send-keys -t jdb 'where' Enter          # 调用栈
sleep 2
tmux capture-pane -t jdb -p | grep -v '^$' | tail -30
6. 放行 + 清理
bash
tmux send-keys -t jdb 'cont' Enter           # 放当前断点
tmux kill-session -t jdb                     # 退出 jdb(不杀 JVM)
# 再停掉后台的 gradlew run / yarn dev 任务

jdb 常用命令速查

命令作用
stop at FQCN:LINE在某文件某行设断点
stop in FQCN.method在方法入口设断点
clear列出所有断点
clear FQCN:LINE删除断点
cont继续执行
step / next单步进入 / 跳过
step up执行到当前方法返回
locals当前栈帧的局部变量和方法参数
print EXPR / eval EXPR求值表达式(可调用方法,见下)
where当前线程调用栈
up / down切换栈帧
threads / thread ID列线程 / 切线程
exit退出 jdb(不杀被调试 JVM)

关键技巧

Kotlin 顶层 / 扩展函数的类名

文件 XiaomiCloudApi.kt 中的顶层函数或扩展函数会被编译成 <FileName>Kt 类的静态方法:

  • package com.coooolfan.xiaomialbumsyncer.xiaomicloud 下 XiaomiCloudApi.kt 的扩展函数
  • 设断点用 com.coooolfan.xiaomialbumsyncer.xiaomicloud.XiaomiCloudApiKt:行号,不是 XiaomiCloudApi
在断点处调用方法

print / eval 可以求值任意表达式,包括调用方法:

print this.sql.entities.findById(Album::class.java, 1L)

this.field 必须显式带 this.——jdb 不会自动解析隐式 receiver。返回值会原样打印。

协程栈不好看

服务端大量使用 kotlinx.coroutines(下载流水线)。挂起函数在 jdb 里的栈是状态机形态,where 看到的是 invokeSuspend;跨挂起点的 step 基本无意义,优先在挂起点之间的同步片段设断点。

延迟断点

JVM 是 lazy class loading:服务刚启动时大量类还没加载。stop at 一个未加载类的位置时 jdb 会 defer,等类加载时再激活。所以任何时候都可以下断点,不必担心时序。

tmux capture-pane 看不到东西时

capture-pane -p 默认只看可见区域。pane 越大空白行越多,输出可能被 tail 掉。两个办法:

  • tmux capture-pane -t jdb -p -S -50 | grep -v '^$' | tail -30(带 scrollback、过滤空行)
  • 创建 session 时给小一点的尺寸:tmux new-session -d -s jdb -x 200 -y 50 ...

踩坑记录

run --debug-jvm 默认 suspend=y

JVM 启动后会卡在 Listening for transport ...,不附加 jdb 永远不会进入 Solon 启动流程。所以必须:(1) 启动 run → (2) 等 JDWP listener → (3) attach jdb → (4) JVM 才开始真正启动。

zsh glob 空目录会让整条命令失败
bash
mkdir -p /tmp/x && rm -f /tmp/x/*.log    # 目录刚建好没文件时整条命令 exit 1

zsh 默认 nomatch 开启。要么先创建占位文件,要么把 rm 分开写,要么避免用 glob。

monitor where 副作用很吵

monitor where 会让每次断点命中都打印整个栈。一旦开了就用 unmonitor 1 关掉。命中后真要看栈用一次性的 where。

jdb 中文版 where N 不工作

where 5 在中文版 jdb 里会被解释成「线程 ID 5」并报错。直接用 where 看全栈,或者用 up/down 切帧。

命中后请求会挂住

JVM 被 jdb 暂停了,发起这次请求的 HTTP 连接也卡在那里,前端可能报超时。处理完务必 cont 放行。若命中点在定时任务或下载流水线中,还可能触发上游超时重试,注意甄别。

完整模板

bash
# === 1. 启动后端 (后台) ===
mkdir -p /tmp/xas-debug && cd /Users/yang/Documents/code/XiaomiAlbumSyncer/server && \
  ./gradlew run --debug-jvm > /tmp/xas-debug/server.log 2>&1

# === 2. 等 JDWP listener ===
until grep -qE "Listening for transport|BUILD FAILED|FAILURE:" /tmp/xas-debug/server.log; do sleep 1; done

# === 3. tmux + jdb ===
tmux kill-session -t jdb 2>/dev/null
tmux new-session -d -s jdb -x 200 -y 50 'jdb -attach localhost:5005'
sleep 3

# === 4. 设断点 + cont ===
tmux send-keys -t jdb 'stop at com.coooolfan.xiaomialbumsyncer.service.AlbumsService:30' Enter
sleep 1
tmux send-keys -t jdb 'cont' Enter

# === 5. 启动前端 (后台) ===
cd /Users/yang/Documents/code/XiaomiAlbumSyncer/web && yarn dev > /tmp/xas-debug/web.log 2>&1

# === 6. 等服务端 + Vite 就绪 ===
until grep -qiE "started|Solon" /tmp/xas-debug/server.log && \
      grep -q "Local:.*http" /tmp/xas-debug/web.log; do sleep 2; done

# === 7. 等用户触发,命中后取现场 ===
tmux send-keys -t jdb 'locals' Enter
sleep 1
tmux capture-pane -t jdb -p | grep -v '^$' | tail -30

# === 8. 放行 + 清理 ===
tmux send-keys -t jdb 'cont' Enter
tmux kill-session -t jdb
# 然后停掉后台的 gradlew run / yarn dev

© Coooolfan, GPL-3.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/jvm-live-debug of Coooolfan/XiaomiAlbumSyncer.

Open the folder on GitHubat commit b3c030f

Compare with similar skills

Jvm Live Debug next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Jvm Live Debug compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Jvm Live Debug this skillCoooolfan/XiaomiAlbumSyncer420—~1.3kAutomated safety check: PassGPL-3.0
Codex Plugin QAcode-yeongyu/oh-my-openagent70k1 repos~1.9kAutomated safety check: PassCustom licence
Tmuxopenclaw/openclaw392k2 repos~640Automated safety check: PassMIT
1passwordtrpc-group/trpc-agent-go1.8k15 repos~656Automated safety check: PassApache-2.0
CodeGraph Agent Evalcolbymchenry/codegraph73k—~950Automated safety check: PassMIT
Tmuxtrpc-group/trpc-agent-go1.8k24 repos~868Automated safety check: PassApache-2.0

Similar skills

  • Codex Plugin QA

    code-yeongyu/oh-my-openagent

    Tests the omo Codex plugin in an isolated CODEX_HOME with a local mock model, proving hooks fired through app-server notifications without touching ~/.codex.

    70k GitHub starsUsed in 1 repo~1.9k tokens
    Testing & QAAuto-check passed
  • Tmux

    openclaw/openclaw

    Control tmux sessions/panes for interactive CLIs: list, capture output, send keys, paste text, monitor prompts.

    392k GitHub starsUsed in 2 repos~640 tokens
    Auto-check passed
  • 1password

    trpc-group/trpc-agent-go

    Set up and use 1Password CLI (op). An agent skill from trpc-group/trpc-agent-go.

    1.8k GitHub starsUsed in 15 repos~656 tokens
    AI & LLM EngineeringAuto-check passed
  • CodeGraph Agent Eval

    colbymchenry/codegraph

    Benchmarks how much CodeGraph helps a coding agent on a real repository, comparing runs with and without it for a chosen local or published version.

    73k GitHub stars~950 tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Tmux

    trpc-group/trpc-agent-go

    Remote-control tmux sessions for interactive CLIs by sending keystrokes and scraping pane output.

    1.8k GitHub starsUsed in 24 repos~868 tokens
    Data & AnalyticsAuto-check passed
  • CodexBar Live QA

    steipete/CodexBar

    Runs live QA for the CodexBar app: provider usage matrix checks through its packaged CLI, config validation and menu checks, with 1Password-backed credentials handled safely.

    22k GitHub stars~1.2k tokensUpdated today
    Testing & QAAuto-check passed

More from Coooolfan/XiaomiAlbumSyncer

  • Jimmer Orm

    Coooolfan/XiaomiAlbumSyncer

    Jimmer ORM 开发助手(XiaomiAlbumSyncer 服务端),帮助编写实体映射代码、DTO 和 DSL 查询语句。适用于:(1) 定义或修改 Jimmer 实体(使用 @Entity 注解的 interface);(2) 编写 Jimmer DSL 查询代码;(3) 配置实体关联关系(@ManyToOne, @OneToMany, @ManyToMany);(4)…

    420 GitHub stars~702 tokensUpdated 2 days ago
    Auto-check passed
  • Release Note Creator

    Coooolfan/XiaomiAlbumSyncer

    撰写 Xiaomi Album Syncer 的 Release Notes。适用于:(1) 发版前为指定版本号生成更新日志;(2) 确定版本的变更范围(前序 tag 比较基准);(3) 校对已有 release notes 是否符合书写规范。

    420 GitHub stars~240 tokensUpdated 2 days ago
    Auto-check passed

Works with

Questions about Jvm Live Debug

What does Jvm Live Debug do?

在无 GUI 调试器的 CLI 环境中,对运行中的 XAS 服务端(Solon,./gradlew run 启动)做交互式断点调试。通过 JDWP + jdb + tmux 组合:run 任务暴露 5005 端口,jdb 跑在持久 tmux session 里,由 send-keys/capture-pane 跨调用读写 REPL 状态。适用于:(1) 设断点观察请求现场;(2)…. Jvm Live Debug is an agent skill from Coooolfan/XiaomiAlbumSyncer.

How do I install Jvm Live Debug in Claude Code?

Run `npx skills add Coooolfan/XiaomiAlbumSyncer --skill jvm-live-debug -a claude-code`. Or copy the skill folder (.agents/skills/jvm-live-debug in Coooolfan/XiaomiAlbumSyncer) into .claude/skills/jvm-live-debug in your project. Claude Code loads it when a task matches its description.

How do I install Jvm Live Debug in Codex?

Run `npx skills add Coooolfan/XiaomiAlbumSyncer --skill jvm-live-debug -a codex`. Or copy the skill folder (.agents/skills/jvm-live-debug in Coooolfan/XiaomiAlbumSyncer) into .agents/skills/jvm-live-debug in your project. Codex loads it when a task matches its description.

Can I use Jvm Live Debug in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add Coooolfan/XiaomiAlbumSyncer --skill jvm-live-debug -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/jvm-live-debug, .gemini/skills/jvm-live-debug, .github/skills/jvm-live-debug and .opencode/skills/jvm-live-debug in your project.

What does Jvm Live Debug need to run?

Going by SKILL.md and its folder, Jvm Live Debug needs the command-line tools its instructions call (yarn).

Does Jvm Live Debug access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Jvm Live Debug safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Jvm Live Debug use?

Jvm Live Debug is published under the GPL-3.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Jvm Live Debug use?

About 1.3k tokens (SKILL.md is roughly 5.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Jvm Live Debug?

Skills that share tags, products or a category with Jvm Live Debug: Codex Plugin QA (code-yeongyu/oh-my-openagent, 70k stars), Tmux (openclaw/openclaw, 392k stars), 1password (trpc-group/trpc-agent-go, 1.8k stars) and CodeGraph Agent Eval (colbymchenry/codegraph, 73k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Jvm Live Debug?

Coooolfan (a GitHub user) maintains it in Coooolfan/XiaomiAlbumSyncer, which has 420 GitHub stars. The repository holds 3 skills in this directory. The repository was last updated on October 6, 2026.

Source: Coooolfan/XiaomiAlbumSyncer on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.